Update types

This commit is contained in:
Dev 2023-08-02 16:18:37 +01:00
parent b2348014ea
commit e6c0fc7835
45 changed files with 262 additions and 113 deletions

View File

@ -128,6 +128,11 @@ export declare class GameController {
* @param pmcProfile Profile of player to get name from * @param pmcProfile Profile of player to get name from
*/ */
protected addPlayerToPMCNames(pmcProfile: IPmcData): void; 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 * Blank out the "test" mail message from prapor
*/ */

View File

@ -58,16 +58,12 @@ export declare class HideoutHelper {
* @returns * @returns
*/ */
isProductionType(productive: Productive): productive is Production; isProductionType(productive: Productive): productive is Production;
applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void;
/** /**
* TODO: * Apply bonus to player profile given after completing hideout upgrades
* After looking at the skills there doesnt seem to be a configuration per skill to boost * @param pmcData Profile to add bonus to
* the XP gain PER skill. I THINK you should be able to put the variable "SkillProgress" (just like health has it) * @param bonus Bonus to add to profile
* and be able to tune the skill gain PER skill, but I havent tested it and Im not sure!
* @param pmcData
* @param bonus
*/ */
protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void; applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void;
/** /**
* Process a players hideout, update areas that use resources + increment production timers * Process a players hideout, update areas that use resources + increment production timers
* @param sessionID Session id * @param sessionID Session id

View File

@ -35,6 +35,7 @@ export declare class PreAkiModLoader implements IModLoader {
getImportedModDetails(): Record<string, IPackageJsonData>; getImportedModDetails(): Record<string, IPackageJsonData>;
getModPath(mod: string): string; getModPath(mod: string): string;
protected importMods(): Promise<void>; protected importMods(): Promise<void>;
protected sortMods(prev: string, next: string, missingFromOrderJSON: Record<string, boolean>): number;
/** /**
* Check for duplicate mods loaded, show error if any * Check for duplicate mods loaded, show error if any
* @param modPackageData Dictionary of mod package.json data * @param modPackageData Dictionary of mod package.json data

View File

@ -11,9 +11,11 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse";
import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IServerDetails } from "../models/eft/game/IServerDetails";
import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig";
import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
@ -25,6 +27,7 @@ import { ProfileFixerService } from "../services/ProfileFixerService";
import { SeasonalEventService } from "../services/SeasonalEventService"; import { SeasonalEventService } from "../services/SeasonalEventService";
import { EncodingUtil } from "../utils/EncodingUtil"; import { EncodingUtil } from "../utils/EncodingUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
export declare class GameController { export declare class GameController {
protected logger: ILogger; protected logger: ILogger;
@ -33,6 +36,7 @@ export declare class GameController {
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected preAkiModLoader: PreAkiModLoader; protected preAkiModLoader: PreAkiModLoader;
protected httpServerHelper: HttpServerHelper; protected httpServerHelper: HttpServerHelper;
protected randomUtil: RandomUtil;
protected encodingUtil: EncodingUtil; protected encodingUtil: EncodingUtil;
protected hideoutHelper: HideoutHelper; protected hideoutHelper: HideoutHelper;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
@ -48,7 +52,9 @@ export declare class GameController {
protected httpConfig: IHttpConfig; protected httpConfig: IHttpConfig;
protected coreConfig: ICoreConfig; protected coreConfig: ICoreConfig;
protected locationConfig: ILocationConfig; protected locationConfig: ILocationConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); protected ragfairConfig: IRagfairConfig;
protected botConfig: IBotConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer);
/** /**
* Handle client/game/start * Handle client/game/start
*/ */
@ -84,6 +90,7 @@ export declare class GameController {
* @param pmcProfile Player profile * @param pmcProfile Player profile
*/ */
protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void; protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void;
protected flagAllItemsInDbAsSellableOnFlea(): void;
/** /**
* When player logs in, iterate over all active effects and reduce timer * When player logs in, iterate over all active effects and reduce timer
* TODO - add body part HP regen * TODO - add body part HP regen
@ -118,9 +125,14 @@ export declare class GameController {
protected validateQuestAssortUnlocksExist(): void; protected validateQuestAssortUnlocksExist(): void;
/** /**
* Add the logged in players name to PMC name pool * Add the logged in players name to PMC name pool
* @param pmcProfile * @param pmcProfile Profile of player to get name from
*/ */
protected addPlayerToPMCNames(pmcProfile: IPmcData): void; protected addPlayerToPMCNames(pmcProfile: IPmcData): void;
/**
* 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 * Blank out the "test" mail message from prapor
*/ */

View File

@ -10,6 +10,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
import { LocalisationService } from "../services/LocalisationService";
import { SeasonalEventService } from "../services/SeasonalEventService"; import { SeasonalEventService } from "../services/SeasonalEventService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
@ -32,9 +33,10 @@ export declare class BotGenerator {
protected botHelper: BotHelper; protected botHelper: BotHelper;
protected botDifficultyHelper: BotDifficultyHelper; protected botDifficultyHelper: BotDifficultyHelper;
protected seasonalEventService: SeasonalEventService; protected seasonalEventService: SeasonalEventService;
protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); 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 * Generate a player scav bot object
* @param role e.g. assault / pmcbot * @param role e.g. assault / pmcbot
@ -71,7 +73,7 @@ export declare class BotGenerator {
* @param botRole role of bot e.g. assault * @param botRole role of bot e.g. assault
* @returns Nickname for bot * @returns Nickname for bot
*/ */
protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string): string; protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string, sessionId: string): string;
/** /**
* Log the number of PMCs generated to the debug console * Log the number of PMCs generated to the debug console
* @param output Generated bot array, ready to send to client * @param output Generated bot array, ready to send to client

View File

@ -58,16 +58,12 @@ export declare class HideoutHelper {
* @returns * @returns
*/ */
isProductionType(productive: Productive): productive is Production; isProductionType(productive: Productive): productive is Production;
applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void;
/** /**
* TODO: * Apply bonus to player profile given after completing hideout upgrades
* After looking at the skills there doesnt seem to be a configuration per skill to boost * @param pmcData Profile to add bonus to
* the XP gain PER skill. I THINK you should be able to put the variable "SkillProgress" (just like health has it) * @param bonus Bonus to add to profile
* and be able to tune the skill gain PER skill, but I havent tested it and Im not sure!
* @param pmcData
* @param bonus
*/ */
protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void; applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void;
/** /**
* Process a players hideout, update areas that use resources + increment production timers * Process a players hideout, update areas that use resources + increment production timers
* @param sessionID Session id * @param sessionID Session id
@ -83,6 +79,7 @@ export declare class HideoutHelper {
isGeneratorOn: boolean; isGeneratorOn: boolean;
waterCollectorHasFilter: boolean; waterCollectorHasFilter: boolean;
}; };
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
/** /**
* Update progress timer for water collector * Update progress timer for water collector
* @param pmcData profile to update * @param pmcData profile to update
@ -141,9 +138,8 @@ export declare class HideoutHelper {
isGeneratorOn: boolean; isGeneratorOn: boolean;
waterCollectorHasFilter: boolean; waterCollectorHasFilter: boolean;
}): void; }): void;
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void; protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void;
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
/** /**
* Adjust water filter objects resourceValue or delete when they reach 0 resource * Adjust water filter objects resourceValue or delete when they reach 0 resource
* @param waterFilterArea water filter area to update * @param waterFilterArea water filter area to update

View File

@ -35,6 +35,7 @@ export declare class PreAkiModLoader implements IModLoader {
getImportedModDetails(): Record<string, IPackageJsonData>; getImportedModDetails(): Record<string, IPackageJsonData>;
getModPath(mod: string): string; getModPath(mod: string): string;
protected importMods(): Promise<void>; protected importMods(): Promise<void>;
protected sortMods(prev: string, next: string, missingFromOrderJSON: Record<string, boolean>): number;
/** /**
* Check for duplicate mods loaded, show error if any * Check for duplicate mods loaded, show error if any
* @param modPackageData Dictionary of mod package.json data * @param modPackageData Dictionary of mod package.json data

View File

@ -40,6 +40,8 @@ export interface IPmcConfig {
botRelativeLevelDeltaMax: number; botRelativeLevelDeltaMax: number;
/** Force a number of healing items into PMCs secure container to ensure they can heal */ /** Force a number of healing items into PMCs secure container to ensure they can heal */
forceHealingItemsIntoSecure: boolean; forceHealingItemsIntoSecure: boolean;
addPrefixToSameNamePMCAsPlayerChance: number;
allPMCsHavePlayerNameWithRandomPrefixChance: number;
} }
export interface PmcTypes { export interface PmcTypes {
usec: string; usec: string;

View File

@ -2,17 +2,19 @@ import { I18n } from "i18n";
import { ILocaleConfig } from "../models/spt/config/ILocaleConfig"; import { ILocaleConfig } from "../models/spt/config/ILocaleConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { RandomUtil } from "../utils/RandomUtil";
import { LocaleService } from "./LocaleService"; import { LocaleService } from "./LocaleService";
/** /**
* Handles translating server text into different langauges * Handles translating server text into different langauges
*/ */
export declare class LocalisationService { export declare class LocalisationService {
protected logger: ILogger; protected logger: ILogger;
protected randomUtil: RandomUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected localeService: LocaleService; protected localeService: LocaleService;
protected localeConfig: ILocaleConfig; protected localeConfig: ILocaleConfig;
protected i18n: I18n; protected i18n: I18n;
constructor(logger: ILogger, databaseServer: DatabaseServer, localeService: LocaleService); constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, localeService: LocaleService);
/** /**
* Get a localised value using the passed in key * Get a localised value using the passed in key
* @param key Key to loop up locale for * @param key Key to loop up locale for
@ -25,4 +27,10 @@ export declare class LocalisationService {
* @returns string array of keys * @returns string array of keys
*/ */
getKeys(): string[]; getKeys(): string[];
/**
* From the provided partial key, find all keys that start with text and choose a random match
* @param partialKey Key to match locale keys on
* @returns locale text
*/
getRandomTextThatMatchesPartialKey(partialKey: string): string;
} }

View File

@ -11,9 +11,11 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse";
import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IServerDetails } from "../models/eft/game/IServerDetails";
import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig";
import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
@ -25,6 +27,7 @@ import { ProfileFixerService } from "../services/ProfileFixerService";
import { SeasonalEventService } from "../services/SeasonalEventService"; import { SeasonalEventService } from "../services/SeasonalEventService";
import { EncodingUtil } from "../utils/EncodingUtil"; import { EncodingUtil } from "../utils/EncodingUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
export declare class GameController { export declare class GameController {
protected logger: ILogger; protected logger: ILogger;
@ -33,6 +36,7 @@ export declare class GameController {
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected preAkiModLoader: PreAkiModLoader; protected preAkiModLoader: PreAkiModLoader;
protected httpServerHelper: HttpServerHelper; protected httpServerHelper: HttpServerHelper;
protected randomUtil: RandomUtil;
protected encodingUtil: EncodingUtil; protected encodingUtil: EncodingUtil;
protected hideoutHelper: HideoutHelper; protected hideoutHelper: HideoutHelper;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
@ -48,7 +52,9 @@ export declare class GameController {
protected httpConfig: IHttpConfig; protected httpConfig: IHttpConfig;
protected coreConfig: ICoreConfig; protected coreConfig: ICoreConfig;
protected locationConfig: ILocationConfig; protected locationConfig: ILocationConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); protected ragfairConfig: IRagfairConfig;
protected botConfig: IBotConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer);
/** /**
* Handle client/game/start * Handle client/game/start
*/ */
@ -84,6 +90,7 @@ export declare class GameController {
* @param pmcProfile Player profile * @param pmcProfile Player profile
*/ */
protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void; protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void;
protected flagAllItemsInDbAsSellableOnFlea(): void;
/** /**
* When player logs in, iterate over all active effects and reduce timer * When player logs in, iterate over all active effects and reduce timer
* TODO - add body part HP regen * TODO - add body part HP regen
@ -118,9 +125,14 @@ export declare class GameController {
protected validateQuestAssortUnlocksExist(): void; protected validateQuestAssortUnlocksExist(): void;
/** /**
* Add the logged in players name to PMC name pool * Add the logged in players name to PMC name pool
* @param pmcProfile * @param pmcProfile Profile of player to get name from
*/ */
protected addPlayerToPMCNames(pmcProfile: IPmcData): void; protected addPlayerToPMCNames(pmcProfile: IPmcData): void;
/**
* 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 * Blank out the "test" mail message from prapor
*/ */

View File

@ -10,6 +10,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
import { LocalisationService } from "../services/LocalisationService";
import { SeasonalEventService } from "../services/SeasonalEventService"; import { SeasonalEventService } from "../services/SeasonalEventService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
@ -32,9 +33,10 @@ export declare class BotGenerator {
protected botHelper: BotHelper; protected botHelper: BotHelper;
protected botDifficultyHelper: BotDifficultyHelper; protected botDifficultyHelper: BotDifficultyHelper;
protected seasonalEventService: SeasonalEventService; protected seasonalEventService: SeasonalEventService;
protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); 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 * Generate a player scav bot object
* @param role e.g. assault / pmcbot * @param role e.g. assault / pmcbot
@ -71,7 +73,7 @@ export declare class BotGenerator {
* @param botRole role of bot e.g. assault * @param botRole role of bot e.g. assault
* @returns Nickname for bot * @returns Nickname for bot
*/ */
protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string): string; protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string, sessionId: string): string;
/** /**
* Log the number of PMCs generated to the debug console * Log the number of PMCs generated to the debug console
* @param output Generated bot array, ready to send to client * @param output Generated bot array, ready to send to client

View File

@ -58,16 +58,12 @@ export declare class HideoutHelper {
* @returns * @returns
*/ */
isProductionType(productive: Productive): productive is Production; isProductionType(productive: Productive): productive is Production;
applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void;
/** /**
* TODO: * Apply bonus to player profile given after completing hideout upgrades
* After looking at the skills there doesnt seem to be a configuration per skill to boost * @param pmcData Profile to add bonus to
* the XP gain PER skill. I THINK you should be able to put the variable "SkillProgress" (just like health has it) * @param bonus Bonus to add to profile
* and be able to tune the skill gain PER skill, but I havent tested it and Im not sure!
* @param pmcData
* @param bonus
*/ */
protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void; applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void;
/** /**
* Process a players hideout, update areas that use resources + increment production timers * Process a players hideout, update areas that use resources + increment production timers
* @param sessionID Session id * @param sessionID Session id
@ -83,6 +79,7 @@ export declare class HideoutHelper {
isGeneratorOn: boolean; isGeneratorOn: boolean;
waterCollectorHasFilter: boolean; waterCollectorHasFilter: boolean;
}; };
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
/** /**
* Update progress timer for water collector * Update progress timer for water collector
* @param pmcData profile to update * @param pmcData profile to update
@ -141,9 +138,8 @@ export declare class HideoutHelper {
isGeneratorOn: boolean; isGeneratorOn: boolean;
waterCollectorHasFilter: boolean; waterCollectorHasFilter: boolean;
}): void; }): void;
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void; protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void;
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
/** /**
* Adjust water filter objects resourceValue or delete when they reach 0 resource * Adjust water filter objects resourceValue or delete when they reach 0 resource
* @param waterFilterArea water filter area to update * @param waterFilterArea water filter area to update

View File

@ -35,6 +35,7 @@ export declare class PreAkiModLoader implements IModLoader {
getImportedModDetails(): Record<string, IPackageJsonData>; getImportedModDetails(): Record<string, IPackageJsonData>;
getModPath(mod: string): string; getModPath(mod: string): string;
protected importMods(): Promise<void>; protected importMods(): Promise<void>;
protected sortMods(prev: string, next: string, missingFromOrderJSON: Record<string, boolean>): number;
/** /**
* Check for duplicate mods loaded, show error if any * Check for duplicate mods loaded, show error if any
* @param modPackageData Dictionary of mod package.json data * @param modPackageData Dictionary of mod package.json data

View File

@ -40,6 +40,8 @@ export interface IPmcConfig {
botRelativeLevelDeltaMax: number; botRelativeLevelDeltaMax: number;
/** Force a number of healing items into PMCs secure container to ensure they can heal */ /** Force a number of healing items into PMCs secure container to ensure they can heal */
forceHealingItemsIntoSecure: boolean; forceHealingItemsIntoSecure: boolean;
addPrefixToSameNamePMCAsPlayerChance: number;
allPMCsHavePlayerNameWithRandomPrefixChance: number;
} }
export interface PmcTypes { export interface PmcTypes {
usec: string; usec: string;

View File

@ -2,17 +2,19 @@ import { I18n } from "i18n";
import { ILocaleConfig } from "../models/spt/config/ILocaleConfig"; import { ILocaleConfig } from "../models/spt/config/ILocaleConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { RandomUtil } from "../utils/RandomUtil";
import { LocaleService } from "./LocaleService"; import { LocaleService } from "./LocaleService";
/** /**
* Handles translating server text into different langauges * Handles translating server text into different langauges
*/ */
export declare class LocalisationService { export declare class LocalisationService {
protected logger: ILogger; protected logger: ILogger;
protected randomUtil: RandomUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected localeService: LocaleService; protected localeService: LocaleService;
protected localeConfig: ILocaleConfig; protected localeConfig: ILocaleConfig;
protected i18n: I18n; protected i18n: I18n;
constructor(logger: ILogger, databaseServer: DatabaseServer, localeService: LocaleService); constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, localeService: LocaleService);
/** /**
* Get a localised value using the passed in key * Get a localised value using the passed in key
* @param key Key to loop up locale for * @param key Key to loop up locale for
@ -25,4 +27,10 @@ export declare class LocalisationService {
* @returns string array of keys * @returns string array of keys
*/ */
getKeys(): string[]; getKeys(): string[];
/**
* From the provided partial key, find all keys that start with text and choose a random match
* @param partialKey Key to match locale keys on
* @returns locale text
*/
getRandomTextThatMatchesPartialKey(partialKey: string): string;
} }

View File

@ -11,9 +11,11 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse";
import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IServerDetails } from "../models/eft/game/IServerDetails";
import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig";
import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
@ -25,6 +27,7 @@ import { ProfileFixerService } from "../services/ProfileFixerService";
import { SeasonalEventService } from "../services/SeasonalEventService"; import { SeasonalEventService } from "../services/SeasonalEventService";
import { EncodingUtil } from "../utils/EncodingUtil"; import { EncodingUtil } from "../utils/EncodingUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
export declare class GameController { export declare class GameController {
protected logger: ILogger; protected logger: ILogger;
@ -33,6 +36,7 @@ export declare class GameController {
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected preAkiModLoader: PreAkiModLoader; protected preAkiModLoader: PreAkiModLoader;
protected httpServerHelper: HttpServerHelper; protected httpServerHelper: HttpServerHelper;
protected randomUtil: RandomUtil;
protected encodingUtil: EncodingUtil; protected encodingUtil: EncodingUtil;
protected hideoutHelper: HideoutHelper; protected hideoutHelper: HideoutHelper;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
@ -48,7 +52,9 @@ export declare class GameController {
protected httpConfig: IHttpConfig; protected httpConfig: IHttpConfig;
protected coreConfig: ICoreConfig; protected coreConfig: ICoreConfig;
protected locationConfig: ILocationConfig; protected locationConfig: ILocationConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); protected ragfairConfig: IRagfairConfig;
protected botConfig: IBotConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer);
/** /**
* Handle client/game/start * Handle client/game/start
*/ */
@ -84,6 +90,7 @@ export declare class GameController {
* @param pmcProfile Player profile * @param pmcProfile Player profile
*/ */
protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void; protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void;
protected flagAllItemsInDbAsSellableOnFlea(): void;
/** /**
* When player logs in, iterate over all active effects and reduce timer * When player logs in, iterate over all active effects and reduce timer
* TODO - add body part HP regen * TODO - add body part HP regen
@ -118,9 +125,14 @@ export declare class GameController {
protected validateQuestAssortUnlocksExist(): void; protected validateQuestAssortUnlocksExist(): void;
/** /**
* Add the logged in players name to PMC name pool * Add the logged in players name to PMC name pool
* @param pmcProfile * @param pmcProfile Profile of player to get name from
*/ */
protected addPlayerToPMCNames(pmcProfile: IPmcData): void; protected addPlayerToPMCNames(pmcProfile: IPmcData): void;
/**
* 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 * Blank out the "test" mail message from prapor
*/ */

View File

@ -10,6 +10,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
import { LocalisationService } from "../services/LocalisationService";
import { SeasonalEventService } from "../services/SeasonalEventService"; import { SeasonalEventService } from "../services/SeasonalEventService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
@ -32,9 +33,10 @@ export declare class BotGenerator {
protected botHelper: BotHelper; protected botHelper: BotHelper;
protected botDifficultyHelper: BotDifficultyHelper; protected botDifficultyHelper: BotDifficultyHelper;
protected seasonalEventService: SeasonalEventService; protected seasonalEventService: SeasonalEventService;
protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); 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 * Generate a player scav bot object
* @param role e.g. assault / pmcbot * @param role e.g. assault / pmcbot
@ -71,7 +73,7 @@ export declare class BotGenerator {
* @param botRole role of bot e.g. assault * @param botRole role of bot e.g. assault
* @returns Nickname for bot * @returns Nickname for bot
*/ */
protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string): string; protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string, sessionId: string): string;
/** /**
* Log the number of PMCs generated to the debug console * Log the number of PMCs generated to the debug console
* @param output Generated bot array, ready to send to client * @param output Generated bot array, ready to send to client

View File

@ -58,16 +58,12 @@ export declare class HideoutHelper {
* @returns * @returns
*/ */
isProductionType(productive: Productive): productive is Production; isProductionType(productive: Productive): productive is Production;
applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void;
/** /**
* TODO: * Apply bonus to player profile given after completing hideout upgrades
* After looking at the skills there doesnt seem to be a configuration per skill to boost * @param pmcData Profile to add bonus to
* the XP gain PER skill. I THINK you should be able to put the variable "SkillProgress" (just like health has it) * @param bonus Bonus to add to profile
* and be able to tune the skill gain PER skill, but I havent tested it and Im not sure!
* @param pmcData
* @param bonus
*/ */
protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void; applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void;
/** /**
* Process a players hideout, update areas that use resources + increment production timers * Process a players hideout, update areas that use resources + increment production timers
* @param sessionID Session id * @param sessionID Session id
@ -83,6 +79,7 @@ export declare class HideoutHelper {
isGeneratorOn: boolean; isGeneratorOn: boolean;
waterCollectorHasFilter: boolean; waterCollectorHasFilter: boolean;
}; };
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
/** /**
* Update progress timer for water collector * Update progress timer for water collector
* @param pmcData profile to update * @param pmcData profile to update
@ -141,9 +138,8 @@ export declare class HideoutHelper {
isGeneratorOn: boolean; isGeneratorOn: boolean;
waterCollectorHasFilter: boolean; waterCollectorHasFilter: boolean;
}): void; }): void;
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void; protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void;
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
/** /**
* Adjust water filter objects resourceValue or delete when they reach 0 resource * Adjust water filter objects resourceValue or delete when they reach 0 resource
* @param waterFilterArea water filter area to update * @param waterFilterArea water filter area to update

View File

@ -35,6 +35,7 @@ export declare class PreAkiModLoader implements IModLoader {
getImportedModDetails(): Record<string, IPackageJsonData>; getImportedModDetails(): Record<string, IPackageJsonData>;
getModPath(mod: string): string; getModPath(mod: string): string;
protected importMods(): Promise<void>; protected importMods(): Promise<void>;
protected sortMods(prev: string, next: string, missingFromOrderJSON: Record<string, boolean>): number;
/** /**
* Check for duplicate mods loaded, show error if any * Check for duplicate mods loaded, show error if any
* @param modPackageData Dictionary of mod package.json data * @param modPackageData Dictionary of mod package.json data

View File

@ -40,6 +40,8 @@ export interface IPmcConfig {
botRelativeLevelDeltaMax: number; botRelativeLevelDeltaMax: number;
/** Force a number of healing items into PMCs secure container to ensure they can heal */ /** Force a number of healing items into PMCs secure container to ensure they can heal */
forceHealingItemsIntoSecure: boolean; forceHealingItemsIntoSecure: boolean;
addPrefixToSameNamePMCAsPlayerChance: number;
allPMCsHavePlayerNameWithRandomPrefixChance: number;
} }
export interface PmcTypes { export interface PmcTypes {
usec: string; usec: string;

View File

@ -2,17 +2,19 @@ import { I18n } from "i18n";
import { ILocaleConfig } from "../models/spt/config/ILocaleConfig"; import { ILocaleConfig } from "../models/spt/config/ILocaleConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { RandomUtil } from "../utils/RandomUtil";
import { LocaleService } from "./LocaleService"; import { LocaleService } from "./LocaleService";
/** /**
* Handles translating server text into different langauges * Handles translating server text into different langauges
*/ */
export declare class LocalisationService { export declare class LocalisationService {
protected logger: ILogger; protected logger: ILogger;
protected randomUtil: RandomUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected localeService: LocaleService; protected localeService: LocaleService;
protected localeConfig: ILocaleConfig; protected localeConfig: ILocaleConfig;
protected i18n: I18n; protected i18n: I18n;
constructor(logger: ILogger, databaseServer: DatabaseServer, localeService: LocaleService); constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, localeService: LocaleService);
/** /**
* Get a localised value using the passed in key * Get a localised value using the passed in key
* @param key Key to loop up locale for * @param key Key to loop up locale for
@ -25,4 +27,10 @@ export declare class LocalisationService {
* @returns string array of keys * @returns string array of keys
*/ */
getKeys(): string[]; getKeys(): string[];
/**
* From the provided partial key, find all keys that start with text and choose a random match
* @param partialKey Key to match locale keys on
* @returns locale text
*/
getRandomTextThatMatchesPartialKey(partialKey: string): string;
} }

View File

@ -11,9 +11,11 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse";
import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IServerDetails } from "../models/eft/game/IServerDetails";
import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig";
import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
@ -25,6 +27,7 @@ import { ProfileFixerService } from "../services/ProfileFixerService";
import { SeasonalEventService } from "../services/SeasonalEventService"; import { SeasonalEventService } from "../services/SeasonalEventService";
import { EncodingUtil } from "../utils/EncodingUtil"; import { EncodingUtil } from "../utils/EncodingUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
export declare class GameController { export declare class GameController {
protected logger: ILogger; protected logger: ILogger;
@ -33,6 +36,7 @@ export declare class GameController {
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected preAkiModLoader: PreAkiModLoader; protected preAkiModLoader: PreAkiModLoader;
protected httpServerHelper: HttpServerHelper; protected httpServerHelper: HttpServerHelper;
protected randomUtil: RandomUtil;
protected encodingUtil: EncodingUtil; protected encodingUtil: EncodingUtil;
protected hideoutHelper: HideoutHelper; protected hideoutHelper: HideoutHelper;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
@ -48,7 +52,9 @@ export declare class GameController {
protected httpConfig: IHttpConfig; protected httpConfig: IHttpConfig;
protected coreConfig: ICoreConfig; protected coreConfig: ICoreConfig;
protected locationConfig: ILocationConfig; protected locationConfig: ILocationConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); protected ragfairConfig: IRagfairConfig;
protected botConfig: IBotConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer);
/** /**
* Handle client/game/start * Handle client/game/start
*/ */
@ -84,6 +90,7 @@ export declare class GameController {
* @param pmcProfile Player profile * @param pmcProfile Player profile
*/ */
protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void; protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void;
protected flagAllItemsInDbAsSellableOnFlea(): void;
/** /**
* When player logs in, iterate over all active effects and reduce timer * When player logs in, iterate over all active effects and reduce timer
* TODO - add body part HP regen * TODO - add body part HP regen
@ -118,9 +125,14 @@ export declare class GameController {
protected validateQuestAssortUnlocksExist(): void; protected validateQuestAssortUnlocksExist(): void;
/** /**
* Add the logged in players name to PMC name pool * Add the logged in players name to PMC name pool
* @param pmcProfile * @param pmcProfile Profile of player to get name from
*/ */
protected addPlayerToPMCNames(pmcProfile: IPmcData): void; protected addPlayerToPMCNames(pmcProfile: IPmcData): void;
/**
* 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 * Blank out the "test" mail message from prapor
*/ */

View File

@ -10,6 +10,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
import { LocalisationService } from "../services/LocalisationService";
import { SeasonalEventService } from "../services/SeasonalEventService"; import { SeasonalEventService } from "../services/SeasonalEventService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
@ -32,9 +33,10 @@ export declare class BotGenerator {
protected botHelper: BotHelper; protected botHelper: BotHelper;
protected botDifficultyHelper: BotDifficultyHelper; protected botDifficultyHelper: BotDifficultyHelper;
protected seasonalEventService: SeasonalEventService; protected seasonalEventService: SeasonalEventService;
protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); 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 * Generate a player scav bot object
* @param role e.g. assault / pmcbot * @param role e.g. assault / pmcbot
@ -71,7 +73,7 @@ export declare class BotGenerator {
* @param botRole role of bot e.g. assault * @param botRole role of bot e.g. assault
* @returns Nickname for bot * @returns Nickname for bot
*/ */
protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string): string; protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string, sessionId: string): string;
/** /**
* Log the number of PMCs generated to the debug console * Log the number of PMCs generated to the debug console
* @param output Generated bot array, ready to send to client * @param output Generated bot array, ready to send to client

View File

@ -58,16 +58,12 @@ export declare class HideoutHelper {
* @returns * @returns
*/ */
isProductionType(productive: Productive): productive is Production; isProductionType(productive: Productive): productive is Production;
applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void;
/** /**
* TODO: * Apply bonus to player profile given after completing hideout upgrades
* After looking at the skills there doesnt seem to be a configuration per skill to boost * @param pmcData Profile to add bonus to
* the XP gain PER skill. I THINK you should be able to put the variable "SkillProgress" (just like health has it) * @param bonus Bonus to add to profile
* and be able to tune the skill gain PER skill, but I havent tested it and Im not sure!
* @param pmcData
* @param bonus
*/ */
protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void; applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void;
/** /**
* Process a players hideout, update areas that use resources + increment production timers * Process a players hideout, update areas that use resources + increment production timers
* @param sessionID Session id * @param sessionID Session id
@ -83,6 +79,7 @@ export declare class HideoutHelper {
isGeneratorOn: boolean; isGeneratorOn: boolean;
waterCollectorHasFilter: boolean; waterCollectorHasFilter: boolean;
}; };
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
/** /**
* Update progress timer for water collector * Update progress timer for water collector
* @param pmcData profile to update * @param pmcData profile to update
@ -141,9 +138,8 @@ export declare class HideoutHelper {
isGeneratorOn: boolean; isGeneratorOn: boolean;
waterCollectorHasFilter: boolean; waterCollectorHasFilter: boolean;
}): void; }): void;
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void; protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void;
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
/** /**
* Adjust water filter objects resourceValue or delete when they reach 0 resource * Adjust water filter objects resourceValue or delete when they reach 0 resource
* @param waterFilterArea water filter area to update * @param waterFilterArea water filter area to update

View File

@ -35,6 +35,7 @@ export declare class PreAkiModLoader implements IModLoader {
getImportedModDetails(): Record<string, IPackageJsonData>; getImportedModDetails(): Record<string, IPackageJsonData>;
getModPath(mod: string): string; getModPath(mod: string): string;
protected importMods(): Promise<void>; protected importMods(): Promise<void>;
protected sortMods(prev: string, next: string, missingFromOrderJSON: Record<string, boolean>): number;
/** /**
* Check for duplicate mods loaded, show error if any * Check for duplicate mods loaded, show error if any
* @param modPackageData Dictionary of mod package.json data * @param modPackageData Dictionary of mod package.json data

View File

@ -40,6 +40,8 @@ export interface IPmcConfig {
botRelativeLevelDeltaMax: number; botRelativeLevelDeltaMax: number;
/** Force a number of healing items into PMCs secure container to ensure they can heal */ /** Force a number of healing items into PMCs secure container to ensure they can heal */
forceHealingItemsIntoSecure: boolean; forceHealingItemsIntoSecure: boolean;
addPrefixToSameNamePMCAsPlayerChance: number;
allPMCsHavePlayerNameWithRandomPrefixChance: number;
} }
export interface PmcTypes { export interface PmcTypes {
usec: string; usec: string;

View File

@ -2,17 +2,19 @@ import { I18n } from "i18n";
import { ILocaleConfig } from "../models/spt/config/ILocaleConfig"; import { ILocaleConfig } from "../models/spt/config/ILocaleConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { RandomUtil } from "../utils/RandomUtil";
import { LocaleService } from "./LocaleService"; import { LocaleService } from "./LocaleService";
/** /**
* Handles translating server text into different langauges * Handles translating server text into different langauges
*/ */
export declare class LocalisationService { export declare class LocalisationService {
protected logger: ILogger; protected logger: ILogger;
protected randomUtil: RandomUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected localeService: LocaleService; protected localeService: LocaleService;
protected localeConfig: ILocaleConfig; protected localeConfig: ILocaleConfig;
protected i18n: I18n; protected i18n: I18n;
constructor(logger: ILogger, databaseServer: DatabaseServer, localeService: LocaleService); constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, localeService: LocaleService);
/** /**
* Get a localised value using the passed in key * Get a localised value using the passed in key
* @param key Key to loop up locale for * @param key Key to loop up locale for
@ -25,4 +27,10 @@ export declare class LocalisationService {
* @returns string array of keys * @returns string array of keys
*/ */
getKeys(): string[]; getKeys(): string[];
/**
* From the provided partial key, find all keys that start with text and choose a random match
* @param partialKey Key to match locale keys on
* @returns locale text
*/
getRandomTextThatMatchesPartialKey(partialKey: string): string;
} }

View File

@ -11,9 +11,11 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse";
import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IServerDetails } from "../models/eft/game/IServerDetails";
import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig";
import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
@ -25,6 +27,7 @@ import { ProfileFixerService } from "../services/ProfileFixerService";
import { SeasonalEventService } from "../services/SeasonalEventService"; import { SeasonalEventService } from "../services/SeasonalEventService";
import { EncodingUtil } from "../utils/EncodingUtil"; import { EncodingUtil } from "../utils/EncodingUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
export declare class GameController { export declare class GameController {
protected logger: ILogger; protected logger: ILogger;
@ -33,6 +36,7 @@ export declare class GameController {
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected preAkiModLoader: PreAkiModLoader; protected preAkiModLoader: PreAkiModLoader;
protected httpServerHelper: HttpServerHelper; protected httpServerHelper: HttpServerHelper;
protected randomUtil: RandomUtil;
protected encodingUtil: EncodingUtil; protected encodingUtil: EncodingUtil;
protected hideoutHelper: HideoutHelper; protected hideoutHelper: HideoutHelper;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
@ -48,7 +52,9 @@ export declare class GameController {
protected httpConfig: IHttpConfig; protected httpConfig: IHttpConfig;
protected coreConfig: ICoreConfig; protected coreConfig: ICoreConfig;
protected locationConfig: ILocationConfig; protected locationConfig: ILocationConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); protected ragfairConfig: IRagfairConfig;
protected botConfig: IBotConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer);
/** /**
* Handle client/game/start * Handle client/game/start
*/ */
@ -84,6 +90,7 @@ export declare class GameController {
* @param pmcProfile Player profile * @param pmcProfile Player profile
*/ */
protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void; protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void;
protected flagAllItemsInDbAsSellableOnFlea(): void;
/** /**
* When player logs in, iterate over all active effects and reduce timer * When player logs in, iterate over all active effects and reduce timer
* TODO - add body part HP regen * TODO - add body part HP regen
@ -118,9 +125,14 @@ export declare class GameController {
protected validateQuestAssortUnlocksExist(): void; protected validateQuestAssortUnlocksExist(): void;
/** /**
* Add the logged in players name to PMC name pool * Add the logged in players name to PMC name pool
* @param pmcProfile * @param pmcProfile Profile of player to get name from
*/ */
protected addPlayerToPMCNames(pmcProfile: IPmcData): void; protected addPlayerToPMCNames(pmcProfile: IPmcData): void;
/**
* 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 * Blank out the "test" mail message from prapor
*/ */

View File

@ -10,6 +10,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
import { LocalisationService } from "../services/LocalisationService";
import { SeasonalEventService } from "../services/SeasonalEventService"; import { SeasonalEventService } from "../services/SeasonalEventService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
@ -32,9 +33,10 @@ export declare class BotGenerator {
protected botHelper: BotHelper; protected botHelper: BotHelper;
protected botDifficultyHelper: BotDifficultyHelper; protected botDifficultyHelper: BotDifficultyHelper;
protected seasonalEventService: SeasonalEventService; protected seasonalEventService: SeasonalEventService;
protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); 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 * Generate a player scav bot object
* @param role e.g. assault / pmcbot * @param role e.g. assault / pmcbot
@ -71,7 +73,7 @@ export declare class BotGenerator {
* @param botRole role of bot e.g. assault * @param botRole role of bot e.g. assault
* @returns Nickname for bot * @returns Nickname for bot
*/ */
protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string): string; protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string, sessionId: string): string;
/** /**
* Log the number of PMCs generated to the debug console * Log the number of PMCs generated to the debug console
* @param output Generated bot array, ready to send to client * @param output Generated bot array, ready to send to client

View File

@ -58,16 +58,12 @@ export declare class HideoutHelper {
* @returns * @returns
*/ */
isProductionType(productive: Productive): productive is Production; isProductionType(productive: Productive): productive is Production;
applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void;
/** /**
* TODO: * Apply bonus to player profile given after completing hideout upgrades
* After looking at the skills there doesnt seem to be a configuration per skill to boost * @param pmcData Profile to add bonus to
* the XP gain PER skill. I THINK you should be able to put the variable "SkillProgress" (just like health has it) * @param bonus Bonus to add to profile
* and be able to tune the skill gain PER skill, but I havent tested it and Im not sure!
* @param pmcData
* @param bonus
*/ */
protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void; applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void;
/** /**
* Process a players hideout, update areas that use resources + increment production timers * Process a players hideout, update areas that use resources + increment production timers
* @param sessionID Session id * @param sessionID Session id
@ -83,6 +79,7 @@ export declare class HideoutHelper {
isGeneratorOn: boolean; isGeneratorOn: boolean;
waterCollectorHasFilter: boolean; waterCollectorHasFilter: boolean;
}; };
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
/** /**
* Update progress timer for water collector * Update progress timer for water collector
* @param pmcData profile to update * @param pmcData profile to update
@ -141,9 +138,8 @@ export declare class HideoutHelper {
isGeneratorOn: boolean; isGeneratorOn: boolean;
waterCollectorHasFilter: boolean; waterCollectorHasFilter: boolean;
}): void; }): void;
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void; protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void;
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
/** /**
* Adjust water filter objects resourceValue or delete when they reach 0 resource * Adjust water filter objects resourceValue or delete when they reach 0 resource
* @param waterFilterArea water filter area to update * @param waterFilterArea water filter area to update

View File

@ -35,6 +35,7 @@ export declare class PreAkiModLoader implements IModLoader {
getImportedModDetails(): Record<string, IPackageJsonData>; getImportedModDetails(): Record<string, IPackageJsonData>;
getModPath(mod: string): string; getModPath(mod: string): string;
protected importMods(): Promise<void>; protected importMods(): Promise<void>;
protected sortMods(prev: string, next: string, missingFromOrderJSON: Record<string, boolean>): number;
/** /**
* Check for duplicate mods loaded, show error if any * Check for duplicate mods loaded, show error if any
* @param modPackageData Dictionary of mod package.json data * @param modPackageData Dictionary of mod package.json data

View File

@ -40,6 +40,8 @@ export interface IPmcConfig {
botRelativeLevelDeltaMax: number; botRelativeLevelDeltaMax: number;
/** Force a number of healing items into PMCs secure container to ensure they can heal */ /** Force a number of healing items into PMCs secure container to ensure they can heal */
forceHealingItemsIntoSecure: boolean; forceHealingItemsIntoSecure: boolean;
addPrefixToSameNamePMCAsPlayerChance: number;
allPMCsHavePlayerNameWithRandomPrefixChance: number;
} }
export interface PmcTypes { export interface PmcTypes {
usec: string; usec: string;

View File

@ -2,17 +2,19 @@ import { I18n } from "i18n";
import { ILocaleConfig } from "../models/spt/config/ILocaleConfig"; import { ILocaleConfig } from "../models/spt/config/ILocaleConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { RandomUtil } from "../utils/RandomUtil";
import { LocaleService } from "./LocaleService"; import { LocaleService } from "./LocaleService";
/** /**
* Handles translating server text into different langauges * Handles translating server text into different langauges
*/ */
export declare class LocalisationService { export declare class LocalisationService {
protected logger: ILogger; protected logger: ILogger;
protected randomUtil: RandomUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected localeService: LocaleService; protected localeService: LocaleService;
protected localeConfig: ILocaleConfig; protected localeConfig: ILocaleConfig;
protected i18n: I18n; protected i18n: I18n;
constructor(logger: ILogger, databaseServer: DatabaseServer, localeService: LocaleService); constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, localeService: LocaleService);
/** /**
* Get a localised value using the passed in key * Get a localised value using the passed in key
* @param key Key to loop up locale for * @param key Key to loop up locale for
@ -25,4 +27,10 @@ export declare class LocalisationService {
* @returns string array of keys * @returns string array of keys
*/ */
getKeys(): string[]; getKeys(): string[];
/**
* From the provided partial key, find all keys that start with text and choose a random match
* @param partialKey Key to match locale keys on
* @returns locale text
*/
getRandomTextThatMatchesPartialKey(partialKey: string): string;
} }

View File

@ -11,9 +11,11 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse";
import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IServerDetails } from "../models/eft/game/IServerDetails";
import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig";
import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
@ -25,6 +27,7 @@ import { ProfileFixerService } from "../services/ProfileFixerService";
import { SeasonalEventService } from "../services/SeasonalEventService"; import { SeasonalEventService } from "../services/SeasonalEventService";
import { EncodingUtil } from "../utils/EncodingUtil"; import { EncodingUtil } from "../utils/EncodingUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
export declare class GameController { export declare class GameController {
protected logger: ILogger; protected logger: ILogger;
@ -33,6 +36,7 @@ export declare class GameController {
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected preAkiModLoader: PreAkiModLoader; protected preAkiModLoader: PreAkiModLoader;
protected httpServerHelper: HttpServerHelper; protected httpServerHelper: HttpServerHelper;
protected randomUtil: RandomUtil;
protected encodingUtil: EncodingUtil; protected encodingUtil: EncodingUtil;
protected hideoutHelper: HideoutHelper; protected hideoutHelper: HideoutHelper;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
@ -48,7 +52,9 @@ export declare class GameController {
protected httpConfig: IHttpConfig; protected httpConfig: IHttpConfig;
protected coreConfig: ICoreConfig; protected coreConfig: ICoreConfig;
protected locationConfig: ILocationConfig; protected locationConfig: ILocationConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); protected ragfairConfig: IRagfairConfig;
protected botConfig: IBotConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer);
/** /**
* Handle client/game/start * Handle client/game/start
*/ */
@ -84,6 +90,7 @@ export declare class GameController {
* @param pmcProfile Player profile * @param pmcProfile Player profile
*/ */
protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void; protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void;
protected flagAllItemsInDbAsSellableOnFlea(): void;
/** /**
* When player logs in, iterate over all active effects and reduce timer * When player logs in, iterate over all active effects and reduce timer
* TODO - add body part HP regen * TODO - add body part HP regen
@ -118,9 +125,14 @@ export declare class GameController {
protected validateQuestAssortUnlocksExist(): void; protected validateQuestAssortUnlocksExist(): void;
/** /**
* Add the logged in players name to PMC name pool * Add the logged in players name to PMC name pool
* @param pmcProfile * @param pmcProfile Profile of player to get name from
*/ */
protected addPlayerToPMCNames(pmcProfile: IPmcData): void; protected addPlayerToPMCNames(pmcProfile: IPmcData): void;
/**
* 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 * Blank out the "test" mail message from prapor
*/ */

View File

@ -10,6 +10,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
import { LocalisationService } from "../services/LocalisationService";
import { SeasonalEventService } from "../services/SeasonalEventService"; import { SeasonalEventService } from "../services/SeasonalEventService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
@ -32,9 +33,10 @@ export declare class BotGenerator {
protected botHelper: BotHelper; protected botHelper: BotHelper;
protected botDifficultyHelper: BotDifficultyHelper; protected botDifficultyHelper: BotDifficultyHelper;
protected seasonalEventService: SeasonalEventService; protected seasonalEventService: SeasonalEventService;
protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); 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 * Generate a player scav bot object
* @param role e.g. assault / pmcbot * @param role e.g. assault / pmcbot
@ -71,7 +73,7 @@ export declare class BotGenerator {
* @param botRole role of bot e.g. assault * @param botRole role of bot e.g. assault
* @returns Nickname for bot * @returns Nickname for bot
*/ */
protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string): string; protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string, sessionId: string): string;
/** /**
* Log the number of PMCs generated to the debug console * Log the number of PMCs generated to the debug console
* @param output Generated bot array, ready to send to client * @param output Generated bot array, ready to send to client

View File

@ -58,16 +58,12 @@ export declare class HideoutHelper {
* @returns * @returns
*/ */
isProductionType(productive: Productive): productive is Production; isProductionType(productive: Productive): productive is Production;
applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void;
/** /**
* TODO: * Apply bonus to player profile given after completing hideout upgrades
* After looking at the skills there doesnt seem to be a configuration per skill to boost * @param pmcData Profile to add bonus to
* the XP gain PER skill. I THINK you should be able to put the variable "SkillProgress" (just like health has it) * @param bonus Bonus to add to profile
* and be able to tune the skill gain PER skill, but I havent tested it and Im not sure!
* @param pmcData
* @param bonus
*/ */
protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void; applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void;
/** /**
* Process a players hideout, update areas that use resources + increment production timers * Process a players hideout, update areas that use resources + increment production timers
* @param sessionID Session id * @param sessionID Session id
@ -83,6 +79,7 @@ export declare class HideoutHelper {
isGeneratorOn: boolean; isGeneratorOn: boolean;
waterCollectorHasFilter: boolean; waterCollectorHasFilter: boolean;
}; };
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
/** /**
* Update progress timer for water collector * Update progress timer for water collector
* @param pmcData profile to update * @param pmcData profile to update
@ -141,9 +138,8 @@ export declare class HideoutHelper {
isGeneratorOn: boolean; isGeneratorOn: boolean;
waterCollectorHasFilter: boolean; waterCollectorHasFilter: boolean;
}): void; }): void;
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void; protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void;
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
/** /**
* Adjust water filter objects resourceValue or delete when they reach 0 resource * Adjust water filter objects resourceValue or delete when they reach 0 resource
* @param waterFilterArea water filter area to update * @param waterFilterArea water filter area to update

View File

@ -35,6 +35,7 @@ export declare class PreAkiModLoader implements IModLoader {
getImportedModDetails(): Record<string, IPackageJsonData>; getImportedModDetails(): Record<string, IPackageJsonData>;
getModPath(mod: string): string; getModPath(mod: string): string;
protected importMods(): Promise<void>; protected importMods(): Promise<void>;
protected sortMods(prev: string, next: string, missingFromOrderJSON: Record<string, boolean>): number;
/** /**
* Check for duplicate mods loaded, show error if any * Check for duplicate mods loaded, show error if any
* @param modPackageData Dictionary of mod package.json data * @param modPackageData Dictionary of mod package.json data

View File

@ -40,6 +40,8 @@ export interface IPmcConfig {
botRelativeLevelDeltaMax: number; botRelativeLevelDeltaMax: number;
/** Force a number of healing items into PMCs secure container to ensure they can heal */ /** Force a number of healing items into PMCs secure container to ensure they can heal */
forceHealingItemsIntoSecure: boolean; forceHealingItemsIntoSecure: boolean;
addPrefixToSameNamePMCAsPlayerChance: number;
allPMCsHavePlayerNameWithRandomPrefixChance: number;
} }
export interface PmcTypes { export interface PmcTypes {
usec: string; usec: string;

View File

@ -2,17 +2,19 @@ import { I18n } from "i18n";
import { ILocaleConfig } from "../models/spt/config/ILocaleConfig"; import { ILocaleConfig } from "../models/spt/config/ILocaleConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { RandomUtil } from "../utils/RandomUtil";
import { LocaleService } from "./LocaleService"; import { LocaleService } from "./LocaleService";
/** /**
* Handles translating server text into different langauges * Handles translating server text into different langauges
*/ */
export declare class LocalisationService { export declare class LocalisationService {
protected logger: ILogger; protected logger: ILogger;
protected randomUtil: RandomUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected localeService: LocaleService; protected localeService: LocaleService;
protected localeConfig: ILocaleConfig; protected localeConfig: ILocaleConfig;
protected i18n: I18n; protected i18n: I18n;
constructor(logger: ILogger, databaseServer: DatabaseServer, localeService: LocaleService); constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, localeService: LocaleService);
/** /**
* Get a localised value using the passed in key * Get a localised value using the passed in key
* @param key Key to loop up locale for * @param key Key to loop up locale for
@ -25,4 +27,10 @@ export declare class LocalisationService {
* @returns string array of keys * @returns string array of keys
*/ */
getKeys(): string[]; getKeys(): string[];
/**
* From the provided partial key, find all keys that start with text and choose a random match
* @param partialKey Key to match locale keys on
* @returns locale text
*/
getRandomTextThatMatchesPartialKey(partialKey: string): string;
} }

View File

@ -11,9 +11,11 @@ import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse";
import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IServerDetails } from "../models/eft/game/IServerDetails";
import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ICoreConfig } from "../models/spt/config/ICoreConfig"; import { ICoreConfig } from "../models/spt/config/ICoreConfig";
import { IHttpConfig } from "../models/spt/config/IHttpConfig"; import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { ILocationConfig } from "../models/spt/config/ILocationConfig"; import { ILocationConfig } from "../models/spt/config/ILocationConfig";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
@ -25,6 +27,7 @@ import { ProfileFixerService } from "../services/ProfileFixerService";
import { SeasonalEventService } from "../services/SeasonalEventService"; import { SeasonalEventService } from "../services/SeasonalEventService";
import { EncodingUtil } from "../utils/EncodingUtil"; import { EncodingUtil } from "../utils/EncodingUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil"; import { TimeUtil } from "../utils/TimeUtil";
export declare class GameController { export declare class GameController {
protected logger: ILogger; protected logger: ILogger;
@ -33,6 +36,7 @@ export declare class GameController {
protected timeUtil: TimeUtil; protected timeUtil: TimeUtil;
protected preAkiModLoader: PreAkiModLoader; protected preAkiModLoader: PreAkiModLoader;
protected httpServerHelper: HttpServerHelper; protected httpServerHelper: HttpServerHelper;
protected randomUtil: RandomUtil;
protected encodingUtil: EncodingUtil; protected encodingUtil: EncodingUtil;
protected hideoutHelper: HideoutHelper; protected hideoutHelper: HideoutHelper;
protected profileHelper: ProfileHelper; protected profileHelper: ProfileHelper;
@ -48,7 +52,9 @@ export declare class GameController {
protected httpConfig: IHttpConfig; protected httpConfig: IHttpConfig;
protected coreConfig: ICoreConfig; protected coreConfig: ICoreConfig;
protected locationConfig: ILocationConfig; protected locationConfig: ILocationConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer); protected ragfairConfig: IRagfairConfig;
protected botConfig: IBotConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, encodingUtil: EncodingUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, giftService: GiftService, applicationContext: ApplicationContext, configServer: ConfigServer);
/** /**
* Handle client/game/start * Handle client/game/start
*/ */
@ -84,6 +90,7 @@ export declare class GameController {
* @param pmcProfile Player profile * @param pmcProfile Player profile
*/ */
protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void; protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void;
protected flagAllItemsInDbAsSellableOnFlea(): void;
/** /**
* When player logs in, iterate over all active effects and reduce timer * When player logs in, iterate over all active effects and reduce timer
* TODO - add body part HP regen * TODO - add body part HP regen
@ -118,9 +125,14 @@ export declare class GameController {
protected validateQuestAssortUnlocksExist(): void; protected validateQuestAssortUnlocksExist(): void;
/** /**
* Add the logged in players name to PMC name pool * Add the logged in players name to PMC name pool
* @param pmcProfile * @param pmcProfile Profile of player to get name from
*/ */
protected addPlayerToPMCNames(pmcProfile: IPmcData): void; protected addPlayerToPMCNames(pmcProfile: IPmcData): void;
/**
* 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 * Blank out the "test" mail message from prapor
*/ */

View File

@ -10,6 +10,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer"; import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
import { LocalisationService } from "../services/LocalisationService";
import { SeasonalEventService } from "../services/SeasonalEventService"; import { SeasonalEventService } from "../services/SeasonalEventService";
import { HashUtil } from "../utils/HashUtil"; import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil"; import { JsonUtil } from "../utils/JsonUtil";
@ -32,9 +33,10 @@ export declare class BotGenerator {
protected botHelper: BotHelper; protected botHelper: BotHelper;
protected botDifficultyHelper: BotDifficultyHelper; protected botDifficultyHelper: BotDifficultyHelper;
protected seasonalEventService: SeasonalEventService; protected seasonalEventService: SeasonalEventService;
protected localisationService: LocalisationService;
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected botConfig: IBotConfig; protected botConfig: IBotConfig;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); 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 * Generate a player scav bot object
* @param role e.g. assault / pmcbot * @param role e.g. assault / pmcbot
@ -71,7 +73,7 @@ export declare class BotGenerator {
* @param botRole role of bot e.g. assault * @param botRole role of bot e.g. assault
* @returns Nickname for bot * @returns Nickname for bot
*/ */
protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string): string; protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string, sessionId: string): string;
/** /**
* Log the number of PMCs generated to the debug console * Log the number of PMCs generated to the debug console
* @param output Generated bot array, ready to send to client * @param output Generated bot array, ready to send to client

View File

@ -58,16 +58,12 @@ export declare class HideoutHelper {
* @returns * @returns
*/ */
isProductionType(productive: Productive): productive is Production; isProductionType(productive: Productive): productive is Production;
applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void;
/** /**
* TODO: * Apply bonus to player profile given after completing hideout upgrades
* After looking at the skills there doesnt seem to be a configuration per skill to boost * @param pmcData Profile to add bonus to
* the XP gain PER skill. I THINK you should be able to put the variable "SkillProgress" (just like health has it) * @param bonus Bonus to add to profile
* and be able to tune the skill gain PER skill, but I havent tested it and Im not sure!
* @param pmcData
* @param bonus
*/ */
protected applySkillXPBoost(pmcData: IPmcData, bonus: StageBonus): void; applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void;
/** /**
* Process a players hideout, update areas that use resources + increment production timers * Process a players hideout, update areas that use resources + increment production timers
* @param sessionID Session id * @param sessionID Session id
@ -83,6 +79,7 @@ export declare class HideoutHelper {
isGeneratorOn: boolean; isGeneratorOn: boolean;
waterCollectorHasFilter: boolean; waterCollectorHasFilter: boolean;
}; };
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
/** /**
* Update progress timer for water collector * Update progress timer for water collector
* @param pmcData profile to update * @param pmcData profile to update
@ -141,9 +138,8 @@ export declare class HideoutHelper {
isGeneratorOn: boolean; isGeneratorOn: boolean;
waterCollectorHasFilter: boolean; waterCollectorHasFilter: boolean;
}): void; }): void;
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void; protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): void;
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
/** /**
* Adjust water filter objects resourceValue or delete when they reach 0 resource * Adjust water filter objects resourceValue or delete when they reach 0 resource
* @param waterFilterArea water filter area to update * @param waterFilterArea water filter area to update

View File

@ -35,6 +35,7 @@ export declare class PreAkiModLoader implements IModLoader {
getImportedModDetails(): Record<string, IPackageJsonData>; getImportedModDetails(): Record<string, IPackageJsonData>;
getModPath(mod: string): string; getModPath(mod: string): string;
protected importMods(): Promise<void>; protected importMods(): Promise<void>;
protected sortMods(prev: string, next: string, missingFromOrderJSON: Record<string, boolean>): number;
/** /**
* Check for duplicate mods loaded, show error if any * Check for duplicate mods loaded, show error if any
* @param modPackageData Dictionary of mod package.json data * @param modPackageData Dictionary of mod package.json data

View File

@ -40,6 +40,8 @@ export interface IPmcConfig {
botRelativeLevelDeltaMax: number; botRelativeLevelDeltaMax: number;
/** Force a number of healing items into PMCs secure container to ensure they can heal */ /** Force a number of healing items into PMCs secure container to ensure they can heal */
forceHealingItemsIntoSecure: boolean; forceHealingItemsIntoSecure: boolean;
addPrefixToSameNamePMCAsPlayerChance: number;
allPMCsHavePlayerNameWithRandomPrefixChance: number;
} }
export interface PmcTypes { export interface PmcTypes {
usec: string; usec: string;

View File

@ -2,17 +2,19 @@ import { I18n } from "i18n";
import { ILocaleConfig } from "../models/spt/config/ILocaleConfig"; import { ILocaleConfig } from "../models/spt/config/ILocaleConfig";
import { ILogger } from "../models/spt/utils/ILogger"; import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer"; import { DatabaseServer } from "../servers/DatabaseServer";
import { RandomUtil } from "../utils/RandomUtil";
import { LocaleService } from "./LocaleService"; import { LocaleService } from "./LocaleService";
/** /**
* Handles translating server text into different langauges * Handles translating server text into different langauges
*/ */
export declare class LocalisationService { export declare class LocalisationService {
protected logger: ILogger; protected logger: ILogger;
protected randomUtil: RandomUtil;
protected databaseServer: DatabaseServer; protected databaseServer: DatabaseServer;
protected localeService: LocaleService; protected localeService: LocaleService;
protected localeConfig: ILocaleConfig; protected localeConfig: ILocaleConfig;
protected i18n: I18n; protected i18n: I18n;
constructor(logger: ILogger, databaseServer: DatabaseServer, localeService: LocaleService); constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, localeService: LocaleService);
/** /**
* Get a localised value using the passed in key * Get a localised value using the passed in key
* @param key Key to loop up locale for * @param key Key to loop up locale for
@ -25,4 +27,10 @@ export declare class LocalisationService {
* @returns string array of keys * @returns string array of keys
*/ */
getKeys(): string[]; getKeys(): string[];
/**
* From the provided partial key, find all keys that start with text and choose a random match
* @param partialKey Key to match locale keys on
* @returns locale text
*/
getRandomTextThatMatchesPartialKey(partialKey: string): string;
} }