Add new example 4.1UseACustomJson5ConfigFile
to aid in explaining how to use json5/jsonc
This commit is contained in:
parent
f7fe7fe4a5
commit
d99e19603a
20
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/.buildignore
Normal file
20
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/.buildignore
Normal file
@ -0,0 +1,20 @@
|
||||
/.buildignore
|
||||
/.DS_Store
|
||||
/.editorconfig
|
||||
/.eslintignore
|
||||
/.eslintrc.json
|
||||
/.git
|
||||
/.github
|
||||
/.gitignore
|
||||
/.gitlab
|
||||
/.nvmrc
|
||||
/.prettierrc
|
||||
/.vscode
|
||||
/build.mjs
|
||||
/dist
|
||||
/images
|
||||
/mod.code-workspace
|
||||
/node_modules
|
||||
/package-lock.json
|
||||
/tsconfig.json
|
||||
/types
|
@ -0,0 +1,9 @@
|
||||
# Exclude these folders from linting
|
||||
node_modules
|
||||
dist/
|
||||
types/
|
||||
|
||||
# Exclude these filetypes from linting
|
||||
*.json
|
||||
*.txt
|
||||
*.exe
|
@ -0,0 +1,98 @@
|
||||
{
|
||||
"root": true,
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"plugins": [
|
||||
"@typescript-eslint"
|
||||
],
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended"
|
||||
],
|
||||
"rules": {
|
||||
"@typescript-eslint/no-explicit-any": 0,
|
||||
"@typescript-eslint/no-unused-vars": 1,
|
||||
"@typescript-eslint/no-empty-interface": 0,
|
||||
"@typescript-eslint/no-namespace": 0,
|
||||
"@typescript-eslint/comma-dangle": 1,
|
||||
"@typescript-eslint/func-call-spacing": 2,
|
||||
"@typescript-eslint/quotes": 1,
|
||||
"@typescript-eslint/brace-style": [
|
||||
"warn",
|
||||
"allman"
|
||||
],
|
||||
"@typescript-eslint/naming-convention": [
|
||||
"warn",
|
||||
{
|
||||
"selector": "default",
|
||||
"format": [
|
||||
"camelCase"
|
||||
],
|
||||
"leadingUnderscore": "allow"
|
||||
},
|
||||
{
|
||||
"selector": "typeLike",
|
||||
"format": [
|
||||
"PascalCase"
|
||||
]
|
||||
},
|
||||
{
|
||||
"selector": "objectLiteralProperty",
|
||||
"format": [
|
||||
"PascalCase",
|
||||
"camelCase"
|
||||
],
|
||||
"leadingUnderscore": "allow"
|
||||
},
|
||||
{
|
||||
"selector": "typeProperty",
|
||||
"format": [
|
||||
"PascalCase",
|
||||
"camelCase"
|
||||
],
|
||||
"leadingUnderscore": "allow"
|
||||
},
|
||||
{
|
||||
"selector": "enumMember",
|
||||
"format": [
|
||||
"UPPER_CASE"
|
||||
]
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/indent": [
|
||||
"warn",
|
||||
4
|
||||
],
|
||||
"@typescript-eslint/no-unused-expressions": [
|
||||
"warn",
|
||||
{
|
||||
"allowShortCircuit": false,
|
||||
"allowTernary": false
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/keyword-spacing": [
|
||||
"warn",
|
||||
{
|
||||
"before": true,
|
||||
"after": true
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/explicit-module-boundary-types": [
|
||||
"warn",
|
||||
{
|
||||
"allowArgumentsExplicitlyTypedAsAny": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": [
|
||||
"*.mjs",
|
||||
"*.ts"
|
||||
],
|
||||
"env": {
|
||||
"node": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
66
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/README.md
Normal file
66
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/README.md
Normal file
@ -0,0 +1,66 @@
|
||||
# Welcome to the SPT-AKI Modding Project
|
||||
|
||||
This project is designed to streamline the initial setup process for building and creating mods in the SPT-AKI environment. Follow this guide to set up your environment efficiently.
|
||||
|
||||
## **Table of Contents**
|
||||
- [NodeJS Setup](#nodejs-setup)
|
||||
- [IDE Setup](#ide-setup)
|
||||
- [Workspace Configuration](#workspace-configuration)
|
||||
- [Environment Setup](#environment-setup)
|
||||
- [Essential Concepts](#essential-concepts)
|
||||
- [Coding Guidelines](#coding-guidelines)
|
||||
- [Distribution Guidelines](#distribution-guidelines)
|
||||
|
||||
## **NodeJS Setup**
|
||||
|
||||
Before you begin, ensure to install NodeJS version `v16.17.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/).
|
||||
|
||||
After installation, it's advised to reboot your system.
|
||||
|
||||
## **IDE Setup**
|
||||
|
||||
For this project, you can work with either [VSCodium](https://vscodium.com/) or [VSCode](https://code.visualstudio.com/). However, we strongly recommend using VSCode, as all development and testing have been carried out using this IDE, ensuring a smoother experience and compatibility with the project setups. Either way, we have a prepared a workspace file to assist you in setting up your environment.
|
||||
|
||||
## **Workspace Configuration**
|
||||
|
||||
With NodeJS and your chosen IDE ready, initiate the `mod.code-workspace` file using your IDE:
|
||||
|
||||
> File -> Open Workspace from File...
|
||||
|
||||
Upon project loading, consider installing recommended plugins like the ESLint plugin.
|
||||
|
||||
## **Environment Setup**
|
||||
|
||||
An automated task is available to configure your environment for Typescript utilization:
|
||||
|
||||
> Terminal -> Run Task... -> Show All Tasks... -> npm: install
|
||||
|
||||
Note: Preserve the `node_modules` folder as it contains necessary dependencies for Typescript and other functionalities.
|
||||
|
||||
## **Essential Concepts**
|
||||
|
||||
Prioritize understanding Dependency Injection and Inversion of Control, the architectural principles SPT-AKI adopts. Comprehensive guidelines will be available on the hub upon release.
|
||||
|
||||
Some resources to get you started:
|
||||
- [A quick intro to Dependency Injection](https://www.freecodecamp.org/news/a-quick-intro-to-dependency-injection-what-it-is-and-when-to-use-it-7578c84fa88f/)
|
||||
- [Understanding Inversion of Control (IoC) Principle](https://medium.com/@amitkma/understanding-inversion-of-control-ioc-principle-163b1dc97454)
|
||||
|
||||
## **Coding Guidelines**
|
||||
|
||||
Focus your mod development around the `mod.ts` file. In the `package.json` file, only alter these properties: `"name"`, `"version"`, `"license"`, `"author"`, and `"akiVersion"`.
|
||||
|
||||
New to Typescript? Find comprehensive documentation on the [official website](https://www.typescriptlang.org/docs/).
|
||||
|
||||
## **Distribution Guidelines**
|
||||
|
||||
Automated tasks are set up to bundle all necessary files for your mod to function in SPT-AKI:
|
||||
|
||||
> Terminal -> Run Task... -> Show All Tasks... -> npm: build
|
||||
|
||||
The ZIP output, located in the `dist` directory, contains all required files. Ensure all files are included and modify the `.buildignore` file as needed. This ZIP file is your uploadable asset for the hub.
|
||||
|
||||
## **Conclusion**
|
||||
|
||||
With this setup, you're ready to begin modding with SPT-AKI. If you run into any trouble be sure to check out the [modding documentation on the hub](https://hub.sp-tarkov.com/doc/lexicon/66-modding/). If you really get stuck feel free to join us in the [#mods-development](https://discord.com/channels/875684761291599922/875803116409323562) official Discord channel.
|
||||
|
||||
Build something awesome!
|
383
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/build.mjs
Normal file
383
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/build.mjs
Normal file
@ -0,0 +1,383 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* Build Script
|
||||
*
|
||||
* This script automates the build process for server-side SPT mod projects, facilitating the creation of distributable
|
||||
* mod packages. It performs a series of operations as outlined below:
|
||||
* - Loads the .buildignore file, which is used to list files that should be ignored during the build process.
|
||||
* - Loads the package.json to get project details so a descriptive name can be created for the mod package.
|
||||
* - Creates a distribution directory and a temporary working directory.
|
||||
* - Copies files to the temporary directory while respecting the .buildignore rules.
|
||||
* - Creates a zip archive of the project files.
|
||||
* - Moves the zip file to the root of the distribution directory.
|
||||
* - Cleans up the temporary directory.
|
||||
*
|
||||
* It's typical that this script be customized to suit the needs of each project. For example, the script can be updated
|
||||
* to perform additional operations, such as moving the mod package to a specific location or uploading it to a server.
|
||||
* This script is intended to be a starting point for developers to build upon.
|
||||
*
|
||||
* Usage:
|
||||
* - Run this script using npm: `npm run build`
|
||||
* - Use `npm run buildinfo` for detailed logging.
|
||||
*
|
||||
* Note:
|
||||
* - Ensure that all necessary Node.js modules are installed before running the script: `npm install`
|
||||
* - The script reads configurations from the `package.json` and `.buildignore` files; ensure they are correctly set up.
|
||||
*
|
||||
* @author Refringe
|
||||
* @version v1.0.0
|
||||
*/
|
||||
|
||||
import fs from "fs-extra";
|
||||
import os from "os";
|
||||
import path from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
import { dirname } from "path";
|
||||
import ignore from "ignore";
|
||||
import archiver from "archiver";
|
||||
import winston from "winston";
|
||||
|
||||
// Get the command line arguments to determine whether to use verbose logging.
|
||||
const args = process.argv.slice(2);
|
||||
const verbose = args.includes("--verbose") || args.includes("-v");
|
||||
|
||||
// Configure the Winston logger to use colours.
|
||||
const logColors = {
|
||||
error: "red",
|
||||
warn: "yellow",
|
||||
info: "grey",
|
||||
success: "green",
|
||||
};
|
||||
winston.addColors(logColors);
|
||||
|
||||
// Create a logger instance to log build progress. Configure the logger levels to allow for different levels of logging
|
||||
// based on the verbosity flag, and set the console transport to log messages of the appropriate level.
|
||||
const logger = winston.createLogger({
|
||||
levels: {
|
||||
error: 0,
|
||||
warn: 1,
|
||||
success: 2,
|
||||
info: 3,
|
||||
},
|
||||
format: winston.format.combine(
|
||||
winston.format.colorize(),
|
||||
winston.format.printf(info => {
|
||||
return `${info.level}: ${info.message}`;
|
||||
})
|
||||
),
|
||||
transports: [
|
||||
new winston.transports.Console({
|
||||
level: verbose ? "info" : "success",
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
/**
|
||||
* The main function orchestrates the build process for creating a distributable mod package. It leverages a series of
|
||||
* helper functions to perform various tasks such as loading configuration files, setting up directories, copying files
|
||||
* according to `.buildignore` rules, and creating a ZIP archive of the project files.
|
||||
*
|
||||
* Utilizes the Winston logger to provide information on the build status at different stages of the process.
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
async function main() {
|
||||
// Get the current directory where the script is being executed
|
||||
const currentDir = getCurrentDirectory();
|
||||
|
||||
// Defining at this scope because we need to use it in the finally block.
|
||||
let projectDir;
|
||||
|
||||
try {
|
||||
// Load the .buildignore file to set up an ignore handler for the build process.
|
||||
const buildIgnorePatterns = await loadBuildIgnoreFile(currentDir);
|
||||
|
||||
// Load the package.json file to get project details.
|
||||
const packageJson = await loadPackageJson(currentDir);
|
||||
|
||||
// Create a descriptive name for the mod package.
|
||||
const projectName = createProjectName(packageJson);
|
||||
logger.log("success", `Project name created: ${projectName}`);
|
||||
|
||||
// Remove the old distribution directory and create a fresh one.
|
||||
const distDir = await removeOldDistDirectory(currentDir);
|
||||
logger.log("info", "Distribution directory successfully cleaned.");
|
||||
|
||||
// Create a temporary working directory to perform the build operations.
|
||||
projectDir = await createTemporaryDirectoryWithProjectName(projectName);
|
||||
logger.log("success", "Temporary working directory successfully created.");
|
||||
logger.log("info", projectDir);
|
||||
|
||||
// Copy files to the temporary directory while respecting the .buildignore rules.
|
||||
logger.log("info", "Beginning copy operation using .buildignore file...");
|
||||
await copyFiles(currentDir, projectDir, buildIgnorePatterns);
|
||||
logger.log("success", "Files successfully copied to temporary directory.");
|
||||
|
||||
// Create a zip archive of the project files.
|
||||
logger.log("info", "Beginning folder compression...");
|
||||
const zipFilePath = path.join(path.dirname(projectDir), `${projectName}.zip`);
|
||||
await createZipFile(projectDir, zipFilePath, "user/mods/" + projectName);
|
||||
logger.log("success", "Archive successfully created.");
|
||||
logger.log("info", zipFilePath);
|
||||
|
||||
// Move the zip file inside of the project directory, within the temporary working directory.
|
||||
const zipFileInProjectDir = path.join(projectDir, `${projectName}.zip`);
|
||||
await fs.move(zipFilePath, zipFileInProjectDir);
|
||||
logger.log("success", "Archive successfully moved.");
|
||||
logger.log("info", zipFileInProjectDir);
|
||||
|
||||
// Move the temporary directory into the distribution directory.
|
||||
await fs.move(projectDir, distDir);
|
||||
logger.log("success", "Temporary directory successfully moved into project distribution directory.");
|
||||
|
||||
// Log the success message. Write out the path to the mod package.
|
||||
logger.log("success", "------------------------------------");
|
||||
logger.log("success", "Build script completed successfully!");
|
||||
logger.log("success", "Your mod package has been created in the 'dist' directory:");
|
||||
logger.log("success", `/${path.relative(process.cwd(), path.join(distDir, `${projectName}.zip`))}`);
|
||||
logger.log("success", "------------------------------------");
|
||||
if (!verbose) {
|
||||
logger.log("success", "To see a detailed build log, use `npm run buildinfo`.");
|
||||
logger.log("success", "------------------------------------");
|
||||
}
|
||||
} catch (err) {
|
||||
// If any of the file operations fail, log the error.
|
||||
logger.log("error", "An error occurred: " + err);
|
||||
} finally {
|
||||
// Clean up the temporary directory, even if the build fails.
|
||||
if (projectDir) {
|
||||
try {
|
||||
await fs.promises.rm(projectDir, { force: true, recursive: true });
|
||||
logger.log("info", "Cleaned temporary directory.");
|
||||
} catch (err) {
|
||||
logger.log("error", "Failed to clean temporary directory: " + err);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the current working directory where the script is being executed. This directory is used as a reference
|
||||
* point for various file operations throughout the build process, ensuring that paths are resolved correctly regardless
|
||||
* of the location from which the script is invoked.
|
||||
*
|
||||
* @returns {string} The absolute path of the current working directory.
|
||||
*/
|
||||
function getCurrentDirectory() {
|
||||
return dirname(fileURLToPath(import.meta.url));
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the `.buildignore` file and sets up an ignore handler using the `ignore` module. The `.buildignore` file
|
||||
* contains a list of patterns describing files and directories that should be ignored during the build process. The
|
||||
* ignore handler created by this method is used to filter files and directories when copying them to the temporary
|
||||
* directory, ensuring that only necessary files are included in the final mod package.
|
||||
*
|
||||
* @param {string} currentDirectory - The absolute path of the current working directory.
|
||||
* @returns {Promise<ignore>} A promise that resolves to an ignore handler.
|
||||
*/
|
||||
async function loadBuildIgnoreFile(currentDir) {
|
||||
const buildIgnorePath = path.join(currentDir, ".buildignore");
|
||||
|
||||
try {
|
||||
// Attempt to read the contents of the .buildignore file asynchronously.
|
||||
const fileContent = await fs.promises.readFile(buildIgnorePath, "utf-8");
|
||||
|
||||
// Return a new ignore instance and add the rules from the .buildignore file (split by newlines).
|
||||
return ignore().add(fileContent.split("\n"));
|
||||
} catch (err) {
|
||||
logger.log("warn", "Failed to read .buildignore file. No files or directories will be ignored.");
|
||||
|
||||
// Return an empty ignore instance, ensuring the build process can continue.
|
||||
return ignore();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the `package.json` file and returns its content as a JSON object. The `package.json` file contains important
|
||||
* project details such as the name and version, which are used in later stages of the build process to create a
|
||||
* descriptive name for the mod package. The method reads the file from the current working directory, ensuring that it
|
||||
* accurately reflects the current state of the project.
|
||||
*
|
||||
* @param {string} currentDirectory - The absolute path of the current working directory.
|
||||
* @returns {Promise<Object>} A promise that resolves to a JSON object containing the contents of the `package.json`.
|
||||
*/
|
||||
async function loadPackageJson(currentDir) {
|
||||
const packageJsonPath = path.join(currentDir, "package.json");
|
||||
|
||||
// Read the contents of the package.json file asynchronously as a UTF-8 string.
|
||||
const packageJsonContent = await fs.promises.readFile(packageJsonPath, "utf-8");
|
||||
|
||||
return JSON.parse(packageJsonContent);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a descriptive name for the mod package using details from the `package.json` file. The name is created by
|
||||
* concatenating the project name, version, and a timestamp, resulting in a unique and descriptive file name for each
|
||||
* build. This name is used as the base name for the temporary working directory and the final ZIP archive, helping to
|
||||
* identify different versions of the mod package easily.
|
||||
*
|
||||
* @param {Object} packageJson - A JSON object containing the contents of the `package.json` file.
|
||||
* @returns {string} A string representing the constructed project name.
|
||||
*/
|
||||
function createProjectName(packageJson) {
|
||||
// Remove any non-alphanumeric characters from the author and name.
|
||||
const author = packageJson.author.replace(/\W/g, "");
|
||||
const name = packageJson.name.replace(/\W/g, "");
|
||||
const version = packageJson.version;
|
||||
|
||||
// Ensure the name is lowercase, as per the package.json specification.
|
||||
return `${author}-${name}-${version}`.toLowerCase();
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the location of the distribution directory where the final mod package will be stored and deletes any
|
||||
* existing distribution directory to ensure a clean slate for the build process.
|
||||
*
|
||||
* @param {string} currentDirectory - The absolute path of the current working directory.
|
||||
* @returns {Promise<string>} A promise that resolves to the absolute path to the distribution directory.
|
||||
*/
|
||||
async function removeOldDistDirectory(projectDir) {
|
||||
const distPath = path.join(projectDir, "dist");
|
||||
await fs.remove(distPath);
|
||||
return distPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a temporary working directory using the project name. This directory serves as a staging area where project
|
||||
* files are gathered before being archived into the final mod package. The method constructs a unique directory path
|
||||
* by appending the project name to a base temporary directory path, ensuring that each build has its own isolated
|
||||
* working space. This approach facilitates clean and organized build processes, avoiding potential conflicts with other
|
||||
* builds.
|
||||
*
|
||||
* @param {string} currentDirectory - The absolute path of the current working directory.
|
||||
* @param {string} projectName - The constructed project name, used to create a unique path for the temporary directory.
|
||||
* @returns {Promise<string>} A promise that resolves to the absolute path of the newly created temporary directory.
|
||||
*/
|
||||
async function createTemporaryDirectoryWithProjectName(projectName) {
|
||||
// Create a new directory in the system's temporary folder to hold the project files.
|
||||
const tempDir = await fs.promises.mkdtemp(path.join(os.tmpdir(), "spt-mod-build-"));
|
||||
|
||||
// Create a subdirectory within the temporary directory using the project name for this specific build.
|
||||
const projectDir = path.join(tempDir, projectName);
|
||||
await fs.ensureDir(projectDir);
|
||||
|
||||
return projectDir;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copies the project files to the temporary directory while respecting the rules defined in the `.buildignore` file.
|
||||
* The method is recursive, iterating over all files and directories in the source directory and using the ignore
|
||||
* handler to filter out files and directories that match the patterns defined in the `.buildignore` file. This ensures
|
||||
* that only the necessary files are included in the final mod package, adhering to the specifications defined by the
|
||||
* developer in the `.buildignore` file.
|
||||
*
|
||||
* The copy operations are delayed and executed in parallel to improve efficiency and reduce the build time. This is
|
||||
* achieved by creating an array of copy promises and awaiting them all at the end of the function.
|
||||
*
|
||||
* @param {string} sourceDirectory - The absolute path of the current working directory.
|
||||
* @param {string} destinationDirectory - The absolute path of the temporary directory where the files will be copied.
|
||||
* @param {Ignore} ignoreHandler - The ignore handler created from the `.buildignore` file.
|
||||
* @returns {Promise<void>} A promise that resolves when all copy operations are completed successfully.
|
||||
*/
|
||||
async function copyFiles(srcDir, destDir, ignoreHandler) {
|
||||
try {
|
||||
// Read the contents of the source directory to get a list of entries (files and directories).
|
||||
const entries = await fs.promises.readdir(srcDir, { withFileTypes: true });
|
||||
|
||||
// Initialize an array to hold the promises returned by recursive calls to copyFiles and copyFile operations.
|
||||
const copyOperations = [];
|
||||
|
||||
for (const entry of entries) {
|
||||
// Define the source and destination paths for each entry.
|
||||
const srcPath = path.join(srcDir, entry.name);
|
||||
const destPath = path.join(destDir, entry.name);
|
||||
|
||||
// Get the relative path of the source file to check against the ignore handler.
|
||||
const relativePath = path.relative(process.cwd(), srcPath);
|
||||
|
||||
// If the ignore handler dictates that this file should be ignored, skip to the next iteration.
|
||||
if (ignoreHandler.ignores(relativePath)) {
|
||||
logger.log("info", `Ignored: /${path.relative(process.cwd(), srcPath)}`);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (entry.isDirectory()) {
|
||||
// If the entry is a directory, create the corresponding temporary directory and make a recursive call
|
||||
// to copyFiles to handle copying the contents of the directory.
|
||||
await fs.ensureDir(destPath);
|
||||
copyOperations.push(copyFiles(srcPath, destPath, ignoreHandler));
|
||||
} else {
|
||||
// If the entry is a file, add a copyFile operation to the copyOperations array and log the event when
|
||||
// the operation is successful.
|
||||
copyOperations.push(
|
||||
fs.copy(srcPath, destPath).then(() => {
|
||||
logger.log("info", `Copied: /${path.relative(process.cwd(), srcPath)}`);
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Await all copy operations to ensure all files and directories are copied before exiting the function.
|
||||
await Promise.all(copyOperations);
|
||||
} catch (err) {
|
||||
// Log an error message if any error occurs during the copy process.
|
||||
logger.log("error", "Error copying files: " + err);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a ZIP archive of the project files located in the temporary directory. The method uses the `archiver` module
|
||||
* to create a ZIP file, which includes all the files that have been copied to the temporary directory during the build
|
||||
* process. The ZIP file is named using the project name, helping to identify the contents of the archive easily.
|
||||
*
|
||||
* @param {string} directoryPath - The absolute path of the temporary directory containing the project files.
|
||||
* @param {string} projectName - The constructed project name, used to name the ZIP file.
|
||||
* @returns {Promise<string>} A promise that resolves to the absolute path of the created ZIP file.
|
||||
*/
|
||||
async function createZipFile(directoryToZip, zipFilePath, containerDirName) {
|
||||
return new Promise((resolve, reject) => {
|
||||
// Create a write stream to the specified ZIP file path.
|
||||
const output = fs.createWriteStream(zipFilePath);
|
||||
|
||||
// Create a new archiver instance with ZIP format and maximum compression level.
|
||||
const archive = archiver("zip", {
|
||||
zlib: { level: 9 },
|
||||
});
|
||||
|
||||
// Set up an event listener for the 'close' event to resolve the promise when the archiver has finalized.
|
||||
output.on("close", function () {
|
||||
logger.log("info", "Archiver has finalized. The output and the file descriptor have closed.");
|
||||
resolve();
|
||||
});
|
||||
|
||||
// Set up an event listener for the 'warning' event to handle warnings appropriately, logging them or rejecting
|
||||
// the promise based on the error code.
|
||||
archive.on("warning", function (err) {
|
||||
if (err.code === "ENOENT") {
|
||||
logger.log("warn", `Archiver issued a warning: ${err.code} - ${err.message}`);
|
||||
} else {
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
|
||||
// Set up an event listener for the 'error' event to reject the promise if any error occurs during archiving.
|
||||
archive.on("error", function (err) {
|
||||
reject(err);
|
||||
});
|
||||
|
||||
// Pipe archive data to the file.
|
||||
archive.pipe(output);
|
||||
|
||||
// Add the directory to the archive, under the provided directory name.
|
||||
archive.directory(directoryToZip, containerDirName);
|
||||
|
||||
// Finalize the archive, indicating that no more files will be added and triggering the 'close' event once all
|
||||
// data has been written.
|
||||
archive.finalize();
|
||||
});
|
||||
}
|
||||
|
||||
// Engage!
|
||||
main();
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"myProperty": "i love json5"
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"myProperty": "i love jsonc"
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "."
|
||||
}
|
||||
],
|
||||
"extensions": {
|
||||
"recommendations": [
|
||||
"dbaeumer.vscode-eslint"
|
||||
]
|
||||
}
|
||||
}
|
26
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/package.json
Normal file
26
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/package.json
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "UseACustomJson5OrJsonCConfigFile",
|
||||
"version": "1.0.0",
|
||||
"main": "src/mod.js",
|
||||
"license": "MIT",
|
||||
"author": "Chomp",
|
||||
"akiVersion": "~3.7",
|
||||
"scripts": {
|
||||
"setup": "npm i",
|
||||
"build": "node ./build.mjs",
|
||||
"buildinfo": "node ./build.mjs --verbose"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "20.4.5",
|
||||
"@typescript-eslint/eslint-plugin": "6.2.0",
|
||||
"@typescript-eslint/parser": "6.2.0",
|
||||
"archiver": "^6.0",
|
||||
"eslint": "8.46.0",
|
||||
"fs-extra": "^11.1",
|
||||
"ignore": "^5.2",
|
||||
"os": "^0.1",
|
||||
"tsyringe": "4.8.0",
|
||||
"typescript": "5.1.6",
|
||||
"winston": "^3.9"
|
||||
}
|
||||
}
|
33
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/src/mod.ts
Normal file
33
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/src/mod.ts
Normal file
@ -0,0 +1,33 @@
|
||||
import { DependencyContainer } from "tsyringe";
|
||||
|
||||
import { IPostAkiLoadMod } from "@spt-aki/models/external/IPostAkiLoadMod";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
import { VFS } from "@spt-aki/utils/VFS";
|
||||
|
||||
import JSON5 from "json5";
|
||||
import { jsonc } from "jsonc";
|
||||
|
||||
import path from "path";
|
||||
|
||||
class Mod implements IPostAkiLoadMod
|
||||
{
|
||||
public postAkiLoad(container: DependencyContainer): void {
|
||||
// get logger
|
||||
const logger = container.resolve<ILogger>("WinstonLogger");
|
||||
|
||||
// Get VFS to read in configs
|
||||
const vfs = container.resolve<VFS>("VFS");
|
||||
|
||||
// Read in the json 5 config content and parse it into json
|
||||
const modConfigJson5 = JSON5.parse(vfs.readFile(path.resolve(__dirname, "../config/config.json5")));
|
||||
|
||||
// Read in the json c config content and parse it into json
|
||||
const modConfigJsonC = jsonc.parse(vfs.readFile(path.resolve(__dirname, "../config/config.jsonc")));
|
||||
|
||||
// log the 'myProperty' values to the console
|
||||
logger.success(`here is the value from my json5 config: ${modConfigJson5.myProperty}`);
|
||||
logger.success(`here is the value from my jsonc config: ${modConfigJsonC.myProperty}`);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { mod: new Mod() }
|
25
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/tsconfig.json
Normal file
25
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/tsconfig.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"module": "CommonJS",
|
||||
"target": "es2021",
|
||||
"moduleResolution": "node",
|
||||
"esModuleInterop": true,
|
||||
"downlevelIteration": true,
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"resolveJsonModule": true,
|
||||
"outDir": "tmp",
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@spt-aki/*": ["./types/*"]
|
||||
}
|
||||
},
|
||||
"lib": [
|
||||
"es2020"
|
||||
],
|
||||
"include": [
|
||||
"src/*",
|
||||
"src/**/*"
|
||||
]
|
||||
}
|
6
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/ErrorHandler.d.ts
vendored
Normal file
6
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/ErrorHandler.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
export declare class ErrorHandler {
|
||||
private logger;
|
||||
private readLine;
|
||||
constructor();
|
||||
handleCriticalError(err: any): void;
|
||||
}
|
5
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/Program.d.ts
vendored
Normal file
5
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/Program.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
export declare class Program {
|
||||
private errorHandler;
|
||||
constructor();
|
||||
start(): void;
|
||||
}
|
3
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/TYPES.d.ts
vendored
Normal file
3
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/TYPES.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
export declare const TYPES: {
|
||||
[name: string]: symbol;
|
||||
};
|
37
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/BotCallbacks.d.ts
vendored
Normal file
37
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/BotCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
import { BotController } from "../controllers/BotController";
|
||||
import { IGenerateBotsRequestData } from "../models/eft/bot/IGenerateBotsRequestData";
|
||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
||||
import { IBotBase } from "../models/eft/common/tables/IBotBase";
|
||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
export declare class BotCallbacks {
|
||||
protected botController: BotController;
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
constructor(botController: BotController, httpResponse: HttpResponseUtil);
|
||||
/**
|
||||
* Handle singleplayer/settings/bot/limit
|
||||
* Is called by client to define each bot roles wave limit
|
||||
* @returns string
|
||||
*/
|
||||
getBotLimit(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||
/**
|
||||
* Handle singleplayer/settings/bot/difficulty
|
||||
* @returns 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[]>;
|
||||
/**
|
||||
* Handle singleplayer/settings/bot/maxCap
|
||||
* @returns string
|
||||
*/
|
||||
getBotCap(): string;
|
||||
/**
|
||||
* Handle singleplayer/settings/bot/getBotBehaviours
|
||||
* @returns string
|
||||
*/
|
||||
getBotBehaviours(): string;
|
||||
}
|
21
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/BundleCallbacks.d.ts
vendored
Normal file
21
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/BundleCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
import { BundleLoader } from "../loaders/BundleLoader";
|
||||
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { HttpFileUtil } from "../utils/HttpFileUtil";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
export declare class BundleCallbacks {
|
||||
protected logger: ILogger;
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected httpFileUtil: HttpFileUtil;
|
||||
protected bundleLoader: BundleLoader;
|
||||
protected configServer: ConfigServer;
|
||||
protected httpConfig: IHttpConfig;
|
||||
constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer);
|
||||
sendBundle(sessionID: string, req: any, resp: any, body: any): any;
|
||||
/**
|
||||
* Handle singleplayer/bundles
|
||||
*/
|
||||
getBundles(url: string, info: any, sessionID: string): string;
|
||||
getBundle(url: string, info: any, sessionID: string): string;
|
||||
}
|
35
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/CustomizationCallbacks.d.ts
vendored
Normal file
35
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/CustomizationCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
import { CustomizationController } from "../controllers/CustomizationController";
|
||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { ISuit } from "../models/eft/common/tables/ITrader";
|
||||
import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothingRequestData";
|
||||
import { IGetSuitsResponse } from "../models/eft/customization/IGetSuitsResponse";
|
||||
import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData";
|
||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
export declare class CustomizationCallbacks {
|
||||
protected customizationController: CustomizationController;
|
||||
protected saveServer: SaveServer;
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
constructor(customizationController: CustomizationController, saveServer: SaveServer, httpResponse: HttpResponseUtil);
|
||||
/**
|
||||
* Handle client/trading/customization/storage
|
||||
* @returns IGetSuitsResponse
|
||||
*/
|
||||
getSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetSuitsResponse>;
|
||||
/**
|
||||
* Handle client/trading/customization
|
||||
* @returns ISuit[]
|
||||
*/
|
||||
getTraderSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ISuit[]>;
|
||||
/**
|
||||
* Handle CustomizationWear event
|
||||
*/
|
||||
wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle CustomizationBuy event
|
||||
*/
|
||||
buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
}
|
85
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DataCallbacks.d.ts
vendored
Normal file
85
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DataCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,85 @@
|
||||
import { HideoutController } from "../controllers/HideoutController";
|
||||
import { RagfairController } from "../controllers/RagfairController";
|
||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
||||
import { IGlobals } from "../models/eft/common/IGlobals";
|
||||
import { ICustomizationItem } from "../models/eft/common/tables/ICustomizationItem";
|
||||
import { IHandbookBase } from "../models/eft/common/tables/IHandbookBase";
|
||||
import { IGetItemPricesResponse } from "../models/eft/game/IGetItemPricesResponse";
|
||||
import { IHideoutArea } from "../models/eft/hideout/IHideoutArea";
|
||||
import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction";
|
||||
import { IHideoutScavCase } from "../models/eft/hideout/IHideoutScavCase";
|
||||
import { IHideoutSettingsBase } from "../models/eft/hideout/IHideoutSettingsBase";
|
||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { ISettingsBase } from "../models/spt/server/ISettingsBase";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
/**
|
||||
* Handle client requests
|
||||
*/
|
||||
export declare class DataCallbacks {
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected ragfairController: RagfairController;
|
||||
protected hideoutController: HideoutController;
|
||||
constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController);
|
||||
/**
|
||||
* Handle client/settings
|
||||
* @returns ISettingsBase
|
||||
*/
|
||||
getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ISettingsBase>;
|
||||
/**
|
||||
* Handle client/globals
|
||||
* @returns IGlobals
|
||||
*/
|
||||
getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGlobals>;
|
||||
/**
|
||||
* Handle client/items
|
||||
* @returns string
|
||||
*/
|
||||
getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||
/**
|
||||
* Handle client/handbook/templates
|
||||
* @returns IHandbookBase
|
||||
*/
|
||||
getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHandbookBase>;
|
||||
/**
|
||||
* Handle client/customization
|
||||
* @returns Record<string, ICustomizationItem
|
||||
*/
|
||||
getTemplateSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, ICustomizationItem>>;
|
||||
/**
|
||||
* Handle client/account/customization
|
||||
* @returns string[]
|
||||
*/
|
||||
getTemplateCharacter(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string[]>;
|
||||
/**
|
||||
* Handle client/hideout/settings
|
||||
* @returns IHideoutSettingsBase
|
||||
*/
|
||||
getHideoutSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutSettingsBase>;
|
||||
getHideoutAreas(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutArea[]>;
|
||||
gethideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutProduction[]>;
|
||||
getHideoutScavcase(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutScavCase[]>;
|
||||
/**
|
||||
* Handle client/languages
|
||||
*/
|
||||
getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, string>>;
|
||||
/**
|
||||
* Handle client/menu/locale
|
||||
*/
|
||||
getLocalesMenu(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string>;
|
||||
/**
|
||||
* Handle client/locale
|
||||
*/
|
||||
getLocalesGlobal(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||
/**
|
||||
* Handle client/hideout/qte/list
|
||||
*/
|
||||
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>;
|
||||
}
|
98
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DialogueCallbacks.d.ts
vendored
Normal file
98
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DialogueCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,98 @@
|
||||
import { DialogueController } from "../controllers/DialogueController";
|
||||
import { OnUpdate } from "../di/OnUpdate";
|
||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
||||
import { IAcceptFriendRequestData, ICancelFriendRequestData } from "../models/eft/dialog/IAcceptFriendRequestData";
|
||||
import { IChatServer } from "../models/eft/dialog/IChatServer";
|
||||
import { IClearMailMessageRequest } from "../models/eft/dialog/IClearMailMessageRequest";
|
||||
import { IDeleteFriendRequest } from "../models/eft/dialog/IDeleteFriendRequest";
|
||||
import { IFriendRequestData } from "../models/eft/dialog/IFriendRequestData";
|
||||
import { IFriendRequestSendResponse } from "../models/eft/dialog/IFriendRequestSendResponse";
|
||||
import { IGetAllAttachmentsRequestData } from "../models/eft/dialog/IGetAllAttachmentsRequestData";
|
||||
import { IGetAllAttachmentsResponse } from "../models/eft/dialog/IGetAllAttachmentsResponse";
|
||||
import { IGetChatServerListRequestData } from "../models/eft/dialog/IGetChatServerListRequestData";
|
||||
import { IGetFriendListDataResponse } from "../models/eft/dialog/IGetFriendListDataResponse";
|
||||
import { IGetMailDialogInfoRequestData } from "../models/eft/dialog/IGetMailDialogInfoRequestData";
|
||||
import { IGetMailDialogListRequestData } from "../models/eft/dialog/IGetMailDialogListRequestData";
|
||||
import { IGetMailDialogViewRequestData } from "../models/eft/dialog/IGetMailDialogViewRequestData";
|
||||
import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDialogViewResponseData";
|
||||
import { IPinDialogRequestData } from "../models/eft/dialog/IPinDialogRequestData";
|
||||
import { IRemoveDialogRequestData } from "../models/eft/dialog/IRemoveDialogRequestData";
|
||||
import { IRemoveMailMessageRequest } from "../models/eft/dialog/IRemoveMailMessageRequest";
|
||||
import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest";
|
||||
import { ISetDialogReadRequestData } from "../models/eft/dialog/ISetDialogReadRequestData";
|
||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
|
||||
import { DialogueInfo } from "../models/eft/profile/IAkiProfile";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class DialogueCallbacks implements OnUpdate {
|
||||
protected hashUtil: HashUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected dialogueController: DialogueController;
|
||||
constructor(hashUtil: HashUtil, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, dialogueController: DialogueController);
|
||||
/**
|
||||
* Handle client/friend/list
|
||||
* @returns IGetFriendListDataResponse
|
||||
*/
|
||||
getFriendList(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetFriendListDataResponse>;
|
||||
/**
|
||||
* Handle client/chatServer/list
|
||||
* @returns IChatServer[]
|
||||
*/
|
||||
getChatServerList(url: string, info: IGetChatServerListRequestData, sessionID: string): IGetBodyResponseData<IChatServer[]>;
|
||||
/** Handle client/mail/dialog/list */
|
||||
getMailDialogList(url: string, info: IGetMailDialogListRequestData, sessionID: string): IGetBodyResponseData<DialogueInfo[]>;
|
||||
/** Handle client/mail/dialog/view */
|
||||
getMailDialogView(url: string, info: IGetMailDialogViewRequestData, sessionID: string): IGetBodyResponseData<IGetMailDialogViewResponseData>;
|
||||
/** Handle client/mail/dialog/info */
|
||||
getMailDialogInfo(url: string, info: IGetMailDialogInfoRequestData, sessionID: string): IGetBodyResponseData<DialogueInfo>;
|
||||
/** Handle client/mail/dialog/remove */
|
||||
removeDialog(url: string, info: IRemoveDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
||||
/** Handle client/mail/dialog/pin */
|
||||
pinDialog(url: string, info: IPinDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
||||
/** Handle client/mail/dialog/unpin */
|
||||
unpinDialog(url: string, info: IPinDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
||||
/** Handle client/mail/dialog/read */
|
||||
setRead(url: string, info: ISetDialogReadRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
||||
/**
|
||||
* Handle client/mail/dialog/getAllAttachments
|
||||
* @returns IGetAllAttachmentsResponse
|
||||
*/
|
||||
getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData<IGetAllAttachmentsResponse>;
|
||||
/** Handle client/mail/msg/send */
|
||||
sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData<string>;
|
||||
/** Handle client/friend/request/list/outbox */
|
||||
listOutbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
||||
/**
|
||||
* Handle client/friend/request/list/inbox
|
||||
*/
|
||||
listInbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any[]>;
|
||||
/**
|
||||
* Handle client/friend/request/send
|
||||
*/
|
||||
sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData<IFriendRequestSendResponse>;
|
||||
/**
|
||||
* Handle client/friend/request/accept
|
||||
*/
|
||||
acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData<boolean>;
|
||||
/**
|
||||
* Handle client/friend/request/cancel
|
||||
*/
|
||||
cancelFriendRequest(url: string, request: ICancelFriendRequestData, sessionID: string): IGetBodyResponseData<boolean>;
|
||||
/** Handle client/friend/delete */
|
||||
deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData;
|
||||
/** Handle client/friend/ignore/set */
|
||||
ignoreFriend(url: string, request: {
|
||||
uid: string;
|
||||
}, sessionID: string): any;
|
||||
/** Handle client/friend/ignore/remove */
|
||||
unIgnoreFriend(url: string, request: {
|
||||
uid: string;
|
||||
}, sessionID: string): any;
|
||||
clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData<any[]>;
|
||||
removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData<any[]>;
|
||||
onUpdate(timeSinceLastRun: number): Promise<boolean>;
|
||||
getRoute(): string;
|
||||
}
|
72
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/GameCallbacks.d.ts
vendored
Normal file
72
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/GameCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,72 @@
|
||||
import { GameController } from "../controllers/GameController";
|
||||
import { OnLoad } from "../di/OnLoad";
|
||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
||||
import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse";
|
||||
import { ICurrentGroupResponse } from "../models/eft/game/ICurrentGroupResponse";
|
||||
import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
|
||||
import { IGameEmptyCrcRequestData } from "../models/eft/game/IGameEmptyCrcRequestData";
|
||||
import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse";
|
||||
import { IGameLogoutResponseData } from "../models/eft/game/IGameLogoutResponseData";
|
||||
import { IGameStartResponse } from "../models/eft/game/IGameStartResponse";
|
||||
import { IReportNicknameRequestData } from "../models/eft/game/IReportNicknameRequestData";
|
||||
import { IServerDetails } from "../models/eft/game/IServerDetails";
|
||||
import { IVersionValidateRequestData } from "../models/eft/game/IVersionValidateRequestData";
|
||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
import { Watermark } from "../utils/Watermark";
|
||||
declare class GameCallbacks implements OnLoad {
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected watermark: Watermark;
|
||||
protected saveServer: SaveServer;
|
||||
protected gameController: GameController;
|
||||
constructor(httpResponse: HttpResponseUtil, watermark: Watermark, saveServer: SaveServer, gameController: GameController);
|
||||
onLoad(): Promise<void>;
|
||||
getRoute(): string;
|
||||
/**
|
||||
* Handle client/game/version/validate
|
||||
* @returns INullResponseData
|
||||
*/
|
||||
versionValidate(url: string, info: IVersionValidateRequestData, sessionID: string): INullResponseData;
|
||||
/**
|
||||
* Handle client/game/start
|
||||
* @returns IGameStartResponse
|
||||
*/
|
||||
gameStart(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGameStartResponse>;
|
||||
/**
|
||||
* Handle client/game/logout
|
||||
* Save profiles on game close
|
||||
* @returns IGameLogoutResponseData
|
||||
*/
|
||||
gameLogout(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGameLogoutResponseData>;
|
||||
/**
|
||||
* Handle client/game/config
|
||||
* @returns IGameConfigResponse
|
||||
*/
|
||||
getGameConfig(url: string, info: IGameEmptyCrcRequestData, sessionID: string): IGetBodyResponseData<IGameConfigResponse>;
|
||||
/**
|
||||
* Handle client/server/list
|
||||
*/
|
||||
getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IServerDetails[]>;
|
||||
/**
|
||||
* Handle client/match/group/current
|
||||
*/
|
||||
getCurrentGroup(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ICurrentGroupResponse>;
|
||||
/**
|
||||
* Handle client/checkVersion
|
||||
*/
|
||||
validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ICheckVersionResponse>;
|
||||
/**
|
||||
* Handle client/game/keepalive
|
||||
* @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;
|
||||
reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData;
|
||||
}
|
||||
export { GameCallbacks };
|
8
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/HandbookCallbacks.d.ts
vendored
Normal file
8
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/HandbookCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
import { HandbookController } from "../controllers/HandbookController";
|
||||
import { OnLoad } from "../di/OnLoad";
|
||||
export declare class HandbookCallbacks implements OnLoad {
|
||||
protected handbookController: HandbookController;
|
||||
constructor(handbookController: HandbookController);
|
||||
onLoad(): Promise<void>;
|
||||
getRoute(): string;
|
||||
}
|
48
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/HealthCallbacks.d.ts
vendored
Normal file
48
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/HealthCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
import { HealthController } from "../controllers/HealthController";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IHealthTreatmentRequestData } from "../models/eft/health/IHealthTreatmentRequestData";
|
||||
import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestData";
|
||||
import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData";
|
||||
import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData";
|
||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IWorkoutData } from "../models/eft/health/IWorkoutData";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
export declare class HealthCallbacks {
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected healthController: HealthController;
|
||||
constructor(httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, healthController: HealthController);
|
||||
/**
|
||||
* Custom aki server request found in modules/HealthSynchronizer.cs
|
||||
* @param url
|
||||
* @param info HealthListener.Instance.CurrentHealth class
|
||||
* @param sessionID session id
|
||||
* @returns empty response, no data sent back to client
|
||||
*/
|
||||
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;
|
||||
/**
|
||||
* Handle Heal
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle RestoreHealth
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
healthTreatment(pmcData: IPmcData, info: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
}
|
75
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/HideoutCallbacks.d.ts
vendored
Normal file
75
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/HideoutCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,75 @@
|
||||
import { HideoutController } from "../controllers/HideoutController";
|
||||
import { OnUpdate } from "../di/OnUpdate";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData";
|
||||
import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData";
|
||||
import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData";
|
||||
import { IHideoutPutItemInRequestData } from "../models/eft/hideout/IHideoutPutItemInRequestData";
|
||||
import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData";
|
||||
import { IHideoutSingleProductionStartRequestData } from "../models/eft/hideout/IHideoutSingleProductionStartRequestData";
|
||||
import { IHideoutTakeItemOutRequestData } from "../models/eft/hideout/IHideoutTakeItemOutRequestData";
|
||||
import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideoutTakeProductionRequestData";
|
||||
import { IHideoutToggleAreaRequestData } from "../models/eft/hideout/IHideoutToggleAreaRequestData";
|
||||
import { IHideoutUpgradeCompleteRequestData } from "../models/eft/hideout/IHideoutUpgradeCompleteRequestData";
|
||||
import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgradeRequestData";
|
||||
import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IHideoutConfig } from "../models/spt/config/IHideoutConfig";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
export declare class HideoutCallbacks implements OnUpdate {
|
||||
protected hideoutController: HideoutController;
|
||||
protected configServer: ConfigServer;
|
||||
protected hideoutConfig: IHideoutConfig;
|
||||
constructor(hideoutController: HideoutController, // TODO: delay needed
|
||||
configServer: ConfigServer);
|
||||
/**
|
||||
* Handle HideoutUpgrade event
|
||||
*/
|
||||
upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle HideoutUpgradeComplete event
|
||||
*/
|
||||
upgradeComplete(pmcData: IPmcData, body: IHideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle HideoutPutItemsInAreaSlots
|
||||
*/
|
||||
putItemsInAreaSlots(pmcData: IPmcData, body: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle HideoutTakeItemsFromAreaSlots event
|
||||
*/
|
||||
takeItemsFromAreaSlots(pmcData: IPmcData, body: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle HideoutToggleArea event
|
||||
*/
|
||||
toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle HideoutSingleProductionStart event
|
||||
*/
|
||||
singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle HideoutScavCaseProductionStart event
|
||||
*/
|
||||
scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle HideoutContinuousProductionStart
|
||||
*/
|
||||
continuousProductionStart(pmcData: IPmcData, body: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle HideoutTakeProduction event
|
||||
*/
|
||||
takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* 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;
|
||||
}
|
9
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/HttpCallbacks.d.ts
vendored
Normal file
9
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/HttpCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
import { OnLoad } from "../di/OnLoad";
|
||||
import { HttpServer } from "../servers/HttpServer";
|
||||
export declare class HttpCallbacks implements OnLoad {
|
||||
protected httpServer: HttpServer;
|
||||
constructor(httpServer: HttpServer);
|
||||
onLoad(): Promise<void>;
|
||||
getRoute(): string;
|
||||
getImage(): string;
|
||||
}
|
50
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/InraidCallbacks.d.ts
vendored
Normal file
50
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/InraidCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
import { InraidController } from "../controllers/InraidController";
|
||||
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
|
||||
import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData";
|
||||
import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
/**
|
||||
* Handle client requests
|
||||
*/
|
||||
export declare class InraidCallbacks {
|
||||
protected inraidController: InraidController;
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
constructor(inraidController: InraidController, httpResponse: HttpResponseUtil);
|
||||
/**
|
||||
* Handle client/location/getLocalloot
|
||||
* Store active map in profile + applicationContext
|
||||
* @param url
|
||||
* @param info register player request
|
||||
* @param sessionID Session id
|
||||
* @returns Null http response
|
||||
*/
|
||||
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;
|
||||
/**
|
||||
* Handle singleplayer/settings/raid/endstate
|
||||
* @returns
|
||||
*/
|
||||
getRaidEndState(): string;
|
||||
/**
|
||||
* Handle singleplayer/settings/raid/menu
|
||||
* @returns JSON as string
|
||||
*/
|
||||
getRaidMenuSettings(): string;
|
||||
/**
|
||||
* Handle singleplayer/settings/weapon/durability
|
||||
* @returns
|
||||
*/
|
||||
getWeaponDurability(): string;
|
||||
/**
|
||||
* Handle singleplayer/airdrop/config
|
||||
* @returns JSON as string
|
||||
*/
|
||||
getAirdropConfig(): string;
|
||||
}
|
32
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/InsuranceCallbacks.d.ts
vendored
Normal file
32
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/InsuranceCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
import { InsuranceController } from "../controllers/InsuranceController";
|
||||
import { OnUpdate } from "../di/OnUpdate";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { IGetInsuranceCostRequestData } from "../models/eft/insurance/IGetInsuranceCostRequestData";
|
||||
import { IGetInsuranceCostResponseData } from "../models/eft/insurance/IGetInsuranceCostResponseData";
|
||||
import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { InsuranceService } from "../services/InsuranceService";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
export declare class InsuranceCallbacks implements OnUpdate {
|
||||
protected insuranceController: InsuranceController;
|
||||
protected insuranceService: InsuranceService;
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected configServer: ConfigServer;
|
||||
protected insuranceConfig: IInsuranceConfig;
|
||||
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>;
|
||||
/**
|
||||
* Handle Insure event
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
onUpdate(secondsSinceLastRun: number): Promise<boolean>;
|
||||
getRoute(): string;
|
||||
}
|
48
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/InventoryCallbacks.d.ts
vendored
Normal file
48
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/InventoryCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
import { InventoryController } from "../controllers/InventoryController";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IInventoryBindRequestData } from "../models/eft/inventory/IInventoryBindRequestData";
|
||||
import { IInventoryCreateMarkerRequestData } from "../models/eft/inventory/IInventoryCreateMarkerRequestData";
|
||||
import { IInventoryDeleteMarkerRequestData } from "../models/eft/inventory/IInventoryDeleteMarkerRequestData";
|
||||
import { IInventoryEditMarkerRequestData } from "../models/eft/inventory/IInventoryEditMarkerRequestData";
|
||||
import { IInventoryExamineRequestData } from "../models/eft/inventory/IInventoryExamineRequestData";
|
||||
import { IInventoryFoldRequestData } from "../models/eft/inventory/IInventoryFoldRequestData";
|
||||
import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData";
|
||||
import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData";
|
||||
import { IInventoryReadEncyclopediaRequestData } from "../models/eft/inventory/IInventoryReadEncyclopediaRequestData";
|
||||
import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData";
|
||||
import { IInventorySortRequestData } from "../models/eft/inventory/IInventorySortRequestData";
|
||||
import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData";
|
||||
import { IInventorySwapRequestData } from "../models/eft/inventory/IInventorySwapRequestData";
|
||||
import { IInventoryTagRequestData } from "../models/eft/inventory/IInventoryTagRequestData";
|
||||
import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryToggleRequestData";
|
||||
import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData";
|
||||
import { IOpenRandomLootContainerRequestData } from "../models/eft/inventory/IOpenRandomLootContainerRequestData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
export declare class InventoryCallbacks {
|
||||
protected inventoryController: InventoryController;
|
||||
constructor(inventoryController: InventoryController);
|
||||
/** Handle Move event */
|
||||
moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle Remove event */
|
||||
removeItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle Split event */
|
||||
splitItem(pmcData: IPmcData, body: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle Swap */
|
||||
swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
foldItem(pmcData: IPmcData, body: IInventoryFoldRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
toggleItem(pmcData: IPmcData, body: IInventoryToggleRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
tagItem(pmcData: IPmcData, body: IInventoryTagRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
bindItem(pmcData: IPmcData, body: IInventoryBindRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle ReadEncyclopedia */
|
||||
readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle ApplyInventoryChanges */
|
||||
sortInventory(pmcData: IPmcData, body: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
createMapMarker(pmcData: IPmcData, body: IInventoryCreateMarkerRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
deleteMapMarker(pmcData: IPmcData, body: IInventoryDeleteMarkerRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle OpenRandomLootContainer */
|
||||
openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
}
|
13
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/ItemEventCallbacks.d.ts
vendored
Normal file
13
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/ItemEventCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { Warning } from "../models/eft/itemEvent/IItemEventRouterBase";
|
||||
import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { ItemEventRouter } from "../routers/ItemEventRouter";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
export declare class ItemEventCallbacks {
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected itemEventRouter: ItemEventRouter;
|
||||
constructor(httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter);
|
||||
handleEvents(url: string, info: IItemEventRouterRequest, sessionID: string): IGetBodyResponseData<IItemEventRouterResponse>;
|
||||
protected getErrorCode(warnings: Warning[]): number;
|
||||
}
|
30
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/LauncherCallbacks.d.ts
vendored
Normal file
30
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/LauncherCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
import { LauncherController } from "../controllers/LauncherController";
|
||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
||||
import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData";
|
||||
import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData";
|
||||
import { IRegisterData } from "../models/eft/launcher/IRegisterData";
|
||||
import { IRemoveProfileData } from "../models/eft/launcher/IRemoveProfileData";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
import { Watermark } from "../utils/Watermark";
|
||||
declare class LauncherCallbacks {
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected launcherController: LauncherController;
|
||||
protected saveServer: SaveServer;
|
||||
protected watermark: Watermark;
|
||||
constructor(httpResponse: HttpResponseUtil, launcherController: LauncherController, saveServer: SaveServer, watermark: Watermark);
|
||||
connect(): string;
|
||||
login(url: string, info: ILoginRequestData, sessionID: string): string;
|
||||
register(url: string, info: IRegisterData, sessionID: string): "FAILED" | "OK";
|
||||
get(url: string, info: ILoginRequestData, sessionID: string): string;
|
||||
changeUsername(url: string, info: IChangeRequestData, sessionID: string): "FAILED" | "OK";
|
||||
changePassword(url: string, info: IChangeRequestData, sessionID: string): "FAILED" | "OK";
|
||||
wipe(url: string, info: IRegisterData, sessionID: string): "FAILED" | "OK";
|
||||
getServerVersion(): string;
|
||||
ping(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||
removeProfile(url: string, info: IRemoveProfileData, sessionID: string): string;
|
||||
getCompatibleTarkovVersion(): string;
|
||||
getLoadedServerMods(): string;
|
||||
getServerModsProfileUsed(url: string, info: IEmptyRequestData, sessionId: string): string;
|
||||
}
|
||||
export { LauncherCallbacks };
|
18
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/LocationCallbacks.d.ts
vendored
Normal file
18
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/LocationCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
import { LocationController } from "../controllers/LocationController";
|
||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
||||
import { ILocationBase } from "../models/eft/common/ILocationBase";
|
||||
import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSourceDestinationBase";
|
||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { IGetLocationRequestData } from "../models/eft/location/IGetLocationRequestData";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
export declare class LocationCallbacks {
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected locationController: LocationController;
|
||||
constructor(httpResponse: HttpResponseUtil, locationController: LocationController);
|
||||
/** Handle client/locations */
|
||||
getLocationData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ILocationsGenerateAllResponse>;
|
||||
/** Handle client/location/getLocalloot */
|
||||
getLocation(url: string, info: IGetLocationRequestData, sessionID: string): IGetBodyResponseData<ILocationBase>;
|
||||
/** Handle client/location/getAirdropLoot */
|
||||
getAirdropLoot(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||
}
|
73
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/MatchCallbacks.d.ts
vendored
Normal file
73
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/MatchCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
import { MatchController } from "../controllers/MatchController";
|
||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
|
||||
import { IAcceptGroupInviteRequest } from "../models/eft/match/IAcceptGroupInviteRequest";
|
||||
import { IAcceptGroupInviteResponse } from "../models/eft/match/IAcceptGroupInviteResponse";
|
||||
import { ICancelGroupInviteRequest } from "../models/eft/match/ICancelGroupInviteRequest";
|
||||
import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData";
|
||||
import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData";
|
||||
import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData";
|
||||
import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData";
|
||||
import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData";
|
||||
import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData";
|
||||
import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult";
|
||||
import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData";
|
||||
import { IRemovePlayerFromGroupRequest } from "../models/eft/match/IRemovePlayerFromGroupRequest";
|
||||
import { ISendGroupInviteRequest } from "../models/eft/match/ISendGroupInviteRequest";
|
||||
import { ITransferGroupRequest } from "../models/eft/match/ITransferGroupRequest";
|
||||
import { IUpdatePingRequestData } from "../models/eft/match/IUpdatePingRequestData";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
export declare class MatchCallbacks {
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected matchController: MatchController;
|
||||
protected databaseServer: DatabaseServer;
|
||||
constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer);
|
||||
/** Handle client/match/updatePing */
|
||||
updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData;
|
||||
exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData;
|
||||
/** Handle client/match/group/exit_from_menu */
|
||||
exitToMenu(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData;
|
||||
startGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData;
|
||||
stopGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData;
|
||||
/** Handle client/match/group/invite/send */
|
||||
sendGroupInvite(url: string, info: ISendGroupInviteRequest, sessionID: string): IGetBodyResponseData<string>;
|
||||
/** Handle client/match/group/invite/accept */
|
||||
acceptGroupInvite(url: string, info: IAcceptGroupInviteRequest, sessionID: string): IGetBodyResponseData<IAcceptGroupInviteResponse[]>;
|
||||
/** Handle client/match/group/invite/cancel */
|
||||
cancelGroupInvite(url: string, info: ICancelGroupInviteRequest, sessionID: string): IGetBodyResponseData<boolean>;
|
||||
/** Handle client/match/group/transfer */
|
||||
transferGroup(url: string, info: ITransferGroupRequest, sessionID: string): IGetBodyResponseData<boolean>;
|
||||
/** Handle client/match/group/invite/cancel-all */
|
||||
cancelAllGroupInvite(url: string, info: any, sessionID: string): INullResponseData;
|
||||
/** @deprecated - not called on raid start/end or game start/exit */
|
||||
putMetrics(url: string, info: IPutMetricsRequestData, sessionID: string): INullResponseData;
|
||||
/** Handle raid/profile/list */
|
||||
getProfile(url: string, info: IGetProfileRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]>;
|
||||
serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<boolean>;
|
||||
/** Handle match/group/start_game */
|
||||
joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData<IJoinMatchResult>;
|
||||
/** Handle client/getMetricsConfig */
|
||||
getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData<string>;
|
||||
/**
|
||||
* @deprecated - not called on raid start/end or game start/exit
|
||||
* Handle client/match/group/status
|
||||
* @returns
|
||||
*/
|
||||
getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData<any>;
|
||||
/** Handle client/match/group/create */
|
||||
createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData<any>;
|
||||
/** Handle client/match/group/delete */
|
||||
deleteGroup(url: string, info: any, sessionID: string): INullResponseData;
|
||||
leaveGroup(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<boolean>;
|
||||
/** Handle client/match/group/player/remove */
|
||||
removePlayerFromGroup(url: string, info: IRemovePlayerFromGroupRequest, sessionID: string): INullResponseData;
|
||||
/** Handle client/match/offline/end */
|
||||
endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData;
|
||||
/** Handle client/raid/configuration */
|
||||
getRaidConfiguration(url: string, info: IGetRaidConfigurationRequestData, sessionID: string): INullResponseData;
|
||||
}
|
21
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/ModCallbacks.d.ts
vendored
Normal file
21
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/ModCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
import { OnLoad } from "../di/OnLoad";
|
||||
import { PostAkiModLoader } from "../loaders/PostAkiModLoader";
|
||||
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { HttpFileUtil } from "../utils/HttpFileUtil";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
declare class ModCallbacks implements OnLoad {
|
||||
protected logger: ILogger;
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected httpFileUtil: HttpFileUtil;
|
||||
protected postAkiModLoader: PostAkiModLoader;
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
protected httpConfig: IHttpConfig;
|
||||
constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, postAkiModLoader: PostAkiModLoader, localisationService: LocalisationService, configServer: ConfigServer);
|
||||
onLoad(): Promise<void>;
|
||||
getRoute(): string;
|
||||
}
|
||||
export { ModCallbacks };
|
14
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/NoteCallbacks.d.ts
vendored
Normal file
14
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/NoteCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
import { NoteController } from "../controllers/NoteController";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { INoteActionData } from "../models/eft/notes/INoteActionData";
|
||||
export declare class NoteCallbacks {
|
||||
protected noteController: NoteController;
|
||||
constructor(noteController: NoteController);
|
||||
/** Handle AddNote event */
|
||||
addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle EditNote event */
|
||||
editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle DeleteNote event */
|
||||
deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;
|
||||
}
|
34
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/NotifierCallbacks.d.ts
vendored
Normal file
34
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/NotifierCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
import { NotifierController } from "../controllers/NotifierController";
|
||||
import { HttpServerHelper } from "../helpers/HttpServerHelper";
|
||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { INotifierChannel } from "../models/eft/notifier/INotifier";
|
||||
import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData";
|
||||
import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
export declare class NotifierCallbacks {
|
||||
protected httpServerHelper: HttpServerHelper;
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected notifierController: NotifierController;
|
||||
constructor(httpServerHelper: HttpServerHelper, httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, notifierController: NotifierController);
|
||||
/**
|
||||
* If we don't have anything to send, it's ok to not send anything back
|
||||
* because notification requests can be long-polling. In fact, we SHOULD wait
|
||||
* until we actually have something to send because otherwise we'd spam the client
|
||||
* and the client would abort the connection due to spam.
|
||||
*/
|
||||
sendNotification(sessionID: string, req: any, resp: any, data: any): void;
|
||||
/** Handle push/notifier/get */
|
||||
/** Handle push/notifier/getwebsocket */
|
||||
getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData<any[]>;
|
||||
/** Handle client/notifier/channel/create */
|
||||
createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<INotifierChannel>;
|
||||
/**
|
||||
* Handle client/game/profile/select
|
||||
* @returns ISelectProfileResponse
|
||||
*/
|
||||
selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData<ISelectProfileResponse>;
|
||||
notify(url: string, info: any, sessionID: string): string;
|
||||
}
|
26
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/PresetBuildCallbacks.d.ts
vendored
Normal file
26
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/PresetBuildCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
import { PresetBuildController } from "../controllers/PresetBuildController";
|
||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData";
|
||||
import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData";
|
||||
import { IUserBuilds } from "../models/eft/profile/IAkiProfile";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
export declare class PresetBuildCallbacks {
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected presetBuildController: PresetBuildController;
|
||||
constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController);
|
||||
/** Handle client/handbook/builds/my/list */
|
||||
getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IUserBuilds>;
|
||||
/** Handle SaveWeaponBuild event */
|
||||
saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle removeBuild event*/
|
||||
removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle RemoveWeaponBuild event*/
|
||||
removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle SaveEquipmentBuild event */
|
||||
saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle RemoveEquipmentBuild event*/
|
||||
removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
}
|
8
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/PresetCallbacks.d.ts
vendored
Normal file
8
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/PresetCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
import { PresetController } from "../controllers/PresetController";
|
||||
import { OnLoad } from "../di/OnLoad";
|
||||
export declare class PresetCallbacks implements OnLoad {
|
||||
protected presetController: PresetController;
|
||||
constructor(presetController: PresetController);
|
||||
onLoad(): Promise<void>;
|
||||
getRoute(): string;
|
||||
}
|
80
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/ProfileCallbacks.d.ts
vendored
Normal file
80
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/ProfileCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
import { ProfileController } from "../controllers/ProfileController";
|
||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
|
||||
import { IGetMiniProfileRequestData } from "../models/eft/launcher/IGetMiniProfileRequestData";
|
||||
import { GetProfileStatusResponseData } from "../models/eft/profile/GetProfileStatusResponseData";
|
||||
import { IGetProfileSettingsRequest } from "../models/eft/profile/IGetProfileSettingsRequest";
|
||||
import { IProfileChangeNicknameRequestData } from "../models/eft/profile/IProfileChangeNicknameRequestData";
|
||||
import { IProfileChangeVoiceRequestData } from "../models/eft/profile/IProfileChangeVoiceRequestData";
|
||||
import { IProfileCreateRequestData } from "../models/eft/profile/IProfileCreateRequestData";
|
||||
import { ISearchFriendRequestData } from "../models/eft/profile/ISearchFriendRequestData";
|
||||
import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendResponse";
|
||||
import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
/** Handle profile related client events */
|
||||
export declare class ProfileCallbacks {
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected profileController: ProfileController;
|
||||
constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, profileController: ProfileController);
|
||||
/**
|
||||
* Handle client/game/profile/create
|
||||
*/
|
||||
createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData<any>;
|
||||
/**
|
||||
* Handle client/game/profile/list
|
||||
* Get the complete player profile (scav + pmc character)
|
||||
*/
|
||||
getProfileData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]>;
|
||||
/**
|
||||
* Handle client/game/profile/savage/regenerate
|
||||
* Handle the creation of a scav profile for player
|
||||
* Occurs post-raid and when profile first created immediately after character details are confirmed by player
|
||||
* @param url
|
||||
* @param info empty
|
||||
* @param sessionID Session id
|
||||
* @returns Profile object
|
||||
*/
|
||||
regenerateScav(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]>;
|
||||
/**
|
||||
* Handle client/game/profile/voice/change event
|
||||
*/
|
||||
changeVoice(url: string, info: IProfileChangeVoiceRequestData, sessionID: string): INullResponseData;
|
||||
/**
|
||||
* Handle client/game/profile/nickname/change event
|
||||
* Client allows player to adjust their profile name
|
||||
*/
|
||||
changeNickname(url: string, info: IProfileChangeNicknameRequestData, sessionID: string): IGetBodyResponseData<any>;
|
||||
/**
|
||||
* Handle client/game/profile/nickname/validate
|
||||
*/
|
||||
validateNickname(url: string, info: IValidateNicknameRequestData, sessionID: string): IGetBodyResponseData<any>;
|
||||
/**
|
||||
* Handle client/game/profile/nickname/reserved
|
||||
*/
|
||||
getReservedNickname(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string>;
|
||||
/**
|
||||
* Handle client/profile/status
|
||||
* Called when creating a character when choosing a character face/voice
|
||||
*/
|
||||
getProfileStatus(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<GetProfileStatusResponseData>;
|
||||
/**
|
||||
* Handle client/profile/settings
|
||||
*/
|
||||
getProfileSettings(url: string, info: IGetProfileSettingsRequest, sessionId: string): IGetBodyResponseData<string>;
|
||||
/**
|
||||
* Handle client/game/profile/search
|
||||
*/
|
||||
searchFriend(url: string, info: ISearchFriendRequestData, sessionID: string): IGetBodyResponseData<ISearchFriendResponse[]>;
|
||||
/**
|
||||
* Handle launcher/profile/info
|
||||
*/
|
||||
getMiniProfile(url: string, info: IGetMiniProfileRequestData, sessionID: string): string;
|
||||
/**
|
||||
* Handle /launcher/profiles
|
||||
*/
|
||||
getAllMiniProfiles(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||
}
|
44
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/QuestCallbacks.d.ts
vendored
Normal file
44
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/QuestCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
import { QuestController } from "../controllers/QuestController";
|
||||
import { RepeatableQuestController } from "../controllers/RepeatableQuestController";
|
||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IQuest } from "../models/eft/common/tables/IQuest";
|
||||
import { IPmcDataRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
|
||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData";
|
||||
import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRequestData";
|
||||
import { IHandoverQuestRequestData } from "../models/eft/quests/IHandoverQuestRequestData";
|
||||
import { IListQuestsRequestData } from "../models/eft/quests/IListQuestsRequestData";
|
||||
import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
export declare class QuestCallbacks {
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected questController: QuestController;
|
||||
protected repeatableQuestController: RepeatableQuestController;
|
||||
constructor(httpResponse: HttpResponseUtil, questController: QuestController, repeatableQuestController: RepeatableQuestController);
|
||||
/**
|
||||
* Handle RepeatableQuestChange event
|
||||
*/
|
||||
changeRepeatableQuest(pmcData: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle QuestAccept event
|
||||
*/
|
||||
acceptQuest(pmcData: IPmcData, body: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle QuestComplete event
|
||||
*/
|
||||
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle QuestHandover event
|
||||
*/
|
||||
handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle client/quest/list
|
||||
*/
|
||||
listQuests(url: string, info: IListQuestsRequestData, sessionID: string): IGetBodyResponseData<IQuest[]>;
|
||||
/**
|
||||
* Handle client/repeatalbeQuests/activityPeriods
|
||||
*/
|
||||
activityPeriods(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcDataRepeatableQuest[]>;
|
||||
}
|
60
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/RagfairCallbacks.d.ts
vendored
Normal file
60
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/RagfairCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
import { OnLoad } from "../di/OnLoad";
|
||||
import { OnUpdate } from "../di/OnUpdate";
|
||||
import { RagfairController } from "../controllers/RagfairController";
|
||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IAddOfferRequestData } from "../models/eft/ragfair/IAddOfferRequestData";
|
||||
import { IExtendOfferRequestData } from "../models/eft/ragfair/IExtendOfferRequestData";
|
||||
import { IGetItemPriceResult } from "../models/eft/ragfair/IGetItemPriceResult";
|
||||
import { IGetMarketPriceRequestData } from "../models/eft/ragfair/IGetMarketPriceRequestData";
|
||||
import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult";
|
||||
import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferRequestData";
|
||||
import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData";
|
||||
import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData";
|
||||
import { IStorePlayerOfferTaxAmountRequestData } from "../models/eft/ragfair/IStorePlayerOfferTaxAmountRequestData";
|
||||
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { RagfairServer } from "../servers/RagfairServer";
|
||||
import { RagfairTaxService } from "../services/RagfairTaxService";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
/**
|
||||
* Handle ragfair related callback events
|
||||
*/
|
||||
export declare class RagfairCallbacks implements OnLoad, OnUpdate {
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected ragfairServer: RagfairServer;
|
||||
protected ragfairController: RagfairController;
|
||||
protected ragfairTaxService: RagfairTaxService;
|
||||
protected configServer: ConfigServer;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, ragfairTaxService: RagfairTaxService, configServer: ConfigServer);
|
||||
onLoad(): Promise<void>;
|
||||
getRoute(): string;
|
||||
onUpdate(timeSinceLastRun: number): Promise<boolean>;
|
||||
/**
|
||||
* Handle client/ragfair/search
|
||||
* Handle client/ragfair/find
|
||||
*/
|
||||
search(url: string, info: ISearchRequestData, sessionID: string): IGetBodyResponseData<IGetOffersResult>;
|
||||
/** Handle client/ragfair/itemMarketPrice */
|
||||
getMarketPrice(url: string, info: IGetMarketPriceRequestData, sessionID: string): IGetBodyResponseData<IGetItemPriceResult>;
|
||||
/** Handle RagFairAddOffer event */
|
||||
addOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** \Handle RagFairRemoveOffer event */
|
||||
removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle RagFairRenewOffer event */
|
||||
extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle /client/items/prices
|
||||
* Called when clicking an item to list on flea
|
||||
*/
|
||||
getFleaPrices(url: string, request: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, number>>;
|
||||
/** Handle client/reports/ragfair/send */
|
||||
sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData;
|
||||
storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData;
|
||||
}
|
27
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/RepairCallbacks.d.ts
vendored
Normal file
27
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/RepairCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
import { RepairController } from "../controllers/RepairController";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IRepairActionDataRequest } from "../models/eft/repair/IRepairActionDataRequest";
|
||||
import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepairActionDataRequest";
|
||||
export declare class RepairCallbacks {
|
||||
protected repairController: RepairController;
|
||||
constructor(repairController: RepairController);
|
||||
/**
|
||||
* Handle TraderRepair event
|
||||
* use trader to repair item
|
||||
* @param pmcData Player profile
|
||||
* @param traderRepairRequest Request object
|
||||
* @param sessionID Session id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
traderRepair(pmcData: IPmcData, traderRepairRequest: ITraderRepairActionDataRequest, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle Repair event
|
||||
* Use repair kit to repair item
|
||||
* @param pmcData Player profile
|
||||
* @param repairRequest Request object
|
||||
* @param sessionID Session id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
repair(pmcData: IPmcData, repairRequest: IRepairActionDataRequest, sessionID: string): IItemEventRouterResponse;
|
||||
}
|
14
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/SaveCallbacks.d.ts
vendored
Normal file
14
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/SaveCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
import { OnLoad } from "../di/OnLoad";
|
||||
import { OnUpdate } from "../di/OnUpdate";
|
||||
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
export declare class SaveCallbacks implements OnLoad, OnUpdate {
|
||||
protected saveServer: SaveServer;
|
||||
protected configServer: ConfigServer;
|
||||
protected coreConfig: ICoreConfig;
|
||||
constructor(saveServer: SaveServer, configServer: ConfigServer);
|
||||
onLoad(): Promise<void>;
|
||||
getRoute(): string;
|
||||
onUpdate(secondsSinceLastRun: number): Promise<boolean>;
|
||||
}
|
18
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/TradeCallbacks.d.ts
vendored
Normal file
18
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/TradeCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
import { TradeController } from "../controllers/TradeController";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData";
|
||||
import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData";
|
||||
import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData";
|
||||
export declare class TradeCallbacks {
|
||||
protected tradeController: TradeController;
|
||||
constructor(tradeController: TradeController);
|
||||
/**
|
||||
* Handle client/game/profile/items/moving TradingConfirm event
|
||||
*/
|
||||
processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle RagFairBuyOffer event */
|
||||
processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle SellAllFromSavage event */
|
||||
sellAllFromSavage(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
}
|
21
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/TraderCallbacks.d.ts
vendored
Normal file
21
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/TraderCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
import { OnLoad } from "../di/OnLoad";
|
||||
import { OnUpdate } from "../di/OnUpdate";
|
||||
import { TraderController } from "../controllers/TraderController";
|
||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
||||
import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader";
|
||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
export declare class TraderCallbacks implements OnLoad, OnUpdate {
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected traderController: TraderController;
|
||||
constructor(httpResponse: HttpResponseUtil, traderController: TraderController);
|
||||
onLoad(): Promise<void>;
|
||||
onUpdate(): Promise<boolean>;
|
||||
getRoute(): string;
|
||||
/** Handle client/trading/api/traderSettings */
|
||||
getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase[]>;
|
||||
/** Handle client/trading/api/getTrader */
|
||||
getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase>;
|
||||
/** Handle client/trading/api/getTraderAssort */
|
||||
getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderAssort>;
|
||||
}
|
15
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/WeatherCallbacks.d.ts
vendored
Normal file
15
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/WeatherCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
import { WeatherController } from "../controllers/WeatherController";
|
||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { IWeatherData } from "../models/eft/weather/IWeatherData";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
export declare class WeatherCallbacks {
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected weatherController: WeatherController;
|
||||
constructor(httpResponse: HttpResponseUtil, weatherController: WeatherController);
|
||||
/**
|
||||
* Handle client/weather
|
||||
* @returns IWeatherData
|
||||
*/
|
||||
getWeather(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IWeatherData>;
|
||||
}
|
12
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/WishlistCallbacks.d.ts
vendored
Normal file
12
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/WishlistCallbacks.d.ts
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
import { WishlistController } from "../controllers/WishlistController";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData";
|
||||
export declare class WishlistCallbacks {
|
||||
protected wishlistController: WishlistController;
|
||||
constructor(wishlistController: WishlistController);
|
||||
/** Handle AddToWishList event */
|
||||
addToWishlist(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle RemoveFromWishList event */
|
||||
removeFromWishlist(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse;
|
||||
}
|
20
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/context/ApplicationContext.d.ts
vendored
Normal file
20
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/context/ApplicationContext.d.ts
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
import { ContextVariable } from "./ContextVariable";
|
||||
import { ContextVariableType } from "./ContextVariableType";
|
||||
export declare class ApplicationContext {
|
||||
private variables;
|
||||
private static holderMaxSize;
|
||||
/**
|
||||
* Called like:
|
||||
*
|
||||
* const registerPlayerInfo = this.applicationContext.getLatestValue(ContextVariableType.REGISTER_PLAYER_REQUEST).getValue<IRegisterPlayerRequestData>();
|
||||
*
|
||||
* const activePlayerSessionId = this.applicationContext.getLatestValue(ContextVariableType.SESSION_ID).getValue<string>();
|
||||
*
|
||||
* const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.MATCH_INFO).getValue<IStartOfflineRaidRequestData>();
|
||||
* @param type
|
||||
* @returns
|
||||
*/
|
||||
getLatestValue(type: ContextVariableType): ContextVariable;
|
||||
getValues(type: ContextVariableType): ContextVariable[];
|
||||
addValue(type: ContextVariableType, value: any): void;
|
||||
}
|
10
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/context/ContextVariable.d.ts
vendored
Normal file
10
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/context/ContextVariable.d.ts
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
import { ContextVariableType } from "./ContextVariableType";
|
||||
export declare class ContextVariable {
|
||||
private value;
|
||||
private timestamp;
|
||||
private type;
|
||||
constructor(value: any, type: ContextVariableType);
|
||||
getValue<T>(): T;
|
||||
getTimestamp(): Date;
|
||||
getType(): ContextVariableType;
|
||||
}
|
10
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/context/ContextVariableType.d.ts
vendored
Normal file
10
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/context/ContextVariableType.d.ts
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
export declare enum ContextVariableType {
|
||||
/** Logged in users session id */
|
||||
SESSION_ID = 0,
|
||||
/** 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
|
||||
}
|
76
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BotController.d.ts
vendored
Normal file
76
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BotController.d.ts
vendored
Normal file
@ -0,0 +1,76 @@
|
||||
import { ApplicationContext } from "../context/ApplicationContext";
|
||||
import { BotGenerator } from "../generators/BotGenerator";
|
||||
import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper";
|
||||
import { BotHelper } from "../helpers/BotHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { IGenerateBotsRequestData } from "../models/eft/bot/IGenerateBotsRequestData";
|
||||
import { IBotBase } from "../models/eft/common/tables/IBotBase";
|
||||
import { IBotCore } from "../models/eft/common/tables/IBotCore";
|
||||
import { Difficulty } from "../models/eft/common/tables/IBotType";
|
||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
||||
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { BotGenerationCacheService } from "../services/BotGenerationCacheService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { MatchBotDetailsCacheService } from "../services/MatchBotDetailsCacheService";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
export declare class BotController {
|
||||
protected logger: ILogger;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected botGenerator: BotGenerator;
|
||||
protected botHelper: BotHelper;
|
||||
protected botDifficultyHelper: BotDifficultyHelper;
|
||||
protected botGenerationCacheService: BotGenerationCacheService;
|
||||
protected matchBotDetailsCacheService: MatchBotDetailsCacheService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected configServer: ConfigServer;
|
||||
protected applicationContext: ApplicationContext;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected botConfig: IBotConfig;
|
||||
protected pmcConfig: IPmcConfig;
|
||||
static readonly pmcTypeLabel = "PMC";
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil);
|
||||
/**
|
||||
* Return the number of bot loadout varieties to be generated
|
||||
* @param type bot Type we want the loadout gen count for
|
||||
* @returns number of bots to generate
|
||||
*/
|
||||
getBotPresetGenerationLimit(type: string): number;
|
||||
/**
|
||||
* Handle singleplayer/settings/bot/difficulty
|
||||
* Get the core.json difficulty settings from database\bots
|
||||
* @returns IBotCore
|
||||
*/
|
||||
getBotCoreDifficulty(): IBotCore;
|
||||
/**
|
||||
* Get bot difficulty settings
|
||||
* adjust PMC settings to ensure they engage the correct bot types
|
||||
* @param type what bot the server is requesting settings for
|
||||
* @param difficulty difficulty level server requested settings for
|
||||
* @returns Difficulty object
|
||||
*/
|
||||
getBotDifficulty(type: string, 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[];
|
||||
/**
|
||||
* 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;
|
||||
getAiBotBrainTypes(): any;
|
||||
}
|
70
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/CustomizationController.d.ts
vendored
Normal file
70
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/CustomizationController.d.ts
vendored
Normal file
@ -0,0 +1,70 @@
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { ISuit } from "../models/eft/common/tables/ITrader";
|
||||
import { ClothingItem, IBuyClothingRequestData } from "../models/eft/customization/IBuyClothingRequestData";
|
||||
import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
export declare class CustomizationController {
|
||||
protected logger: ILogger;
|
||||
protected eventOutputHolder: EventOutputHolder;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected saveServer: SaveServer;
|
||||
protected localisationService: LocalisationService;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected readonly clothingIds: {
|
||||
lowerParentId: string;
|
||||
upperParentId: string;
|
||||
};
|
||||
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper);
|
||||
/**
|
||||
* Get purchasable clothing items from trader that match players side (usec/bear)
|
||||
* @param traderID trader to look up clothing for
|
||||
* @param sessionID Session id
|
||||
* @returns ISuit array
|
||||
*/
|
||||
getTraderSuits(traderID: string, sessionID: string): ISuit[];
|
||||
/**
|
||||
* Handle CustomizationWear event
|
||||
* Equip one to many clothing items to player
|
||||
*/
|
||||
wearClothing(pmcData: IPmcData, wearClothingRequest: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle CustomizationBuy event
|
||||
* Purchase/unlock a clothing item from a trader
|
||||
* @param pmcData Player profile
|
||||
* @param buyClothingRequest Request object
|
||||
* @param sessionId Session id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
buyClothing(pmcData: IPmcData, buyClothingRequest: IBuyClothingRequestData, sessionId: string): IItemEventRouterResponse;
|
||||
protected getTraderClothingOffer(sessionId: string, offerId: string): ISuit;
|
||||
/**
|
||||
* Has an outfit been purchased by a player
|
||||
* @param suitId clothing id
|
||||
* @param sessionID Session id of profile to check for clothing in
|
||||
* @returns true if already purchased
|
||||
*/
|
||||
protected outfitAlreadyPurchased(suitId: string, sessionID: string): boolean;
|
||||
/**
|
||||
* Update output object and player profile with purchase details
|
||||
* @param sessionId Session id
|
||||
* @param pmcData Player profile
|
||||
* @param clothingItems Clothing purchased
|
||||
* @param output Client response
|
||||
*/
|
||||
protected payForClothingItems(sessionId: string, pmcData: IPmcData, clothingItems: ClothingItem[], output: IItemEventRouterResponse): void;
|
||||
/**
|
||||
* Update output object and player profile with purchase details for single piece of clothing
|
||||
* @param sessionId Session id
|
||||
* @param pmcData Player profile
|
||||
* @param clothingItem Clothing item purchased
|
||||
* @param output Client response
|
||||
*/
|
||||
protected payForClothingItem(sessionId: string, pmcData: IPmcData, clothingItem: ClothingItem, output: IItemEventRouterResponse): void;
|
||||
protected getAllTraderSuits(sessionID: string): ISuit[];
|
||||
}
|
162
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/DialogueController.d.ts
vendored
Normal file
162
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/DialogueController.d.ts
vendored
Normal file
@ -0,0 +1,162 @@
|
||||
import { DialogueHelper } from "../helpers/DialogueHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { IGetAllAttachmentsResponse } from "../models/eft/dialog/IGetAllAttachmentsResponse";
|
||||
import { IGetFriendListDataResponse } from "../models/eft/dialog/IGetFriendListDataResponse";
|
||||
import { IGetMailDialogViewRequestData } from "../models/eft/dialog/IGetMailDialogViewRequestData";
|
||||
import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDialogViewResponseData";
|
||||
import { ISendMessageRequest } from "../models/eft/dialog/ISendMessageRequest";
|
||||
import { Dialogue, DialogueInfo, IAkiProfile, IUserDialogInfo, Message } from "../models/eft/profile/IAkiProfile";
|
||||
import { MessageType } from "../models/enums/MessageType";
|
||||
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { GiftService } from "../services/GiftService";
|
||||
import { MailSendService } from "../services/MailSendService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class DialogueController {
|
||||
protected logger: ILogger;
|
||||
protected saveServer: SaveServer;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected mailSendService: MailSendService;
|
||||
protected giftService: GiftService;
|
||||
protected hashUtil: HashUtil;
|
||||
protected configServer: ConfigServer;
|
||||
protected coreConfig: ICoreConfig;
|
||||
constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, hashUtil: HashUtil, configServer: ConfigServer);
|
||||
/** Handle onUpdate spt event */
|
||||
update(): void;
|
||||
/**
|
||||
* Handle client/friend/list
|
||||
* @returns IGetFriendListDataResponse
|
||||
*/
|
||||
getFriendList(sessionID: string): IGetFriendListDataResponse;
|
||||
/**
|
||||
* Handle client/mail/dialog/list
|
||||
* Create array holding trader dialogs and mail interactions with player
|
||||
* Set the content of the dialogue on the list tab.
|
||||
* @param sessionID Session Id
|
||||
* @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;
|
||||
/**
|
||||
* Get the users involved in a dialog (player + other party)
|
||||
* @param dialog The dialog to check for users
|
||||
* @param messageType What type of message is being sent
|
||||
* @param sessionID Player id
|
||||
* @returns IUserDialogInfo array
|
||||
*/
|
||||
getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[];
|
||||
/**
|
||||
* Handle client/mail/dialog/view
|
||||
* Handle player clicking 'messenger' and seeing all the messages they've recieved
|
||||
* Set the content of the dialogue on the details panel, showing all the messages
|
||||
* for the specified dialogue.
|
||||
* @param request Get dialog request
|
||||
* @param sessionId Session id
|
||||
* @returns IGetMailDialogViewResponseData object
|
||||
*/
|
||||
generateDialogueView(request: IGetMailDialogViewRequestData, sessionId: string): IGetMailDialogViewResponseData;
|
||||
/**
|
||||
* Get dialog from player profile, create if doesn't exist
|
||||
* @param profile Player profile
|
||||
* @param request get dialog request (params used when dialog doesnt exist in profile)
|
||||
* @returns Dialogue
|
||||
*/
|
||||
protected getDialogByIdFromProfile(profile: IAkiProfile, request: IGetMailDialogViewRequestData): Dialogue;
|
||||
/**
|
||||
* Get the users involved in a mail between two entities
|
||||
* @param fullProfile Player profile
|
||||
* @param dialogUsers The participants of the mail
|
||||
* @returns IUserDialogInfo array
|
||||
*/
|
||||
protected getProfilesForMail(fullProfile: IAkiProfile, dialogUsers: IUserDialogInfo[]): IUserDialogInfo[];
|
||||
/**
|
||||
* Get a count of messages with attachments from a particular dialog
|
||||
* @param sessionID Session id
|
||||
* @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;
|
||||
/**
|
||||
* Handle client/mail/dialog/remove
|
||||
* Remove an entire dialog with an entity (trader/user)
|
||||
* @param dialogueId id of the dialog to remove
|
||||
* @param sessionId Player id
|
||||
*/
|
||||
removeDialogue(dialogueId: string, sessionId: string): void;
|
||||
/** Handle client/mail/dialog/pin && Handle client/mail/dialog/unpin */
|
||||
setDialoguePin(dialogueId: string, shouldPin: boolean, sessionId: string): void;
|
||||
/**
|
||||
* Handle client/mail/dialog/read
|
||||
* Set a dialog to be read (no number alert/attachment alert)
|
||||
* @param dialogueIds Dialog ids to set as read
|
||||
* @param sessionId Player profile id
|
||||
*/
|
||||
setRead(dialogueIds: string[], sessionId: string): void;
|
||||
/**
|
||||
* Handle client/mail/dialog/getAllAttachments
|
||||
* Get all uncollected items attached to mail in a particular dialog
|
||||
* @param dialogueId Dialog to get mail attachments from
|
||||
* @param sessionId Session id
|
||||
* @returns
|
||||
*/
|
||||
getAllAttachments(dialogueId: string, sessionId: string): IGetAllAttachmentsResponse;
|
||||
/** client/mail/msg/send */
|
||||
sendMessage(sessionId: string, request: ISendMessageRequest): string;
|
||||
/**
|
||||
* Send responses back to player when they communicate with SPT friend on friends list
|
||||
* @param sessionId Session Id
|
||||
* @param request send message request
|
||||
*/
|
||||
protected handleChatWithSPTFriend(sessionId: string, request: ISendMessageRequest): void;
|
||||
protected getSptFriendData(friendId?: string): IUserDialogInfo;
|
||||
/**
|
||||
* Get messages from a specific dialog that have items not expired
|
||||
* @param sessionId Session id
|
||||
* @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 from all messages in player profile. triggers when updating traders.
|
||||
* @param sessionId Session id
|
||||
*/
|
||||
protected removeExpiredItemsFromMessages(sessionId: string): void;
|
||||
/**
|
||||
* Removes expired items from a message in player profile
|
||||
* @param sessionId Session id
|
||||
* @param dialogueId Dialog id
|
||||
*/
|
||||
protected removeExpiredItemsFromMessage(sessionId: string, dialogueId: string): void;
|
||||
/**
|
||||
* Has a dialog message expired
|
||||
* @param message Message to check expiry of
|
||||
* @returns true or false
|
||||
*/
|
||||
protected messageHasExpired(message: Message): boolean;
|
||||
}
|
161
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/GameController.d.ts
vendored
Normal file
161
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/GameController.d.ts
vendored
Normal file
@ -0,0 +1,161 @@
|
||||
import { ApplicationContext } from "../context/ApplicationContext";
|
||||
import { HideoutHelper } from "../helpers/HideoutHelper";
|
||||
import { HttpServerHelper } from "../helpers/HttpServerHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { PreAkiModLoader } from "../loaders/PreAkiModLoader";
|
||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse";
|
||||
import { ICurrentGroupResponse } from "../models/eft/game/ICurrentGroupResponse";
|
||||
import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
|
||||
import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse";
|
||||
import { IServerDetails } from "../models/eft/game/IServerDetails";
|
||||
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
|
||||
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
|
||||
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
|
||||
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
|
||||
import { ILootConfig } from "../models/spt/config/ILootConfig";
|
||||
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
|
||||
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { CustomLocationWaveService } from "../services/CustomLocationWaveService";
|
||||
import { GiftService } from "../services/GiftService";
|
||||
import { ItemBaseClassService } from "../services/ItemBaseClassService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { OpenZoneService } from "../services/OpenZoneService";
|
||||
import { ProfileFixerService } from "../services/ProfileFixerService";
|
||||
import { SeasonalEventService } from "../services/SeasonalEventService";
|
||||
import { EncodingUtil } from "../utils/EncodingUtil";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class GameController {
|
||||
protected logger: ILogger;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected hashUtil: HashUtil;
|
||||
protected preAkiModLoader: PreAkiModLoader;
|
||||
protected httpServerHelper: HttpServerHelper;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected encodingUtil: EncodingUtil;
|
||||
protected hideoutHelper: HideoutHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected profileFixerService: ProfileFixerService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected customLocationWaveService: CustomLocationWaveService;
|
||||
protected openZoneService: OpenZoneService;
|
||||
protected seasonalEventService: SeasonalEventService;
|
||||
protected itemBaseClassService: ItemBaseClassService;
|
||||
protected giftService: GiftService;
|
||||
protected applicationContext: ApplicationContext;
|
||||
protected configServer: ConfigServer;
|
||||
protected os: any;
|
||||
protected httpConfig: IHttpConfig;
|
||||
protected coreConfig: ICoreConfig;
|
||||
protected locationConfig: ILocationConfig;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
protected pmcConfig: IPmcConfig;
|
||||
protected lootConfig: ILootConfig;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer);
|
||||
load(): void;
|
||||
/**
|
||||
* Handle client/game/start
|
||||
*/
|
||||
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
|
||||
protected addCustomLooseLootPositions(): void;
|
||||
protected adjustLooseLootSpawnProbabilities(): void;
|
||||
protected setHideoutAreasAndCraftsTo40Secs(): void;
|
||||
/**
|
||||
* 3.7.0 moved AIDs to be numeric, old profiles need to be migrated
|
||||
* We store the old AID value in new field `sessionId`
|
||||
* @param fullProfile Profile to update
|
||||
*/
|
||||
protected fixIncorrectAidValue(fullProfile: IAkiProfile): void;
|
||||
/** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */
|
||||
protected adjustMapBotLimits(): void;
|
||||
/**
|
||||
* Handle client/game/config
|
||||
*/
|
||||
getGameConfig(sessionID: string): IGameConfigResponse;
|
||||
/**
|
||||
* Handle client/server/list
|
||||
*/
|
||||
getServer(sessionId: string): IServerDetails[];
|
||||
/**
|
||||
* Handle client/match/group/current
|
||||
*/
|
||||
getCurrentGroup(sessionId: string): ICurrentGroupResponse;
|
||||
/**
|
||||
* Handle client/checkVersion
|
||||
*/
|
||||
getValidGameVersion(sessionId: string): ICheckVersionResponse;
|
||||
/**
|
||||
* Handle client/game/keepalive
|
||||
*/
|
||||
getKeepAlive(sessionId: string): IGameKeepAliveResponse;
|
||||
/**
|
||||
* BSG have two values for shotgun dispersion, we make sure both have the same value
|
||||
*/
|
||||
protected fixShotgunDispersions(): void;
|
||||
/**
|
||||
* Players set botReload to a high value and don't expect the crazy fast reload speeds, give them a warn about it
|
||||
* @param pmcProfile Player profile
|
||||
*/
|
||||
protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void;
|
||||
protected flagAllItemsInDbAsSellableOnFlea(): void;
|
||||
/**
|
||||
* When player logs in, iterate over all active effects and reduce timer
|
||||
* TODO - add body part HP regen
|
||||
* @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;
|
||||
/**
|
||||
* Send starting gifts to profile after x days
|
||||
* @param pmcProfile Profile to add gifts to
|
||||
*/
|
||||
protected sendPraporGiftsToNewProfiles(pmcProfile: IPmcData): void;
|
||||
/**
|
||||
* Find and split waves with large numbers of bots into smaller waves - BSG appears to reduce the size of these waves to one bot when they're waiting to spawn for too long
|
||||
*/
|
||||
protected splitBotWavesIntoSingleWaves(): void;
|
||||
/**
|
||||
* Get a list of installed mods and save their details to the profile being used
|
||||
* @param fullProfile Profile to add mod details to
|
||||
*/
|
||||
protected saveActiveModsToProfile(fullProfile: IAkiProfile): void;
|
||||
/**
|
||||
* Check for any missing assorts inside each traders assort.json data, checking against traders qeustassort.json
|
||||
*/
|
||||
protected validateQuestAssortUnlocksExist(): void;
|
||||
/**
|
||||
* Add the logged in players name to PMC name pool
|
||||
* @param pmcProfile Profile of player to get name from
|
||||
*/
|
||||
protected addPlayerToPMCNames(pmcProfile: IPmcData): void;
|
||||
/**
|
||||
* Check for a dialog with the key 'undefined', and remove it
|
||||
* @param fullProfile Profile to check for dialog in
|
||||
*/
|
||||
protected checkForAndRemoveUndefinedDialogs(fullProfile: IAkiProfile): void;
|
||||
/**
|
||||
* Blank out the "test" mail message from prapor
|
||||
*/
|
||||
protected removePraporTestMessage(): void;
|
||||
/**
|
||||
* Make non-trigger-spawned raiders spawn earlier + always
|
||||
*/
|
||||
protected adjustLabsRaiderSpawnRate(): void;
|
||||
protected logProfileDetails(fullProfile: IAkiProfile): void;
|
||||
}
|
8
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/HandbookController.d.ts
vendored
Normal file
8
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/HandbookController.d.ts
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
import { HandbookHelper } from "../helpers/HandbookHelper";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
export declare class HandbookController {
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected handbookHelper: HandbookHelper;
|
||||
constructor(databaseServer: DatabaseServer, handbookHelper: HandbookHelper);
|
||||
load(): void;
|
||||
}
|
70
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/HealthController.d.ts
vendored
Normal file
70
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/HealthController.d.ts
vendored
Normal file
@ -0,0 +1,70 @@
|
||||
import { HealthHelper } from "../helpers/HealthHelper";
|
||||
import { InventoryHelper } from "../helpers/InventoryHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IHealthTreatmentRequestData } from "../models/eft/health/IHealthTreatmentRequestData";
|
||||
import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestData";
|
||||
import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData";
|
||||
import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData";
|
||||
import { IWorkoutData } from "../models/eft/health/IWorkoutData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { PaymentService } from "../services/PaymentService";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
export declare class HealthController {
|
||||
protected logger: ILogger;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected eventOutputHolder: EventOutputHolder;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected paymentService: PaymentService;
|
||||
protected inventoryHelper: InventoryHelper;
|
||||
protected localisationService: LocalisationService;
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected healthHelper: HealthHelper;
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, localisationService: LocalisationService, httpResponse: HttpResponseUtil, healthHelper: HealthHelper);
|
||||
/**
|
||||
* stores in-raid player health
|
||||
* @param pmcData Player profile
|
||||
* @param info Request data
|
||||
* @param sessionID Player id
|
||||
* @param addEffects Should effects found be added or removed from profile
|
||||
* @param deleteExistingEffects Should all prior effects be removed before apply new ones
|
||||
*/
|
||||
saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void;
|
||||
/**
|
||||
* When healing in menu
|
||||
* @param pmcData Player profile
|
||||
* @param request Healing request
|
||||
* @param sessionID Player id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
offraidHeal(pmcData: IPmcData, request: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle Eat event
|
||||
* Consume food/water outside of a raid
|
||||
* @param pmcData Player profile
|
||||
* @param request Eat request
|
||||
* @param sessionID Session id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
offraidEat(pmcData: IPmcData, request: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle RestoreHealth event
|
||||
* Occurs on post-raid healing page
|
||||
* @param pmcData player profile
|
||||
* @param healthTreatmentRequest Request data from client
|
||||
* @param sessionID Session id
|
||||
* @returns 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;
|
||||
}
|
260
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/HideoutController.d.ts
vendored
Normal file
260
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/HideoutController.d.ts
vendored
Normal file
@ -0,0 +1,260 @@
|
||||
import { ScavCaseRewardGenerator } from "../generators/ScavCaseRewardGenerator";
|
||||
import { HideoutHelper } from "../helpers/HideoutHelper";
|
||||
import { InventoryHelper } from "../helpers/InventoryHelper";
|
||||
import { PaymentHelper } from "../helpers/PaymentHelper";
|
||||
import { PresetHelper } from "../helpers/PresetHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase";
|
||||
import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData";
|
||||
import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData";
|
||||
import { IHideoutArea, Stage } from "../models/eft/hideout/IHideoutArea";
|
||||
import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData";
|
||||
import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData";
|
||||
import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction";
|
||||
import { IHideoutPutItemInRequestData } from "../models/eft/hideout/IHideoutPutItemInRequestData";
|
||||
import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData";
|
||||
import { IHideoutSingleProductionStartRequestData } from "../models/eft/hideout/IHideoutSingleProductionStartRequestData";
|
||||
import { IHideoutTakeItemOutRequestData } from "../models/eft/hideout/IHideoutTakeItemOutRequestData";
|
||||
import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideoutTakeProductionRequestData";
|
||||
import { IHideoutToggleAreaRequestData } from "../models/eft/hideout/IHideoutToggleAreaRequestData";
|
||||
import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgradeRequestData";
|
||||
import { IQteData } from "../models/eft/hideout/IQteData";
|
||||
import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { HideoutAreas } from "../models/enums/HideoutAreas";
|
||||
import { IHideoutConfig } from "../models/spt/config/IHideoutConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { FenceService } from "../services/FenceService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { PlayerService } from "../services/PlayerService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class HideoutController {
|
||||
protected logger: ILogger;
|
||||
protected hashUtil: HashUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected inventoryHelper: InventoryHelper;
|
||||
protected saveServer: SaveServer;
|
||||
protected playerService: PlayerService;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected paymentHelper: PaymentHelper;
|
||||
protected eventOutputHolder: EventOutputHolder;
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected hideoutHelper: HideoutHelper;
|
||||
protected scavCaseRewardGenerator: ScavCaseRewardGenerator;
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected fenceService: FenceService;
|
||||
protected static nameBackendCountersCrafting: string;
|
||||
protected hideoutConfig: IHideoutConfig;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService);
|
||||
/**
|
||||
* Handle HideoutUpgrade event
|
||||
* 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;
|
||||
/**
|
||||
* Handle HideoutUpgradeComplete event
|
||||
* 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;
|
||||
/**
|
||||
* Upgrade wall status to visible in profile if medstation/water collector are both level 1
|
||||
* @param pmcData Player profile
|
||||
*/
|
||||
protected checkAndUpgradeWall(pmcData: IPmcData): void;
|
||||
/**
|
||||
*
|
||||
* @param pmcData Profile to edit
|
||||
* @param output Object to send back to client
|
||||
* @param sessionID Session/player id
|
||||
* @param profileParentHideoutArea Current hideout area for profile
|
||||
* @param dbHideoutArea Hideout area being upgraded
|
||||
* @param hideoutStage Stage hideout area is being upgraded to
|
||||
*/
|
||||
protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileParentHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void;
|
||||
/**
|
||||
* Add an inventory item to profile from a hideout area stage data
|
||||
* @param pmcData Profile to update
|
||||
* @param dbHideoutData Hideout area from db being upgraded
|
||||
* @param hideoutStage Stage area upgraded to
|
||||
*/
|
||||
protected addUpdateInventoryItemToProfile(pmcData: IPmcData, dbHideoutData: IHideoutArea, hideoutStage: Stage): void;
|
||||
/**
|
||||
*
|
||||
* @param output Objet to send to client
|
||||
* @param sessionID Session/player id
|
||||
* @param areaType Hideout area that had stash added
|
||||
* @param hideoutDbData Hideout area that caused addition of stash
|
||||
* @param hideoutStage Hideout area upgraded to this
|
||||
*/
|
||||
protected addContainerUpgradeToClientOutput(output: IItemEventRouterResponse, sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage): void;
|
||||
/**
|
||||
* Handle HideoutPutItemsInAreaSlots
|
||||
* Create item in hideout slot item array, remove item from player inventory
|
||||
* @param pmcData Profile data
|
||||
* @param addItemToHideoutRequest reqeust from client to place item in area slot
|
||||
* @param sessionID Session id
|
||||
* @returns IItemEventRouterResponse object
|
||||
*/
|
||||
putItemsInAreaSlots(pmcData: IPmcData, addItemToHideoutRequest: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle HideoutTakeItemsFromAreaSlots event
|
||||
* Remove item from hideout area and place into player inventory
|
||||
* @param pmcData Player profile
|
||||
* @param request Take item out of area request
|
||||
* @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
|
||||
* @param sessionID Session id
|
||||
* @param pmcData Profile to update
|
||||
* @param removeResourceRequest client request
|
||||
* @param output response to send to client
|
||||
* @param hideoutArea Area fuel is being removed from
|
||||
* @returns IItemEventRouterResponse response
|
||||
*/
|
||||
protected removeResourceFromArea(sessionID: string, pmcData: IPmcData, removeResourceRequest: IHideoutTakeItemOutRequestData, output: IItemEventRouterResponse, hideoutArea: HideoutArea): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle HideoutToggleArea event
|
||||
* Toggle area on/off
|
||||
* @param pmcData Player profile
|
||||
* @param request Toggle area request
|
||||
* @param sessionID Session id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
toggleArea(pmcData: IPmcData, request: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle HideoutSingleProductionStart event
|
||||
* Start production for an item from hideout area
|
||||
* @param pmcData Player profile
|
||||
* @param body Start prodution of single item request
|
||||
* @param sessionID Session id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle HideoutScavCaseProductionStart event
|
||||
* Handles event after clicking 'start' on the scav case hideout page
|
||||
* @param pmcData player profile
|
||||
* @param body client request object
|
||||
* @param sessionID session id
|
||||
* @returns item event router response
|
||||
*/
|
||||
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
|
||||
* @param pmcData player profile to add rewards to
|
||||
* @param rewards reward items to add to profile
|
||||
* @param recipeId recipe id to save into Production dict
|
||||
*/
|
||||
protected addScavCaseRewardsToProfile(pmcData: IPmcData, rewards: Product[], recipeId: string): void;
|
||||
/**
|
||||
* Start production of continuously created item
|
||||
* @param pmcData Player profile
|
||||
* @param request Continious production request
|
||||
* @param sessionID Session id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
continuousProductionStart(pmcData: IPmcData, request: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle HideoutTakeProduction event
|
||||
* Take completed item out of hideout area and place into player inventory
|
||||
* @param pmcData Player profile
|
||||
* @param request Remove production from area request
|
||||
* @param sessionID Session id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
takeProduction(pmcData: IPmcData, request: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Take recipe-type production out of hideout area and place into player inventory
|
||||
* @param sessionID Session id
|
||||
* @param recipe Completed recipe of item
|
||||
* @param pmcData Player profile
|
||||
* @param request Remove production from area request
|
||||
* @param output Output object to update
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
protected handleRecipe(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handles generating case rewards and sending to player inventory
|
||||
* @param sessionID Session id
|
||||
* @param pmcData Player profile
|
||||
* @param request Get rewards from scavcase craft request
|
||||
* @param output Output object to update
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
protected handleScavCase(sessionID: string, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
/**
|
||||
* Start area production for item by adding production to profiles' Hideout.Production array
|
||||
* @param pmcData Player profile
|
||||
* @param request Start production request
|
||||
* @param sessionID Session id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
registerProduction(pmcData: IPmcData, request: IHideoutSingleProductionStartRequestData | IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
update(): void;
|
||||
}
|
136
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InraidController.d.ts
vendored
Normal file
136
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InraidController.d.ts
vendored
Normal file
@ -0,0 +1,136 @@
|
||||
import { ApplicationContext } from "../context/ApplicationContext";
|
||||
import { PlayerScavGenerator } from "../generators/PlayerScavGenerator";
|
||||
import { HealthHelper } from "../helpers/HealthHelper";
|
||||
import { InRaidHelper } from "../helpers/InRaidHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { QuestHelper } from "../helpers/QuestHelper";
|
||||
import { TraderHelper } from "../helpers/TraderHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData";
|
||||
import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData";
|
||||
import { PlayerRaidEndState } from "../models/enums/PlayerRaidEndState";
|
||||
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
|
||||
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { InsuranceService } from "../services/InsuranceService";
|
||||
import { MatchBotDetailsCacheService } from "../services/MatchBotDetailsCacheService";
|
||||
import { PmcChatResponseService } from "../services/PmcChatResponseService";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
/**
|
||||
* Logic for handling In Raid callbacks
|
||||
*/
|
||||
export declare class InraidController {
|
||||
protected logger: ILogger;
|
||||
protected saveServer: SaveServer;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected pmcChatResponseService: PmcChatResponseService;
|
||||
protected matchBotDetailsCacheService: MatchBotDetailsCacheService;
|
||||
protected questHelper: QuestHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected playerScavGenerator: PlayerScavGenerator;
|
||||
protected healthHelper: HealthHelper;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected insuranceService: InsuranceService;
|
||||
protected inRaidHelper: InRaidHelper;
|
||||
protected applicationContext: ApplicationContext;
|
||||
protected configServer: ConfigServer;
|
||||
protected airdropConfig: IAirdropConfig;
|
||||
protected inraidConfig: IInRaidConfig;
|
||||
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer);
|
||||
/**
|
||||
* 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;
|
||||
/**
|
||||
* Handle raid/profile/save
|
||||
* 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 offraidData post-raid data
|
||||
*/
|
||||
protected savePmcProgress(sessionID: string, offraidData: ISaveProgressRequestData): void;
|
||||
/**
|
||||
* Make changes to pmc profile after they've died in raid,
|
||||
* Alter bodypart hp, handle insurance, delete inventory items, remove carried quest items
|
||||
* @param postRaidSaveRequest Post-raid save request
|
||||
* @param pmcData Pmc profile
|
||||
* @param insuranceEnabled Is insurance enabled
|
||||
* @param preRaidGear Gear player had before raid
|
||||
* @param sessionID Session id
|
||||
* @returns Updated profile object
|
||||
*/
|
||||
protected performPostRaidActionsWhenDead(postRaidSaveRequest: ISaveProgressRequestData, pmcData: IPmcData, insuranceEnabled: boolean, preRaidGear: Item[], sessionID: string): IPmcData;
|
||||
/**
|
||||
* Adjust player characters bodypart hp post-raid
|
||||
* @param postRaidSaveRequest post raid data
|
||||
* @param pmcData player profile
|
||||
*/
|
||||
protected updatePmcHealthPostRaid(postRaidSaveRequest: ISaveProgressRequestData, pmcData: IPmcData): void;
|
||||
/**
|
||||
* Reduce body part hp to % of max
|
||||
* @param pmcData profile to edit
|
||||
* @param multipler multipler to apply to max health
|
||||
*/
|
||||
protected reducePmcHealthToPercent(pmcData: IPmcData, multipler: number): void;
|
||||
/**
|
||||
* Handle updating the profile post-pscav raid
|
||||
* @param sessionID session id
|
||||
* @param offraidData post-raid data of raid
|
||||
*/
|
||||
protected savePlayerScavProgress(sessionID: string, offraidData: ISaveProgressRequestData): void;
|
||||
/**
|
||||
* Is the player dead after a raid - dead is anything other than "survived" / "runner"
|
||||
* @param statusOnExit exit value from offraidData object
|
||||
* @returns true if dead
|
||||
*/
|
||||
protected isPlayerDead(statusOnExit: PlayerRaidEndState): boolean;
|
||||
/**
|
||||
* Mark inventory items as FiR if player survived raid, otherwise remove FiR from them
|
||||
* @param offraidData Save Progress Request
|
||||
*/
|
||||
protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData): void;
|
||||
/**
|
||||
* Update profile after player completes scav raid
|
||||
* @param scavData Scav profile
|
||||
* @param sessionID Session id
|
||||
* @param offraidData Post-raid save request
|
||||
* @param pmcData Pmc profile
|
||||
* @param isDead Is player dead
|
||||
*/
|
||||
protected handlePostRaidPlayerScavProcess(scavData: IPmcData, sessionID: string, offraidData: ISaveProgressRequestData, pmcData: IPmcData, isDead: boolean): void;
|
||||
/**
|
||||
* Update profile with scav karma values based on in-raid actions
|
||||
* @param pmcData Pmc profile
|
||||
* @param offraidData Post-raid save request
|
||||
* @param scavData Scav profile
|
||||
* @param sessionID Session id
|
||||
*/
|
||||
protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData, sessionID: string): void;
|
||||
/**
|
||||
* Get the inraid config from configs/inraid.json
|
||||
* @returns InRaid Config
|
||||
*/
|
||||
getInraidConfig(): IInRaidConfig;
|
||||
/**
|
||||
* Get airdrop config from configs/airdrop.json
|
||||
* @returns Airdrop config
|
||||
*/
|
||||
getAirdropConfig(): IAirdropConfig;
|
||||
}
|
177
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InsuranceController.d.ts
vendored
Normal file
177
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InsuranceController.d.ts
vendored
Normal file
@ -0,0 +1,177 @@
|
||||
import { DialogueHelper } from "../helpers/DialogueHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { TraderHelper } from "../helpers/TraderHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { IGetInsuranceCostRequestData } from "../models/eft/insurance/IGetInsuranceCostRequestData";
|
||||
import { IGetInsuranceCostResponseData } from "../models/eft/insurance/IGetInsuranceCostResponseData";
|
||||
import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { Insurance } from "../models/eft/profile/IAkiProfile";
|
||||
import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { InsuranceService } from "../services/InsuranceService";
|
||||
import { MailSendService } from "../services/MailSendService";
|
||||
import { PaymentService } from "../services/PaymentService";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class InsuranceController {
|
||||
protected logger: ILogger;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected eventOutputHolder: EventOutputHolder;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected saveServer: SaveServer;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected paymentService: PaymentService;
|
||||
protected insuranceService: InsuranceService;
|
||||
protected mailSendService: MailSendService;
|
||||
protected configServer: ConfigServer;
|
||||
protected insuranceConfig: IInsuranceConfig;
|
||||
constructor(logger: ILogger, randomUtil: RandomUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer);
|
||||
/**
|
||||
* Process insurance items of all profiles prior to being given back to the player through the mail service.
|
||||
*
|
||||
* @returns void
|
||||
*/
|
||||
processReturn(): void;
|
||||
/**
|
||||
* Process insurance items of a single profile prior to being given back to the player through the mail service.
|
||||
*
|
||||
* @returns void
|
||||
*/
|
||||
processReturnByProfile(sessionID: string): void;
|
||||
/**
|
||||
* Get all insured items that are ready to be processed in a specific profile.
|
||||
*
|
||||
* @param sessionID Session ID of the profile to check.
|
||||
* @param time The time to check ready status against. Current time by default.
|
||||
* @returns All insured items that are ready to be processed.
|
||||
*/
|
||||
protected filterInsuredItems(sessionID: string, time?: number): Insurance[];
|
||||
/**
|
||||
* This method orchestrates the processing of insured items in a profile.
|
||||
*
|
||||
* @param insuranceDetails The insured items to process.
|
||||
* @param sessionID The session ID that should receive the processed items.
|
||||
* @returns void
|
||||
*/
|
||||
protected processInsuredItems(insuranceDetails: Insurance[], sessionID: string): void;
|
||||
/**
|
||||
* Build an array of items to delete from the insured items.
|
||||
*
|
||||
* This method orchestrates several steps:
|
||||
* - Filters items based on their presence in the database and their raid moddability.
|
||||
* - Sorts base and independent child items to consider for deletion.
|
||||
* - Groups child items by their parent for later evaluation.
|
||||
* - Evaluates grouped child items to decide which should be deleted, based on their value and a random roll.
|
||||
*
|
||||
* @param insured - The insured items to build a removal array from.
|
||||
* @returns An array of IDs representing items that should be deleted.
|
||||
*/
|
||||
protected findItemsToDelete(insured: Insurance): string[];
|
||||
/**
|
||||
* Filters an item based on its existence in the database, raid moddability, and slot requirements.
|
||||
*
|
||||
* @param item The item to be filtered.
|
||||
* @param parentItemDbDetails The database details of the parent item, or null if the item has no parent.
|
||||
* @param itemDbDetails A tuple where the first element is a boolean indicating if the item exists in the database,
|
||||
* and the second element is the item details if it does.
|
||||
* @returns true if the item exists in the database and neither of the following conditions are met:
|
||||
* - The item has the RaidModdable property set to false.
|
||||
* - The item is attached to a required slot in its parent item.
|
||||
* Otherwise, returns false.
|
||||
*/
|
||||
protected filterByRaidModdability(item: Item, parentItemDbDetails: ITemplateItem | null, itemDbDetails: [boolean, ITemplateItem]): boolean;
|
||||
/**
|
||||
* Determines if an item is either a base item or a child item that is not equipped to its parent.
|
||||
*
|
||||
* @param item The item to check.
|
||||
* @returns true if the item is a base or an independent child item, otherwise false.
|
||||
*/
|
||||
protected isBaseOrIndependentChild(item: Item): boolean;
|
||||
/**
|
||||
* Makes a roll to determine if a given item should be deleted. If the roll is successful, the item's ID is added
|
||||
* to the `toDelete` array.
|
||||
*
|
||||
* @param item The item for which the roll is made.
|
||||
* @param traderId The ID of the trader to consider in the rollForItemDelete method.
|
||||
* @param toDelete The array accumulating the IDs of items to be deleted.
|
||||
* @returns true if the item is marked for deletion, otherwise false.
|
||||
*/
|
||||
protected makeRollAndMarkForDeletion(item: Item, traderId: string, toDelete: string[]): boolean;
|
||||
/**
|
||||
* Groups child items by their parent IDs in a Map data structure.
|
||||
*
|
||||
* @param item The child item to be grouped by its parent.
|
||||
* @param childrenGroupedByParent The Map that holds arrays of children items grouped by their parent IDs.
|
||||
* @returns void
|
||||
*/
|
||||
protected groupChildrenByParent(item: Item, childrenGroupedByParent: Map<string, Item[]>): void;
|
||||
/**
|
||||
* Sorts the array of children items in descending order by their maximum price. For each child, a roll is made to
|
||||
* determine if it should be deleted. The method then deletes the most valuable children based on the number of
|
||||
* successful rolls made.
|
||||
*
|
||||
* @param children The array of children items to sort and filter.
|
||||
* @param traderId The ID of the trader to consider in the rollForItemDelete method.
|
||||
* @param toDelete The array that accumulates the IDs of the items to be deleted.
|
||||
* @returns void
|
||||
*/
|
||||
protected sortAndFilterChildren(children: Item[], traderId: string, toDelete: string[]): void;
|
||||
/**
|
||||
* Remove items from the insured items that should not be returned to the player.
|
||||
*
|
||||
* @param insured The insured items to process.
|
||||
* @param toDelete The items that should be deleted.
|
||||
* @returns void
|
||||
*/
|
||||
protected removeItemsFromInsurance(insured: Insurance, toDelete: string[]): void;
|
||||
/**
|
||||
* Handle sending the insurance message to the user that potentially contains the valid insurance items.
|
||||
*
|
||||
* @param sessionID The session ID that should receive the insurance message.
|
||||
* @param insurance The context of insurance to use.
|
||||
* @param noItems Whether or not there are any items to return to the player.
|
||||
* @returns void
|
||||
*/
|
||||
protected sendMail(sessionID: string, insurance: Insurance, noItems: boolean): void;
|
||||
/**
|
||||
* Determines whether a valid insured item should be removed from the player's inventory based on a random roll and
|
||||
* trader-specific return chance.
|
||||
*
|
||||
* @param insuredItem The insured item being evaluated for removal.
|
||||
* @param traderId The ID of the trader who insured the item.
|
||||
* @param itemsBeingDeleted List of items that are already slated for removal.
|
||||
* @returns true if the insured item should be removed from inventory, false otherwise.
|
||||
*/
|
||||
protected rollForItemDelete(insuredItem: Item, traderId: string, itemsBeingDeleted: string[]): boolean;
|
||||
/**
|
||||
* Handle Insure event
|
||||
* Add insurance to an item
|
||||
*
|
||||
* @param pmcData Player profile
|
||||
* @param body Insurance request
|
||||
* @param sessionID Session id
|
||||
* @returns IItemEventRouterResponse object to send to client
|
||||
*/
|
||||
insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle client/insurance/items/list/cost
|
||||
* Calculate insurance cost
|
||||
*
|
||||
* @param request request object
|
||||
* @param sessionID session id
|
||||
* @returns IGetInsuranceCostResponseData object to send to client
|
||||
*/
|
||||
cost(request: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData;
|
||||
}
|
210
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InventoryController.d.ts
vendored
Normal file
210
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InventoryController.d.ts
vendored
Normal file
@ -0,0 +1,210 @@
|
||||
import { LootGenerator } from "../generators/LootGenerator";
|
||||
import { InventoryHelper } from "../helpers/InventoryHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { PaymentHelper } from "../helpers/PaymentHelper";
|
||||
import { PresetHelper } from "../helpers/PresetHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { QuestHelper } from "../helpers/QuestHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IInventoryBindRequestData } from "../models/eft/inventory/IInventoryBindRequestData";
|
||||
import { IInventoryCreateMarkerRequestData } from "../models/eft/inventory/IInventoryCreateMarkerRequestData";
|
||||
import { IInventoryDeleteMarkerRequestData } from "../models/eft/inventory/IInventoryDeleteMarkerRequestData";
|
||||
import { IInventoryEditMarkerRequestData } from "../models/eft/inventory/IInventoryEditMarkerRequestData";
|
||||
import { IInventoryExamineRequestData } from "../models/eft/inventory/IInventoryExamineRequestData";
|
||||
import { IInventoryFoldRequestData } from "../models/eft/inventory/IInventoryFoldRequestData";
|
||||
import { IInventoryMergeRequestData } from "../models/eft/inventory/IInventoryMergeRequestData";
|
||||
import { IInventoryMoveRequestData } from "../models/eft/inventory/IInventoryMoveRequestData";
|
||||
import { IInventoryReadEncyclopediaRequestData } from "../models/eft/inventory/IInventoryReadEncyclopediaRequestData";
|
||||
import { IInventoryRemoveRequestData } from "../models/eft/inventory/IInventoryRemoveRequestData";
|
||||
import { IInventorySortRequestData } from "../models/eft/inventory/IInventorySortRequestData";
|
||||
import { IInventorySplitRequestData } from "../models/eft/inventory/IInventorySplitRequestData";
|
||||
import { IInventorySwapRequestData } from "../models/eft/inventory/IInventorySwapRequestData";
|
||||
import { IInventoryTagRequestData } from "../models/eft/inventory/IInventoryTagRequestData";
|
||||
import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryToggleRequestData";
|
||||
import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData";
|
||||
import { IOpenRandomLootContainerRequestData } from "../models/eft/inventory/IOpenRandomLootContainerRequestData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { FenceService } from "../services/FenceService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { RagfairOfferService } from "../services/RagfairOfferService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
export declare class InventoryController {
|
||||
protected logger: ILogger;
|
||||
protected hashUtil: HashUtil;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected fenceService: FenceService;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected inventoryHelper: InventoryHelper;
|
||||
protected questHelper: QuestHelper;
|
||||
protected ragfairOfferService: RagfairOfferService;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected paymentHelper: PaymentHelper;
|
||||
protected localisationService: LocalisationService;
|
||||
protected lootGenerator: LootGenerator;
|
||||
protected eventOutputHolder: EventOutputHolder;
|
||||
protected httpResponseUtil: HttpResponseUtil;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, itemHelper: ItemHelper, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, questHelper: QuestHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, lootGenerator: LootGenerator, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil);
|
||||
/**
|
||||
* Move Item
|
||||
* change location of item with parentId and slotId
|
||||
* transfers items from one profile to another if fromOwner/toOwner is set in the body.
|
||||
* otherwise, move is contained within the same profile_f.
|
||||
* @param pmcData Profile
|
||||
* @param moveRequest Move request data
|
||||
* @param sessionID Session id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
moveItem(pmcData: IPmcData, moveRequest: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Get a event router response with inventory trader message
|
||||
* @param output Item event router response
|
||||
* @returns Item event router response
|
||||
*/
|
||||
protected getTraderExploitErrorResponse(output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
/**
|
||||
* Remove Item from Profile
|
||||
* Deep tree item deletion, also removes items from insurance list
|
||||
*/
|
||||
removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle Remove event
|
||||
* Implements functionality "Discard" from Main menu (Stash etc.)
|
||||
* Removes item from PMC Profile
|
||||
*/
|
||||
discardItem(pmcData: IPmcData, body: IInventoryRemoveRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Split Item
|
||||
* spliting 1 stack into 2
|
||||
* @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile)
|
||||
* @param request Split request
|
||||
* @param sessionID Session/player id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
splitItem(pmcData: IPmcData, request: IInventorySplitRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Fully merge 2 inventory stacks together into one stack (merging where both stacks remain is called 'transfer')
|
||||
* Deletes item from `body.item` and adding number of stacks into `body.with`
|
||||
* @param pmcData Player profile (unused, getOwnerInventoryItems() gets profile)
|
||||
* @param body Merge request
|
||||
* @param sessionID Player id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
mergeItem(pmcData: IPmcData, body: IInventoryMergeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* TODO: Adds no data to output to send to client, is this by design?
|
||||
* TODO: should make use of getOwnerInventoryItems(), stack being transferred may not always be on pmc
|
||||
* Transfer items from one stack into another while keeping original stack
|
||||
* Used to take items from scav inventory into stash or to insert ammo into mags (shotgun ones) and reloading weapon by clicking "Reload"
|
||||
* @param pmcData Player profile
|
||||
* @param body Transfer request
|
||||
* @param sessionID Session id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Swap Item
|
||||
* its used for "reload" if you have weapon in hands and magazine is somewhere else in rig or backpack in equipment
|
||||
* Also used to swap items using quick selection on character screen
|
||||
*/
|
||||
swapItem(pmcData: IPmcData, request: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handles folding of Weapons
|
||||
*/
|
||||
foldItem(pmcData: IPmcData, body: IInventoryFoldRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Toggles "Toggleable" items like night vision goggles and face shields.
|
||||
* @param pmcData player profile
|
||||
* @param body Toggle request
|
||||
* @param sessionID Session id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
toggleItem(pmcData: IPmcData, body: IInventoryToggleRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Add a tag to an inventory item
|
||||
* @param pmcData profile with item to add tag to
|
||||
* @param body tag request data
|
||||
* @param sessionID session id
|
||||
* @returns client response object
|
||||
*/
|
||||
tagItem(pmcData: IPmcData, body: IInventoryTagRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Bind an inventory item to the quick access menu at bottom of player screen
|
||||
* @param pmcData Player profile
|
||||
* @param bindRequest Reqeust object
|
||||
* @param sessionID Session id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
bindItem(pmcData: IPmcData, bindRequest: IInventoryBindRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handles examining an item
|
||||
* @param pmcData player profile
|
||||
* @param body request object
|
||||
* @param sessionID session id
|
||||
* @returns response
|
||||
*/
|
||||
examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Get the tplid of an item from the examine request object
|
||||
* @param body response request
|
||||
* @returns tplid
|
||||
*/
|
||||
protected getExaminedItemTpl(body: IInventoryExamineRequestData): string;
|
||||
readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle ApplyInventoryChanges
|
||||
* Sorts supplied items.
|
||||
* @param pmcData Player profile
|
||||
* @param request sort request
|
||||
* @param sessionID Session id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
sortInventory(pmcData: IPmcData, request: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Add note to a map
|
||||
* @param pmcData Player profile
|
||||
* @param request Add marker request
|
||||
* @param sessionID Session id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
createMapMarker(pmcData: IPmcData, request: IInventoryCreateMarkerRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Delete a map marker
|
||||
* @param pmcData Player profile
|
||||
* @param request Delete marker request
|
||||
* @param sessionID Session id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
deleteMapMarker(pmcData: IPmcData, request: IInventoryDeleteMarkerRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Edit an existing map marker
|
||||
* @param pmcData Player profile
|
||||
* @param request Edit marker request
|
||||
* @param sessionID Session id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
editMapMarker(pmcData: IPmcData, request: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Strip out characters from note string that are not: letter/numbers/unicode/spaces
|
||||
* @param mapNoteText Marker text to sanitise
|
||||
* @returns Sanitised map marker text
|
||||
*/
|
||||
protected sanitiseMapMarkerText(mapNoteText: string): string;
|
||||
/**
|
||||
* Handle OpenRandomLootContainer event
|
||||
* Handle event fired when a container is unpacked (currently only the halloween pumpkin)
|
||||
* @param pmcData Profile data
|
||||
* @param body open loot container request data
|
||||
* @param sessionID Session id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
}
|
52
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/LauncherController.d.ts
vendored
Normal file
52
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/LauncherController.d.ts
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
import { HttpServerHelper } from "../helpers/HttpServerHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { PreAkiModLoader } from "../loaders/PreAkiModLoader";
|
||||
import { IChangeRequestData } from "../models/eft/launcher/IChangeRequestData";
|
||||
import { ILoginRequestData } from "../models/eft/launcher/ILoginRequestData";
|
||||
import { IRegisterData } from "../models/eft/launcher/IRegisterData";
|
||||
import { Info, ModDetails } from "../models/eft/profile/IAkiProfile";
|
||||
import { IConnectResponse } from "../models/eft/profile/IConnectResponse";
|
||||
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
|
||||
import { IPackageJsonData } from "../models/spt/mod/IPackageJsonData";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
export declare class LauncherController {
|
||||
protected hashUtil: HashUtil;
|
||||
protected saveServer: SaveServer;
|
||||
protected httpServerHelper: HttpServerHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected localisationService: LocalisationService;
|
||||
protected preAkiModLoader: PreAkiModLoader;
|
||||
protected configServer: ConfigServer;
|
||||
protected coreConfig: ICoreConfig;
|
||||
constructor(hashUtil: HashUtil, saveServer: SaveServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, preAkiModLoader: PreAkiModLoader, configServer: ConfigServer);
|
||||
connect(): IConnectResponse;
|
||||
/**
|
||||
* Get descriptive text for each of the profile edtions a player can choose
|
||||
* @returns
|
||||
*/
|
||||
protected getProfileDescriptions(): Record<string, string>;
|
||||
find(sessionIdKey: string): Info;
|
||||
login(info: ILoginRequestData): string;
|
||||
register(info: IRegisterData): string;
|
||||
protected createAccount(info: IRegisterData): string;
|
||||
changeUsername(info: IChangeRequestData): string;
|
||||
changePassword(info: IChangeRequestData): string;
|
||||
wipe(info: IRegisterData): string;
|
||||
getCompatibleTarkovVersion(): string;
|
||||
/**
|
||||
* Get the mods the server has currently loaded
|
||||
* @returns Dictionary of mod name and mod details
|
||||
*/
|
||||
getLoadedServerMods(): Record<string, IPackageJsonData>;
|
||||
/**
|
||||
* Get the mods a profile has ever loaded into game with
|
||||
* @param sessionId Player id
|
||||
* @returns Array of mod details
|
||||
*/
|
||||
getServerModsProfileUsed(sessionId: string): ModDetails[];
|
||||
}
|
74
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/LocationController.d.ts
vendored
Normal file
74
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/LocationController.d.ts
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
import { LocationGenerator } from "../generators/LocationGenerator";
|
||||
import { LootGenerator } from "../generators/LootGenerator";
|
||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
||||
import { ILocationBase } from "../models/eft/common/ILocationBase";
|
||||
import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSourceDestinationBase";
|
||||
import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult";
|
||||
import { IGetLocationRequestData } from "../models/eft/location/IGetLocationRequestData";
|
||||
import { AirdropTypeEnum } from "../models/enums/AirdropType";
|
||||
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
|
||||
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
|
||||
import { LootRequest } from "../models/spt/services/LootRequest";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class LocationController {
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected hashUtil: HashUtil;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected weightedRandomHelper: WeightedRandomHelper;
|
||||
protected logger: ILogger;
|
||||
protected locationGenerator: LocationGenerator;
|
||||
protected localisationService: LocalisationService;
|
||||
protected lootGenerator: LootGenerator;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected configServer: ConfigServer;
|
||||
protected airdropConfig: IAirdropConfig;
|
||||
protected locationConfig: ILocationConfig;
|
||||
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer);
|
||||
/**
|
||||
* Handle client/location/getLocalloot
|
||||
* Get a location (map) with generated loot data
|
||||
* @param sessionId Player id
|
||||
* @param request Map request to generate
|
||||
* @returns ILocationBase
|
||||
*/
|
||||
get(sessionId: string, request: IGetLocationRequestData): ILocationBase;
|
||||
/**
|
||||
* Generate a maps base location with loot
|
||||
* @param name Map name
|
||||
* @returns ILocationBase
|
||||
*/
|
||||
protected generate(name: string): ILocationBase;
|
||||
/**
|
||||
* Handle client/locations
|
||||
* Get all maps base location properties without loot data
|
||||
* @param sessionId Players Id
|
||||
* @returns ILocationsGenerateAllResponse
|
||||
*/
|
||||
generateAll(sessionId: string): ILocationsGenerateAllResponse;
|
||||
/**
|
||||
* Handle client/location/getAirdropLoot
|
||||
* Get loot for an airdop container
|
||||
* Generates it randomly based on config/airdrop.json values
|
||||
* @returns Array of LootItem objects
|
||||
*/
|
||||
getAirdropLoot(): IAirdropLootResult;
|
||||
/**
|
||||
* Randomly pick a type of airdrop loot using weighted values from config
|
||||
* @returns airdrop type value
|
||||
*/
|
||||
protected chooseAirdropType(): AirdropTypeEnum;
|
||||
/**
|
||||
* Get the configuration for a specific type of airdrop
|
||||
* @param airdropType Type of airdrop to get settings for
|
||||
* @returns LootRequest
|
||||
*/
|
||||
protected getAirdropLootConfigByType(airdropType: AirdropTypeEnum): LootRequest;
|
||||
}
|
82
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/MatchController.d.ts
vendored
Normal file
82
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/MatchController.d.ts
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
import { ApplicationContext } from "../context/ApplicationContext";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { TraderHelper } from "../helpers/TraderHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData";
|
||||
import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData";
|
||||
import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData";
|
||||
import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData";
|
||||
import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData";
|
||||
import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData";
|
||||
import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult";
|
||||
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
|
||||
import { IMatchConfig } from "../models/spt/config/IMatchConfig";
|
||||
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { BotGenerationCacheService } from "../services/BotGenerationCacheService";
|
||||
import { BotLootCacheService } from "../services/BotLootCacheService";
|
||||
import { MatchLocationService } from "../services/MatchLocationService";
|
||||
import { ProfileSnapshotService } from "../services/ProfileSnapshotService";
|
||||
export declare class MatchController {
|
||||
protected logger: ILogger;
|
||||
protected saveServer: SaveServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected matchLocationService: MatchLocationService;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected botLootCacheService: BotLootCacheService;
|
||||
protected configServer: ConfigServer;
|
||||
protected profileSnapshotService: ProfileSnapshotService;
|
||||
protected botGenerationCacheService: BotGenerationCacheService;
|
||||
protected applicationContext: ApplicationContext;
|
||||
protected matchConfig: IMatchConfig;
|
||||
protected inraidConfig: IInRaidConfig;
|
||||
protected pmcConfig: IPmcConfig;
|
||||
constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext);
|
||||
getEnabled(): boolean;
|
||||
/** Handle raid/profile/list */
|
||||
getProfile(info: IGetProfileRequestData): IPmcData[];
|
||||
/** Handle client/match/group/create */
|
||||
createGroup(sessionID: string, info: ICreateGroupRequestData): any;
|
||||
/** Handle client/match/group/delete */
|
||||
deleteGroup(info: any): void;
|
||||
/** Handle match/group/start_game */
|
||||
joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult;
|
||||
/** Handle client/match/group/status */
|
||||
getGroupStatus(info: IGetGroupStatusRequestData): any;
|
||||
/**
|
||||
* Handle /client/raid/configuration
|
||||
* @param request Raid config request
|
||||
* @param sessionID Session id
|
||||
*/
|
||||
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;
|
||||
/** Handle client/match/offline/end */
|
||||
endOfflineRaid(info: IEndOfflineRaidRequestData, sessionId: string): void;
|
||||
/**
|
||||
* Was extract by car
|
||||
* @param extractName name of extract
|
||||
* @returns true if car extract
|
||||
*/
|
||||
protected extractWasViaCar(extractName: string): boolean;
|
||||
/**
|
||||
* Handle when a player extracts using a car - Add rep to fence
|
||||
* @param extractName name of the extract used
|
||||
* @param pmcData Player profile
|
||||
* @param sessionId Session id
|
||||
*/
|
||||
protected handleCarExtract(extractName: string, pmcData: IPmcData, sessionId: string): void;
|
||||
/**
|
||||
* Update players fence trader standing value in profile
|
||||
* @param pmcData Player profile
|
||||
* @param fenceId Id of fence trader
|
||||
* @param extractName Name of extract used
|
||||
*/
|
||||
protected updateFenceStandingInProfile(pmcData: IPmcData, fenceId: string, extractName: string): void;
|
||||
}
|
11
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/NoteController.d.ts
vendored
Normal file
11
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/NoteController.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { INoteActionData } from "../models/eft/notes/INoteActionData";
|
||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
||||
export declare class NoteController {
|
||||
protected eventOutputHolder: EventOutputHolder;
|
||||
constructor(eventOutputHolder: EventOutputHolder);
|
||||
addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;
|
||||
editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;
|
||||
deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;
|
||||
}
|
23
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/NotifierController.d.ts
vendored
Normal file
23
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/NotifierController.d.ts
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
import { NotifierHelper } from "../helpers/NotifierHelper";
|
||||
import { NotificationService } from "../services/NotificationService";
|
||||
import { INotifierChannel } from "../models/eft/notifier/INotifier";
|
||||
import { HttpServerHelper } from "../helpers/HttpServerHelper";
|
||||
export declare class NotifierController {
|
||||
protected notifierHelper: NotifierHelper;
|
||||
protected httpServerHelper: HttpServerHelper;
|
||||
protected notificationService: NotificationService;
|
||||
protected pollInterval: number;
|
||||
protected timeout: number;
|
||||
constructor(notifierHelper: NotifierHelper, httpServerHelper: HttpServerHelper, notificationService: NotificationService);
|
||||
/**
|
||||
* Resolve an array of session notifications.
|
||||
*
|
||||
* If no notifications are currently queued then intermittently check for new notifications until either
|
||||
* one or more appear or when a timeout expires.
|
||||
* If no notifications are available after the timeout, use a default message.
|
||||
*/
|
||||
notifyAsync(sessionID: string): Promise<unknown>;
|
||||
getServer(sessionID: string): string;
|
||||
/** Handle client/notifier/channel/create */
|
||||
getChannel(sessionID: string): INotifierChannel;
|
||||
}
|
36
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/PresetBuildController.d.ts
vendored
Normal file
36
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/PresetBuildController.d.ts
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData";
|
||||
import { IRemoveBuildRequestData } from "../models/eft/presetBuild/IRemoveBuildRequestData";
|
||||
import { IUserBuilds } from "../models/eft/profile/IAkiProfile";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
export declare class PresetBuildController {
|
||||
protected logger: ILogger;
|
||||
protected hashUtil: HashUtil;
|
||||
protected eventOutputHolder: EventOutputHolder;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected saveServer: SaveServer;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer);
|
||||
/** Handle client/handbook/builds/my/list */
|
||||
getUserBuilds(sessionID: string): IUserBuilds;
|
||||
/** Handle SaveWeaponBuild event */
|
||||
saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionId: string): IItemEventRouterResponse;
|
||||
/** Handle SaveEquipmentBuild event */
|
||||
saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
protected saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string, buildType: string): IItemEventRouterResponse;
|
||||
/** Handle RemoveWeaponBuild event*/
|
||||
removeBuild(pmcData: IPmcData, body: IRemoveBuildRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle RemoveWeaponBuild event*/
|
||||
removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle RemoveEquipmentBuild event*/
|
||||
removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
protected removePlayerBuild(pmcData: IPmcData, id: string, sessionID: string): IItemEventRouterResponse;
|
||||
}
|
8
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/PresetController.d.ts
vendored
Normal file
8
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/PresetController.d.ts
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
import { PresetHelper } from "../helpers/PresetHelper";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
export declare class PresetController {
|
||||
protected presetHelper: PresetHelper;
|
||||
protected databaseServer: DatabaseServer;
|
||||
constructor(presetHelper: PresetHelper, databaseServer: DatabaseServer);
|
||||
initialize(): void;
|
||||
}
|
101
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/ProfileController.d.ts
vendored
Normal file
101
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/ProfileController.d.ts
vendored
Normal file
@ -0,0 +1,101 @@
|
||||
import { PlayerScavGenerator } from "../generators/PlayerScavGenerator";
|
||||
import { DialogueHelper } from "../helpers/DialogueHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { QuestHelper } from "../helpers/QuestHelper";
|
||||
import { TraderHelper } from "../helpers/TraderHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IMiniProfile } from "../models/eft/launcher/IMiniProfile";
|
||||
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
|
||||
import { IProfileChangeNicknameRequestData } from "../models/eft/profile/IProfileChangeNicknameRequestData";
|
||||
import { IProfileChangeVoiceRequestData } from "../models/eft/profile/IProfileChangeVoiceRequestData";
|
||||
import { IProfileCreateRequestData } from "../models/eft/profile/IProfileCreateRequestData";
|
||||
import { ISearchFriendRequestData } from "../models/eft/profile/ISearchFriendRequestData";
|
||||
import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendResponse";
|
||||
import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { MailSendService } from "../services/MailSendService";
|
||||
import { ProfileFixerService } from "../services/ProfileFixerService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class ProfileController {
|
||||
protected logger: ILogger;
|
||||
protected hashUtil: HashUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected saveServer: SaveServer;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected profileFixerService: ProfileFixerService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected mailSendService: MailSendService;
|
||||
protected playerScavGenerator: PlayerScavGenerator;
|
||||
protected eventOutputHolder: EventOutputHolder;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected questHelper: QuestHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper);
|
||||
/**
|
||||
* Handle /launcher/profiles
|
||||
*/
|
||||
getMiniProfiles(): IMiniProfile[];
|
||||
/**
|
||||
* Handle launcher/profile/info
|
||||
*/
|
||||
getMiniProfile(sessionID: string): any;
|
||||
/**
|
||||
* Handle client/game/profile/list
|
||||
*/
|
||||
getCompleteProfile(sessionID: string): IPmcData[];
|
||||
/**
|
||||
* Handle client/game/profile/create
|
||||
*/
|
||||
createProfile(info: IProfileCreateRequestData, sessionID: string): void;
|
||||
/**
|
||||
* Delete a profile
|
||||
* @param sessionID Id of profile to delete
|
||||
*/
|
||||
protected deleteProfileBySessionId(sessionID: string): void;
|
||||
/**
|
||||
* Iterate over all quests in player profile, inspect rewards for the quests current state (accepted/completed)
|
||||
* and send rewards to them in mail
|
||||
* @param profileDetails Player profile
|
||||
* @param sessionID Session id
|
||||
* @param response Event router response
|
||||
*/
|
||||
protected givePlayerStartingQuestRewards(profileDetails: IAkiProfile, sessionID: string, response: IItemEventRouterResponse): void;
|
||||
/**
|
||||
* For each trader reset their state to what a level 1 player would see
|
||||
* @param sessionID Session id of profile to reset
|
||||
*/
|
||||
protected resetAllTradersInProfile(sessionID: string): void;
|
||||
/**
|
||||
* Generate a player scav object
|
||||
* PMC profile MUST exist first before pscav can be generated
|
||||
* @param sessionID
|
||||
* @returns IPmcData object
|
||||
*/
|
||||
generatePlayerScav(sessionID: string): IPmcData;
|
||||
/**
|
||||
* Handle client/game/profile/nickname/validate
|
||||
*/
|
||||
validateNickname(info: IValidateNicknameRequestData, sessionID: string): string;
|
||||
/**
|
||||
* Handle client/game/profile/nickname/change event
|
||||
* Client allows player to adjust their profile name
|
||||
*/
|
||||
changeNickname(info: IProfileChangeNicknameRequestData, sessionID: string): string;
|
||||
/**
|
||||
* Handle client/game/profile/voice/change event
|
||||
*/
|
||||
changeVoice(info: IProfileChangeVoiceRequestData, sessionID: string): void;
|
||||
/**
|
||||
* Handle client/game/profile/search
|
||||
*/
|
||||
getFriends(info: ISearchFriendRequestData, sessionID: string): ISearchFriendResponse[];
|
||||
}
|
186
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/QuestController.d.ts
vendored
Normal file
186
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/QuestController.d.ts
vendored
Normal file
@ -0,0 +1,186 @@
|
||||
import { DialogueHelper } from "../helpers/DialogueHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { QuestConditionHelper } from "../helpers/QuestConditionHelper";
|
||||
import { QuestHelper } from "../helpers/QuestHelper";
|
||||
import { TraderHelper } from "../helpers/TraderHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IQuestStatus } from "../models/eft/common/tables/IBotBase";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { AvailableForConditions, IQuest, Reward } from "../models/eft/common/tables/IQuest";
|
||||
import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData";
|
||||
import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRequestData";
|
||||
import { IHandoverQuestRequestData } from "../models/eft/quests/IHandoverQuestRequestData";
|
||||
import { IQuestConfig } from "../models/spt/config/IQuestConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { MailSendService } from "../services/MailSendService";
|
||||
import { PlayerService } from "../services/PlayerService";
|
||||
import { SeasonalEventService } from "../services/SeasonalEventService";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class QuestController {
|
||||
protected logger: ILogger;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected httpResponseUtil: HttpResponseUtil;
|
||||
protected eventOutputHolder: EventOutputHolder;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected mailSendService: MailSendService;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected questHelper: QuestHelper;
|
||||
protected questConditionHelper: QuestConditionHelper;
|
||||
protected playerService: PlayerService;
|
||||
protected localeService: LocaleService;
|
||||
protected seasonalEventService: SeasonalEventService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
protected questConfig: IQuestConfig;
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, jsonUtil: JsonUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, mailSendService: MailSendService, profileHelper: ProfileHelper, traderHelper: TraderHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer);
|
||||
/**
|
||||
* Handle client/quest/list
|
||||
* Get all quests visible to player
|
||||
* Exclude quests with incomplete preconditions (level/loyalty)
|
||||
* @param sessionID session id
|
||||
* @returns array of IQuest
|
||||
*/
|
||||
getClientQuests(sessionID: string): IQuest[];
|
||||
/**
|
||||
* Does a provided quest have a level requirement equal to or below defined level
|
||||
* @param quest Quest to check
|
||||
* @param playerLevel level of player to test against quest
|
||||
* @returns true if quest can be seen/accepted by player of defined level
|
||||
*/
|
||||
protected playerLevelFulfillsQuestRequirement(quest: IQuest, playerLevel: number): boolean;
|
||||
/**
|
||||
* Should a quest be shown to the player in trader quest screen
|
||||
* @param questId Quest to check
|
||||
* @returns true = show to player
|
||||
*/
|
||||
protected showEventQuestToPlayer(questId: string): boolean;
|
||||
/**
|
||||
* Is the quest for the opposite side the player is on
|
||||
* @param playerSide Player side (usec/bear)
|
||||
* @param questId QuestId to check
|
||||
*/
|
||||
protected questIsForOtherSide(playerSide: string, questId: string): boolean;
|
||||
/**
|
||||
* Handle QuestAccept event
|
||||
* Handle the client accepting a quest and starting it
|
||||
* Send starting rewards if any to player and
|
||||
* Send start notification if any to player
|
||||
* @param pmcData Profile to update
|
||||
* @param acceptedQuest Quest accepted
|
||||
* @param sessionID Session id
|
||||
* @returns client response
|
||||
*/
|
||||
acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* 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;
|
||||
/**
|
||||
* 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;
|
||||
/**
|
||||
* Handle QuestComplete event
|
||||
* Update completed quest in profile
|
||||
* Add newly unlocked quests to profile
|
||||
* Also recalculate their level due to exp rewards
|
||||
* @param pmcData Player profile
|
||||
* @param body Completed quest request
|
||||
* @param sessionID Session id
|
||||
* @returns ItemEvent client response
|
||||
*/
|
||||
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Return quests that have different statuses
|
||||
* @param preQuestStatusus Quests before
|
||||
* @param postQuestStatuses Quests after
|
||||
* @returns QuestStatusChange array
|
||||
*/
|
||||
protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[];
|
||||
/**
|
||||
* Send a popup to player on successful completion of a quest
|
||||
* @param sessionID session id
|
||||
* @param pmcData Player profile
|
||||
* @param completedQuestId Completed quest id
|
||||
* @param questRewards Rewards given to player
|
||||
*/
|
||||
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
|
||||
* @param completedQuestId quest completed id
|
||||
* @returns array of quests
|
||||
*/
|
||||
protected getQuestsFailedByCompletingQuest(completedQuestId: string): IQuest[];
|
||||
/**
|
||||
* Fail the provided quests
|
||||
* Update quest in profile, otherwise add fresh quest object with failed status
|
||||
* @param sessionID session id
|
||||
* @param pmcData player profile
|
||||
* @param questsToFail quests to fail
|
||||
* @param output Client output
|
||||
*/
|
||||
protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[], output: IItemEventRouterResponse): void;
|
||||
/**
|
||||
* Handle QuestHandover event
|
||||
* @param pmcData Player profile
|
||||
* @param handoverQuestRequest handover item request
|
||||
* @param sessionID Session id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Show warning to user and write to log that repeatable quest failed a condition check
|
||||
* @param handoverQuestRequest Quest request
|
||||
* @param output Response to send to user
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
protected showRepeatableQuestInvalidConditionError(handoverQuestRequest: IHandoverQuestRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
/**
|
||||
* Show warning to user and write to log quest item handed over did not match what is required
|
||||
* @param handoverQuestRequest Quest request
|
||||
* @param itemHandedOver Non-matching item found
|
||||
* @param handoverRequirements Quest handover requirements
|
||||
* @param output Response to send to user
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
protected showQuestItemHandoverMatchError(handoverQuestRequest: IHandoverQuestRequestData, itemHandedOver: Item, handoverRequirements: AvailableForConditions, output: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
/**
|
||||
* Increment a backend counter stored value by an amount,
|
||||
* Create counter if it does not exist
|
||||
* @param pmcData Profile to find backend counter in
|
||||
* @param conditionId backend counter id to update
|
||||
* @param questId quest id counter is associated with
|
||||
* @param counterValue value to increment the backend counter with
|
||||
*/
|
||||
protected updateProfileBackendCounterValue(pmcData: IPmcData, conditionId: string, questId: string, counterValue: number): void;
|
||||
}
|
181
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RagfairController.d.ts
vendored
Normal file
181
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RagfairController.d.ts
vendored
Normal file
@ -0,0 +1,181 @@
|
||||
import { RagfairOfferGenerator } from "../generators/RagfairOfferGenerator";
|
||||
import { HandbookHelper } from "../helpers/HandbookHelper";
|
||||
import { InventoryHelper } from "../helpers/InventoryHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { PaymentHelper } from "../helpers/PaymentHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { RagfairHelper } from "../helpers/RagfairHelper";
|
||||
import { RagfairOfferHelper } from "../helpers/RagfairOfferHelper";
|
||||
import { RagfairSellHelper } from "../helpers/RagfairSellHelper";
|
||||
import { RagfairSortHelper } from "../helpers/RagfairSortHelper";
|
||||
import { TraderHelper } from "../helpers/TraderHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { ITraderAssort } from "../models/eft/common/tables/ITrader";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
|
||||
import { IAddOfferRequestData, Requirement } from "../models/eft/ragfair/IAddOfferRequestData";
|
||||
import { IExtendOfferRequestData } from "../models/eft/ragfair/IExtendOfferRequestData";
|
||||
import { IGetItemPriceResult } from "../models/eft/ragfair/IGetItemPriceResult";
|
||||
import { IGetMarketPriceRequestData } from "../models/eft/ragfair/IGetMarketPriceRequestData";
|
||||
import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult";
|
||||
import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer";
|
||||
import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData";
|
||||
import { IProcessBuyTradeRequestData } from "../models/eft/trade/IProcessBuyTradeRequestData";
|
||||
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { RagfairServer } from "../servers/RagfairServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { PaymentService } from "../services/PaymentService";
|
||||
import { RagfairOfferService } from "../services/RagfairOfferService";
|
||||
import { RagfairPriceService } from "../services/RagfairPriceService";
|
||||
import { RagfairRequiredItemsService } from "../services/RagfairRequiredItemsService";
|
||||
import { RagfairTaxService } from "../services/RagfairTaxService";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
/**
|
||||
* Handle RagfairCallback events
|
||||
*/
|
||||
export declare class RagfairController {
|
||||
protected logger: ILogger;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected eventOutputHolder: EventOutputHolder;
|
||||
protected ragfairServer: RagfairServer;
|
||||
protected ragfairPriceService: RagfairPriceService;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected saveServer: SaveServer;
|
||||
protected ragfairSellHelper: RagfairSellHelper;
|
||||
protected ragfairTaxService: RagfairTaxService;
|
||||
protected ragfairSortHelper: RagfairSortHelper;
|
||||
protected ragfairOfferHelper: RagfairOfferHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected paymentService: PaymentService;
|
||||
protected handbookHelper: HandbookHelper;
|
||||
protected paymentHelper: PaymentHelper;
|
||||
protected inventoryHelper: InventoryHelper;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected ragfairHelper: RagfairHelper;
|
||||
protected ragfairOfferService: RagfairOfferService;
|
||||
protected ragfairRequiredItemsService: RagfairRequiredItemsService;
|
||||
protected ragfairOfferGenerator: RagfairOfferGenerator;
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxService: RagfairTaxService, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer);
|
||||
getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult;
|
||||
/**
|
||||
* Get offers for the client based on type of search being performed
|
||||
* @param searchRequest Client search request data
|
||||
* @param itemsToAdd comes from ragfairHelper.filterCategories()
|
||||
* @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
|
||||
* @param offer flea offer to update
|
||||
* @param profile full profile of player
|
||||
*/
|
||||
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 isRequiredSearch(info: ISearchRequestData): boolean;
|
||||
update(): void;
|
||||
/**
|
||||
* 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;
|
||||
/**
|
||||
* List item(s) on flea for sale
|
||||
* @param pmcData Player profile
|
||||
* @param offerRequest Flea list creation offer
|
||||
* @param sessionID Session id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
addPlayerOffer(pmcData: IPmcData, offerRequest: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Charge player a listing fee for using flea, pulls charge from data previously sent by client
|
||||
* @param sessionID Player id
|
||||
* @param rootItem Base item being listed (used when client tax cost not found and must be done on server)
|
||||
* @param pmcData Player profile
|
||||
* @param requirementsPriceInRub Rouble cost player chose for listing (used when client tax cost not found and must be done on server)
|
||||
* @param itemStackCount How many items were listed in player (used when client tax cost not found and must be done on server)
|
||||
* @param offerRequest Add offer request object from client
|
||||
* @param output IItemEventRouterResponse
|
||||
* @returns True if charging tax to player failed
|
||||
*/
|
||||
protected chargePlayerTaxFee(sessionID: string, rootItem: Item, pmcData: IPmcData, requirementsPriceInRub: number, itemStackCount: number, offerRequest: IAddOfferRequestData, output: IItemEventRouterResponse): boolean;
|
||||
/**
|
||||
* Is the item to be listed on the flea valid
|
||||
* @param offerRequest Client offer request
|
||||
* @param errorMessage message to show to player when offer is invalid
|
||||
* @returns Is offer valid
|
||||
*/
|
||||
protected isValidPlayerOfferRequest(offerRequest: IAddOfferRequestData, errorMessage: string): boolean;
|
||||
/**
|
||||
* Get the handbook price in roubles for the items being listed
|
||||
* @param requirements
|
||||
* @returns Rouble price
|
||||
*/
|
||||
protected calculateRequirementsPriceInRub(requirements: Requirement[]): number;
|
||||
/**
|
||||
* Using item ids from flea offer request, find corrispnding items from player inventory and return as array
|
||||
* @param pmcData Player profile
|
||||
* @param itemIdsFromFleaOfferRequest Ids from request
|
||||
* @param errorMessage if item is not found, add error message to this parameter
|
||||
* @returns Array of items from player inventory
|
||||
*/
|
||||
protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[], errorMessage: string): Item[];
|
||||
createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer;
|
||||
getAllFleaPrices(): Record<string, number>;
|
||||
getStaticPrices(): Record<string, number>;
|
||||
/**
|
||||
* User requested removal of the offer, actually reduces the time to 71 seconds,
|
||||
* allowing for the possibility of extending the auction before it's end time
|
||||
* @param offerId offer to 'remove'
|
||||
* @param sessionID Players id
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse;
|
||||
extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Create a basic trader request object with price and currency type
|
||||
* @param currency What currency: RUB, EURO, USD
|
||||
* @param value Amount of currency
|
||||
* @returns IProcessBuyTradeRequestData
|
||||
*/
|
||||
protected createBuyTradeRequestObject(currency: string, value: number): IProcessBuyTradeRequestData;
|
||||
}
|
43
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepairController.d.ts
vendored
Normal file
43
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepairController.d.ts
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
import { QuestHelper } from "../helpers/QuestHelper";
|
||||
import { RepairHelper } from "../helpers/RepairHelper";
|
||||
import { TraderHelper } from "../helpers/TraderHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IRepairActionDataRequest } from "../models/eft/repair/IRepairActionDataRequest";
|
||||
import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepairActionDataRequest";
|
||||
import { IRepairConfig } from "../models/spt/config/IRepairConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { PaymentService } from "../services/PaymentService";
|
||||
import { RepairService } from "../services/RepairService";
|
||||
export declare class RepairController {
|
||||
protected logger: ILogger;
|
||||
protected eventOutputHolder: EventOutputHolder;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected questHelper: QuestHelper;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected paymentService: PaymentService;
|
||||
protected repairHelper: RepairHelper;
|
||||
protected repairService: RepairService;
|
||||
protected repairConfig: IRepairConfig;
|
||||
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService);
|
||||
/**
|
||||
* Handle TraderRepair event
|
||||
* Repair with trader
|
||||
* @param sessionID session id
|
||||
* @param body endpoint request data
|
||||
* @param pmcData player profile
|
||||
* @returns item event router action
|
||||
*/
|
||||
traderRepair(sessionID: string, body: ITraderRepairActionDataRequest, pmcData: IPmcData): IItemEventRouterResponse;
|
||||
/**
|
||||
* Handle Repair event
|
||||
* Repair with repair kit
|
||||
* @param sessionID session id
|
||||
* @param body endpoint request data
|
||||
* @param pmcData player profile
|
||||
* @returns item event router action
|
||||
*/
|
||||
repairWithKit(sessionID: string, body: IRepairActionDataRequest, pmcData: IPmcData): IItemEventRouterResponse;
|
||||
}
|
267
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepeatableQuestController.d.ts
vendored
Normal file
267
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepeatableQuestController.d.ts
vendored
Normal file
@ -0,0 +1,267 @@
|
||||
import { HandbookHelper } from "../helpers/HandbookHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { PresetHelper } from "../helpers/PresetHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { RagfairServerHelper } from "../helpers/RagfairServerHelper";
|
||||
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
|
||||
import { Exit } from "../models/eft/common/ILocationBase";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { TraderInfo } from "../models/eft/common/tables/IBotBase";
|
||||
import { ICompletion, ICompletionAvailableFor, IElimination, IEliminationCondition, IExploration, IExplorationCondition, IPmcDataRepeatableQuest, IRepeatableQuest, IReward, IRewards } from "../models/eft/common/tables/IRepeatableQuests";
|
||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest";
|
||||
import { ELocationName } from "../models/enums/ELocationName";
|
||||
import { IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { ItemFilterService } from "../services/ItemFilterService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { PaymentService } from "../services/PaymentService";
|
||||
import { ProfileFixerService } from "../services/ProfileFixerService";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { MathUtil } from "../utils/MathUtil";
|
||||
import { ObjectId } from "../utils/ObjectId";
|
||||
import { ProbabilityObject, ProbabilityObjectArray, RandomUtil } from "../utils/RandomUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
export interface IQuestTypePool {
|
||||
types: string[];
|
||||
pool: IQuestPool;
|
||||
}
|
||||
export interface IQuestPool {
|
||||
Exploration: IExplorationPool;
|
||||
Elimination: IEliminationPool;
|
||||
}
|
||||
export interface IExplorationPool {
|
||||
locations: Partial<Record<ELocationName, string[]>>;
|
||||
}
|
||||
export interface IEliminationPool {
|
||||
targets: IEliminationTargetPool;
|
||||
}
|
||||
export interface IEliminationTargetPool {
|
||||
Savage?: ITargetLocation;
|
||||
AnyPmc?: ITargetLocation;
|
||||
bossBully?: ITargetLocation;
|
||||
bossGluhar?: ITargetLocation;
|
||||
bossKilla?: ITargetLocation;
|
||||
bossSanitar?: ITargetLocation;
|
||||
bossTagilla?: ITargetLocation;
|
||||
bossKojaniy?: ITargetLocation;
|
||||
}
|
||||
export interface ITargetLocation {
|
||||
locations: string[];
|
||||
}
|
||||
export declare class RepeatableQuestController {
|
||||
protected timeUtil: TimeUtil;
|
||||
protected logger: ILogger;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected mathUtil: MathUtil;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected profileFixerService: ProfileFixerService;
|
||||
protected handbookHelper: HandbookHelper;
|
||||
protected ragfairServerHelper: RagfairServerHelper;
|
||||
protected eventOutputHolder: EventOutputHolder;
|
||||
protected localisationService: LocalisationService;
|
||||
protected paymentService: PaymentService;
|
||||
protected objectId: ObjectId;
|
||||
protected itemFilterService: ItemFilterService;
|
||||
protected configServer: ConfigServer;
|
||||
protected questConfig: IQuestConfig;
|
||||
constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, handbookHelper: HandbookHelper, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, localisationService: LocalisationService, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer);
|
||||
/**
|
||||
* Handle client/repeatalbeQuests/activityPeriods
|
||||
* Returns an array of objects in the format of repeatable quests to the client.
|
||||
* repeatableQuestObject = {
|
||||
* id: Unique Id,
|
||||
* name: "Daily",
|
||||
* endTime: the time when the quests expire
|
||||
* activeQuests: currently available quests in an array. Each element of quest type format (see assets/database/templates/repeatableQuests.json).
|
||||
* inactiveQuests: the quests which were previously active (required by client to fail them if they are not completed)
|
||||
* }
|
||||
*
|
||||
* The method checks if the player level requirement for repeatable quests (e.g. daily lvl5, weekly lvl15) is met and if the previously active quests
|
||||
* are still valid. This ischecked by endTime persisted in profile accordning to the resetTime configured for each repeatable kind (daily, weekly)
|
||||
* in QuestCondig.js
|
||||
*
|
||||
* If the condition is met, new repeatableQuests are created, old quests (which are persisted in the profile.RepeatableQuests[i].activeQuests) are
|
||||
* moved to profile.RepeatableQuests[i].inactiveQuests. This memory is required to get rid of old repeatable quest data in the profile, otherwise
|
||||
* they'll litter the profile's Quests field.
|
||||
* (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards)
|
||||
* The new quests generated are again persisted in profile.RepeatableQuests
|
||||
*
|
||||
*
|
||||
* @param {string} sessionId Player's session id
|
||||
* @returns {array} array of "repeatableQuestObjects" as descibed above
|
||||
*/
|
||||
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).
|
||||
* It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest
|
||||
*/
|
||||
protected generateRepeatableQuest(pmcLevel: number, pmcTraderInfo: Record<string, TraderInfo>, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest;
|
||||
/**
|
||||
* Just for debug reasons. Draws dailies a random assort of dailies extracted from dumps
|
||||
*/
|
||||
generateDebugDailies(dailiesPool: any, factory: any, number: number): any;
|
||||
/**
|
||||
* Generates the base object of quest type format given as templates in assets/database/templates/repeatableQuests.json
|
||||
* The templates include Elimination, Completion and Extraction quest types
|
||||
*
|
||||
* @param {string} type quest type: "Elimination", "Completion" or "Extraction"
|
||||
* @param {string} traderId trader from which the quest will be provided
|
||||
* @param {string} side scav daily or pmc daily/weekly quest
|
||||
* @returns {object} a object which contains the base elements for repeatable quests of the requests type
|
||||
* (needs to be filled with reward and conditions by called to make a valid quest)
|
||||
*/
|
||||
protected generateRepeatableTemplate(type: string, traderId: string, side: string): IRepeatableQuest;
|
||||
/**
|
||||
* Generates a valid Exploration quest
|
||||
*
|
||||
* @param {integer} pmcLevel player's level for reward generation
|
||||
* @param {string} traderId trader from which the quest will be provided
|
||||
* @param {object} questTypePool Pools for quests (used to avoid redundant quests)
|
||||
* @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest
|
||||
* @returns {object} object of quest type format for "Exploration" (see assets/database/templates/repeatableQuests.json)
|
||||
*/
|
||||
protected generateExplorationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IExploration;
|
||||
/**
|
||||
* Generates a valid Completion quest
|
||||
*
|
||||
* @param {integer} pmcLevel player's level for requested items and reward generation
|
||||
* @param {string} traderId trader from which the quest will be provided
|
||||
* @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest
|
||||
* @returns {object} object of quest type format for "Completion" (see assets/database/templates/repeatableQuests.json)
|
||||
*/
|
||||
protected generateCompletionQuest(pmcLevel: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): ICompletion;
|
||||
/**
|
||||
* Generates a valid Elimination quest
|
||||
*
|
||||
* @param {integer} pmcLevel player's level for requested items and reward generation
|
||||
* @param {string} traderId trader from which the quest will be provided
|
||||
* @param {object} questTypePool Pools for quests (used to avoid redundant quests)
|
||||
* @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest
|
||||
* @returns {object} object of quest type format for "Elimination" (see assets/database/templates/repeatableQuests.json)
|
||||
*/
|
||||
protected generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination;
|
||||
/**
|
||||
* Get the relevant elimination config based on the current players PMC level
|
||||
* @param pmcLevel Level of PMC character
|
||||
* @param repeatableConfig Main repeatable config
|
||||
* @returns IEliminationConfig
|
||||
*/
|
||||
protected getEliminationConfigByPmcLevel(pmcLevel: number, repeatableConfig: IRepeatableQuestConfig): IEliminationConfig;
|
||||
/**
|
||||
* Convert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567)
|
||||
* @param locationKey e.g factory4_day
|
||||
* @returns guid
|
||||
*/
|
||||
protected getQuestLocationByMapId(locationKey: string): string;
|
||||
/**
|
||||
* Exploration repeatable quests can specify a required extraction point.
|
||||
* This method creates the according object which will be appended to the conditions array
|
||||
*
|
||||
* @param {string} exit The exit name to generate the condition for
|
||||
* @returns {object} Exit condition
|
||||
*/
|
||||
protected generateExplorationExitCondition(exit: Exit): IExplorationCondition;
|
||||
/**
|
||||
* A repeatable quest, besides some more or less static components, exists of reward and condition (see assets/database/templates/repeatableQuests.json)
|
||||
* This is a helper method for GenerateCompletionQuest to create a completion condition (of which a completion quest theoretically can have many)
|
||||
*
|
||||
* @param {string} targetItemId id of the item to request
|
||||
* @param {integer} value amount of items of this specific type to request
|
||||
* @returns {object} object of "Completion"-condition
|
||||
*/
|
||||
protected generateCompletionAvailableForFinish(targetItemId: string, value: number): ICompletionAvailableFor;
|
||||
/**
|
||||
* A repeatable quest, besides some more or less static components, exists of reward and condition (see assets/database/templates/repeatableQuests.json)
|
||||
* This is a helper method for GenerateEliminationQuest to create a location condition.
|
||||
*
|
||||
* @param {string} location the location on which to fulfill the elimination quest
|
||||
* @returns {object} object of "Elimination"-location-subcondition
|
||||
*/
|
||||
protected generateEliminationLocation(location: string[]): IEliminationCondition;
|
||||
/**
|
||||
* A repeatable quest, besides some more or less static components, exists of reward and condition (see assets/database/templates/repeatableQuests.json)
|
||||
* This is a helper method for GenerateEliminationQuest to create a kill condition.
|
||||
*
|
||||
* @param {string} target array of target npcs e.g. "AnyPmc", "Savage"
|
||||
* @param {array} bodyParts array of body parts with which to kill e.g. ["stomach", "thorax"]
|
||||
* @param {number} distance distance from which to kill (currently only >= supported)
|
||||
* @returns {object} object of "Elimination"-kill-subcondition
|
||||
*/
|
||||
protected generateEliminationCondition(target: string, bodyPart: string[], distance: number): IEliminationCondition;
|
||||
/**
|
||||
* Used to create a quest pool during each cycle of repeatable quest generation. The pool will be subsequently
|
||||
* narrowed down during quest generation to avoid duplicate quests. Like duplicate extractions or elimination quests
|
||||
* where you have to e.g. kill scavs in same locations.
|
||||
* @param repeatableConfig main repeatable quest config
|
||||
* @param pmcLevel level of pmc generating quest pool
|
||||
* @returns IQuestTypePool
|
||||
*/
|
||||
protected generateQuestPool(repeatableConfig: IRepeatableQuestConfig, pmcLevel: number): IQuestTypePool;
|
||||
/**
|
||||
* Generate the reward for a mission. A reward can consist of
|
||||
* - Experience
|
||||
* - Money
|
||||
* - Items
|
||||
* - Trader Reputation
|
||||
*
|
||||
* The reward is dependent on the player level as given by the wiki. The exact mapping of pmcLevel to
|
||||
* experience / money / items / trader reputation can be defined in QuestConfig.js
|
||||
*
|
||||
* There's also a random variation of the reward the spread of which can be also defined in the config.
|
||||
*
|
||||
* Additonaly, a scaling factor w.r.t. quest difficulty going from 0.2...1 can be used
|
||||
*
|
||||
* @param {integer} pmcLevel player's level
|
||||
* @param {number} difficulty a reward scaling factor goint from 0.2 to 1
|
||||
* @param {string} traderId the trader for reputation gain (and possible in the future filtering of reward item type based on trader)
|
||||
* @param {object} repeatableConfig The configuration for the repeatably kind (daily, weekly) as configured in QuestConfig for the requestd quest
|
||||
* @returns {object} object of "Reward"-type that can be given for a repeatable mission
|
||||
*/
|
||||
protected generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig): IRewards;
|
||||
/**
|
||||
* Helper to create a reward item structured as required by the client
|
||||
*
|
||||
* @param {string} tpl itemId of the rewarded item
|
||||
* @param {integer} value amount of items to give
|
||||
* @param {integer} index all rewards will be appended to a list, for unkown reasons the client wants the index
|
||||
* @returns {object} object of "Reward"-item-type
|
||||
*/
|
||||
protected generateRewardItem(tpl: string, value: number, index: number, preset?: any): IReward;
|
||||
debugLogRepeatableQuestIds(pmcData: IPmcData): void;
|
||||
protected probabilityObjectArray<K, V>(configArrayInput: ProbabilityObject<K, V>[]): ProbabilityObjectArray<K, V>;
|
||||
/**
|
||||
* Handle RepeatableQuestChange event
|
||||
*/
|
||||
changeRepeatableQuest(pmcData: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable)
|
||||
* @param repeatableQuestConfig config file
|
||||
* @returns a list of rewardable items [[_tpl, itemTemplate],...]
|
||||
*/
|
||||
protected getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig): [string, ITemplateItem][];
|
||||
/**
|
||||
* Checks if an id is a valid item. Valid meaning that it's an item that may be a reward
|
||||
* or content of bot loot. Items that are tested as valid may be in a player backpack or stash.
|
||||
* @param {string} tpl template id of item to check
|
||||
* @returns boolean: true if item is valid reward
|
||||
*/
|
||||
protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig): boolean;
|
||||
}
|
66
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/TradeController.d.ts
vendored
Normal file
66
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/TradeController.d.ts
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { TradeHelper } from "../helpers/TradeHelper";
|
||||
import { TraderHelper } from "../helpers/TraderHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Item, Upd } from "../models/eft/common/tables/IItem";
|
||||
import { ITraderBase } from "../models/eft/common/tables/ITrader";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData";
|
||||
import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData";
|
||||
import { ISellScavItemsToFenceRequestData } from "../models/eft/trade/ISellScavItemsToFenceRequestData";
|
||||
import { Traders } from "../models/enums/Traders";
|
||||
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
||||
import { ITraderConfig } from "../models/spt/config/ITraderConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { RagfairServer } from "../servers/RagfairServer";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { RagfairPriceService } from "../services/RagfairPriceService";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
declare class TradeController {
|
||||
protected logger: ILogger;
|
||||
protected eventOutputHolder: EventOutputHolder;
|
||||
protected tradeHelper: TradeHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected ragfairServer: RagfairServer;
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected localisationService: LocalisationService;
|
||||
protected ragfairPriceService: RagfairPriceService;
|
||||
protected configServer: ConfigServer;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
protected traderConfig: ITraderConfig;
|
||||
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, jsonUtil: JsonUtil, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer);
|
||||
/** Handle TradingConfirm event */
|
||||
confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle RagFairBuyOffer event */
|
||||
confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle SellAllFromSavage event */
|
||||
sellScavItemsToFence(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionId: string): IItemEventRouterResponse;
|
||||
/**
|
||||
* Sell all sellable items to a trader from inventory
|
||||
* WILL DELETE ITEMS FROM INVENTORY + CHILDREN OF ITEMS SOLD
|
||||
* @param sessionId Session id
|
||||
* @param profileWithItemsToSell Profile with items to be sold to trader
|
||||
* @param profileThatGetsMoney Profile that gets the money after selling items
|
||||
* @param trader Trader to sell items to
|
||||
* @returns IItemEventRouterResponse
|
||||
*/
|
||||
protected sellInventoryToTrader(sessionId: string, profileWithItemsToSell: IPmcData, profileThatGetsMoney: IPmcData, trader: Traders): IItemEventRouterResponse;
|
||||
/**
|
||||
* Looks up an items children and gets total handbook price for them
|
||||
* @param parentItemId parent item that has children we want to sum price of
|
||||
* @param items All items (parent + children)
|
||||
* @param handbookPrices Prices of items from handbook
|
||||
* @param traderDetails Trader being sold to to perform buy category check against
|
||||
* @returns Rouble price
|
||||
*/
|
||||
protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record<string, number>, traderDetails: ITraderBase): number;
|
||||
protected confirmTradingInternal(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse;
|
||||
}
|
||||
export { TradeController };
|
55
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/TraderController.d.ts
vendored
Normal file
55
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/TraderController.d.ts
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { TraderAssortHelper } from "../helpers/TraderAssortHelper";
|
||||
import { TraderHelper } from "../helpers/TraderHelper";
|
||||
import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { FenceService } from "../services/FenceService";
|
||||
import { TraderAssortService } from "../services/TraderAssortService";
|
||||
import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
export declare class TraderController {
|
||||
protected logger: ILogger;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected traderAssortHelper: TraderAssortHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected traderAssortService: TraderAssortService;
|
||||
protected traderPurchasePersisterService: TraderPurchasePersisterService;
|
||||
protected fenceService: FenceService;
|
||||
protected fenceBaseAssortGenerator: FenceBaseAssortGenerator;
|
||||
protected jsonUtil: JsonUtil;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil);
|
||||
/**
|
||||
* Runs when onLoad event is fired
|
||||
* Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService
|
||||
* Store timestamp of next assort refresh in nextResupply property of traders .base object
|
||||
*/
|
||||
load(): void;
|
||||
/**
|
||||
* Runs when onUpdate is fired
|
||||
* If current time is > nextResupply(expire) time of trader, refresh traders assorts and
|
||||
* Fence is handled slightly differently
|
||||
* @returns has run
|
||||
*/
|
||||
update(): boolean;
|
||||
/**
|
||||
* Handle client/trading/api/traderSettings
|
||||
* Return an array of all traders
|
||||
* @param sessionID Session id
|
||||
* @returns array if ITraderBase objects
|
||||
*/
|
||||
getAllTraders(sessionID: string): ITraderBase[];
|
||||
/**
|
||||
* Order traders by their traderId (Ttid)
|
||||
* @param traderA First trader to compare
|
||||
* @param traderB Second trader to compare
|
||||
* @returns 1,-1 or 0
|
||||
*/
|
||||
protected sortByTraderId(traderA: ITraderBase, traderB: ITraderBase): number;
|
||||
/** Handle client/trading/api/getTrader */
|
||||
getTrader(sessionID: string, traderID: string): ITraderBase;
|
||||
/** Handle client/trading/api/getTraderAssort */
|
||||
getAssort(sessionId: string, traderId: string): ITraderAssort;
|
||||
}
|
19
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/WeatherController.d.ts
vendored
Normal file
19
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/WeatherController.d.ts
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
import { WeatherGenerator } from "../generators/WeatherGenerator";
|
||||
import { IWeatherData } from "../models/eft/weather/IWeatherData";
|
||||
import { IWeatherConfig } from "../models/spt/config/IWeatherConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
export declare class WeatherController {
|
||||
protected weatherGenerator: WeatherGenerator;
|
||||
protected logger: ILogger;
|
||||
protected configServer: ConfigServer;
|
||||
protected weatherConfig: IWeatherConfig;
|
||||
constructor(weatherGenerator: WeatherGenerator, logger: ILogger, configServer: ConfigServer);
|
||||
/** Handle client/weather */
|
||||
generate(): IWeatherData;
|
||||
/**
|
||||
* Get the current in-raid time (MUST HAVE PLAYER LOGGED INTO CLIENT TO WORK)
|
||||
* @returns Date object
|
||||
*/
|
||||
getCurrentInRaidTime(): Date;
|
||||
}
|
12
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/WishlistController.d.ts
vendored
Normal file
12
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/WishlistController.d.ts
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
import { EventOutputHolder } from "../routers/EventOutputHolder";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData";
|
||||
export declare class WishlistController {
|
||||
protected eventOutputHolder: EventOutputHolder;
|
||||
constructor(eventOutputHolder: EventOutputHolder);
|
||||
/** Handle AddToWishList */
|
||||
addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse;
|
||||
/** Handle RemoveFromWishList event */
|
||||
removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse;
|
||||
}
|
18
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/di/Container.d.ts
vendored
Normal file
18
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/di/Container.d.ts
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
import { DependencyContainer } from "tsyringe";
|
||||
/**
|
||||
* Handle the registration of classes to be used by the Dependency Injection code
|
||||
*/
|
||||
export declare class Container {
|
||||
static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void;
|
||||
static registerTypes(depContainer: DependencyContainer): void;
|
||||
static registerListTypes(depContainer: DependencyContainer): void;
|
||||
private static registerUtils;
|
||||
private static registerRouters;
|
||||
private static registerGenerators;
|
||||
private static registerHelpers;
|
||||
private static registerLoaders;
|
||||
private static registerCallbacks;
|
||||
private static registerServices;
|
||||
private static registerServers;
|
||||
private static registerControllers;
|
||||
}
|
4
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/di/OnLoad.d.ts
vendored
Normal file
4
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/di/OnLoad.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
export interface OnLoad {
|
||||
onLoad(): Promise<void>;
|
||||
getRoute(): string;
|
||||
}
|
4
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/di/OnUpdate.d.ts
vendored
Normal file
4
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/di/OnUpdate.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
export interface OnUpdate {
|
||||
onUpdate(timeSinceLastRun: number): Promise<boolean>;
|
||||
getRoute(): string;
|
||||
}
|
40
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/di/Router.d.ts
vendored
Normal file
40
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/di/Router.d.ts
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
|
||||
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
|
||||
export declare class Router {
|
||||
protected handledRoutes: HandledRoute[];
|
||||
getTopLevelRoute(): string;
|
||||
protected getHandledRoutes(): HandledRoute[];
|
||||
protected getInternalHandledRoutes(): HandledRoute[];
|
||||
canHandle(url: string, partialMatch?: boolean): boolean;
|
||||
}
|
||||
export declare class StaticRouter extends Router {
|
||||
private routes;
|
||||
constructor(routes: RouteAction[]);
|
||||
handleStatic(url: string, info: any, sessionID: string, output: string): any;
|
||||
getHandledRoutes(): HandledRoute[];
|
||||
}
|
||||
export declare class DynamicRouter extends Router {
|
||||
private routes;
|
||||
constructor(routes: RouteAction[]);
|
||||
handleDynamic(url: string, info: any, sessionID: string, output: string): any;
|
||||
getHandledRoutes(): HandledRoute[];
|
||||
}
|
||||
export declare class ItemEventRouterDefinition extends Router {
|
||||
constructor();
|
||||
handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string): IItemEventRouterResponse;
|
||||
}
|
||||
export declare class SaveLoadRouter extends Router {
|
||||
constructor();
|
||||
handleLoad(profile: IAkiProfile): IAkiProfile;
|
||||
}
|
||||
export declare class HandledRoute {
|
||||
route: string;
|
||||
dynamic: boolean;
|
||||
constructor(route: string, dynamic: boolean);
|
||||
}
|
||||
export declare class RouteAction {
|
||||
url: string;
|
||||
action: (url: string, info: any, sessionID: string, output: string) => any;
|
||||
constructor(url: string, action: (url: string, info: any, sessionID: string, output: string) => any);
|
||||
}
|
6
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/di/Serializer.d.ts
vendored
Normal file
6
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/di/Serializer.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
/// <reference types="node" />
|
||||
import { IncomingMessage, ServerResponse } from "http";
|
||||
export declare class Serializer {
|
||||
serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void;
|
||||
canHandle(something: string): boolean;
|
||||
}
|
203
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotEquipmentModGenerator.d.ts
vendored
Normal file
203
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotEquipmentModGenerator.d.ts
vendored
Normal file
@ -0,0 +1,203 @@
|
||||
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 mod spawn chances to defined amount
|
||||
* @param modSpawnChances Chance dictionary to update
|
||||
*/
|
||||
protected adjustSlotSpawnChances(modSpawnChances: ModsChances, modSlotsToAdjust: string[], newChancePercent: number): void;
|
||||
protected modSlotCanHoldMuzzleDevices(modSlot: string, modsParentId: string): boolean;
|
||||
protected sortModKeys(unsortedKeys: string[]): string[];
|
||||
/**
|
||||
* Get a Slot property for an item (chamber/cartridge/slot)
|
||||
* @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
|
||||
* Controlled by bot.json weaponSightWhitelist
|
||||
* e.g. filter out rifle scopes from SMGs
|
||||
* @param weapon Weapon scopes will be added to
|
||||
* @param scopes Full scope pool
|
||||
* @param botWeaponSightWhitelist Whitelist of scope types by weapon base type
|
||||
* @returns Array of scope tpls that have been filtered to just ones allowed for that weapon type
|
||||
*/
|
||||
protected filterSightsByWeaponType(weapon: Item, scopes: string[], botWeaponSightWhitelist: Record<string, string[]>): string[];
|
||||
}
|
131
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotGenerator.d.ts
vendored
Normal file
131
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotGenerator.d.ts
vendored
Normal file
@ -0,0 +1,131 @@
|
||||
import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper";
|
||||
import { BotHelper } from "../helpers/BotHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
||||
import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "../models/eft/common/tables/IBotBase";
|
||||
import { Appearance, Health, IBotType } from "../models/eft/common/tables/IBotType";
|
||||
import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails";
|
||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
||||
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { SeasonalEventService } from "../services/SeasonalEventService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
import { BotInventoryGenerator } from "./BotInventoryGenerator";
|
||||
import { BotLevelGenerator } from "./BotLevelGenerator";
|
||||
export declare class BotGenerator {
|
||||
protected logger: ILogger;
|
||||
protected hashUtil: HashUtil;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected botInventoryGenerator: BotInventoryGenerator;
|
||||
protected botLevelGenerator: BotLevelGenerator;
|
||||
protected botEquipmentFilterService: BotEquipmentFilterService;
|
||||
protected weightedRandomHelper: WeightedRandomHelper;
|
||||
protected botHelper: BotHelper;
|
||||
protected botDifficultyHelper: BotDifficultyHelper;
|
||||
protected seasonalEventService: SeasonalEventService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
protected botConfig: IBotConfig;
|
||||
protected pmcConfig: IPmcConfig;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer);
|
||||
/**
|
||||
* Generate a player scav bot object
|
||||
* @param role e.g. assault / pmcbot
|
||||
* @param difficulty easy/normal/hard/impossible
|
||||
* @param botTemplate base bot template to use (e.g. assault/pmcbot)
|
||||
* @returns
|
||||
*/
|
||||
generatePlayerScav(sessionId: string, role: string, difficulty: string, botTemplate: IBotType): IBotBase;
|
||||
/**
|
||||
* Create x number of bots of the type/side/difficulty defined in botGenerationDetails
|
||||
* @param sessionId Session id
|
||||
* @param botGenerationDetails details on how to generate bots
|
||||
* @returns array of bots
|
||||
*/
|
||||
prepareAndGenerateBots(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase[];
|
||||
/**
|
||||
* Get a clone of the database\bots\base.json file
|
||||
* @returns IBotBase object
|
||||
*/
|
||||
protected getCloneOfBotBase(): 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;
|
||||
/**
|
||||
* Choose various appearance settings for a bot using weights
|
||||
* @param bot Bot to adjust
|
||||
* @param appearance Appearance settings to choose from
|
||||
* @param botGenerationDetails Generation details
|
||||
*/
|
||||
protected setBotAppearance(bot: IBotBase, appearance: Appearance, botGenerationDetails: BotGenerationDetails): void;
|
||||
/**
|
||||
* Create a bot nickname
|
||||
* @param botJsonTemplate x.json from database
|
||||
* @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, sessionId: string): string;
|
||||
/**
|
||||
* 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;
|
||||
/**
|
||||
* Converts health object to the required format
|
||||
* @param healthObj health object from bot json
|
||||
* @param playerScav Is a pscav bot being generated
|
||||
* @returns PmcHealth object
|
||||
*/
|
||||
protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth;
|
||||
/**
|
||||
* Get a bots skills with randomsied progress value between the min and max values
|
||||
* @param botSkills Skills that should have their progress value randomised
|
||||
* @returns
|
||||
*/
|
||||
protected generateSkills(botSkills: IBaseJsonSkills): botSkills;
|
||||
/**
|
||||
* Randomise the progress value of passed in skills based on the min/max value
|
||||
* @param skills Skills to randomise
|
||||
* @param isCommonSkills Are the skills 'common' skills
|
||||
* @returns Skills with randomised progress values as an array
|
||||
*/
|
||||
protected getSkillsWithRandomisedProgressValue(skills: Record<string, IBaseSkill>, isCommonSkills: boolean): IBaseSkill[];
|
||||
/**
|
||||
* Generate a random Id for a bot and apply to bots _id and aid value
|
||||
* @param bot bot to update
|
||||
* @returns updated IBotBase object
|
||||
*/
|
||||
protected generateId(bot: IBotBase): IBotBase;
|
||||
protected generateInventoryID(profile: IBotBase): IBotBase;
|
||||
/**
|
||||
* 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
|
||||
* @param bot bot to add dogtag to
|
||||
* @returns Bot with dogtag added
|
||||
*/
|
||||
protected generateDogtag(bot: IBotBase): IBotBase;
|
||||
}
|
114
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotInventoryGenerator.d.ts
vendored
Normal file
114
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotInventoryGenerator.d.ts
vendored
Normal file
@ -0,0 +1,114 @@
|
||||
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
|
||||
import { BotHelper } from "../helpers/BotHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
||||
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
|
||||
import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType";
|
||||
import { EquipmentSlots } from "../models/enums/EquipmentSlots";
|
||||
import { EquipmentFilterDetails, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { BotEquipmentModGenerator } from "./BotEquipmentModGenerator";
|
||||
import { BotLootGenerator } from "./BotLootGenerator";
|
||||
import { BotWeaponGenerator } from "./BotWeaponGenerator";
|
||||
export declare class BotInventoryGenerator {
|
||||
protected logger: ILogger;
|
||||
protected hashUtil: HashUtil;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected botWeaponGenerator: BotWeaponGenerator;
|
||||
protected botLootGenerator: BotLootGenerator;
|
||||
protected botGeneratorHelper: BotGeneratorHelper;
|
||||
protected botHelper: BotHelper;
|
||||
protected weightedRandomHelper: WeightedRandomHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected localisationService: LocalisationService;
|
||||
protected botEquipmentModPoolService: BotEquipmentModPoolService;
|
||||
protected botEquipmentModGenerator: BotEquipmentModGenerator;
|
||||
protected configServer: ConfigServer;
|
||||
protected botConfig: IBotConfig;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer);
|
||||
/**
|
||||
* Add equipment/weapons/loot to bot
|
||||
* @param sessionId Session id
|
||||
* @param botJsonTemplate Base json db file for the bot having its loot generated
|
||||
* @param botRole Role bot has (assault/pmcBot)
|
||||
* @param isPmc Is bot being converted into a pmc
|
||||
* @param botLevel Level of bot being generated
|
||||
* @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;
|
||||
/**
|
||||
* 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 itemGenerationWeights
|
||||
*/
|
||||
protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: {
|
||||
slot: EquipmentSlots;
|
||||
shouldSpawn: boolean;
|
||||
}, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationWeights: Generation, botLevel: number): void;
|
||||
}
|
29
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotLevelGenerator.d.ts
vendored
Normal file
29
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotLevelGenerator.d.ts
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
import { MinMax } from "../models/common/MinMax";
|
||||
import { IRandomisedBotLevelResult } from "../models/eft/bot/IRandomisedBotLevelResult";
|
||||
import { IExpTable } from "../models/eft/common/IGlobals";
|
||||
import { IBotBase } from "../models/eft/common/tables/IBotBase";
|
||||
import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
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: IExpTable[]): number;
|
||||
}
|
150
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotLootGenerator.d.ts
vendored
Normal file
150
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotLootGenerator.d.ts
vendored
Normal file
@ -0,0 +1,150 @@
|
||||
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
|
||||
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
|
||||
import { HandbookHelper } from "../helpers/HandbookHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
||||
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
|
||||
import { IBotType, Inventory, ModsChances } from "../models/eft/common/tables/IBotType";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { EquipmentSlots } from "../models/enums/EquipmentSlots";
|
||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
||||
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { BotLootCacheService } from "../services/BotLootCacheService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { BotWeaponGenerator } from "./BotWeaponGenerator";
|
||||
export declare class BotLootGenerator {
|
||||
protected logger: ILogger;
|
||||
protected hashUtil: HashUtil;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected handbookHelper: HandbookHelper;
|
||||
protected botGeneratorHelper: BotGeneratorHelper;
|
||||
protected botWeaponGenerator: BotWeaponGenerator;
|
||||
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
|
||||
protected weightedRandomHelper: WeightedRandomHelper;
|
||||
protected botLootCacheService: BotLootCacheService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
protected botConfig: IBotConfig;
|
||||
protected pmcConfig: IPmcConfig;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, weightedRandomHelper: WeightedRandomHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer);
|
||||
/**
|
||||
* Add loot to bots containers
|
||||
* @param sessionId Session id
|
||||
* @param botJsonTemplate Base json db file for the bot having its loot generated
|
||||
* @param isPmc Will bot be a pmc
|
||||
* @param botRole Role of bot, e.g. asssult
|
||||
* @param botInventory Inventory to add loot to
|
||||
* @param botLevel Level of bot
|
||||
*/
|
||||
generateLoot(sessionId: string, botJsonTemplate: IBotType, isPmc: boolean, botRole: string, botInventory: PmcInventory, botLevel: number): void;
|
||||
/**
|
||||
* Get an array of the containers a bot has on them (pockets/backpack/vest)
|
||||
* @param botInventory Bot to check
|
||||
* @returns Array of available slots
|
||||
*/
|
||||
protected getAvailableContainersBotCanStoreItemsIn(botInventory: PmcInventory): EquipmentSlots[];
|
||||
/**
|
||||
* Force healing items onto bot to ensure they can heal in-raid
|
||||
* @param botInventory Inventory to add items to
|
||||
* @param botRole Role of bot (sptBear/sptUsec)
|
||||
*/
|
||||
protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void;
|
||||
/**
|
||||
* Get a biased random number
|
||||
* @param min Smallest size
|
||||
* @param max Biggest size
|
||||
* @param nValue Value to bias choice
|
||||
* @returns Chosen number
|
||||
*/
|
||||
protected getRandomisedCount(min: number, max: number, nValue: number): number;
|
||||
/**
|
||||
* Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached
|
||||
* @param pool Pool of items to pick from
|
||||
* @param equipmentSlots What equipment slot will the loot items be added to
|
||||
* @param totalItemCount Max count of items to add
|
||||
* @param inventoryToAddItemsTo Bot inventory loot will be added to
|
||||
* @param botRole Role of the bot loot is being generated for (assault/pmcbot)
|
||||
* @param useLimits Should item limit counts be used as defined in config/bot.json
|
||||
* @param totalValueLimitRub Total value of loot allowed in roubles
|
||||
* @param isPmc Is bot being generated for a pmc
|
||||
*/
|
||||
protected addLootFromPool(pool: ITemplateItem[], equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, useLimits?: boolean, totalValueLimitRub?: number, isPmc?: boolean): void;
|
||||
/**
|
||||
* Add generated weapons to inventory as loot
|
||||
* @param botInventory inventory to add preset to
|
||||
* @param equipmentSlot slot to place the preset in (backpack)
|
||||
* @param templateInventory bots template, assault.json
|
||||
* @param modChances chances for mods to spawn on weapon
|
||||
* @param botRole bots role, .e.g. pmcBot
|
||||
* @param isPmc are we generating for a pmc
|
||||
*/
|
||||
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void;
|
||||
/**
|
||||
* Get a random item from the pool parameter using the biasedRandomNumber system
|
||||
* @param pool Pool of items to pick an item from
|
||||
* @param isPmc Is the bot being created a pmc
|
||||
* @returns ITemplateItem object
|
||||
*/
|
||||
protected getRandomItemFromPoolByRole(pool: ITemplateItem[], botRole: string): ITemplateItem;
|
||||
/**
|
||||
* Get the loot nvalue from botconfig
|
||||
* @param botRole Role of bot e.g. assault/bosstagilla/sptBear
|
||||
* @returns nvalue as number
|
||||
*/
|
||||
protected getBotLootNValueByRole(botRole: string): number;
|
||||
/**
|
||||
* Hydrate item limit array to contain items that have a limit for a specific bot type
|
||||
* All values are set to 0
|
||||
* @param isPmc Is the bot a pmc
|
||||
* @param botRole Role the bot has
|
||||
* @param limitCount
|
||||
*/
|
||||
protected initItemLimitArray(isPmc: boolean, botRole: string, limitCount: Record<string, number>): void;
|
||||
/**
|
||||
* Check if an item has reached its bot-specific spawn limit
|
||||
* @param itemTemplate Item we check to see if its reached spawn limit
|
||||
* @param botRole Bot type
|
||||
* @param isPmc Is bot we're working with a pmc
|
||||
* @param limitCount Spawn limits for items on bot
|
||||
* @param itemSpawnLimits The limits this bot is allowed to have
|
||||
* @returns true if item has reached spawn limit
|
||||
*/
|
||||
protected itemHasReachedSpawnLimit(itemTemplate: ITemplateItem, botRole: string, isPmc: boolean, limitCount: Record<string, number>, itemSpawnLimits: Record<string, number>): boolean;
|
||||
/**
|
||||
* Randomise the stack size of a money object, uses different values for pmc or scavs
|
||||
* @param isPmc is this a PMC
|
||||
* @param itemTemplate item details
|
||||
* @param moneyItem Money stack to randomise
|
||||
*/
|
||||
protected randomiseMoneyStackSize(isPmc: boolean, itemTemplate: ITemplateItem, moneyItem: Item): void;
|
||||
/**
|
||||
* Randomise the size of an ammo stack
|
||||
* @param isPmc is this a PMC
|
||||
* @param itemTemplate item details
|
||||
* @param ammoItem Ammo stack to randomise
|
||||
*/
|
||||
protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void;
|
||||
/**
|
||||
* Get spawn limits for a specific bot type from bot.json config
|
||||
* If no limit found for a non pmc bot, fall back to defaults
|
||||
* @param isPmc is the bot we want limits for a pmc
|
||||
* @param botRole what role does the bot have
|
||||
* @returns Dictionary of tplIds and limit
|
||||
*/
|
||||
protected getItemSpawnLimitsForBotType(isPmc: boolean, botRole: string): Record<string, number>;
|
||||
/**
|
||||
* Get the parentId or tplId of item inside spawnLimits object if it exists
|
||||
* @param itemTemplate item we want to look for in spawn limits
|
||||
* @param spawnLimits Limits to check for item
|
||||
* @returns id as string, otherwise undefined
|
||||
*/
|
||||
protected getMatchingIdFromSpawnLimits(itemTemplate: ITemplateItem, spawnLimits: Record<string, number>): string;
|
||||
}
|
183
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotWeaponGenerator.d.ts
vendored
Normal file
183
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotWeaponGenerator.d.ts
vendored
Normal file
@ -0,0 +1,183 @@
|
||||
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
|
||||
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
||||
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
|
||||
import { GenerationData, Inventory, ModsChances } from "../models/eft/common/tables/IBotType";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { GenerateWeaponResult } from "../models/spt/bots/GenerateWeaponResult";
|
||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
||||
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
|
||||
import { IRepairConfig } from "../models/spt/config/IRepairConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { RepairService } from "../services/RepairService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { BotEquipmentModGenerator } from "./BotEquipmentModGenerator";
|
||||
import { IInventoryMagGen } from "./weapongen/IInventoryMagGen";
|
||||
export declare class BotWeaponGenerator {
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected logger: ILogger;
|
||||
protected hashUtil: HashUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected weightedRandomHelper: WeightedRandomHelper;
|
||||
protected botGeneratorHelper: BotGeneratorHelper;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected configServer: ConfigServer;
|
||||
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
|
||||
protected botWeaponModLimitService: BotWeaponModLimitService;
|
||||
protected botEquipmentModGenerator: BotEquipmentModGenerator;
|
||||
protected localisationService: LocalisationService;
|
||||
protected repairService: RepairService;
|
||||
protected inventoryMagGenComponents: IInventoryMagGen[];
|
||||
protected readonly modMagazineSlotId = "mod_magazine";
|
||||
protected botConfig: IBotConfig;
|
||||
protected pmcConfig: IPmcConfig;
|
||||
protected repairConfig: IRepairConfig;
|
||||
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, repairService: RepairService, inventoryMagGenComponents: IInventoryMagGen[]);
|
||||
/**
|
||||
* Pick a random weapon based on weightings and generate a functional weapon
|
||||
* @param equipmentSlot Primary/secondary/holster
|
||||
* @param botTemplateInventory e.g. assault.json
|
||||
* @param weaponParentId
|
||||
* @param modChances
|
||||
* @param botRole role of bot, e.g. assault/followerBully
|
||||
* @param isPmc Is weapon generated for a pmc
|
||||
* @returns GenerateWeaponResult object
|
||||
*/
|
||||
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
|
||||
* @param equipmentSlot Primary/secondary/holster
|
||||
* @param botTemplateInventory e.g. assault.json
|
||||
* @returns weapon tpl
|
||||
*/
|
||||
pickWeightedWeaponTplFromPool(equipmentSlot: string, botTemplateInventory: Inventory): string;
|
||||
/**
|
||||
* Generated a weapon based on the supplied weapon tpl
|
||||
* @param weaponTpl weapon tpl to generate (use pickWeightedWeaponTplFromPool())
|
||||
* @param equipmentSlot slot to fit into, primary/secondary/holster
|
||||
* @param botTemplateInventory e.g. assault.json
|
||||
* @param weaponParentId ParentId of the weapon being generated
|
||||
* @param modChances Dictionary of item types and % chance weapon will have that mod
|
||||
* @param botRole e.g. assault/exusec
|
||||
* @param isPmc Is weapon being generated for a pmc
|
||||
* @returns GenerateWeaponResult object
|
||||
*/
|
||||
generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult;
|
||||
/**
|
||||
* Insert a cartridge into a weapon
|
||||
* @param weaponWithModsArray Weapon and mods
|
||||
* @param ammoTpl Cartridge to add to weapon
|
||||
* @param desiredSlotId name of slot, e.g. patron_in_weapon
|
||||
*/
|
||||
protected addCartridgeToChamber(weaponWithModsArray: Item[], ammoTpl: string, desiredSlotId: string): void;
|
||||
/**
|
||||
* Create array with weapon base as only element and
|
||||
* add additional properties based on weapon type
|
||||
* @param weaponTpl Weapon tpl to create item with
|
||||
* @param weaponParentId Weapons parent id
|
||||
* @param equipmentSlot e.g. primary/secondary/holster
|
||||
* @param weaponItemTemplate db template for weapon
|
||||
* @param botRole for durability values
|
||||
* @returns Base weapon item in array
|
||||
*/
|
||||
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
|
||||
* @param weaponTpl weapon to find preset for
|
||||
* @param equipmentSlot the slot the weapon will be placed in
|
||||
* @param weaponParentId Value used for the parentid
|
||||
* @returns array of weapon mods
|
||||
*/
|
||||
protected getPresetWeaponMods(weaponTpl: string, equipmentSlot: string, weaponParentId: string, itemTemplate: ITemplateItem, botRole: string): Item[];
|
||||
/**
|
||||
* Checks if all required slots are occupied on a weapon and all it's mods
|
||||
* @param weaponItemArray Weapon + mods
|
||||
* @param botRole role of bot weapon is for
|
||||
* @returns true if valid
|
||||
*/
|
||||
protected isWeaponValid(weaponItemArray: Item[], botRole: string): boolean;
|
||||
/**
|
||||
* Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets.
|
||||
* Additionally, adds extra bullets to SecuredContainer
|
||||
* @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl)
|
||||
* @param magWeights Magazine weights for count to add to inventory
|
||||
* @param inventory Inventory to add magazines to
|
||||
* @param botRole The bot type we're getting generating extra mags for
|
||||
*/
|
||||
addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magWeights: GenerationData, inventory: PmcInventory, botRole: string): void;
|
||||
/**
|
||||
* Add Grendaes for UBGL to bots vest and secure container
|
||||
* @param weaponMods Weapon array with mods
|
||||
* @param generatedWeaponResult result of weapon generation
|
||||
* @param inventory bot inventory to add grenades to
|
||||
*/
|
||||
protected addUbglGrenadesToBotInventory(weaponMods: Item[], generatedWeaponResult: GenerateWeaponResult, inventory: PmcInventory): void;
|
||||
/**
|
||||
* Add ammo to the secure container
|
||||
* @param stackCount How many stacks of ammo to add
|
||||
* @param ammoTpl Ammo type to add
|
||||
* @param stackSize Size of the ammo stack to add
|
||||
* @param inventory Player inventory
|
||||
*/
|
||||
protected addAmmoToSecureContainer(stackCount: number, ammoTpl: string, stackSize: number, inventory: PmcInventory): void;
|
||||
/**
|
||||
* Get a weapons magazine tpl from a weapon template
|
||||
* @param weaponMods mods from a weapon template
|
||||
* @param weaponTemplate Weapon to get magazine tpl for
|
||||
* @param botRole the bot type we are getting the magazine for
|
||||
* @returns magazine tpl string
|
||||
*/
|
||||
protected getMagazineTplFromWeaponTemplate(weaponMods: Item[], weaponTemplate: ITemplateItem, botRole: string): string;
|
||||
/**
|
||||
* 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 weaponTemplate the weapon we want to pick ammo for
|
||||
* @returns an ammo tpl that works with the desired gun
|
||||
*/
|
||||
protected getWeightedCompatibleAmmo(ammo: Record<string, Record<string, number>>, weaponTemplate: ITemplateItem): string;
|
||||
/**
|
||||
* Get a weapons compatible cartridge caliber
|
||||
* @param weaponTemplate Weapon to look up caliber of
|
||||
* @returns caliber as string
|
||||
*/
|
||||
protected getWeaponCaliber(weaponTemplate: ITemplateItem): string;
|
||||
/**
|
||||
* Fill existing magazines to full, while replacing their contents with specified ammo
|
||||
* @param weaponMods Weapon with children
|
||||
* @param magazine Magazine item
|
||||
* @param cartridgeTpl Cartridge to insert into magazine
|
||||
*/
|
||||
protected fillExistingMagazines(weaponMods: Item[], magazine: Item, cartridgeTpl: string): void;
|
||||
/**
|
||||
* Add desired ammo tpl as item to weaponmods array, placed as child to UBGL
|
||||
* @param weaponMods Weapon with children
|
||||
* @param ubglMod UBGL item
|
||||
* @param ubglAmmoTpl Grenade ammo tpl
|
||||
*/
|
||||
protected fillUbgl(weaponMods: Item[], ubglMod: Item, ubglAmmoTpl: string): void;
|
||||
/**
|
||||
* Add cartridge item to weapon Item array, if it already exists, update
|
||||
* @param weaponWithMods Weapon items array to amend
|
||||
* @param magazine magazine item details we're adding cartridges to
|
||||
* @param chosenAmmoTpl cartridge to put into the magazine
|
||||
* @param newStackSize how many cartridges should go into the magazine
|
||||
* @param magazineTemplate magazines db template
|
||||
*/
|
||||
protected addOrUpdateMagazinesChildWithAmmo(weaponWithMods: Item[], magazine: Item, chosenAmmoTpl: string, magazineTemplate: ITemplateItem): void;
|
||||
/**
|
||||
* Fill each Camora with a bullet
|
||||
* @param weaponMods Weapon mods to find and update camora mod(s) from
|
||||
* @param magazineId magazine id to find and add to
|
||||
* @param ammoTpl ammo template id to hydate with
|
||||
*/
|
||||
protected fillCamorasWithAmmo(weaponMods: Item[], magazineId: string, ammoTpl: string): void;
|
||||
}
|
30
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/FenceBaseAssortGenerator.d.ts
vendored
Normal file
30
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/FenceBaseAssortGenerator.d.ts
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
import { HandbookHelper } from "../helpers/HandbookHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { ITraderConfig } from "../models/spt/config/ITraderConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { ItemFilterService } from "../services/ItemFilterService";
|
||||
import { SeasonalEventService } from "../services/SeasonalEventService";
|
||||
export declare class FenceBaseAssortGenerator {
|
||||
protected logger: ILogger;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected handbookHelper: HandbookHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected itemFilterService: ItemFilterService;
|
||||
protected seasonalEventService: SeasonalEventService;
|
||||
protected configServer: ConfigServer;
|
||||
protected traderConfig: ITraderConfig;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, 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;
|
||||
}
|
151
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/LocationGenerator.d.ts
vendored
Normal file
151
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/LocationGenerator.d.ts
vendored
Normal file
@ -0,0 +1,151 @@
|
||||
import { ContainerHelper } from "../helpers/ContainerHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { PresetHelper } from "../helpers/PresetHelper";
|
||||
import { RagfairServerHelper } from "../helpers/RagfairServerHelper";
|
||||
import { IContainerMinMax, IStaticContainer } from "../models/eft/common/ILocation";
|
||||
import { ILocationBase } from "../models/eft/common/ILocationBase";
|
||||
import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "../models/eft/common/ILooseLoot";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { IStaticAmmoDetails, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "../models/eft/common/tables/ILootBase";
|
||||
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { SeasonalEventService } from "../services/SeasonalEventService";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { MathUtil } from "../utils/MathUtil";
|
||||
import { ObjectId } from "../utils/ObjectId";
|
||||
import { ProbabilityObjectArray, RandomUtil } from "../utils/RandomUtil";
|
||||
export interface IContainerItem {
|
||||
items: Item[];
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
export interface IContainerGroupCount {
|
||||
/** Containers this group has + probabilty to spawn */
|
||||
containerIdsWithProbability: Record<string, number>;
|
||||
/** How many containers the map should spawn with this group id */
|
||||
chosenCount: number;
|
||||
}
|
||||
export declare class LocationGenerator {
|
||||
protected logger: ILogger;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected objectId: ObjectId;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected ragfairServerHelper: RagfairServerHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected mathUtil: MathUtil;
|
||||
protected seasonalEventService: SeasonalEventService;
|
||||
protected containerHelper: ContainerHelper;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected localisationService: LocalisationService;
|
||||
protected configServer: ConfigServer;
|
||||
protected locationConfig: ILocationConfig;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer);
|
||||
/**
|
||||
* Create an array of container objects with randomised loot
|
||||
* @param locationBase Map base to generate containers for
|
||||
* @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo
|
||||
* @returns Array of container objects
|
||||
*/
|
||||
generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record<string, IStaticAmmoDetails[]>): SpawnpointTemplate[];
|
||||
/**
|
||||
* Get containers with a non-100% chance to spawn OR are NOT on the container type randomistion blacklist
|
||||
* @param staticContainers
|
||||
* @returns IStaticContainerData array
|
||||
*/
|
||||
protected getRandomisableContainersOnMap(staticContainers: IStaticContainerData[]): IStaticContainerData[];
|
||||
/**
|
||||
* Get containers with 100% spawn rate or have a type on the randomistion ignore list
|
||||
* @param staticContainersOnMap
|
||||
* @returns IStaticContainerData array
|
||||
*/
|
||||
protected getGuaranteedContainers(staticContainersOnMap: IStaticContainerData[]): IStaticContainerData[];
|
||||
/**
|
||||
* Choose a number of containers based on their probabilty value to fulfil the desired count in containerData.chosenCount
|
||||
* @param groupId Name of the group the containers are being collected for
|
||||
* @param containerData Containers and probability values for a groupId
|
||||
* @returns List of chosen container Ids
|
||||
*/
|
||||
protected getContainersByProbabilty(groupId: string, containerData: IContainerGroupCount): string[];
|
||||
/**
|
||||
* Get a mapping of each groupid and the containers in that group + count of containers to spawn on map
|
||||
* @param containersGroups Container group values
|
||||
* @returns dictionary keyed by groupId
|
||||
*/
|
||||
protected getGroupIdToContainerMappings(staticContainerGroupData: IStaticContainer | Record<string, IContainerMinMax>, staticContainersOnMap: IStaticContainerData[]): Record<string, IContainerGroupCount>;
|
||||
/**
|
||||
* Choose loot to put into a static container based on weighting
|
||||
* Handle forced items + seasonal item removal when not in season
|
||||
* @param staticContainer The container itself we will add loot to
|
||||
* @param staticForced Loot we need to force into the container
|
||||
* @param staticLootDist staticLoot.json
|
||||
* @param staticAmmoDist staticAmmo.json
|
||||
* @param locationName Name of the map to generate static loot for
|
||||
* @returns IStaticContainerProps
|
||||
*/
|
||||
protected addLootToContainer(staticContainer: IStaticContainerData, staticForced: IStaticForcedProps[], staticLootDist: Record<string, IStaticLootDetails>, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): IStaticContainerData;
|
||||
/**
|
||||
* Get a 2d grid of a containers item slots
|
||||
* @param containerTpl Tpl id of the container
|
||||
* @returns number[][]
|
||||
*/
|
||||
protected getContainerMapping(containerTpl: string): number[][];
|
||||
/**
|
||||
* Look up a containers itemcountDistribution data and choose an item count based on the found weights
|
||||
* @param containerTypeId Container to get item count for
|
||||
* @param staticLootDist staticLoot.json
|
||||
* @param locationName Map name (to get per-map multiplier for from config)
|
||||
* @returns item count
|
||||
*/
|
||||
protected getWeightedCountOfContainerItems(containerTypeId: string, staticLootDist: Record<string, IStaticLootDetails>, locationName: string): number;
|
||||
/**
|
||||
* Get all possible loot items that can be placed into a container
|
||||
* Do not add seasonal items if found + current date is inside seasonal event
|
||||
* @param containerTypeId Contianer to get possible loot for
|
||||
* @param staticLootDist staticLoot.json
|
||||
* @returns ProbabilityObjectArray of item tpls + probabilty
|
||||
*/
|
||||
protected getPossibleLootItemsForContainer(containerTypeId: string, staticLootDist: Record<string, IStaticLootDetails>): ProbabilityObjectArray<string, number>;
|
||||
protected getLooseLootMultiplerForLocation(location: string): number;
|
||||
protected getStaticLootMultiplerForLocation(location: string): number;
|
||||
/**
|
||||
* Create array of loose + forced loot using probability system
|
||||
* @param dynamicLootDist
|
||||
* @param staticAmmoDist
|
||||
* @param locationName Location to generate loot for
|
||||
* @returns Array of spawn points with loot in them
|
||||
*/
|
||||
generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): SpawnpointTemplate[];
|
||||
/**
|
||||
* Add forced spawn point loot into loot parameter array
|
||||
* @param loot array to add forced loot to
|
||||
* @param forcedSpawnPoints forced loot to add
|
||||
* @param name of map currently generating forced loot for
|
||||
*/
|
||||
protected addForcedLoot(loot: SpawnpointTemplate[], forcedSpawnPoints: SpawnpointsForced[], locationName: string): void;
|
||||
/**
|
||||
* Create array of item (with child items) and return
|
||||
* @param chosenComposedKey Key we want to look up items for
|
||||
* @param spawnPoint Dynamic spawn point item we want will be placed in
|
||||
* @param staticAmmoDist ammo distributions
|
||||
* @returns IContainerItem
|
||||
*/
|
||||
protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint, staticAmmoDist: Record<string, IStaticAmmoDetails[]>): IContainerItem;
|
||||
/**
|
||||
* Replace the _id value for base item + all children items parentid value
|
||||
* @param itemWithChildren Item with mods to update
|
||||
* @param newId new id to add on chidren of base item
|
||||
*/
|
||||
protected reparentItemAndChildren(itemWithChildren: Item[], newId?: string): void;
|
||||
/**
|
||||
* Find an item in array by its _tpl, handle differently if chosenTpl is a weapon
|
||||
* @param items Items array to search
|
||||
* @param chosenTpl Tpl we want to get item with
|
||||
* @returns Item object
|
||||
*/
|
||||
protected getItemInArray(items: Item[], chosenTpl: string): Item;
|
||||
protected createStaticLootItem(tpl: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, parentId?: string): IContainerItem;
|
||||
}
|
113
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/LootGenerator.d.ts
vendored
Normal file
113
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/LootGenerator.d.ts
vendored
Normal file
@ -0,0 +1,113 @@
|
||||
import { InventoryHelper } from "../helpers/InventoryHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { PresetHelper } from "../helpers/PresetHelper";
|
||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
||||
import { IPreset } from "../models/eft/common/IGlobals";
|
||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { AddItem } from "../models/eft/inventory/IAddItemRequestData";
|
||||
import { ISealedAirdropContainerSettings, RewardDetails } from "../models/spt/config/IInventoryConfig";
|
||||
import { LootItem } from "../models/spt/services/LootItem";
|
||||
import { LootRequest } from "../models/spt/services/LootRequest";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { ItemFilterService } from "../services/ItemFilterService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { RagfairLinkedItemService } from "../services/RagfairLinkedItemService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
type ItemLimit = {
|
||||
current: number;
|
||||
max: number;
|
||||
};
|
||||
export declare class LootGenerator {
|
||||
protected logger: ILogger;
|
||||
protected hashUtil: HashUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected inventoryHelper: InventoryHelper;
|
||||
protected weightedRandomHelper: WeightedRandomHelper;
|
||||
protected localisationService: LocalisationService;
|
||||
protected ragfairLinkedItemService: RagfairLinkedItemService;
|
||||
protected itemFilterService: ItemFilterService;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, ragfairLinkedItemService: RagfairLinkedItemService, itemFilterService: ItemFilterService);
|
||||
/**
|
||||
* Generate a list of items based on configuration options parameter
|
||||
* @param options parameters to adjust how loot is generated
|
||||
* @returns An array of loot items
|
||||
*/
|
||||
createRandomLoot(options: LootRequest): LootItem[];
|
||||
/**
|
||||
* Construct item limit record to hold max and current item count for each item type
|
||||
* @param limits limits as defined in config
|
||||
* @returns record, key: item tplId, value: current/max item count allowed
|
||||
*/
|
||||
protected initItemLimitCounter(limits: Record<string, number>): Record<string, ItemLimit>;
|
||||
/**
|
||||
* Find a random item in items.json and add to result array
|
||||
* @param items items to choose from
|
||||
* @param itemTypeCounts item limit counts
|
||||
* @param options item filters
|
||||
* @param result array to add found item to
|
||||
* @returns true if item was valid and added to pool
|
||||
*/
|
||||
protected findAndAddRandomItemToLoot(items: [string, ITemplateItem][], itemTypeCounts: Record<string, {
|
||||
current: number;
|
||||
max: number;
|
||||
}>, 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
|
||||
* @param globalDefaultPresets presets to choose from
|
||||
* @param itemTypeCounts item limit counts
|
||||
* @param itemBlacklist items to skip
|
||||
* @param result array to add found preset to
|
||||
* @returns true if preset was valid and added to pool
|
||||
*/
|
||||
protected findAndAddRandomPresetToLoot(globalDefaultPresets: [string, IPreset][], itemTypeCounts: Record<string, {
|
||||
current: number;
|
||||
max: number;
|
||||
}>, itemBlacklist: string[], result: LootItem[]): boolean;
|
||||
/**
|
||||
* Sealed weapon containers have a weapon + associated mods inside them + assortment of other things (food/meds)
|
||||
* @param containerSettings sealed weapon container settings
|
||||
* @returns Array of items to add to player inventory
|
||||
*/
|
||||
getSealedWeaponCaseLoot(containerSettings: ISealedAirdropContainerSettings): AddItem[];
|
||||
/**
|
||||
* Get non-weapon mod rewards for a sealed container
|
||||
* @param containerSettings Sealed weapon container settings
|
||||
* @param weaponDetailsDb Details for the weapon to reward player
|
||||
* @returns AddItem array
|
||||
*/
|
||||
protected getSealedContainerNonWeaponModRewards(containerSettings: ISealedAirdropContainerSettings, weaponDetailsDb: ITemplateItem): AddItem[];
|
||||
/**
|
||||
* Iterate over the container weaponModRewardLimits settings and create an array of weapon mods to reward player
|
||||
* @param containerSettings Sealed weapon container settings
|
||||
* @param linkedItemsToWeapon All items that can be attached/inserted into weapon
|
||||
* @param chosenWeaponPreset The weapon preset given to player as reward
|
||||
* @returns AddItem array
|
||||
*/
|
||||
protected getSealedContainerWeaponModRewards(containerSettings: ISealedAirdropContainerSettings, linkedItemsToWeapon: ITemplateItem[], chosenWeaponPreset: IPreset): AddItem[];
|
||||
/**
|
||||
* Handle event-related loot containers - currently just the halloween jack-o-lanterns that give food rewards
|
||||
* @param rewardContainerDetails
|
||||
* @returns AddItem array
|
||||
*/
|
||||
getRandomLootContainerLoot(rewardContainerDetails: RewardDetails): AddItem[];
|
||||
/**
|
||||
* A bug in inventoryHelper.addItem() means you cannot add the same item to the array twice with a count of 1, it causes duplication
|
||||
* Default adds 1, or increments count
|
||||
* @param itemTplToAdd items tpl we want to add to array
|
||||
* @param resultsArray Array to add item tpl to
|
||||
*/
|
||||
protected addOrIncrementItemToArray(itemTplToAdd: string, resultsArray: AddItem[]): void;
|
||||
}
|
||||
export {};
|
45
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/PMCLootGenerator.d.ts
vendored
Normal file
45
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/PMCLootGenerator.d.ts
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { IPmcConfig } from "../models/spt/config/IPmcConfig";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { ItemFilterService } from "../services/ItemFilterService";
|
||||
import { SeasonalEventService } from "../services/SeasonalEventService";
|
||||
/**
|
||||
* Handle the generation of dynamic PMC loot in pockets and backpacks
|
||||
* and the removal of blacklisted items
|
||||
*/
|
||||
export declare class PMCLootGenerator {
|
||||
protected itemHelper: ItemHelper;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected configServer: ConfigServer;
|
||||
protected itemFilterService: ItemFilterService;
|
||||
protected seasonalEventService: SeasonalEventService;
|
||||
protected pocketLootPool: string[];
|
||||
protected vestLootPool: string[];
|
||||
protected backpackLootPool: string[];
|
||||
protected pmcConfig: IPmcConfig;
|
||||
constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService);
|
||||
/**
|
||||
* Create an array of loot items a PMC can have in their pockets
|
||||
* @returns string array of tpls
|
||||
*/
|
||||
generatePMCPocketLootPool(): string[];
|
||||
/**
|
||||
* Create an array of loot items a PMC can have in their vests
|
||||
* @returns string array of tpls
|
||||
*/
|
||||
generatePMCVestLootPool(): string[];
|
||||
/**
|
||||
* Check if item has a width/height that lets it fit into a 2x2 slot
|
||||
* 1x1 / 1x2 / 2x1 / 2x2
|
||||
* @param item Item to check size of
|
||||
* @returns true if it fits
|
||||
*/
|
||||
protected itemFitsInto2By2Slot(item: ITemplateItem): boolean;
|
||||
/**
|
||||
* Create an array of loot items a PMC can have in their backpack
|
||||
* @returns string array of tpls
|
||||
*/
|
||||
generatePMCBackpackLootPool(): string[];
|
||||
}
|
79
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/PlayerScavGenerator.d.ts
vendored
Normal file
79
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/PlayerScavGenerator.d.ts
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
|
||||
import { BotHelper } from "../helpers/BotHelper";
|
||||
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Skills, Stats } from "../models/eft/common/tables/IBotBase";
|
||||
import { IBotType } from "../models/eft/common/tables/IBotType";
|
||||
import { IPlayerScavConfig, KarmaLevel } from "../models/spt/config/IPlayerScavConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { BotLootCacheService } from "../services/BotLootCacheService";
|
||||
import { FenceService } from "../services/FenceService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { BotGenerator } from "./BotGenerator";
|
||||
export declare class PlayerScavGenerator {
|
||||
protected logger: ILogger;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected hashUtil: HashUtil;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
|
||||
protected botGeneratorHelper: BotGeneratorHelper;
|
||||
protected saveServer: SaveServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected botHelper: BotHelper;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected fenceService: FenceService;
|
||||
protected botLootCacheService: BotLootCacheService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected botGenerator: BotGenerator;
|
||||
protected configServer: ConfigServer;
|
||||
protected playerScavConfig: IPlayerScavConfig;
|
||||
constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, hashUtil: HashUtil, itemHelper: ItemHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botGeneratorHelper: BotGeneratorHelper, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, jsonUtil: JsonUtil, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer);
|
||||
/**
|
||||
* Update a player profile to include a new player scav profile
|
||||
* @param sessionID session id to specify what profile is updated
|
||||
* @returns profile object
|
||||
*/
|
||||
generate(sessionID: string): IPmcData;
|
||||
/**
|
||||
* Get the scav karama level for a profile
|
||||
* Is also the fence trader rep level
|
||||
* @param pmcData pmc profile
|
||||
* @returns karma level
|
||||
*/
|
||||
protected getScavKarmaLevel(pmcData: IPmcData): number;
|
||||
/**
|
||||
* Get a baseBot template
|
||||
* If the parameter doesnt match "assault", take parts from the loot type and apply to the return bot template
|
||||
* @param botTypeForLoot bot type to use for inventory/chances
|
||||
* @returns IBotType object
|
||||
*/
|
||||
protected constructBotBaseTemplate(botTypeForLoot: string): IBotType;
|
||||
/**
|
||||
* Adjust equipment/mod/item generation values based on scav karma levels
|
||||
* @param karmaSettings Values to modify the bot template with
|
||||
* @param baseBotNode bot template to modify according to karama level settings
|
||||
*/
|
||||
protected adjustBotTemplateWithKarmaSpecificSettings(karmaSettings: KarmaLevel, baseBotNode: IBotType): void;
|
||||
protected getScavSkills(scavProfile: IPmcData): Skills;
|
||||
protected getDefaultScavSkills(): Skills;
|
||||
protected getScavStats(scavProfile: IPmcData): Stats;
|
||||
protected getScavLevel(scavProfile: IPmcData): number;
|
||||
protected getScavExperience(scavProfile: IPmcData): number;
|
||||
/**
|
||||
* Set cooldown till pscav is playable
|
||||
* take into account scav cooldown bonus
|
||||
* @param scavData scav profile
|
||||
* @param pmcData pmc profile
|
||||
* @returns
|
||||
*/
|
||||
protected setScavCooldownTimer(scavData: IPmcData, pmcData: IPmcData): IPmcData;
|
||||
}
|
52
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RagfairAssortGenerator.d.ts
vendored
Normal file
52
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RagfairAssortGenerator.d.ts
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { IPreset } from "../models/eft/common/IGlobals";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SeasonalEventService } from "../services/SeasonalEventService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
export declare class RagfairAssortGenerator {
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected hashUtil: HashUtil;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected seasonalEventService: SeasonalEventService;
|
||||
protected configServer: ConfigServer;
|
||||
protected generatedAssortItems: Item[];
|
||||
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
|
||||
* @returns array of unique items
|
||||
*/
|
||||
getAssortItems(): Item[];
|
||||
/**
|
||||
* Check internal generatedAssortItems array has objects
|
||||
* @returns true if array has objects
|
||||
*/
|
||||
protected assortsAreGenerated(): boolean;
|
||||
/**
|
||||
* Generate an array of items the flea can sell
|
||||
* @returns array of unique items
|
||||
*/
|
||||
protected generateRagfairAssortItems(): Item[];
|
||||
/**
|
||||
* Get presets from globals.json
|
||||
* @returns Preset object array
|
||||
*/
|
||||
protected getPresets(): IPreset[];
|
||||
/**
|
||||
* Get default presets from globals.json
|
||||
* @returns Preset object array
|
||||
*/
|
||||
protected getDefaultPresets(): IPreset[];
|
||||
/**
|
||||
* Create a base assort item and return it with populated values + 999999 stack count + unlimited count = true
|
||||
* @param tplId tplid to add to item
|
||||
* @param id id to add to item
|
||||
* @returns hydrated Item object
|
||||
*/
|
||||
protected createRagfairAssortItem(tplId: string, id?: string): Item;
|
||||
}
|
202
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RagfairOfferGenerator.d.ts
vendored
Normal file
202
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RagfairOfferGenerator.d.ts
vendored
Normal file
@ -0,0 +1,202 @@
|
||||
import { HandbookHelper } from "../helpers/HandbookHelper";
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { PaymentHelper } from "../helpers/PaymentHelper";
|
||||
import { PresetHelper } from "../helpers/PresetHelper";
|
||||
import { RagfairServerHelper } from "../helpers/RagfairServerHelper";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { IBarterScheme } from "../models/eft/common/tables/ITrader";
|
||||
import { IRagfairOffer, OfferRequirement } from "../models/eft/ragfair/IRagfairOffer";
|
||||
import { Dynamic, IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { FenceService } from "../services/FenceService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { RagfairCategoriesService } from "../services/RagfairCategoriesService";
|
||||
import { RagfairOfferService } from "../services/RagfairOfferService";
|
||||
import { RagfairPriceService } from "../services/RagfairPriceService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
import { RagfairAssortGenerator } from "./RagfairAssortGenerator";
|
||||
export declare class RagfairOfferGenerator {
|
||||
protected logger: ILogger;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected hashUtil: HashUtil;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected ragfairServerHelper: RagfairServerHelper;
|
||||
protected handbookHelper: HandbookHelper;
|
||||
protected saveServer: SaveServer;
|
||||
protected presetHelper: PresetHelper;
|
||||
protected ragfairAssortGenerator: RagfairAssortGenerator;
|
||||
protected ragfairOfferService: RagfairOfferService;
|
||||
protected ragfairPriceService: RagfairPriceService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected paymentHelper: PaymentHelper;
|
||||
protected ragfairCategoriesService: RagfairCategoriesService;
|
||||
protected fenceService: FenceService;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected configServer: ConfigServer;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
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);
|
||||
/**
|
||||
* Create a flea offer and store it in the Ragfair server offers array
|
||||
* @param userID Owner of the offer
|
||||
* @param time Time offer is listed at
|
||||
* @param items Items in the offer
|
||||
* @param barterScheme Cost of item (currency or barter)
|
||||
* @param loyalLevel Loyalty level needed to buy item
|
||||
* @param sellInOnePiece Flags sellInOnePiece to be true
|
||||
* @returns IRagfairOffer
|
||||
*/
|
||||
createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
|
||||
/**
|
||||
* Create an offer object ready to send to ragfairOfferService.addOffer()
|
||||
* @param userID Owner of the offer
|
||||
* @param time Time offer is listed at
|
||||
* @param items Items in the offer
|
||||
* @param barterScheme Cost of item (currency or barter)
|
||||
* @param loyalLevel Loyalty level needed to buy item
|
||||
* @param sellInOnePiece Set StackObjectsCount to 1
|
||||
* @returns IRagfairOffer
|
||||
*/
|
||||
protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer;
|
||||
/**
|
||||
* Calculate the offer price that's listed on the flea listing
|
||||
* @param offerRequirements barter requirements for offer
|
||||
* @returns rouble cost of offer
|
||||
*/
|
||||
protected convertOfferRequirementsIntoRoubles(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;
|
||||
/**
|
||||
* Check userId, if its a player, return their pmc _id, otherwise return userId parameter
|
||||
* @param userId Users Id to check
|
||||
* @returns Users Id
|
||||
*/
|
||||
protected getTraderId(userId: string): string;
|
||||
/**
|
||||
* Get a flea trading rating for the passed in user
|
||||
* @param userId User to get flea rating of
|
||||
* @returns Flea rating value
|
||||
*/
|
||||
protected getRating(userId: string): number;
|
||||
/**
|
||||
* Is the offers user rating growing
|
||||
* @param userID user to check rating of
|
||||
* @returns true if its growing
|
||||
*/
|
||||
protected getRatingGrowing(userID: string): boolean;
|
||||
/**
|
||||
* Get number of section until offer should expire
|
||||
* @param userID Id of the offer owner
|
||||
* @param time Time the offer is posted
|
||||
* @returns number of seconds until offer expires
|
||||
*/
|
||||
protected getOfferEndTime(userID: string, time: number): number;
|
||||
/**
|
||||
* Create multiple offers for items by using a unique list of items we've generated previously
|
||||
* @param expiredOffers optional, expired offers to regenerate
|
||||
*/
|
||||
generateDynamicOffers(expiredOffers?: Item[]): Promise<void>;
|
||||
/**
|
||||
*
|
||||
* @param assortItemIndex Index of assort item
|
||||
* @param assortItemsToProcess Item array containing index
|
||||
* @param expiredOffers Currently expired offers on flea
|
||||
* @param config Ragfair dynamic config
|
||||
*/
|
||||
protected createOffersForItems(assortItemIndex: string, assortItemsToProcess: Item[], expiredOffers: Item[], config: Dynamic): Promise<void>;
|
||||
/**
|
||||
* Create one flea offer for a specific item
|
||||
* @param items Item to create offer for
|
||||
* @param isPreset Is item a weapon preset
|
||||
* @param itemDetails raw db item details
|
||||
* @returns Item array
|
||||
*/
|
||||
protected createSingleOfferForItem(items: Item[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise<void>;
|
||||
/**
|
||||
* Generate trader offers on flea using the traders assort data
|
||||
* @param traderID Trader to generate offers for
|
||||
*/
|
||||
generateFleaOffersForTrader(traderID: string): void;
|
||||
/**
|
||||
* 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 randomiseItemUpdProperties(userID: string, itemWithMods: Item[], itemDetails: ITemplateItem): Item[];
|
||||
/**
|
||||
* Get the relevant condition id if item tpl matches in ragfair.json/condition
|
||||
* @param tpl Item to look for matching condition object
|
||||
* @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
|
||||
* Durabiltiy for repairable items
|
||||
* HpResource for medical items
|
||||
* @param item item to add conditions to
|
||||
* @returns Item with conditions added
|
||||
*/
|
||||
protected addMissingConditions(item: Item): Item;
|
||||
/**
|
||||
* Create a barter-based barter scheme, if not possible, fall back to making barter scheme currency based
|
||||
* @param offerItems Items for sale in offer
|
||||
* @returns Barter scheme
|
||||
*/
|
||||
protected createBarterBarterScheme(offerItems: Item[]): IBarterScheme[];
|
||||
/**
|
||||
* Get an array of flea prices + item tpl, cached in generator class inside `allowedFleaPriceItemsForBarter`
|
||||
* @returns array with tpl/price values
|
||||
*/
|
||||
protected getFleaPricesAsArray(): {
|
||||
tpl: string;
|
||||
price: number;
|
||||
}[];
|
||||
/**
|
||||
* Create a random currency-based barter scheme for an array of items
|
||||
* @param offerItems Items on offer
|
||||
* @param isPackOffer Is the barter scheme being created for a pack offer
|
||||
* @param multipler What to multiply the resulting price by
|
||||
* @returns Barter scheme for offer
|
||||
*/
|
||||
protected createCurrencyBarterScheme(offerItems: Item[], isPackOffer: boolean, multipler?: number): IBarterScheme[];
|
||||
}
|
106
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/ScavCaseRewardGenerator.d.ts
vendored
Normal file
106
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/ScavCaseRewardGenerator.d.ts
vendored
Normal file
@ -0,0 +1,106 @@
|
||||
import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { Product } from "../models/eft/common/tables/IBotBase";
|
||||
import { Upd } from "../models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { IHideoutScavCase } from "../models/eft/hideout/IHideoutScavCase";
|
||||
import { IScavCaseConfig } from "../models/spt/config/IScavCaseConfig";
|
||||
import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "../models/spt/hideout/ScavCaseRewardCountsAndPrices";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { ItemFilterService } from "../services/ItemFilterService";
|
||||
import { RagfairPriceService } from "../services/RagfairPriceService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
/**
|
||||
* Handle the creation of randomised scav case rewards
|
||||
*/
|
||||
export declare class ScavCaseRewardGenerator {
|
||||
protected logger: ILogger;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected hashUtil: HashUtil;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected ragfairPriceService: RagfairPriceService;
|
||||
protected itemFilterService: ItemFilterService;
|
||||
protected configServer: ConfigServer;
|
||||
protected scavCaseConfig: IScavCaseConfig;
|
||||
protected dbItemsCache: ITemplateItem[];
|
||||
protected dbAmmoItemsCache: ITemplateItem[];
|
||||
constructor(logger: ILogger, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, ragfairPriceService: RagfairPriceService, itemFilterService: ItemFilterService, configServer: ConfigServer);
|
||||
/**
|
||||
* Create an array of rewards that will be given to the player upon completing their scav case build
|
||||
* @param recipeId recipe of the scav case craft
|
||||
* @returns Product array
|
||||
*/
|
||||
generate(recipeId: string): Product[];
|
||||
/**
|
||||
* Get all db items that are not blacklisted in scavcase config or global blacklist
|
||||
* Store in class field
|
||||
*/
|
||||
protected cacheDbItems(): void;
|
||||
/**
|
||||
* 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 itemFilters how the rewards should be filtered down (by item count)
|
||||
* @returns
|
||||
*/
|
||||
protected pickRandomRewards(items: ITemplateItem[], itemFilters: RewardCountAndPriceDetails, rarity: string): ITemplateItem[];
|
||||
/**
|
||||
* Choose if money should be a reward based on the moneyRewardChancePercent config chance in scavCaseConfig
|
||||
* @returns true if reward should be money
|
||||
*/
|
||||
protected rewardShouldBeMoney(): boolean;
|
||||
/**
|
||||
* Choose if ammo should be a reward based on the ammoRewardChancePercent config chance in scavCaseConfig
|
||||
* @returns true if reward should be ammo
|
||||
*/
|
||||
protected rewardShouldBeAmmo(): boolean;
|
||||
/**
|
||||
* Choose from rouble/dollar/euro at random
|
||||
*/
|
||||
protected getRandomMoney(): ITemplateItem;
|
||||
/**
|
||||
* Get a random ammo from items.json that is not in the ammo blacklist AND inside the price rage defined in scavcase.json config
|
||||
* @param rarity The rarity this ammo reward is for
|
||||
* @returns random ammo item from items.json
|
||||
*/
|
||||
protected getRandomAmmo(rarity: string): ITemplateItem;
|
||||
/**
|
||||
* Take all the rewards picked create the Product object array ready to return to calling code
|
||||
* Also add a stack count to ammo and money
|
||||
* @param rewardItems items to convert
|
||||
* @returns Product array
|
||||
*/
|
||||
protected randomiseContainerItemRewards(rewardItems: ITemplateItem[], rarity: string): Product[];
|
||||
/**
|
||||
* Add a randomised stack count to ammo or money items
|
||||
* @param item money or ammo item
|
||||
* @param resultItem money or ammo item with a randomise stack size
|
||||
*/
|
||||
protected addStackCountToAmmoAndMoney(item: ITemplateItem, resultItem: {
|
||||
_id: string;
|
||||
_tpl: string;
|
||||
upd: Upd;
|
||||
}, rarity: string): void;
|
||||
/**
|
||||
*
|
||||
* @param dbItems all items from the items.json
|
||||
* @param itemFilters controls how the dbItems will be filtered and returned (handbook price)
|
||||
* @returns filtered dbItems array
|
||||
*/
|
||||
protected getFilteredItemsByPrice(dbItems: ITemplateItem[], itemFilters: RewardCountAndPriceDetails): ITemplateItem[];
|
||||
/**
|
||||
* Gathers the reward min and max count params for each reward quality level from config and scavcase.json into a single object
|
||||
* @param scavCaseDetails scavcase.json values
|
||||
* @returns ScavCaseRewardCountsAndPrices object
|
||||
*/
|
||||
protected getScavCaseRewardCountsAndPrices(scavCaseDetails: IHideoutScavCase): ScavCaseRewardCountsAndPrices;
|
||||
/**
|
||||
* Randomises the size of ammo and money stacks
|
||||
* @param itemToCalculate ammo or money item
|
||||
* @param rarity rarity (common/rare/superrare)
|
||||
* @returns value to set stack count to
|
||||
*/
|
||||
protected getRandomAmountRewardForScavCase(itemToCalculate: ITemplateItem, rarity: string): number;
|
||||
}
|
60
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/WeatherGenerator.d.ts
vendored
Normal file
60
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/WeatherGenerator.d.ts
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
import { ApplicationContext } from "../context/ApplicationContext";
|
||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
||||
import { IWeather, IWeatherData } from "../models/eft/weather/IWeatherData";
|
||||
import { WindDirection } from "../models/enums/WindDirection";
|
||||
import { IWeatherConfig } from "../models/spt/config/IWeatherConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class WeatherGenerator {
|
||||
protected weightedRandomHelper: WeightedRandomHelper;
|
||||
protected logger: ILogger;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected applicationContext: ApplicationContext;
|
||||
protected configServer: ConfigServer;
|
||||
protected weatherConfig: IWeatherConfig;
|
||||
constructor(weightedRandomHelper: WeightedRandomHelper, logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, applicationContext: ApplicationContext, configServer: ConfigServer);
|
||||
/**
|
||||
* Get current + raid datetime and format into correct BSG format and return
|
||||
* @param data Weather data
|
||||
* @returns IWeatherData
|
||||
*/
|
||||
calculateGameTime(data: IWeatherData): IWeatherData;
|
||||
/**
|
||||
* Get server uptime seconds multiplied by a multiplier and add to current time as seconds
|
||||
* Format to BSGs requirements
|
||||
* @param currentDate current date
|
||||
* @returns formatted time
|
||||
*/
|
||||
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
|
||||
* @param date date to format into bsg style
|
||||
* @returns Time formatted in BSG format
|
||||
*/
|
||||
protected getBSGFormattedTime(date: Date): string;
|
||||
/**
|
||||
* Return randomised Weather data with help of config/weather.json
|
||||
* @returns Randomised weather data
|
||||
*/
|
||||
generateWeather(): IWeather;
|
||||
/**
|
||||
* Set IWeather date/time/timestamp values to now
|
||||
* @param weather Object to update
|
||||
*/
|
||||
protected setCurrentDateTime(weather: IWeather): void;
|
||||
protected getWeightedWindDirection(): WindDirection;
|
||||
protected getWeightedClouds(): number;
|
||||
protected getWeightedWindSpeed(): number;
|
||||
protected getWeightedFog(): number;
|
||||
protected getWeightedRain(): number;
|
||||
protected getRandomFloat(node: string): number;
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
import { InventoryMagGen } from "./InventoryMagGen";
|
||||
export interface IInventoryMagGen {
|
||||
getPriority(): number;
|
||||
canHandleInventoryMagGen(inventoryMagGen: InventoryMagGen): boolean;
|
||||
process(inventoryMagGen: InventoryMagGen): void;
|
||||
}
|
16
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/weapongen/InventoryMagGen.d.ts
vendored
Normal file
16
TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/weapongen/InventoryMagGen.d.ts
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
import { Inventory } from "../../models/eft/common/tables/IBotBase";
|
||||
import { GenerationData } from "../../models/eft/common/tables/IBotType";
|
||||
import { ITemplateItem } from "../../models/eft/common/tables/ITemplateItem";
|
||||
export declare class InventoryMagGen {
|
||||
private magCounts;
|
||||
private magazineTemplate;
|
||||
private weaponTemplate;
|
||||
private ammoTemplate;
|
||||
private pmcInventory;
|
||||
constructor(magCounts: GenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory);
|
||||
getMagCount(): GenerationData;
|
||||
getMagazineTemplate(): ITemplateItem;
|
||||
getWeaponTemplate(): ITemplateItem;
|
||||
getAmmoTemplate(): ITemplateItem;
|
||||
getPmcInventory(): Inventory;
|
||||
}
|
@ -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;
|
||||
}
|
@ -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;
|
||||
}
|
@ -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;
|
||||
}
|
@ -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;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user