This commit is contained in:
Dev 2024-08-17 21:00:27 +01:00
parent 56e4fee0c3
commit c83a3f6f50
729 changed files with 925 additions and 785 deletions

View File

@ -1,4 +1,4 @@
# Mod examples for v3.9.5 # Mod examples for v3.9.6
A collection of example mods that perform typical actions in SPT A collection of example mods that perform typical actions in SPT

View File

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

View File

@ -76,6 +76,14 @@ export declare class BotEquipmentModGenerator {
* @returns Weapon + mods array * @returns Weapon + mods array
*/ */
generateModsForWeapon(sessionId: string, request: IGenerateWeaponRequest): Item[]; generateModsForWeapon(sessionId: string, request: IGenerateWeaponRequest): Item[];
/**
* Should the provided bot have its stock chance values altered to 100%
* @param modSlot Slot to check
* @param botEquipConfig Bots equipment config/chance values
* @param modToAddTemplate Mod being added to bots weapon
* @returns True if it should
*/
protected shouldForceSubStockSlots(modSlot: string, botEquipConfig: EquipmentFilters, modToAddTemplate: ITemplateItem): boolean;
/** /**
* Is this modslot a front or rear sight * Is this modslot a front or rear sight
* @param modSlot Slot to check * @param modSlot Slot to check

View File

@ -28,6 +28,7 @@ export declare class RepeatableQuestGenerator {
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected cloner: ICloner; protected cloner: ICloner;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
protected maxRandomNumberAttempts: number;
constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner);
/** /**
* This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json).

View File

@ -76,7 +76,13 @@ export declare class ItemHelper {
*/ */
generateUpdForItem(itemTemplate: ITemplateItem): Upd; generateUpdForItem(itemTemplate: ITemplateItem): Upd;
/** /**
* Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * Checks if a tpl is a valid item. Valid meaning that it's an item that be stored in stash
* Valid means:
* Not quest item
* 'Item' type
* Not on the invalid base types array
* Price above 0 roubles
* Not on item config blacklist
* @param {string} tpl the template id / tpl * @param {string} tpl the template id / tpl
* @returns boolean; true for items that may be in player possession and not quest items * @returns boolean; true for items that may be in player possession and not quest items
*/ */

View File

@ -3,6 +3,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData";
import { Common, CounterKeyValue, Stats } from "@spt/models/eft/common/tables/IBotBase"; import { Common, CounterKeyValue, Stats } from "@spt/models/eft/common/tables/IBotBase";
import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ISptProfile } from "@spt/models/eft/profile/ISptProfile";
import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData";
import { BonusType } from "@spt/models/enums/BonusType";
import { SkillTypes } from "@spt/models/enums/SkillTypes"; import { SkillTypes } from "@spt/models/enums/SkillTypes";
import { IInventoryConfig } from "@spt/models/spt/config/IInventoryConfig"; import { IInventoryConfig } from "@spt/models/spt/config/IInventoryConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
@ -190,6 +191,13 @@ export declare class ProfileHelper {
* @param rowsToAdd How many rows to give profile * @param rowsToAdd How many rows to give profile
*/ */
addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void;
/**
* Iterate over all bonuses and sum up all bonuses of desired type in provided profile
* @param pmcProfile Player profile
* @param desiredBonus Bonus to sum up
* @returns Summed bonus value or 0 if no bonus found
*/
getBonusValueFromProfile(pmcProfile: IPmcData, desiredBonus: BonusType): number;
playerIsFleaBanned(pmcProfile: IPmcData): boolean; playerIsFleaBanned(pmcProfile: IPmcData): boolean;
/** /**
* Add an achievement to player profile * Add an achievement to player profile

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
export type HandleFn = (_: string, req: IncomingMessage, resp: ServerResponse) => void; export type HandleFn = (_: string, req: IncomingMessage, resp: ServerResponse) => void;
/** /**
@ -6,7 +5,9 @@ export type HandleFn = (_: string, req: IncomingMessage, resp: ServerResponse) =
* @param basePath The base path * @param basePath The base path
* @returns The decorator that create the listener proxy * @returns The decorator that create the listener proxy
*/ */
export declare const Listen: (basePath: string) => <T extends new (...args: any[]) => any>(Base: T) => T; export declare const Listen: (basePath: string) => <T extends {
new (...args: any[]): any;
}>(Base: T) => T;
/** /**
* HTTP DELETE decorator * HTTP DELETE decorator
*/ */

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage } from "node:http"; import { IncomingMessage } from "node:http";
import { DynamicRouter, Router, StaticRouter } from "@spt/di/Router"; import { DynamicRouter, Router, StaticRouter } from "@spt/di/Router";
export declare class HttpRouter { export declare class HttpRouter {

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { ImageRouteService } from "@spt/services/mod/image/ImageRouteService"; import { ImageRouteService } from "@spt/services/mod/image/ImageRouteService";
import { HttpFileUtil } from "@spt/utils/HttpFileUtil"; import { HttpFileUtil } from "@spt/utils/HttpFileUtil";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { Serializer } from "@spt/di/Serializer"; import { Serializer } from "@spt/di/Serializer";
import { BundleLoader } from "@spt/loaders/BundleLoader"; import { BundleLoader } from "@spt/loaders/BundleLoader";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { Serializer } from "@spt/di/Serializer"; import { Serializer } from "@spt/di/Serializer";
import { ImageRouter } from "@spt/routers/ImageRouter"; import { ImageRouter } from "@spt/routers/ImageRouter";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { NotifierController } from "@spt/controllers/NotifierController"; import { NotifierController } from "@spt/controllers/NotifierController";
import { Serializer } from "@spt/di/Serializer"; import { Serializer } from "@spt/di/Serializer";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { ApplicationContext } from "@spt/context/ApplicationContext"; import { ApplicationContext } from "@spt/context/ApplicationContext";
import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; import { HttpServerHelper } from "@spt/helpers/HttpServerHelper";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import http, { IncomingMessage } from "node:http"; import http, { IncomingMessage } from "node:http";
import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; import { HttpServerHelper } from "@spt/helpers/HttpServerHelper";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
export interface IHttpListener { export interface IHttpListener {
canHandle(sessionId: string, req: IncomingMessage): boolean; canHandle(sessionId: string, req: IncomingMessage): boolean;

View File

@ -1,5 +1,3 @@
/// <reference types="node" />
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { Serializer } from "@spt/di/Serializer"; import { Serializer } from "@spt/di/Serializer";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage } from "node:http"; import { IncomingMessage } from "node:http";
import { WebSocket } from "ws"; import { WebSocket } from "ws";
export interface IWebSocketConnectionHandler { export interface IWebSocketConnectionHandler {

View File

@ -1,5 +1,3 @@
/// <reference types="node" />
/// <reference types="node" />
import { IncomingMessage } from "http"; import { IncomingMessage } from "http";
import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { IWsNotificationEvent } from "@spt/models/eft/ws/IWsNotificationEvent"; import { IWsNotificationEvent } from "@spt/models/eft/ws/IWsNotificationEvent";

View File

@ -22,6 +22,7 @@ import { HashUtil } from "@spt/utils/HashUtil";
import { RandomUtil } from "@spt/utils/RandomUtil"; import { RandomUtil } from "@spt/utils/RandomUtil";
import { TimeUtil } from "@spt/utils/TimeUtil"; import { TimeUtil } from "@spt/utils/TimeUtil";
import { ICloner } from "@spt/utils/cloners/ICloner"; import { ICloner } from "@spt/utils/cloners/ICloner";
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
export declare class InsuranceService { export declare class InsuranceService {
protected logger: ILogger; protected logger: ILogger;
protected databaseService: DatabaseService; protected databaseService: DatabaseService;
@ -39,10 +40,11 @@ export declare class InsuranceService {
protected mailSendService: MailSendService; protected mailSendService: MailSendService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected cloner: ICloner; protected cloner: ICloner;
protected profileHelper: ProfileHelper;
protected insured: Record<string, Record<string, Item[]>>; protected insured: Record<string, Record<string, Item[]>>;
protected insuranceConfig: IInsuranceConfig; protected insuranceConfig: IInsuranceConfig;
protected lostOnDeathConfig: ILostOnDeathConfig; protected lostOnDeathConfig: ILostOnDeathConfig;
constructor(logger: ILogger, databaseService: DatabaseService, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, databaseService: DatabaseService, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer, cloner: ICloner, profileHelper: ProfileHelper);
/** /**
* Does player have insurance array * Does player have insurance array
* @param sessionId Player id * @param sessionId Player id

View File

@ -1,4 +1,5 @@
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcData } from "@spt/models/eft/common/IPmcData";
import { Item } from "@spt/models/eft/common/tables/IItem"; import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
@ -11,8 +12,9 @@ export declare class RagfairTaxService {
protected databaseService: DatabaseService; protected databaseService: DatabaseService;
protected ragfairPriceService: RagfairPriceService; protected ragfairPriceService: RagfairPriceService;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected profileHelper: ProfileHelper;
protected playerOfferTaxCache: Record<string, IStorePlayerOfferTaxAmountRequestData>; protected playerOfferTaxCache: Record<string, IStorePlayerOfferTaxAmountRequestData>;
constructor(logger: ILogger, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, itemHelper: ItemHelper); constructor(logger: ILogger, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, itemHelper: ItemHelper, profileHelper: ProfileHelper);
storeClientOfferTaxValue(sessionId: string, offer: IStorePlayerOfferTaxAmountRequestData): void; storeClientOfferTaxValue(sessionId: string, offer: IStorePlayerOfferTaxAmountRequestData): void;
clearStoredOfferTaxById(offerIdToRemove: string): void; clearStoredOfferTaxById(offerIdToRemove: string): void;
getStoredClientOfferTaxValueById(offerIdToGet: string): IStorePlayerOfferTaxAmountRequestData; getStoredClientOfferTaxValueById(offerIdToGet: string): IStorePlayerOfferTaxAmountRequestData;

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { IHttpListener } from "@spt/servers/http/IHttpListener"; import { IHttpListener } from "@spt/servers/http/IHttpListener";
export declare class HttpListenerMod implements IHttpListener { export declare class HttpListenerMod implements IHttpListener {

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { DependencyContainer } from "tsyringe"; import { DependencyContainer } from "tsyringe";
export declare class HttpListenerModService { export declare class HttpListenerModService {

View File

@ -1,5 +1,3 @@
/// <reference types="node" />
/// <reference types="node" />
import crypto from "node:crypto"; import crypto from "node:crypto";
import fs from "node:fs"; import fs from "node:fs";
import { TimeUtil } from "@spt/utils/TimeUtil"; import { TimeUtil } from "@spt/utils/TimeUtil";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { ServerResponse } from "node:http"; import { ServerResponse } from "node:http";
import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; import { HttpServerHelper } from "@spt/helpers/HttpServerHelper";
export declare class HttpFileUtil { export declare class HttpFileUtil {

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { TimeUtil } from "@spt/utils/TimeUtil"; import { TimeUtil } from "@spt/utils/TimeUtil";
export declare class ObjectId { export declare class ObjectId {
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;

View File

@ -1,5 +1,3 @@
/// <reference types="node" />
/// <reference types="node" />
import "reflect-metadata"; import "reflect-metadata";
import fs from "node:fs"; import fs from "node:fs";
import { IAsyncQueue } from "@spt/models/spt/utils/IAsyncQueue"; import { IAsyncQueue } from "@spt/models/spt/utils/IAsyncQueue";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import fs from "node:fs"; import fs from "node:fs";
import { Daum } from "@spt/models/eft/itemEvent/IItemEventRouterRequest"; import { Daum } from "@spt/models/eft/itemEvent/IItemEventRouterRequest";
import { LogBackgroundColor } from "@spt/models/spt/logging/LogBackgroundColor"; import { LogBackgroundColor } from "@spt/models/spt/logging/LogBackgroundColor";

View File

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

View File

@ -76,6 +76,14 @@ export declare class BotEquipmentModGenerator {
* @returns Weapon + mods array * @returns Weapon + mods array
*/ */
generateModsForWeapon(sessionId: string, request: IGenerateWeaponRequest): Item[]; generateModsForWeapon(sessionId: string, request: IGenerateWeaponRequest): Item[];
/**
* Should the provided bot have its stock chance values altered to 100%
* @param modSlot Slot to check
* @param botEquipConfig Bots equipment config/chance values
* @param modToAddTemplate Mod being added to bots weapon
* @returns True if it should
*/
protected shouldForceSubStockSlots(modSlot: string, botEquipConfig: EquipmentFilters, modToAddTemplate: ITemplateItem): boolean;
/** /**
* Is this modslot a front or rear sight * Is this modslot a front or rear sight
* @param modSlot Slot to check * @param modSlot Slot to check

View File

@ -28,6 +28,7 @@ export declare class RepeatableQuestGenerator {
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected cloner: ICloner; protected cloner: ICloner;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
protected maxRandomNumberAttempts: number;
constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner);
/** /**
* This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json).

View File

@ -76,7 +76,13 @@ export declare class ItemHelper {
*/ */
generateUpdForItem(itemTemplate: ITemplateItem): Upd; generateUpdForItem(itemTemplate: ITemplateItem): Upd;
/** /**
* Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * Checks if a tpl is a valid item. Valid meaning that it's an item that be stored in stash
* Valid means:
* Not quest item
* 'Item' type
* Not on the invalid base types array
* Price above 0 roubles
* Not on item config blacklist
* @param {string} tpl the template id / tpl * @param {string} tpl the template id / tpl
* @returns boolean; true for items that may be in player possession and not quest items * @returns boolean; true for items that may be in player possession and not quest items
*/ */

View File

@ -3,6 +3,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData";
import { Common, CounterKeyValue, Stats } from "@spt/models/eft/common/tables/IBotBase"; import { Common, CounterKeyValue, Stats } from "@spt/models/eft/common/tables/IBotBase";
import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ISptProfile } from "@spt/models/eft/profile/ISptProfile";
import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData";
import { BonusType } from "@spt/models/enums/BonusType";
import { SkillTypes } from "@spt/models/enums/SkillTypes"; import { SkillTypes } from "@spt/models/enums/SkillTypes";
import { IInventoryConfig } from "@spt/models/spt/config/IInventoryConfig"; import { IInventoryConfig } from "@spt/models/spt/config/IInventoryConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
@ -190,6 +191,13 @@ export declare class ProfileHelper {
* @param rowsToAdd How many rows to give profile * @param rowsToAdd How many rows to give profile
*/ */
addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void;
/**
* Iterate over all bonuses and sum up all bonuses of desired type in provided profile
* @param pmcProfile Player profile
* @param desiredBonus Bonus to sum up
* @returns Summed bonus value or 0 if no bonus found
*/
getBonusValueFromProfile(pmcProfile: IPmcData, desiredBonus: BonusType): number;
playerIsFleaBanned(pmcProfile: IPmcData): boolean; playerIsFleaBanned(pmcProfile: IPmcData): boolean;
/** /**
* Add an achievement to player profile * Add an achievement to player profile

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
export type HandleFn = (_: string, req: IncomingMessage, resp: ServerResponse) => void; export type HandleFn = (_: string, req: IncomingMessage, resp: ServerResponse) => void;
/** /**
@ -6,7 +5,9 @@ export type HandleFn = (_: string, req: IncomingMessage, resp: ServerResponse) =
* @param basePath The base path * @param basePath The base path
* @returns The decorator that create the listener proxy * @returns The decorator that create the listener proxy
*/ */
export declare const Listen: (basePath: string) => <T extends new (...args: any[]) => any>(Base: T) => T; export declare const Listen: (basePath: string) => <T extends {
new (...args: any[]): any;
}>(Base: T) => T;
/** /**
* HTTP DELETE decorator * HTTP DELETE decorator
*/ */

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage } from "node:http"; import { IncomingMessage } from "node:http";
import { DynamicRouter, Router, StaticRouter } from "@spt/di/Router"; import { DynamicRouter, Router, StaticRouter } from "@spt/di/Router";
export declare class HttpRouter { export declare class HttpRouter {

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { ImageRouteService } from "@spt/services/mod/image/ImageRouteService"; import { ImageRouteService } from "@spt/services/mod/image/ImageRouteService";
import { HttpFileUtil } from "@spt/utils/HttpFileUtil"; import { HttpFileUtil } from "@spt/utils/HttpFileUtil";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { Serializer } from "@spt/di/Serializer"; import { Serializer } from "@spt/di/Serializer";
import { BundleLoader } from "@spt/loaders/BundleLoader"; import { BundleLoader } from "@spt/loaders/BundleLoader";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { Serializer } from "@spt/di/Serializer"; import { Serializer } from "@spt/di/Serializer";
import { ImageRouter } from "@spt/routers/ImageRouter"; import { ImageRouter } from "@spt/routers/ImageRouter";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { NotifierController } from "@spt/controllers/NotifierController"; import { NotifierController } from "@spt/controllers/NotifierController";
import { Serializer } from "@spt/di/Serializer"; import { Serializer } from "@spt/di/Serializer";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { ApplicationContext } from "@spt/context/ApplicationContext"; import { ApplicationContext } from "@spt/context/ApplicationContext";
import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; import { HttpServerHelper } from "@spt/helpers/HttpServerHelper";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import http, { IncomingMessage } from "node:http"; import http, { IncomingMessage } from "node:http";
import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; import { HttpServerHelper } from "@spt/helpers/HttpServerHelper";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
export interface IHttpListener { export interface IHttpListener {
canHandle(sessionId: string, req: IncomingMessage): boolean; canHandle(sessionId: string, req: IncomingMessage): boolean;

View File

@ -1,5 +1,3 @@
/// <reference types="node" />
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { Serializer } from "@spt/di/Serializer"; import { Serializer } from "@spt/di/Serializer";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage } from "node:http"; import { IncomingMessage } from "node:http";
import { WebSocket } from "ws"; import { WebSocket } from "ws";
export interface IWebSocketConnectionHandler { export interface IWebSocketConnectionHandler {

View File

@ -1,5 +1,3 @@
/// <reference types="node" />
/// <reference types="node" />
import { IncomingMessage } from "http"; import { IncomingMessage } from "http";
import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { IWsNotificationEvent } from "@spt/models/eft/ws/IWsNotificationEvent"; import { IWsNotificationEvent } from "@spt/models/eft/ws/IWsNotificationEvent";

View File

@ -22,6 +22,7 @@ import { HashUtil } from "@spt/utils/HashUtil";
import { RandomUtil } from "@spt/utils/RandomUtil"; import { RandomUtil } from "@spt/utils/RandomUtil";
import { TimeUtil } from "@spt/utils/TimeUtil"; import { TimeUtil } from "@spt/utils/TimeUtil";
import { ICloner } from "@spt/utils/cloners/ICloner"; import { ICloner } from "@spt/utils/cloners/ICloner";
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
export declare class InsuranceService { export declare class InsuranceService {
protected logger: ILogger; protected logger: ILogger;
protected databaseService: DatabaseService; protected databaseService: DatabaseService;
@ -39,10 +40,11 @@ export declare class InsuranceService {
protected mailSendService: MailSendService; protected mailSendService: MailSendService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected cloner: ICloner; protected cloner: ICloner;
protected profileHelper: ProfileHelper;
protected insured: Record<string, Record<string, Item[]>>; protected insured: Record<string, Record<string, Item[]>>;
protected insuranceConfig: IInsuranceConfig; protected insuranceConfig: IInsuranceConfig;
protected lostOnDeathConfig: ILostOnDeathConfig; protected lostOnDeathConfig: ILostOnDeathConfig;
constructor(logger: ILogger, databaseService: DatabaseService, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, databaseService: DatabaseService, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer, cloner: ICloner, profileHelper: ProfileHelper);
/** /**
* Does player have insurance array * Does player have insurance array
* @param sessionId Player id * @param sessionId Player id

View File

@ -1,4 +1,5 @@
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcData } from "@spt/models/eft/common/IPmcData";
import { Item } from "@spt/models/eft/common/tables/IItem"; import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
@ -11,8 +12,9 @@ export declare class RagfairTaxService {
protected databaseService: DatabaseService; protected databaseService: DatabaseService;
protected ragfairPriceService: RagfairPriceService; protected ragfairPriceService: RagfairPriceService;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected profileHelper: ProfileHelper;
protected playerOfferTaxCache: Record<string, IStorePlayerOfferTaxAmountRequestData>; protected playerOfferTaxCache: Record<string, IStorePlayerOfferTaxAmountRequestData>;
constructor(logger: ILogger, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, itemHelper: ItemHelper); constructor(logger: ILogger, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, itemHelper: ItemHelper, profileHelper: ProfileHelper);
storeClientOfferTaxValue(sessionId: string, offer: IStorePlayerOfferTaxAmountRequestData): void; storeClientOfferTaxValue(sessionId: string, offer: IStorePlayerOfferTaxAmountRequestData): void;
clearStoredOfferTaxById(offerIdToRemove: string): void; clearStoredOfferTaxById(offerIdToRemove: string): void;
getStoredClientOfferTaxValueById(offerIdToGet: string): IStorePlayerOfferTaxAmountRequestData; getStoredClientOfferTaxValueById(offerIdToGet: string): IStorePlayerOfferTaxAmountRequestData;

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { IHttpListener } from "@spt/servers/http/IHttpListener"; import { IHttpListener } from "@spt/servers/http/IHttpListener";
export declare class HttpListenerMod implements IHttpListener { export declare class HttpListenerMod implements IHttpListener {

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { DependencyContainer } from "tsyringe"; import { DependencyContainer } from "tsyringe";
export declare class HttpListenerModService { export declare class HttpListenerModService {

View File

@ -1,5 +1,3 @@
/// <reference types="node" />
/// <reference types="node" />
import crypto from "node:crypto"; import crypto from "node:crypto";
import fs from "node:fs"; import fs from "node:fs";
import { TimeUtil } from "@spt/utils/TimeUtil"; import { TimeUtil } from "@spt/utils/TimeUtil";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { ServerResponse } from "node:http"; import { ServerResponse } from "node:http";
import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; import { HttpServerHelper } from "@spt/helpers/HttpServerHelper";
export declare class HttpFileUtil { export declare class HttpFileUtil {

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { TimeUtil } from "@spt/utils/TimeUtil"; import { TimeUtil } from "@spt/utils/TimeUtil";
export declare class ObjectId { export declare class ObjectId {
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;

View File

@ -1,5 +1,3 @@
/// <reference types="node" />
/// <reference types="node" />
import "reflect-metadata"; import "reflect-metadata";
import fs from "node:fs"; import fs from "node:fs";
import { IAsyncQueue } from "@spt/models/spt/utils/IAsyncQueue"; import { IAsyncQueue } from "@spt/models/spt/utils/IAsyncQueue";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import fs from "node:fs"; import fs from "node:fs";
import { Daum } from "@spt/models/eft/itemEvent/IItemEventRouterRequest"; import { Daum } from "@spt/models/eft/itemEvent/IItemEventRouterRequest";
import { LogBackgroundColor } from "@spt/models/spt/logging/LogBackgroundColor"; import { LogBackgroundColor } from "@spt/models/spt/logging/LogBackgroundColor";

View File

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

View File

@ -76,6 +76,14 @@ export declare class BotEquipmentModGenerator {
* @returns Weapon + mods array * @returns Weapon + mods array
*/ */
generateModsForWeapon(sessionId: string, request: IGenerateWeaponRequest): Item[]; generateModsForWeapon(sessionId: string, request: IGenerateWeaponRequest): Item[];
/**
* Should the provided bot have its stock chance values altered to 100%
* @param modSlot Slot to check
* @param botEquipConfig Bots equipment config/chance values
* @param modToAddTemplate Mod being added to bots weapon
* @returns True if it should
*/
protected shouldForceSubStockSlots(modSlot: string, botEquipConfig: EquipmentFilters, modToAddTemplate: ITemplateItem): boolean;
/** /**
* Is this modslot a front or rear sight * Is this modslot a front or rear sight
* @param modSlot Slot to check * @param modSlot Slot to check

View File

@ -28,6 +28,7 @@ export declare class RepeatableQuestGenerator {
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected cloner: ICloner; protected cloner: ICloner;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
protected maxRandomNumberAttempts: number;
constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner);
/** /**
* This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json).

View File

@ -76,7 +76,13 @@ export declare class ItemHelper {
*/ */
generateUpdForItem(itemTemplate: ITemplateItem): Upd; generateUpdForItem(itemTemplate: ITemplateItem): Upd;
/** /**
* Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * Checks if a tpl is a valid item. Valid meaning that it's an item that be stored in stash
* Valid means:
* Not quest item
* 'Item' type
* Not on the invalid base types array
* Price above 0 roubles
* Not on item config blacklist
* @param {string} tpl the template id / tpl * @param {string} tpl the template id / tpl
* @returns boolean; true for items that may be in player possession and not quest items * @returns boolean; true for items that may be in player possession and not quest items
*/ */

View File

@ -3,6 +3,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData";
import { Common, CounterKeyValue, Stats } from "@spt/models/eft/common/tables/IBotBase"; import { Common, CounterKeyValue, Stats } from "@spt/models/eft/common/tables/IBotBase";
import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ISptProfile } from "@spt/models/eft/profile/ISptProfile";
import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData";
import { BonusType } from "@spt/models/enums/BonusType";
import { SkillTypes } from "@spt/models/enums/SkillTypes"; import { SkillTypes } from "@spt/models/enums/SkillTypes";
import { IInventoryConfig } from "@spt/models/spt/config/IInventoryConfig"; import { IInventoryConfig } from "@spt/models/spt/config/IInventoryConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
@ -190,6 +191,13 @@ export declare class ProfileHelper {
* @param rowsToAdd How many rows to give profile * @param rowsToAdd How many rows to give profile
*/ */
addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void;
/**
* Iterate over all bonuses and sum up all bonuses of desired type in provided profile
* @param pmcProfile Player profile
* @param desiredBonus Bonus to sum up
* @returns Summed bonus value or 0 if no bonus found
*/
getBonusValueFromProfile(pmcProfile: IPmcData, desiredBonus: BonusType): number;
playerIsFleaBanned(pmcProfile: IPmcData): boolean; playerIsFleaBanned(pmcProfile: IPmcData): boolean;
/** /**
* Add an achievement to player profile * Add an achievement to player profile

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
export type HandleFn = (_: string, req: IncomingMessage, resp: ServerResponse) => void; export type HandleFn = (_: string, req: IncomingMessage, resp: ServerResponse) => void;
/** /**
@ -6,7 +5,9 @@ export type HandleFn = (_: string, req: IncomingMessage, resp: ServerResponse) =
* @param basePath The base path * @param basePath The base path
* @returns The decorator that create the listener proxy * @returns The decorator that create the listener proxy
*/ */
export declare const Listen: (basePath: string) => <T extends new (...args: any[]) => any>(Base: T) => T; export declare const Listen: (basePath: string) => <T extends {
new (...args: any[]): any;
}>(Base: T) => T;
/** /**
* HTTP DELETE decorator * HTTP DELETE decorator
*/ */

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage } from "node:http"; import { IncomingMessage } from "node:http";
import { DynamicRouter, Router, StaticRouter } from "@spt/di/Router"; import { DynamicRouter, Router, StaticRouter } from "@spt/di/Router";
export declare class HttpRouter { export declare class HttpRouter {

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { ImageRouteService } from "@spt/services/mod/image/ImageRouteService"; import { ImageRouteService } from "@spt/services/mod/image/ImageRouteService";
import { HttpFileUtil } from "@spt/utils/HttpFileUtil"; import { HttpFileUtil } from "@spt/utils/HttpFileUtil";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { Serializer } from "@spt/di/Serializer"; import { Serializer } from "@spt/di/Serializer";
import { BundleLoader } from "@spt/loaders/BundleLoader"; import { BundleLoader } from "@spt/loaders/BundleLoader";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { Serializer } from "@spt/di/Serializer"; import { Serializer } from "@spt/di/Serializer";
import { ImageRouter } from "@spt/routers/ImageRouter"; import { ImageRouter } from "@spt/routers/ImageRouter";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { NotifierController } from "@spt/controllers/NotifierController"; import { NotifierController } from "@spt/controllers/NotifierController";
import { Serializer } from "@spt/di/Serializer"; import { Serializer } from "@spt/di/Serializer";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { ApplicationContext } from "@spt/context/ApplicationContext"; import { ApplicationContext } from "@spt/context/ApplicationContext";
import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; import { HttpServerHelper } from "@spt/helpers/HttpServerHelper";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import http, { IncomingMessage } from "node:http"; import http, { IncomingMessage } from "node:http";
import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; import { HttpServerHelper } from "@spt/helpers/HttpServerHelper";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
export interface IHttpListener { export interface IHttpListener {
canHandle(sessionId: string, req: IncomingMessage): boolean; canHandle(sessionId: string, req: IncomingMessage): boolean;

View File

@ -1,5 +1,3 @@
/// <reference types="node" />
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { Serializer } from "@spt/di/Serializer"; import { Serializer } from "@spt/di/Serializer";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage } from "node:http"; import { IncomingMessage } from "node:http";
import { WebSocket } from "ws"; import { WebSocket } from "ws";
export interface IWebSocketConnectionHandler { export interface IWebSocketConnectionHandler {

View File

@ -1,5 +1,3 @@
/// <reference types="node" />
/// <reference types="node" />
import { IncomingMessage } from "http"; import { IncomingMessage } from "http";
import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { IWsNotificationEvent } from "@spt/models/eft/ws/IWsNotificationEvent"; import { IWsNotificationEvent } from "@spt/models/eft/ws/IWsNotificationEvent";

View File

@ -22,6 +22,7 @@ import { HashUtil } from "@spt/utils/HashUtil";
import { RandomUtil } from "@spt/utils/RandomUtil"; import { RandomUtil } from "@spt/utils/RandomUtil";
import { TimeUtil } from "@spt/utils/TimeUtil"; import { TimeUtil } from "@spt/utils/TimeUtil";
import { ICloner } from "@spt/utils/cloners/ICloner"; import { ICloner } from "@spt/utils/cloners/ICloner";
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
export declare class InsuranceService { export declare class InsuranceService {
protected logger: ILogger; protected logger: ILogger;
protected databaseService: DatabaseService; protected databaseService: DatabaseService;
@ -39,10 +40,11 @@ export declare class InsuranceService {
protected mailSendService: MailSendService; protected mailSendService: MailSendService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected cloner: ICloner; protected cloner: ICloner;
protected profileHelper: ProfileHelper;
protected insured: Record<string, Record<string, Item[]>>; protected insured: Record<string, Record<string, Item[]>>;
protected insuranceConfig: IInsuranceConfig; protected insuranceConfig: IInsuranceConfig;
protected lostOnDeathConfig: ILostOnDeathConfig; protected lostOnDeathConfig: ILostOnDeathConfig;
constructor(logger: ILogger, databaseService: DatabaseService, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, databaseService: DatabaseService, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer, cloner: ICloner, profileHelper: ProfileHelper);
/** /**
* Does player have insurance array * Does player have insurance array
* @param sessionId Player id * @param sessionId Player id

View File

@ -1,4 +1,5 @@
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcData } from "@spt/models/eft/common/IPmcData";
import { Item } from "@spt/models/eft/common/tables/IItem"; import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
@ -11,8 +12,9 @@ export declare class RagfairTaxService {
protected databaseService: DatabaseService; protected databaseService: DatabaseService;
protected ragfairPriceService: RagfairPriceService; protected ragfairPriceService: RagfairPriceService;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected profileHelper: ProfileHelper;
protected playerOfferTaxCache: Record<string, IStorePlayerOfferTaxAmountRequestData>; protected playerOfferTaxCache: Record<string, IStorePlayerOfferTaxAmountRequestData>;
constructor(logger: ILogger, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, itemHelper: ItemHelper); constructor(logger: ILogger, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, itemHelper: ItemHelper, profileHelper: ProfileHelper);
storeClientOfferTaxValue(sessionId: string, offer: IStorePlayerOfferTaxAmountRequestData): void; storeClientOfferTaxValue(sessionId: string, offer: IStorePlayerOfferTaxAmountRequestData): void;
clearStoredOfferTaxById(offerIdToRemove: string): void; clearStoredOfferTaxById(offerIdToRemove: string): void;
getStoredClientOfferTaxValueById(offerIdToGet: string): IStorePlayerOfferTaxAmountRequestData; getStoredClientOfferTaxValueById(offerIdToGet: string): IStorePlayerOfferTaxAmountRequestData;

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { IHttpListener } from "@spt/servers/http/IHttpListener"; import { IHttpListener } from "@spt/servers/http/IHttpListener";
export declare class HttpListenerMod implements IHttpListener { export declare class HttpListenerMod implements IHttpListener {

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { DependencyContainer } from "tsyringe"; import { DependencyContainer } from "tsyringe";
export declare class HttpListenerModService { export declare class HttpListenerModService {

View File

@ -1,5 +1,3 @@
/// <reference types="node" />
/// <reference types="node" />
import crypto from "node:crypto"; import crypto from "node:crypto";
import fs from "node:fs"; import fs from "node:fs";
import { TimeUtil } from "@spt/utils/TimeUtil"; import { TimeUtil } from "@spt/utils/TimeUtil";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { ServerResponse } from "node:http"; import { ServerResponse } from "node:http";
import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; import { HttpServerHelper } from "@spt/helpers/HttpServerHelper";
export declare class HttpFileUtil { export declare class HttpFileUtil {

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { TimeUtil } from "@spt/utils/TimeUtil"; import { TimeUtil } from "@spt/utils/TimeUtil";
export declare class ObjectId { export declare class ObjectId {
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;

View File

@ -1,5 +1,3 @@
/// <reference types="node" />
/// <reference types="node" />
import "reflect-metadata"; import "reflect-metadata";
import fs from "node:fs"; import fs from "node:fs";
import { IAsyncQueue } from "@spt/models/spt/utils/IAsyncQueue"; import { IAsyncQueue } from "@spt/models/spt/utils/IAsyncQueue";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import fs from "node:fs"; import fs from "node:fs";
import { Daum } from "@spt/models/eft/itemEvent/IItemEventRouterRequest"; import { Daum } from "@spt/models/eft/itemEvent/IItemEventRouterRequest";
import { LogBackgroundColor } from "@spt/models/spt/logging/LogBackgroundColor"; import { LogBackgroundColor } from "@spt/models/spt/logging/LogBackgroundColor";

View File

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

View File

@ -76,6 +76,14 @@ export declare class BotEquipmentModGenerator {
* @returns Weapon + mods array * @returns Weapon + mods array
*/ */
generateModsForWeapon(sessionId: string, request: IGenerateWeaponRequest): Item[]; generateModsForWeapon(sessionId: string, request: IGenerateWeaponRequest): Item[];
/**
* Should the provided bot have its stock chance values altered to 100%
* @param modSlot Slot to check
* @param botEquipConfig Bots equipment config/chance values
* @param modToAddTemplate Mod being added to bots weapon
* @returns True if it should
*/
protected shouldForceSubStockSlots(modSlot: string, botEquipConfig: EquipmentFilters, modToAddTemplate: ITemplateItem): boolean;
/** /**
* Is this modslot a front or rear sight * Is this modslot a front or rear sight
* @param modSlot Slot to check * @param modSlot Slot to check

View File

@ -28,6 +28,7 @@ export declare class RepeatableQuestGenerator {
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected cloner: ICloner; protected cloner: ICloner;
protected questConfig: IQuestConfig; protected questConfig: IQuestConfig;
protected maxRandomNumberAttempts: number;
constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner);
/** /**
* This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json).

View File

@ -76,7 +76,13 @@ export declare class ItemHelper {
*/ */
generateUpdForItem(itemTemplate: ITemplateItem): Upd; generateUpdForItem(itemTemplate: ITemplateItem): Upd;
/** /**
* Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * Checks if a tpl is a valid item. Valid meaning that it's an item that be stored in stash
* Valid means:
* Not quest item
* 'Item' type
* Not on the invalid base types array
* Price above 0 roubles
* Not on item config blacklist
* @param {string} tpl the template id / tpl * @param {string} tpl the template id / tpl
* @returns boolean; true for items that may be in player possession and not quest items * @returns boolean; true for items that may be in player possession and not quest items
*/ */

View File

@ -3,6 +3,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData";
import { Common, CounterKeyValue, Stats } from "@spt/models/eft/common/tables/IBotBase"; import { Common, CounterKeyValue, Stats } from "@spt/models/eft/common/tables/IBotBase";
import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ISptProfile } from "@spt/models/eft/profile/ISptProfile";
import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData";
import { BonusType } from "@spt/models/enums/BonusType";
import { SkillTypes } from "@spt/models/enums/SkillTypes"; import { SkillTypes } from "@spt/models/enums/SkillTypes";
import { IInventoryConfig } from "@spt/models/spt/config/IInventoryConfig"; import { IInventoryConfig } from "@spt/models/spt/config/IInventoryConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
@ -190,6 +191,13 @@ export declare class ProfileHelper {
* @param rowsToAdd How many rows to give profile * @param rowsToAdd How many rows to give profile
*/ */
addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void;
/**
* Iterate over all bonuses and sum up all bonuses of desired type in provided profile
* @param pmcProfile Player profile
* @param desiredBonus Bonus to sum up
* @returns Summed bonus value or 0 if no bonus found
*/
getBonusValueFromProfile(pmcProfile: IPmcData, desiredBonus: BonusType): number;
playerIsFleaBanned(pmcProfile: IPmcData): boolean; playerIsFleaBanned(pmcProfile: IPmcData): boolean;
/** /**
* Add an achievement to player profile * Add an achievement to player profile

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
export type HandleFn = (_: string, req: IncomingMessage, resp: ServerResponse) => void; export type HandleFn = (_: string, req: IncomingMessage, resp: ServerResponse) => void;
/** /**
@ -6,7 +5,9 @@ export type HandleFn = (_: string, req: IncomingMessage, resp: ServerResponse) =
* @param basePath The base path * @param basePath The base path
* @returns The decorator that create the listener proxy * @returns The decorator that create the listener proxy
*/ */
export declare const Listen: (basePath: string) => <T extends new (...args: any[]) => any>(Base: T) => T; export declare const Listen: (basePath: string) => <T extends {
new (...args: any[]): any;
}>(Base: T) => T;
/** /**
* HTTP DELETE decorator * HTTP DELETE decorator
*/ */

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage } from "node:http"; import { IncomingMessage } from "node:http";
import { DynamicRouter, Router, StaticRouter } from "@spt/di/Router"; import { DynamicRouter, Router, StaticRouter } from "@spt/di/Router";
export declare class HttpRouter { export declare class HttpRouter {

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { ImageRouteService } from "@spt/services/mod/image/ImageRouteService"; import { ImageRouteService } from "@spt/services/mod/image/ImageRouteService";
import { HttpFileUtil } from "@spt/utils/HttpFileUtil"; import { HttpFileUtil } from "@spt/utils/HttpFileUtil";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { Serializer } from "@spt/di/Serializer"; import { Serializer } from "@spt/di/Serializer";
import { BundleLoader } from "@spt/loaders/BundleLoader"; import { BundleLoader } from "@spt/loaders/BundleLoader";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { Serializer } from "@spt/di/Serializer"; import { Serializer } from "@spt/di/Serializer";
import { ImageRouter } from "@spt/routers/ImageRouter"; import { ImageRouter } from "@spt/routers/ImageRouter";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { NotifierController } from "@spt/controllers/NotifierController"; import { NotifierController } from "@spt/controllers/NotifierController";
import { Serializer } from "@spt/di/Serializer"; import { Serializer } from "@spt/di/Serializer";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { ApplicationContext } from "@spt/context/ApplicationContext"; import { ApplicationContext } from "@spt/context/ApplicationContext";
import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; import { HttpServerHelper } from "@spt/helpers/HttpServerHelper";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import http, { IncomingMessage } from "node:http"; import http, { IncomingMessage } from "node:http";
import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; import { HttpServerHelper } from "@spt/helpers/HttpServerHelper";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
export interface IHttpListener { export interface IHttpListener {
canHandle(sessionId: string, req: IncomingMessage): boolean; canHandle(sessionId: string, req: IncomingMessage): boolean;

View File

@ -1,5 +1,3 @@
/// <reference types="node" />
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { Serializer } from "@spt/di/Serializer"; import { Serializer } from "@spt/di/Serializer";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage } from "node:http"; import { IncomingMessage } from "node:http";
import { WebSocket } from "ws"; import { WebSocket } from "ws";
export interface IWebSocketConnectionHandler { export interface IWebSocketConnectionHandler {

View File

@ -1,5 +1,3 @@
/// <reference types="node" />
/// <reference types="node" />
import { IncomingMessage } from "http"; import { IncomingMessage } from "http";
import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { IWsNotificationEvent } from "@spt/models/eft/ws/IWsNotificationEvent"; import { IWsNotificationEvent } from "@spt/models/eft/ws/IWsNotificationEvent";

View File

@ -22,6 +22,7 @@ import { HashUtil } from "@spt/utils/HashUtil";
import { RandomUtil } from "@spt/utils/RandomUtil"; import { RandomUtil } from "@spt/utils/RandomUtil";
import { TimeUtil } from "@spt/utils/TimeUtil"; import { TimeUtil } from "@spt/utils/TimeUtil";
import { ICloner } from "@spt/utils/cloners/ICloner"; import { ICloner } from "@spt/utils/cloners/ICloner";
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
export declare class InsuranceService { export declare class InsuranceService {
protected logger: ILogger; protected logger: ILogger;
protected databaseService: DatabaseService; protected databaseService: DatabaseService;
@ -39,10 +40,11 @@ export declare class InsuranceService {
protected mailSendService: MailSendService; protected mailSendService: MailSendService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected cloner: ICloner; protected cloner: ICloner;
protected profileHelper: ProfileHelper;
protected insured: Record<string, Record<string, Item[]>>; protected insured: Record<string, Record<string, Item[]>>;
protected insuranceConfig: IInsuranceConfig; protected insuranceConfig: IInsuranceConfig;
protected lostOnDeathConfig: ILostOnDeathConfig; protected lostOnDeathConfig: ILostOnDeathConfig;
constructor(logger: ILogger, databaseService: DatabaseService, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer, cloner: ICloner); constructor(logger: ILogger, databaseService: DatabaseService, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer, cloner: ICloner, profileHelper: ProfileHelper);
/** /**
* Does player have insurance array * Does player have insurance array
* @param sessionId Player id * @param sessionId Player id

View File

@ -1,4 +1,5 @@
import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper";
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcData } from "@spt/models/eft/common/IPmcData";
import { Item } from "@spt/models/eft/common/tables/IItem"; import { Item } from "@spt/models/eft/common/tables/IItem";
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
@ -11,8 +12,9 @@ export declare class RagfairTaxService {
protected databaseService: DatabaseService; protected databaseService: DatabaseService;
protected ragfairPriceService: RagfairPriceService; protected ragfairPriceService: RagfairPriceService;
protected itemHelper: ItemHelper; protected itemHelper: ItemHelper;
protected profileHelper: ProfileHelper;
protected playerOfferTaxCache: Record<string, IStorePlayerOfferTaxAmountRequestData>; protected playerOfferTaxCache: Record<string, IStorePlayerOfferTaxAmountRequestData>;
constructor(logger: ILogger, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, itemHelper: ItemHelper); constructor(logger: ILogger, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, itemHelper: ItemHelper, profileHelper: ProfileHelper);
storeClientOfferTaxValue(sessionId: string, offer: IStorePlayerOfferTaxAmountRequestData): void; storeClientOfferTaxValue(sessionId: string, offer: IStorePlayerOfferTaxAmountRequestData): void;
clearStoredOfferTaxById(offerIdToRemove: string): void; clearStoredOfferTaxById(offerIdToRemove: string): void;
getStoredClientOfferTaxValueById(offerIdToGet: string): IStorePlayerOfferTaxAmountRequestData; getStoredClientOfferTaxValueById(offerIdToGet: string): IStorePlayerOfferTaxAmountRequestData;

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { IHttpListener } from "@spt/servers/http/IHttpListener"; import { IHttpListener } from "@spt/servers/http/IHttpListener";
export declare class HttpListenerMod implements IHttpListener { export declare class HttpListenerMod implements IHttpListener {

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "node:http"; import { IncomingMessage, ServerResponse } from "node:http";
import { DependencyContainer } from "tsyringe"; import { DependencyContainer } from "tsyringe";
export declare class HttpListenerModService { export declare class HttpListenerModService {

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