diff --git a/Live/CWX_BushWhacker/BushWhacker.cs b/Live/CWX_BushWhacker/BushWhacker.cs
index f8f52bc..7c94270 100644
--- a/Live/CWX_BushWhacker/BushWhacker.cs
+++ b/Live/CWX_BushWhacker/BushWhacker.cs
@@ -5,7 +5,7 @@ using UnityEngine;
namespace CWX_BushWhacker
{
- [BepInPlugin("com.cwx.bushwhacker", "cwx-bushwhacker", "1.2.7")]
+ [BepInPlugin("com.cwx.bushwhacker", "cwx-bushwhacker", "1.2.8")]
public class BushWhacker : BaseUnityPlugin
{
public void Start()
diff --git a/Live/CWX_BushWhacker/CWX-BushWhacker 1.2.7/bepInEx/plugins/CWX-BushWhacker.dll b/Live/CWX_BushWhacker/CWX-BushWhacker 1.2.8/bepInEx/plugins/CWX-BushWhacker.dll
similarity index 73%
rename from Live/CWX_BushWhacker/CWX-BushWhacker 1.2.7/bepInEx/plugins/CWX-BushWhacker.dll
rename to Live/CWX_BushWhacker/CWX-BushWhacker 1.2.8/bepInEx/plugins/CWX-BushWhacker.dll
index 49554ff..dd49a64 100644
Binary files a/Live/CWX_BushWhacker/CWX-BushWhacker 1.2.7/bepInEx/plugins/CWX-BushWhacker.dll and b/Live/CWX_BushWhacker/CWX-BushWhacker 1.2.8/bepInEx/plugins/CWX-BushWhacker.dll differ
diff --git a/Live/CWX_BushWhacker/CWX_BushWhacker.csproj b/Live/CWX_BushWhacker/CWX_BushWhacker.csproj
index b488151..c2a4160 100644
--- a/Live/CWX_BushWhacker/CWX_BushWhacker.csproj
+++ b/Live/CWX_BushWhacker/CWX_BushWhacker.csproj
@@ -3,7 +3,7 @@
net472
CWX-BushWhacker
- 1.4.7
+ 1.2.8
diff --git a/Live/CWX_DeSharpener/CWX-DeSharpener 1.4.7/bepInEx/plugins/CWX-DeSharpener.dll b/Live/CWX_DeSharpener/CWX-DeSharpener 1.4.8/bepInEx/plugins/CWX-DeSharpener.dll
similarity index 85%
rename from Live/CWX_DeSharpener/CWX-DeSharpener 1.4.7/bepInEx/plugins/CWX-DeSharpener.dll
rename to Live/CWX_DeSharpener/CWX-DeSharpener 1.4.8/bepInEx/plugins/CWX-DeSharpener.dll
index d3f8e93..ebae012 100644
Binary files a/Live/CWX_DeSharpener/CWX-DeSharpener 1.4.7/bepInEx/plugins/CWX-DeSharpener.dll and b/Live/CWX_DeSharpener/CWX-DeSharpener 1.4.8/bepInEx/plugins/CWX-DeSharpener.dll differ
diff --git a/Live/CWX_DeSharpener/CWX_DeSharpener.csproj b/Live/CWX_DeSharpener/CWX_DeSharpener.csproj
index 367968a..0dd916c 100644
--- a/Live/CWX_DeSharpener/CWX_DeSharpener.csproj
+++ b/Live/CWX_DeSharpener/CWX_DeSharpener.csproj
@@ -2,7 +2,7 @@
net472
- 1.4.7
+ 1.4.8
CWX-DeSharpener
diff --git a/Live/CWX_DeSharpener/DeSharpener.cs b/Live/CWX_DeSharpener/DeSharpener.cs
index 26249ae..f99f747 100644
--- a/Live/CWX_DeSharpener/DeSharpener.cs
+++ b/Live/CWX_DeSharpener/DeSharpener.cs
@@ -2,7 +2,7 @@
namespace CWX_DeSharpener
{
- [BepInPlugin("com.CWX.DeSharpener", "CWX-DeSharpener", "1.4.7")]
+ [BepInPlugin("com.CWX.DeSharpener", "CWX-DeSharpener", "1.4.8")]
public class DeSharpener : BaseUnityPlugin
{
private void Awake()
diff --git a/Live/CWX_DebugTool/config/config.json b/Live/CWX_DebugTool/config/config.json
index ececeea..74e5dc3 100644
--- a/Live/CWX_DebugTool/config/config.json
+++ b/Live/CWX_DebugTool/config/config.json
@@ -6,7 +6,7 @@
"quickScav": true
},
"ragfairConfig": {
- "staticTrader": true,
+ "staticTrader": false,
"roublesOnly": true,
"disableBSGBlacklist": true
},
@@ -14,18 +14,19 @@
"turnLootOff": true
},
"inraidConfig": {
- "turnPVEOff": true
+ "turnPVEOff": true,
+ "extendRaidTimes": true
},
"itemsConfig": {
"changeShrapProps": true,
"changeMaxAmmoForKS23": true,
- "removeDevFromBlacklist": true
+ "removeDevFromBlacklist": true,
+ "inspectAllItems": true
},
"airdropConfig": {
"enableAllTheTime": true,
"changeFlightHeight": true,
"changeStartTime": true,
"changePlaneVolume": true
-
}
}
\ No newline at end of file
diff --git a/Live/CWX_DebugTool/dist/config/config.json b/Live/CWX_DebugTool/dist/config/config.json
index ececeea..74e5dc3 100644
--- a/Live/CWX_DebugTool/dist/config/config.json
+++ b/Live/CWX_DebugTool/dist/config/config.json
@@ -6,7 +6,7 @@
"quickScav": true
},
"ragfairConfig": {
- "staticTrader": true,
+ "staticTrader": false,
"roublesOnly": true,
"disableBSGBlacklist": true
},
@@ -14,18 +14,19 @@
"turnLootOff": true
},
"inraidConfig": {
- "turnPVEOff": true
+ "turnPVEOff": true,
+ "extendRaidTimes": true
},
"itemsConfig": {
"changeShrapProps": true,
"changeMaxAmmoForKS23": true,
- "removeDevFromBlacklist": true
+ "removeDevFromBlacklist": true,
+ "inspectAllItems": true
},
"airdropConfig": {
"enableAllTheTime": true,
"changeFlightHeight": true,
"changeStartTime": true,
"changePlaneVolume": true
-
}
}
\ No newline at end of file
diff --git a/Live/CWX_DebugTool/dist/models/IConfig.ts b/Live/CWX_DebugTool/dist/models/IConfig.ts
index 2cb6a28..a5fad5b 100644
--- a/Live/CWX_DebugTool/dist/models/IConfig.ts
+++ b/Live/CWX_DebugTool/dist/models/IConfig.ts
@@ -31,6 +31,7 @@ export interface LocationConfig
export interface InraidConfig
{
turnPVEOff: boolean
+ extendRaidTimes: boolean
}
export interface ItemsConfig
@@ -38,6 +39,7 @@ export interface ItemsConfig
changeShrapProps: boolean
changeMaxAmmoForKS23: boolean
removeDevFromBlacklist: boolean
+ inspectAllItems: boolean
}
export interface AirdropConfig
diff --git a/Live/CWX_DebugTool/dist/src/inraidConfig.ts b/Live/CWX_DebugTool/dist/src/inraidConfig.ts
index c32960a..7da317e 100644
--- a/Live/CWX_DebugTool/dist/src/inraidConfig.ts
+++ b/Live/CWX_DebugTool/dist/src/inraidConfig.ts
@@ -3,19 +3,23 @@ import { inject, injectable } from "tsyringe";
import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { IInRaidConfig } from "@spt-aki/models/spt/config/IInRaidConfig";
+import { ILocationData, ILocations } from "@spt-aki/models/spt/server/ILocations";
+import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
+import { InraidConfig } from "models/IConfig";
import { CwxConfigHandler } from "./configHandler";
-import { InraidConfig } from "models/IConfig";
@injectable()
export class CwxInraidConfig
{
private tables: IInRaidConfig;
private config: InraidConfig;
+ private locations: ILocations;
constructor(
@inject("ConfigServer") private configServer: ConfigServer,
- @inject("CwxConfigHandler") private configHandler: CwxConfigHandler
+ @inject("CwxConfigHandler") private configHandler: CwxConfigHandler,
+ @inject("DatabaseServer") private databaseServer: DatabaseServer
)
{}
@@ -23,8 +27,10 @@ export class CwxInraidConfig
{
this.config = this.configHandler.getConfig().inraidConfig;
this.tables = this.configServer.getConfig(ConfigTypes.IN_RAID);
+ this.locations = this.databaseServer.getTables().locations;
this.turnPVEOff();
+ this.extendRaidTimes();
}
private turnPVEOff(): void
@@ -34,4 +40,19 @@ export class CwxInraidConfig
this.tables.raidMenuSettings.enablePve = false;
}
}
+
+ private extendRaidTimes(): void
+ {
+ if (this.config.extendRaidTimes)
+ {
+ for (const i in this.locations)
+ {
+ if (i !== "base")
+ {
+ this.locations[i].base.EscapeTimeLimit = 300;
+ this.locations[i].base.exit_access_time = 300;
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/Live/CWX_DebugTool/dist/src/itemsConfig.ts b/Live/CWX_DebugTool/dist/src/itemsConfig.ts
index 90ab130..121b559 100644
--- a/Live/CWX_DebugTool/dist/src/itemsConfig.ts
+++ b/Live/CWX_DebugTool/dist/src/itemsConfig.ts
@@ -31,6 +31,7 @@ export class CwxItemsConfig
//this.changeShrapProps();
//this.changeMaxAmmoForKS23();
//this.removeDevFromBlacklist();
+ this.inspectAllItems();
}
@@ -62,4 +63,18 @@ export class CwxItemsConfig
this.itemConfig.blacklist.splice(this.itemConfig.blacklist.indexOf("58ac60eb86f77401897560ff"));
}
}
+
+ private inspectAllItems(): void
+ {
+ if (this.config.inspectAllItems)
+ {
+ for (const item in this.tables)
+ {
+ if (this.tables[item]._props.ExaminedByDefault)
+ {
+ this.tables[item]._props.ExaminedByDefault = true;
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/Live/CWX_DebugTool/dist/src/logging.ts b/Live/CWX_DebugTool/dist/src/logging.ts
index 1e93ba9..d15e530 100644
--- a/Live/CWX_DebugTool/dist/src/logging.ts
+++ b/Live/CWX_DebugTool/dist/src/logging.ts
@@ -33,11 +33,13 @@ export class CwxLogging
// inraid
this.turnPVEOff();
+ this.extendRaidTimes();
// items
this.changeShrapProps();
this.changeMaxAmmoForKS23();
this.removeDevFromBlacklist();
+ this.inspectAllItems();
// airdrops
this.enableAllTheTime();
@@ -46,7 +48,7 @@ export class CwxLogging
this.changePlaneVolume();
}
-
+
private noFallDamage(): void
{
if (this.config.globalsConfig.noFallDamage)
@@ -111,6 +113,14 @@ export class CwxLogging
}
}
+ private extendRaidTimes()
+ {
+ if (this.config.inraidConfig.extendRaidTimes)
+ {
+ this.logger.info("Extend Raid Times Activated");
+ }
+ }
+
private changeShrapProps(): void
{
if (this.config.itemsConfig.changeShrapProps)
@@ -135,6 +145,14 @@ export class CwxLogging
}
}
+ private inspectAllItems(): void
+ {
+ if (this.config.itemsConfig.inspectAllItems)
+ {
+ this.logger.info("Inspect All Items Activated");
+ }
+ }
+
private enableAllTheTime(): void
{
if (this.config.airdropConfig.enableAllTheTime)
diff --git a/Live/CWX_DebugTool/models/IConfig.ts b/Live/CWX_DebugTool/models/IConfig.ts
index 2cb6a28..a5fad5b 100644
--- a/Live/CWX_DebugTool/models/IConfig.ts
+++ b/Live/CWX_DebugTool/models/IConfig.ts
@@ -31,6 +31,7 @@ export interface LocationConfig
export interface InraidConfig
{
turnPVEOff: boolean
+ extendRaidTimes: boolean
}
export interface ItemsConfig
@@ -38,6 +39,7 @@ export interface ItemsConfig
changeShrapProps: boolean
changeMaxAmmoForKS23: boolean
removeDevFromBlacklist: boolean
+ inspectAllItems: boolean
}
export interface AirdropConfig
diff --git a/Live/CWX_DebugTool/src/inraidConfig.ts b/Live/CWX_DebugTool/src/inraidConfig.ts
index c32960a..7da317e 100644
--- a/Live/CWX_DebugTool/src/inraidConfig.ts
+++ b/Live/CWX_DebugTool/src/inraidConfig.ts
@@ -3,19 +3,23 @@ import { inject, injectable } from "tsyringe";
import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { IInRaidConfig } from "@spt-aki/models/spt/config/IInRaidConfig";
+import { ILocationData, ILocations } from "@spt-aki/models/spt/server/ILocations";
+import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
+import { InraidConfig } from "models/IConfig";
import { CwxConfigHandler } from "./configHandler";
-import { InraidConfig } from "models/IConfig";
@injectable()
export class CwxInraidConfig
{
private tables: IInRaidConfig;
private config: InraidConfig;
+ private locations: ILocations;
constructor(
@inject("ConfigServer") private configServer: ConfigServer,
- @inject("CwxConfigHandler") private configHandler: CwxConfigHandler
+ @inject("CwxConfigHandler") private configHandler: CwxConfigHandler,
+ @inject("DatabaseServer") private databaseServer: DatabaseServer
)
{}
@@ -23,8 +27,10 @@ export class CwxInraidConfig
{
this.config = this.configHandler.getConfig().inraidConfig;
this.tables = this.configServer.getConfig(ConfigTypes.IN_RAID);
+ this.locations = this.databaseServer.getTables().locations;
this.turnPVEOff();
+ this.extendRaidTimes();
}
private turnPVEOff(): void
@@ -34,4 +40,19 @@ export class CwxInraidConfig
this.tables.raidMenuSettings.enablePve = false;
}
}
+
+ private extendRaidTimes(): void
+ {
+ if (this.config.extendRaidTimes)
+ {
+ for (const i in this.locations)
+ {
+ if (i !== "base")
+ {
+ this.locations[i].base.EscapeTimeLimit = 300;
+ this.locations[i].base.exit_access_time = 300;
+ }
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/Live/CWX_DebugTool/src/itemsConfig.ts b/Live/CWX_DebugTool/src/itemsConfig.ts
index 90ab130..9663896 100644
--- a/Live/CWX_DebugTool/src/itemsConfig.ts
+++ b/Live/CWX_DebugTool/src/itemsConfig.ts
@@ -31,6 +31,7 @@ export class CwxItemsConfig
//this.changeShrapProps();
//this.changeMaxAmmoForKS23();
//this.removeDevFromBlacklist();
+ this.inspectAllItems();
}
@@ -62,4 +63,15 @@ export class CwxItemsConfig
this.itemConfig.blacklist.splice(this.itemConfig.blacklist.indexOf("58ac60eb86f77401897560ff"));
}
}
+
+ private inspectAllItems(): void
+ {
+ if (this.config.inspectAllItems)
+ {
+ for (const item in this.tables)
+ {
+ this.tables[item]._props.ExaminedByDefault = true;
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/Live/CWX_DebugTool/src/logging.ts b/Live/CWX_DebugTool/src/logging.ts
index 1e93ba9..d15e530 100644
--- a/Live/CWX_DebugTool/src/logging.ts
+++ b/Live/CWX_DebugTool/src/logging.ts
@@ -33,11 +33,13 @@ export class CwxLogging
// inraid
this.turnPVEOff();
+ this.extendRaidTimes();
// items
this.changeShrapProps();
this.changeMaxAmmoForKS23();
this.removeDevFromBlacklist();
+ this.inspectAllItems();
// airdrops
this.enableAllTheTime();
@@ -46,7 +48,7 @@ export class CwxLogging
this.changePlaneVolume();
}
-
+
private noFallDamage(): void
{
if (this.config.globalsConfig.noFallDamage)
@@ -111,6 +113,14 @@ export class CwxLogging
}
}
+ private extendRaidTimes()
+ {
+ if (this.config.inraidConfig.extendRaidTimes)
+ {
+ this.logger.info("Extend Raid Times Activated");
+ }
+ }
+
private changeShrapProps(): void
{
if (this.config.itemsConfig.changeShrapProps)
@@ -135,6 +145,14 @@ export class CwxLogging
}
}
+ private inspectAllItems(): void
+ {
+ if (this.config.itemsConfig.inspectAllItems)
+ {
+ this.logger.info("Inspect All Items Activated");
+ }
+ }
+
private enableAllTheTime(): void
{
if (this.config.airdropConfig.enableAllTheTime)
diff --git a/Live/CWX_DebugTool/types/callbacks/DataCallbacks.d.ts b/Live/CWX_DebugTool/types/callbacks/DataCallbacks.d.ts
index 2efcf81..1f359e5 100644
--- a/Live/CWX_DebugTool/types/callbacks/DataCallbacks.d.ts
+++ b/Live/CWX_DebugTool/types/callbacks/DataCallbacks.d.ts
@@ -8,7 +8,6 @@ import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction";
import { IHideoutScavCase } from "../models/eft/hideout/IHideoutScavCase";
import { IHideoutSettingsBase } from "../models/eft/hideout/IHideoutSettingsBase";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
-import { ILanguageBase } from "../models/spt/server/ILocaleBase";
import { ISettingsBase } from "../models/spt/server/ISettingsBase";
import { DatabaseServer } from "../servers/DatabaseServer";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
@@ -54,7 +53,7 @@ export declare class DataCallbacks {
getHideoutAreas(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData;
gethideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData;
getHideoutScavcase(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData;
- getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData;
+ getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>;
getLocalesMenu(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData;
getLocalesGlobal(url: string, info: IEmptyRequestData, sessionID: string): string;
}
diff --git a/Live/CWX_DebugTool/types/callbacks/DialogueCallbacks.d.ts b/Live/CWX_DebugTool/types/callbacks/DialogueCallbacks.d.ts
index 7b2eeae..581c980 100644
--- a/Live/CWX_DebugTool/types/callbacks/DialogueCallbacks.d.ts
+++ b/Live/CWX_DebugTool/types/callbacks/DialogueCallbacks.d.ts
@@ -52,6 +52,6 @@ export declare class DialogueCallbacks extends OnUpdate {
listInbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData;
friendRequest(url: string, request: IFriendRequestData, sessionID: string): INullResponseData;
sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData;
- onUpdate(timeSinceLastRun: number): boolean;
+ onUpdate(timeSinceLastRun: number): Promise;
getRoute(): string;
}
diff --git a/Live/CWX_DebugTool/types/callbacks/HandbookCallbacks.d.ts b/Live/CWX_DebugTool/types/callbacks/HandbookCallbacks.d.ts
index 891e375..1bb6241 100644
--- a/Live/CWX_DebugTool/types/callbacks/HandbookCallbacks.d.ts
+++ b/Live/CWX_DebugTool/types/callbacks/HandbookCallbacks.d.ts
@@ -3,6 +3,6 @@ import { OnLoad } from "../di/OnLoad";
export declare class HandbookCallbacks extends OnLoad {
protected handbookController: HandbookController;
constructor(handbookController: HandbookController);
- onLoad(): void;
+ onLoad(): Promise;
getRoute(): string;
}
diff --git a/Live/CWX_DebugTool/types/callbacks/HideoutCallbacks.d.ts b/Live/CWX_DebugTool/types/callbacks/HideoutCallbacks.d.ts
index e39e806..56450a9 100644
--- a/Live/CWX_DebugTool/types/callbacks/HideoutCallbacks.d.ts
+++ b/Live/CWX_DebugTool/types/callbacks/HideoutCallbacks.d.ts
@@ -91,6 +91,6 @@ export declare class HideoutCallbacks extends OnUpdate {
* @returns
*/
takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse;
- onUpdate(timeSinceLastRun: number): boolean;
+ onUpdate(timeSinceLastRun: number): Promise;
getRoute(): string;
}
diff --git a/Live/CWX_DebugTool/types/callbacks/HttpCallbacks.d.ts b/Live/CWX_DebugTool/types/callbacks/HttpCallbacks.d.ts
index 43928a1..299a32c 100644
--- a/Live/CWX_DebugTool/types/callbacks/HttpCallbacks.d.ts
+++ b/Live/CWX_DebugTool/types/callbacks/HttpCallbacks.d.ts
@@ -3,7 +3,7 @@ import { HttpServer } from "../servers/HttpServer";
export declare class HttpCallbacks extends OnLoad {
protected httpServer: HttpServer;
constructor(httpServer: HttpServer);
- onLoad(): void;
+ onLoad(): Promise;
getRoute(): string;
getImage(): string;
}
diff --git a/Live/CWX_DebugTool/types/callbacks/InsuranceCallbacks.d.ts b/Live/CWX_DebugTool/types/callbacks/InsuranceCallbacks.d.ts
index a171e1c..11aef4a 100644
--- a/Live/CWX_DebugTool/types/callbacks/InsuranceCallbacks.d.ts
+++ b/Live/CWX_DebugTool/types/callbacks/InsuranceCallbacks.d.ts
@@ -27,6 +27,6 @@ export declare class InsuranceCallbacks extends OnUpdate {
* @returns IItemEventRouterResponse
*/
insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse;
- onUpdate(secondsSinceLastRun: number): boolean;
+ onUpdate(secondsSinceLastRun: number): Promise;
getRoute(): string;
}
diff --git a/Live/CWX_DebugTool/types/callbacks/ModCallbacks.d.ts b/Live/CWX_DebugTool/types/callbacks/ModCallbacks.d.ts
index aec2f59..9ebb750 100644
--- a/Live/CWX_DebugTool/types/callbacks/ModCallbacks.d.ts
+++ b/Live/CWX_DebugTool/types/callbacks/ModCallbacks.d.ts
@@ -3,6 +3,7 @@ import { PostAkiModLoader } from "../loaders/PostAkiModLoader";
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
+import { LocalisationService } from "../services/LocalisationService";
import { HttpFileUtil } from "../utils/HttpFileUtil";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
declare class ModCallbacks extends OnLoad {
@@ -10,10 +11,11 @@ declare class ModCallbacks extends OnLoad {
protected httpResponse: HttpResponseUtil;
protected httpFileUtil: HttpFileUtil;
protected postAkiModLoader: PostAkiModLoader;
+ protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected httpConfig: IHttpConfig;
- constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, postAkiModLoader: PostAkiModLoader, configServer: ConfigServer);
- onLoad(): void;
+ constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, postAkiModLoader: PostAkiModLoader, localisationService: LocalisationService, configServer: ConfigServer);
+ onLoad(): Promise;
getRoute(): string;
sendBundle(sessionID: string, req: any, resp: any, body: any): void;
getBundles(url: string, info: any, sessionID: string): string;
diff --git a/Live/CWX_DebugTool/types/callbacks/PresetCallbacks.d.ts b/Live/CWX_DebugTool/types/callbacks/PresetCallbacks.d.ts
index 4553f8f..681bb99 100644
--- a/Live/CWX_DebugTool/types/callbacks/PresetCallbacks.d.ts
+++ b/Live/CWX_DebugTool/types/callbacks/PresetCallbacks.d.ts
@@ -3,6 +3,6 @@ import { OnLoad } from "../di/OnLoad";
export declare class PresetCallbacks extends OnLoad {
protected presetController: PresetController;
constructor(presetController: PresetController);
- onLoad(): void;
+ onLoad(): Promise;
getRoute(): string;
}
diff --git a/Live/CWX_DebugTool/types/callbacks/RagfairCallbacks.d.ts b/Live/CWX_DebugTool/types/callbacks/RagfairCallbacks.d.ts
index 37f3807..15597bf 100644
--- a/Live/CWX_DebugTool/types/callbacks/RagfairCallbacks.d.ts
+++ b/Live/CWX_DebugTool/types/callbacks/RagfairCallbacks.d.ts
@@ -14,7 +14,6 @@ import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferReque
import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData";
import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
-import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { RagfairServer } from "../servers/RagfairServer";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
@@ -24,14 +23,13 @@ import { JsonUtil } from "../utils/JsonUtil";
*/
export declare class RagfairCallbacks extends OnLoadOnUpdate {
protected httpResponse: HttpResponseUtil;
- protected logger: ILogger;
protected jsonUtil: JsonUtil;
protected ragfairServer: RagfairServer;
protected ragfairController: RagfairController;
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
- constructor(httpResponse: HttpResponseUtil, logger: ILogger, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, configServer: ConfigServer);
- onLoad(): void;
+ constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, configServer: ConfigServer);
+ onLoad(): Promise;
getRoute(): string;
search(url: string, info: ISearchRequestData, sessionID: string): IGetBodyResponseData;
getMarketPrice(url: string, info: IGetMarketPriceRequestData, sessionID: string): IGetBodyResponseData;
@@ -39,6 +37,6 @@ export declare class RagfairCallbacks extends OnLoadOnUpdate {
addOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse;
removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse;
extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse;
- onUpdate(timeSinceLastRun: number): boolean;
+ onUpdate(timeSinceLastRun: number): Promise;
sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData;
}
diff --git a/Live/CWX_DebugTool/types/callbacks/SaveCallbacks.d.ts b/Live/CWX_DebugTool/types/callbacks/SaveCallbacks.d.ts
index bbb6e53..ab29ddc 100644
--- a/Live/CWX_DebugTool/types/callbacks/SaveCallbacks.d.ts
+++ b/Live/CWX_DebugTool/types/callbacks/SaveCallbacks.d.ts
@@ -3,7 +3,7 @@ import { SaveServer } from "../servers/SaveServer";
export declare class SaveCallbacks extends OnLoadOnUpdate {
protected saveServer: SaveServer;
constructor(saveServer: SaveServer);
- onLoad(): void;
+ onLoad(): Promise;
getRoute(): string;
- onUpdate(secondsSinceLastRun: number): boolean;
+ onUpdate(secondsSinceLastRun: number): Promise;
}
diff --git a/Live/CWX_DebugTool/types/callbacks/TraderCallbacks.d.ts b/Live/CWX_DebugTool/types/callbacks/TraderCallbacks.d.ts
index 40a1455..1efde87 100644
--- a/Live/CWX_DebugTool/types/callbacks/TraderCallbacks.d.ts
+++ b/Live/CWX_DebugTool/types/callbacks/TraderCallbacks.d.ts
@@ -8,8 +8,8 @@ export declare class TraderCallbacks extends OnLoadOnUpdate {
protected httpResponse: HttpResponseUtil;
protected traderController: TraderController;
constructor(httpResponse: HttpResponseUtil, traderController: TraderController);
- onLoad(): void;
- onUpdate(): boolean;
+ onLoad(): Promise;
+ onUpdate(): Promise;
getRoute(): string;
getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData;
/**
diff --git a/Live/CWX_DebugTool/types/controllers/BotController.d.ts b/Live/CWX_DebugTool/types/controllers/BotController.d.ts
index 51c0c68..a80aaed 100644
--- a/Live/CWX_DebugTool/types/controllers/BotController.d.ts
+++ b/Live/CWX_DebugTool/types/controllers/BotController.d.ts
@@ -57,6 +57,12 @@ export declare class BotController {
* @returns IBotBase array
*/
generate(sessionId: string, info: IGenerateBotsRequestData): IBotBase[];
+ /**
+ * Get the difficulty passed in, if its not "asoline", get selected difficulty from config
+ * @param requestedDifficulty
+ * @returns
+ */
+ getPMCDifficulty(requestedDifficulty: string): string;
/**
* Get the max number of bots allowed on a map
* Looks up location player is entering when getting cap value
diff --git a/Live/CWX_DebugTool/types/controllers/CustomizationController.d.ts b/Live/CWX_DebugTool/types/controllers/CustomizationController.d.ts
index 5fe51e3..a4ef8cf 100644
--- a/Live/CWX_DebugTool/types/controllers/CustomizationController.d.ts
+++ b/Live/CWX_DebugTool/types/controllers/CustomizationController.d.ts
@@ -8,13 +8,15 @@ import { ILogger } from "../models/spt/utils/ILogger";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer";
+import { LocalisationService } from "../services/LocalisationService";
export declare class CustomizationController {
protected logger: ILogger;
protected eventOutputHolder: EventOutputHolder;
protected databaseServer: DatabaseServer;
protected saveServer: SaveServer;
+ protected localisationService: LocalisationService;
protected profileHelper: ProfileHelper;
- constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper);
+ constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper);
getTraderSuits(traderID: string, sessionID: string): ISuit[];
wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse;
buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse;
diff --git a/Live/CWX_DebugTool/types/controllers/GameController.d.ts b/Live/CWX_DebugTool/types/controllers/GameController.d.ts
index f4f5849..0136961 100644
--- a/Live/CWX_DebugTool/types/controllers/GameController.d.ts
+++ b/Live/CWX_DebugTool/types/controllers/GameController.d.ts
@@ -1,59 +1,37 @@
import { ApplicationContext } from "../context/ApplicationContext";
-import { GameEventHelper } from "../helpers/GameEventHelper";
import { HttpServerHelper } from "../helpers/HttpServerHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
-import { Config } from "../models/eft/common/IGlobals";
import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse";
import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
import { IServerDetails } from "../models/eft/game/IServerDetails";
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
-import { ISeasonalEvent } from "../models/spt/config/ISeasonalEventConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
-import { LocaleService } from "../services/LocaleService";
import { LocalisationService } from "../services/LocalisationService";
import { ProfileFixerService } from "../services/ProfileFixerService";
-import { Watermark } from "../utils/Watermark";
+import { SeasonalEventService } from "../services/SeasonalEventService";
export declare class GameController {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
- protected watermark: Watermark;
protected httpServerHelper: HttpServerHelper;
- protected localeService: LocaleService;
protected profileHelper: ProfileHelper;
protected profileFixerService: ProfileFixerService;
protected localisationService: LocalisationService;
- protected gameEventHelper: GameEventHelper;
+ protected seasonalEventService: SeasonalEventService;
protected applicationContext: ApplicationContext;
protected configServer: ConfigServer;
protected httpConfig: IHttpConfig;
protected coreConfig: ICoreConfig;
- constructor(logger: ILogger, databaseServer: DatabaseServer, watermark: Watermark, httpServerHelper: HttpServerHelper, localeService: LocaleService, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, gameEventHelper: GameEventHelper, applicationContext: ApplicationContext, configServer: ConfigServer);
+ constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer);
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
/**
- * Check if current date falls inside any of the seasons events pased in, if so, handle them
- * @param seasonalEvents events to check for
+ * Blank out the "test" mail message from prapor
*/
- protected checkForAndEnableSeasonalEvents(seasonalEvents: ISeasonalEvent[]): void;
- /**
- * Make adjusted to server code based on the name of the event passed in
- * @param globalConfig globals.json
- * @param eventName Name of the event to enable. e.g. Christmas
- */
- protected updateGlobalEvents(globalConfig: Config, eventName: string): void;
- /**
- * Read in data from seasonalEvents.json and add found equipment items to bots
- * @param eventName Name of the event to read equipment in from config
- */
- protected addEventGearToScavs(eventName: string): void;
- /**
- * Set Khorovod(dancing tree) chance to 100% on all maps that support it
- */
- protected enableDancingTree(): void;
+ protected removePraporTestMessage(): void;
/**
* Make non-trigger-spawned raiders spawn earlier + always
*/
@@ -61,6 +39,5 @@ export declare class GameController {
protected logProfileDetails(fullProfile: IAkiProfile): void;
getGameConfig(sessionID: string): IGameConfigResponse;
getServer(): IServerDetails[];
- protected addPumpkinsToScavBackpacks(): void;
getValidGameVersion(): ICheckVersionResponse;
}
diff --git a/Live/CWX_DebugTool/types/controllers/HealthController.d.ts b/Live/CWX_DebugTool/types/controllers/HealthController.d.ts
index ce67993..97cf7ef 100644
--- a/Live/CWX_DebugTool/types/controllers/HealthController.d.ts
+++ b/Live/CWX_DebugTool/types/controllers/HealthController.d.ts
@@ -1,23 +1,25 @@
-import { ItemHelper } from "../helpers/ItemHelper";
-import { PaymentService } from "../services/PaymentService";
-import { InventoryHelper } from "../helpers/InventoryHelper";
import { HealthHelper } from "../helpers/HealthHelper";
+import { InventoryHelper } from "../helpers/InventoryHelper";
+import { ItemHelper } from "../helpers/ItemHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IHealthTreatmentRequestData } from "../models/eft/health/IHealthTreatmentRequestData";
import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestData";
import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData";
import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
-import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ILogger } from "../models/spt/utils/ILogger";
+import { EventOutputHolder } from "../routers/EventOutputHolder";
+import { LocalisationService } from "../services/LocalisationService";
+import { PaymentService } from "../services/PaymentService";
export declare class HealthController {
protected logger: ILogger;
protected eventOutputHolder: EventOutputHolder;
protected itemHelper: ItemHelper;
protected paymentService: PaymentService;
protected inventoryHelper: InventoryHelper;
+ protected localisationService: LocalisationService;
protected healthHelper: HealthHelper;
- constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper);
+ constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, localisationService: LocalisationService, healthHelper: HealthHelper);
/**
* stores in-raid player health
* @param pmcData Player profile
diff --git a/Live/CWX_DebugTool/types/controllers/MatchController.d.ts b/Live/CWX_DebugTool/types/controllers/MatchController.d.ts
index 2b0d150..2c78405 100644
--- a/Live/CWX_DebugTool/types/controllers/MatchController.d.ts
+++ b/Live/CWX_DebugTool/types/controllers/MatchController.d.ts
@@ -18,7 +18,9 @@ import { ConfigServer } from "../servers/ConfigServer";
import { SaveServer } from "../servers/SaveServer";
import { BotGenerationCacheService } from "../services/BotGenerationCacheService";
import { BotLootCacheService } from "../services/BotLootCacheService";
+import { CustomLocationWaveService } from "../services/CustomLocationWaveService";
import { MatchLocationService } from "../services/MatchLocationService";
+import { OpenZoneService } from "../services/OpenZoneService";
import { ProfileSnapshotService } from "../services/ProfileSnapshotService";
export declare class MatchController {
protected logger: ILogger;
@@ -29,12 +31,14 @@ export declare class MatchController {
protected botLootCacheService: BotLootCacheService;
protected configServer: ConfigServer;
protected profileSnapshotService: ProfileSnapshotService;
+ protected customLocationWaveService: CustomLocationWaveService;
+ protected openZoneService: OpenZoneService;
protected botGenerationCacheService: BotGenerationCacheService;
protected applicationContext: ApplicationContext;
protected matchConfig: IMatchConfig;
protected inraidConfig: IInRaidConfig;
protected botConfig: IBotConfig;
- constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext);
+ constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext);
getEnabled(): boolean;
getProfile(info: IGetProfileRequestData): IPmcData[];
createGroup(sessionID: string, info: ICreateGroupRequestData): any;
diff --git a/Live/CWX_DebugTool/types/controllers/QuestController.d.ts b/Live/CWX_DebugTool/types/controllers/QuestController.d.ts
index 842207f..59061c7 100644
--- a/Live/CWX_DebugTool/types/controllers/QuestController.d.ts
+++ b/Live/CWX_DebugTool/types/controllers/QuestController.d.ts
@@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper";
import { QuestHelper } from "../helpers/QuestHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IQuest, Reward } from "../models/eft/common/tables/IQuest";
+import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData";
import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRequestData";
@@ -15,6 +16,7 @@ import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { LocaleService } from "../services/LocaleService";
+import { LocalisationService } from "../services/LocalisationService";
import { PlayerService } from "../services/PlayerService";
import { TimeUtil } from "../utils/TimeUtil";
export declare class QuestController {
@@ -29,9 +31,10 @@ export declare class QuestController {
protected questConditionHelper: QuestConditionHelper;
protected playerService: PlayerService;
protected localeService: LocaleService;
+ protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected questConfig: IQuestConfig;
- constructor(logger: ILogger, timeUtil: TimeUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer);
+ constructor(logger: ILogger, timeUtil: TimeUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer);
/**
* Get all quests visible to player
* Exclude quests with incomplete preconditions (level/loyalty)
@@ -56,6 +59,13 @@ export declare class QuestController {
*/
acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
+ /**
+ * Look for an accepted quest inside player profile, return matching
+ * @param pmcData Profile to search through
+ * @param acceptedQuest Quest to search for
+ * @returns IRepeatableQuest
+ */
+ protected getRepeatableQuestFromProfile(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData): IRepeatableQuest;
/**
* Update completed quest in profile
* Add newly unlocked quests to profile
diff --git a/Live/CWX_DebugTool/types/controllers/RagfairController.d.ts b/Live/CWX_DebugTool/types/controllers/RagfairController.d.ts
index 95702f2..5caac53 100644
--- a/Live/CWX_DebugTool/types/controllers/RagfairController.d.ts
+++ b/Live/CWX_DebugTool/types/controllers/RagfairController.d.ts
@@ -67,16 +67,16 @@ export declare class RagfairController {
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer);
- getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult;
+ getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult;
/**
* Get offers for the client based on type of search being performed
* @param searchRequest Client search request data
* @param itemsToAdd
- * @param assorts
+ * @param traderAssorts Trader assorts
* @param pmcProfile Player profile
* @returns array of offers
*/
- protected getOffersForSearchType(searchRequest: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[];
+ protected getOffersForSearchType(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[];
/**
* Get categories for the type of search being performed, linked/required/all
* @param searchRequest Client search request data
diff --git a/Live/CWX_DebugTool/types/controllers/RepeatableQuestController.d.ts b/Live/CWX_DebugTool/types/controllers/RepeatableQuestController.d.ts
index 333583b..f97efc6 100644
--- a/Live/CWX_DebugTool/types/controllers/RepeatableQuestController.d.ts
+++ b/Live/CWX_DebugTool/types/controllers/RepeatableQuestController.d.ts
@@ -98,6 +98,13 @@ export declare class RepeatableQuestController {
* @returns {array} array of "repeatableQuestObjects" as descibed above
*/
getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[];
+ /**
+ * Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists
+ * @param repeatableConfig daily/weekly config
+ * @param pmcData Profile to search
+ * @returns IPmcDataRepeatableQuest
+ */
+ protected getRepeatableQuestSubTypeFromProfile(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): IPmcDataRepeatableQuest;
/**
* This method is called by GetClientRepeatableQuests and creates one element of quest type format (see assets/database/templates/repeatableQuests.json).
* It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest
diff --git a/Live/CWX_DebugTool/types/di/OnLoad.d.ts b/Live/CWX_DebugTool/types/di/OnLoad.d.ts
index 064d07d..4a28f13 100644
--- a/Live/CWX_DebugTool/types/di/OnLoad.d.ts
+++ b/Live/CWX_DebugTool/types/di/OnLoad.d.ts
@@ -1,4 +1,4 @@
export declare class OnLoad {
- onLoad(): void;
+ onLoad(): Promise;
getRoute(): string;
}
diff --git a/Live/CWX_DebugTool/types/di/OnLoadOnUpdate.d.ts b/Live/CWX_DebugTool/types/di/OnLoadOnUpdate.d.ts
index 8bd3dc3..eaa297c 100644
--- a/Live/CWX_DebugTool/types/di/OnLoadOnUpdate.d.ts
+++ b/Live/CWX_DebugTool/types/di/OnLoadOnUpdate.d.ts
@@ -1,7 +1,7 @@
import { OnLoad } from "./OnLoad";
import { OnUpdate } from "./OnUpdate";
export declare class OnLoadOnUpdate implements OnLoad, OnUpdate {
- onUpdate(timeSinceLastRun: number): boolean;
- onLoad(): void;
+ onUpdate(timeSinceLastRun: number): Promise;
+ onLoad(): Promise;
getRoute(): string;
}
diff --git a/Live/CWX_DebugTool/types/di/OnUpdate.d.ts b/Live/CWX_DebugTool/types/di/OnUpdate.d.ts
index 7fbbe09..6839719 100644
--- a/Live/CWX_DebugTool/types/di/OnUpdate.d.ts
+++ b/Live/CWX_DebugTool/types/di/OnUpdate.d.ts
@@ -1,4 +1,4 @@
export declare class OnUpdate {
- onUpdate(timeSinceLastRun: number): boolean;
+ onUpdate(timeSinceLastRun: number): Promise;
getRoute(): string;
}
diff --git a/Live/CWX_DebugTool/types/generators/BotEquipmentModGenerator.d.ts b/Live/CWX_DebugTool/types/generators/BotEquipmentModGenerator.d.ts
new file mode 100644
index 0000000..ae25ebe
--- /dev/null
+++ b/Live/CWX_DebugTool/types/generators/BotEquipmentModGenerator.d.ts
@@ -0,0 +1,181 @@
+import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
+import { BotHelper } from "../helpers/BotHelper";
+import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
+import { ItemHelper } from "../helpers/ItemHelper";
+import { ProbabilityHelper } from "../helpers/ProbabilityHelper";
+import { ProfileHelper } from "../helpers/ProfileHelper";
+import { Mods, ModsChances } from "../models/eft/common/tables/IBotType";
+import { Item } from "../models/eft/common/tables/IItem";
+import { ITemplateItem, Slot } from "../models/eft/common/tables/ITemplateItem";
+import { EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig";
+import { ILogger } from "../models/spt/utils/ILogger";
+import { ConfigServer } from "../servers/ConfigServer";
+import { DatabaseServer } from "../servers/DatabaseServer";
+import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
+import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService";
+import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService";
+import { ItemFilterService } from "../services/ItemFilterService";
+import { LocalisationService } from "../services/LocalisationService";
+import { HashUtil } from "../utils/HashUtil";
+import { JsonUtil } from "../utils/JsonUtil";
+import { RandomUtil } from "../utils/RandomUtil";
+export declare class BotEquipmentModGenerator {
+ protected logger: ILogger;
+ protected jsonUtil: JsonUtil;
+ protected hashUtil: HashUtil;
+ protected randomUtil: RandomUtil;
+ protected probabilityHelper: ProbabilityHelper;
+ protected databaseServer: DatabaseServer;
+ protected itemHelper: ItemHelper;
+ protected botEquipmentFilterService: BotEquipmentFilterService;
+ protected itemFilterService: ItemFilterService;
+ protected profileHelper: ProfileHelper;
+ protected botWeaponModLimitService: BotWeaponModLimitService;
+ protected botHelper: BotHelper;
+ protected botGeneratorHelper: BotGeneratorHelper;
+ protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
+ protected localisationService: LocalisationService;
+ protected botEquipmentModPoolService: BotEquipmentModPoolService;
+ protected configServer: ConfigServer;
+ protected botConfig: IBotConfig;
+ constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer);
+ /**
+ * Check mods are compatible and add to array
+ * @param equipment Equipment item to add mods to
+ * @param modPool Mod list to choose frm
+ * @param parentId parentid of item to add mod to
+ * @param parentTemplate template objet of item to add mods to
+ * @param modSpawnChances dictionary of mod items and their chance to spawn for this bot type
+ * @param botRole the bot role being generated for
+ * @param forceSpawn should this mod be forced to spawn
+ * @returns Item + compatible mods as an array
+ */
+ generateModsForEquipment(equipment: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, botRole: string, forceSpawn?: boolean): Item[];
+ /**
+ * Add mods to a weapon using the provided mod pool
+ * @param sessionId session id
+ * @param weapon Weapon to add mods to
+ * @param modPool Pool of compatible mods to attach to weapon
+ * @param weaponParentId parentId of weapon
+ * @param parentWeaponTemplate Weapon which mods will be generated on
+ * @param modSpawnChances Mod spawn chances
+ * @param ammoTpl Ammo tpl to use when generating magazines/cartridges
+ * @param botRole Role of bot weapon is generated for
+ * @param botLevel lvel of the bot weapon is being generated for
+ * @param modLimits limits placed on certian mod types per gun
+ * @param botEquipmentRole role of bot when accessing bot.json equipment config settings
+ * @returns Weapon + mods array
+ */
+ generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponParentId: string, parentWeaponTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string, botLevel: number, modLimits: BotModLimits, botEquipmentRole: string): Item[];
+ /**
+ * Get a Slot property for an item (chamber/cartridge/slot)
+ * @param modSlot e.g patron_in_weapon
+ * @param parentTemplate item template
+ * @returns Slot item
+ */
+ protected getModItemSlot(modSlot: string, parentTemplate: ITemplateItem): Slot;
+ /**
+ * randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot
+ * never return true for an item that has 0% spawn chance
+ * @param itemSlot slot the item sits in
+ * @param modSlot slot the mod sits in
+ * @param modSpawnChances Chances for various mod spawns
+ * @returns boolean true if it should spawn
+ */
+ protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances): boolean;
+ /**
+ *
+ * @param modSlot Slot mod will fit into
+ * @param isRandomisableSlot Will generate a randomised mod pool if true
+ * @param modsParent Parent slot the item will be a part of
+ * @param botEquipBlacklist Blacklist to prevent mods from being picked
+ * @param itemModPool Pool of items to pick from
+ * @param weapon array with only weapon tpl in it, ready for mods to be added
+ * @param ammoTpl ammo tpl to use if slot requires a cartridge to be added (e.g. mod_magazine)
+ * @param parentTemplate Parent item the mod will go into
+ * @returns ITemplateItem
+ */
+ protected chooseModToPutIntoSlot(modSlot: string, isRandomisableSlot: boolean, botWeaponSightWhitelist: Record, botEquipBlacklist: EquipmentFilterDetails, itemModPool: Record, weapon: Item[], ammoTpl: string, parentTemplate: ITemplateItem): [boolean, ITemplateItem];
+ /**
+ * Create a mod item with parameters as properties
+ * @param modId _id
+ * @param modTpl _tpl
+ * @param parentId parentId
+ * @param modSlot slotId
+ * @param modTemplate Used to add additional properites in the upd object
+ * @returns Item object
+ */
+ protected createModItem(modId: string, modTpl: string, parentId: string, modSlot: string, modTemplate: ITemplateItem, botRole: string): Item;
+ /**
+ * Get a list of containers that hold ammo
+ * e.g. mod_magazine / patron_in_weapon_000
+ * @returns string array
+ */
+ protected getAmmoContainers(): string[];
+ /**
+ * Get a random mod from an items compatible mods Filter array
+ * @param modTpl ???? default value to return if nothing found
+ * @param parentSlot item mod will go into, used to get combatible items
+ * @param modSlot Slot to get mod to fill
+ * @param items items to ensure picked mod is compatible with
+ * @returns item tpl
+ */
+ protected getModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string;
+ /**
+ * Log errors if mod is not compatible with slot
+ * @param modToAdd template of mod to check
+ * @param itemSlot slot the item will be placed in
+ * @param modSlot slot the mod will fill
+ * @param parentTemplate tempalte of the mods parent item
+ * @returns true if valid
+ */
+ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], itemSlot: Slot, modSlot: string, parentTemplate: ITemplateItem): boolean;
+ /**
+ * Find mod tpls of a provided type and add to modPool
+ * @param desiredSlotName slot to look up and add we are adding tpls for (e.g mod_scope)
+ * @param modTemplate db object for modItem we get compatible mods from
+ * @param modPool Pool of mods we are adding to
+ */
+ protected addCompatibleModsForProvidedMod(desiredSlotName: string, modTemplate: ITemplateItem, modPool: Mods, botEquipBlacklist: EquipmentFilterDetails): void;
+ /**
+ * Get the possible items that fit a slot
+ * @param parentItemId item tpl to get compatible items for
+ * @param modSlot Slot item should fit in
+ * @param botEquipBlacklist equipment that should not be picked
+ * @returns array of compatible items for that slot
+ */
+ protected getDynamicModPool(parentItemId: string, modSlot: string, botEquipBlacklist: EquipmentFilterDetails): string[];
+ /**
+ * Take a list of tpls and filter out blacklisted values using itemFilterService + botEquipmentBlacklist
+ * @param allowedMods base mods to filter
+ * @param botEquipBlacklist equipment blacklist
+ * @param modSlot slot mods belong to
+ * @returns Filtered array of mod tpls
+ */
+ protected filterWeaponModsByBlacklist(allowedMods: string[], botEquipBlacklist: EquipmentFilterDetails, modSlot: string): string[];
+ /**
+ * With the shotgun revolver (60db29ce99594040e04c4a27) 12.12 introduced CylinderMagazines.
+ * Those magazines (e.g. 60dc519adf4c47305f6d410d) have a "Cartridges" entry with a _max_count=0.
+ * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots.
+ * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine"
+ * @param items The items where the CylinderMagazine's camora are appended to
+ * @param modPool modPool which should include available cartrigdes
+ * @param parentId The CylinderMagazine's UID
+ * @param parentTemplate The CylinderMagazine's template
+ */
+ protected fillCamora(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem): void;
+ /**
+ * Take a record of camoras and merge the compatable shells into one array
+ * @param camorasWithShells camoras we want to merge into one array
+ * @returns string array of shells fro luitple camora sources
+ */
+ protected mergeCamoraPoolsTogether(camorasWithShells: Record): string[];
+ /**
+ * Filter out non-whitelisted weapon scopes
+ * @param weapon Weapon scopes will be added to
+ * @param scopes Full scope pool
+ * @param botWeaponSightWhitelist whitelist of scope types by weapon base type
+ * @returns array of scope tpls that have been filtered
+ */
+ protected filterSightsByWeaponType(weapon: Item, scopes: string[], botWeaponSightWhitelist: Record): string[];
+}
diff --git a/Live/CWX_DebugTool/types/generators/BotGenerator.d.ts b/Live/CWX_DebugTool/types/generators/BotGenerator.d.ts
index 08ad50a..2675146 100644
--- a/Live/CWX_DebugTool/types/generators/BotGenerator.d.ts
+++ b/Live/CWX_DebugTool/types/generators/BotGenerator.d.ts
@@ -1,16 +1,16 @@
import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper";
import { BotHelper } from "../helpers/BotHelper";
-import { GameEventHelper } from "../helpers/GameEventHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Health as PmcHealth, IBotBase, Skills } from "../models/eft/common/tables/IBotBase";
-import { Health, IBotType, Inventory } from "../models/eft/common/tables/IBotType";
+import { Health, IBotType } from "../models/eft/common/tables/IBotType";
import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails";
import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
+import { SeasonalEventService } from "../services/SeasonalEventService";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
@@ -29,10 +29,10 @@ export declare class BotGenerator {
protected weightedRandomHelper: WeightedRandomHelper;
protected botHelper: BotHelper;
protected botDifficultyHelper: BotDifficultyHelper;
- protected gameEventHelper: GameEventHelper;
+ protected seasonalEventService: SeasonalEventService;
protected configServer: ConfigServer;
protected botConfig: IBotConfig;
- constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, gameEventHelper: GameEventHelper, configServer: ConfigServer);
+ constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
/**
* Generate a player scav bot object
* @param role e.g. assault / pmcbot
@@ -42,23 +42,12 @@ export declare class BotGenerator {
*/
generatePlayerScav(sessionId: string, role: string, difficulty: string, botTemplate: IBotType): IBotBase;
/**
- * Generate an array of bot objects based on a condition for a raid with
- * @param sessionId session id
- * @param botGenerationDetails details on how to generate the bots
- * @returns Generated bots in array
+ * Create x number of bots of the type/side/difficulty defined in botGenerationDetails
+ * @param sessionId Session id
+ * @param botGenerationDetails details on how to generate bots
+ * @returns array of bots
*/
- generateByCondition(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase[];
- /**
- * Get the PMCs wildSpawnType value
- * @param role "usec" / "bear"
- * @returns wildSpawnType value as string
- */
- protected getPmcRoleByDescription(role: string): string;
- /**
- * Get a randomised PMC side based on bot config value 'isUsec'
- * @returns pmc side as string
- */
- protected getRandomisedPmcSide(): string;
+ prepareAndGenerateBots(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase[];
/**
* Get a clone of the database\bots\base.json file
* @returns IBotBase object
@@ -94,11 +83,6 @@ export declare class BotGenerator {
*/
protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth;
protected generateSkills(skillsObj: Skills): Skills;
- /**
- * Iterate through bots inventory and loot to find and remove christmas items (as defined in GameEventHelper)
- * @param nodeInventory Bots inventory to iterate over
- */
- protected removeChristmasItemsFromBotInventory(nodeInventory: Inventory): void;
/**
* Generate a random Id for a bot and apply to bots _id and aid value
* @param bot bot to update
@@ -106,12 +90,6 @@ export declare class BotGenerator {
*/
protected generateId(bot: IBotBase): IBotBase;
protected generateInventoryID(profile: IBotBase): IBotBase;
- /**
- * Get the difficulty passed in, if its not "asoline", get selected difficulty from config
- * @param requestedDifficulty
- * @returns
- */
- protected getPMCDifficulty(requestedDifficulty: string): string;
/**
* Add a side-specific (usec/bear) dogtag item to a bots inventory
* @param bot bot to add dogtag to
diff --git a/Live/CWX_DebugTool/types/generators/BotInventoryGenerator.d.ts b/Live/CWX_DebugTool/types/generators/BotInventoryGenerator.d.ts
index a3b5eaa..83a548b 100644
--- a/Live/CWX_DebugTool/types/generators/BotInventoryGenerator.d.ts
+++ b/Live/CWX_DebugTool/types/generators/BotInventoryGenerator.d.ts
@@ -4,13 +4,15 @@ import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType";
import { EquipmentSlots } from "../models/enums/EquipmentSlots";
-import { IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig";
+import { EquipmentFilterDetails, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
+import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService";
import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { RandomUtil } from "../utils/RandomUtil";
+import { BotEquipmentModGenerator } from "./BotEquipmentModGenerator";
import { BotLootGenerator } from "./BotLootGenerator";
import { BotWeaponGenerator } from "./BotWeaponGenerator";
export declare class BotInventoryGenerator {
@@ -24,9 +26,11 @@ export declare class BotInventoryGenerator {
protected botHelper: BotHelper;
protected weightedRandomHelper: WeightedRandomHelper;
protected localisationService: LocalisationService;
+ protected botEquipmentModPoolService: BotEquipmentModPoolService;
+ protected botEquipmentModGenerator: BotEquipmentModGenerator;
protected configServer: ConfigServer;
protected botConfig: IBotConfig;
- constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, configServer: ConfigServer);
+ constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer);
/**
* Add equipment/weapons/loot to bot
* @param sessionId Session id
@@ -62,6 +66,13 @@ export declare class BotInventoryGenerator {
* @param randomisationDetails settings from bot.json to adjust how item is generated
*/
protected generateEquipment(equipmentSlot: string, equipmentPool: Record, modPool: Mods, spawnChances: Chances, botRole: string, inventory: PmcInventory, randomisationDetails: RandomisationDetails): void;
+ /**
+ * Get all possible mods for item and filter down based on equipment blacklist from bot.json config
+ * @param itemTpl Item mod pool is being retreived and filtered
+ * @param equipmentBlacklist blacklist to filter mod pool with
+ * @returns Filtered pool of mods
+ */
+ protected getFilteredDynamicModsForItem(itemTpl: string, equipmentBlacklist: EquipmentFilterDetails[]): Record;
/**
* Work out what weapons bot should have equipped and add them to bot inventory
* @param templateInventory bot/x.json data from db
diff --git a/Live/CWX_DebugTool/types/generators/BotWeaponGenerator.d.ts b/Live/CWX_DebugTool/types/generators/BotWeaponGenerator.d.ts
index b2eaf3b..938d61c 100644
--- a/Live/CWX_DebugTool/types/generators/BotWeaponGenerator.d.ts
+++ b/Live/CWX_DebugTool/types/generators/BotWeaponGenerator.d.ts
@@ -12,10 +12,12 @@ import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
+import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService";
import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
+import { BotEquipmentModGenerator } from "./BotEquipmentModGenerator";
import { IInventoryMagGen } from "./weapongen/IInventoryMagGen";
export declare class BotWeaponGenerator {
protected jsonUtil: JsonUtil;
@@ -28,11 +30,13 @@ export declare class BotWeaponGenerator {
protected randomUtil: RandomUtil;
protected configServer: ConfigServer;
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
+ protected botWeaponModLimitService: BotWeaponModLimitService;
+ protected botEquipmentModGenerator: BotEquipmentModGenerator;
protected localisationService: LocalisationService;
protected inventoryMagGenComponents: IInventoryMagGen[];
protected readonly modMagazineSlotId = "mod_magazine";
protected botConfig: IBotConfig;
- constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]);
+ constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]);
/**
* Pick a random weapon based on weightings and generate a functional weapon
* @param equipmentSlot Primary/secondary/holster
diff --git a/Live/CWX_DebugTool/types/generators/LocationGenerator.d.ts b/Live/CWX_DebugTool/types/generators/LocationGenerator.d.ts
index cc61dcf..a80ae3c 100644
--- a/Live/CWX_DebugTool/types/generators/LocationGenerator.d.ts
+++ b/Live/CWX_DebugTool/types/generators/LocationGenerator.d.ts
@@ -1,5 +1,4 @@
import { ContainerHelper } from "../helpers/ContainerHelper";
-import { GameEventHelper } from "../helpers/GameEventHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { PresetHelper } from "../helpers/PresetHelper";
import { RagfairServerHelper } from "../helpers/RagfairServerHelper";
@@ -9,6 +8,8 @@ import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticL
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
+import { LocalisationService } from "../services/LocalisationService";
+import { SeasonalEventService } from "../services/SeasonalEventService";
import { JsonUtil } from "../utils/JsonUtil";
import { MathUtil } from "../utils/MathUtil";
import { ObjectId } from "../utils/ObjectId";
@@ -26,12 +27,13 @@ export declare class LocationGenerator {
protected ragfairServerHelper: RagfairServerHelper;
protected itemHelper: ItemHelper;
protected mathUtil: MathUtil;
- protected gameEventHelper: GameEventHelper;
+ protected seasonalEventService: SeasonalEventService;
protected containerHelper: ContainerHelper;
protected presetHelper: PresetHelper;
+ protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected locationConfig: ILocationConfig;
- constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, gameEventHelper: GameEventHelper, containerHelper: ContainerHelper, presetHelper: PresetHelper, configServer: ConfigServer);
+ constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer);
generateContainerLoot(containerIn: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerProps;
protected getLooseLootMultiplerForLocation(location: string): number;
protected getStaticLootMultiplerForLocation(location: string): number;
diff --git a/Live/CWX_DebugTool/types/generators/LootGenerator.d.ts b/Live/CWX_DebugTool/types/generators/LootGenerator.d.ts
index bc0d7ec..0d2ef24 100644
--- a/Live/CWX_DebugTool/types/generators/LootGenerator.d.ts
+++ b/Live/CWX_DebugTool/types/generators/LootGenerator.d.ts
@@ -6,6 +6,7 @@ import { LootRequest } from "../models/spt/services/LootRequest";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { ItemFilterService } from "../services/ItemFilterService";
+import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { RandomUtil } from "../utils/RandomUtil";
export declare class LootGenerator {
@@ -14,8 +15,9 @@ export declare class LootGenerator {
protected databaseServer: DatabaseServer;
protected randomUtil: RandomUtil;
protected itemHelper: ItemHelper;
+ protected localisationService: LocalisationService;
protected itemFilterService: ItemFilterService;
- constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, itemFilterService: ItemFilterService);
+ constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService);
/**
* Generate a list of items based on configuration options parameter
* @param options parameters to adjust how loot is generated
diff --git a/Live/CWX_DebugTool/types/generators/PlayerScavGenerator.d.ts b/Live/CWX_DebugTool/types/generators/PlayerScavGenerator.d.ts
index bb2c730..9fee88b 100644
--- a/Live/CWX_DebugTool/types/generators/PlayerScavGenerator.d.ts
+++ b/Live/CWX_DebugTool/types/generators/PlayerScavGenerator.d.ts
@@ -10,6 +10,7 @@ import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer";
import { BotLootCacheService } from "../services/BotLootCacheService";
import { FenceService } from "../services/FenceService";
+import { LocalisationService } from "../services/LocalisationService";
import { JsonUtil } from "../utils/JsonUtil";
import { BotGenerator } from "./BotGenerator";
export declare class PlayerScavGenerator {
@@ -21,10 +22,11 @@ export declare class PlayerScavGenerator {
protected jsonUtil: JsonUtil;
protected fenceService: FenceService;
protected botLootCacheService: BotLootCacheService;
+ protected localisationService: LocalisationService;
protected botGenerator: BotGenerator;
protected configServer: ConfigServer;
protected playerScavConfig: IPlayerScavConfig;
- constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, jsonUtil: JsonUtil, fenceService: FenceService, botLootCacheService: BotLootCacheService, botGenerator: BotGenerator, configServer: ConfigServer);
+ constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, jsonUtil: JsonUtil, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer);
/**
* Update a player profile to include a new player scav profile
* @param sessionID session id to specify what profile is updated
diff --git a/Live/CWX_DebugTool/types/generators/RagfairOfferGenerator.d.ts b/Live/CWX_DebugTool/types/generators/RagfairOfferGenerator.d.ts
index 23882d2..dba8eb3 100644
--- a/Live/CWX_DebugTool/types/generators/RagfairOfferGenerator.d.ts
+++ b/Live/CWX_DebugTool/types/generators/RagfairOfferGenerator.d.ts
@@ -7,7 +7,7 @@ import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { IBarterScheme } from "../models/eft/common/tables/ITrader";
import { IRagfairOffer, OfferRequirement } from "../models/eft/ragfair/IRagfairOffer";
-import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
+import { Dynamic, IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
@@ -88,7 +88,16 @@ export declare class RagfairOfferGenerator {
* Create multiple offers for items by using a unique list of items we've generated previously
* @param expiredOffers optional, expired offers to regenerate
*/
- generateDynamicOffers(expiredOffers?: Item[]): void;
+ generateDynamicOffers(expiredOffers?: Item[]): Promise;
+ protected createOffersForItems(assortItemIndex: string, assortItemsToProcess: Item[], expiredOffers: Item[], config: Dynamic): Promise;
+ /**
+ * Create one flea offer for a specific item
+ * @param items Item to create offer for
+ * @param isPreset Is item a weapon preset
+ * @param itemDetails raw db item details
+ * @returns
+ */
+ protected createSingleOfferForItem(items: Item[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise- ;
/**
* Generate trader offers on flea using the traders assort data
* @param traderID Trader to generate offers for
diff --git a/Live/CWX_DebugTool/types/helpers/BotGeneratorHelper.d.ts b/Live/CWX_DebugTool/types/helpers/BotGeneratorHelper.d.ts
index 9ee017f..740805b 100644
--- a/Live/CWX_DebugTool/types/helpers/BotGeneratorHelper.d.ts
+++ b/Live/CWX_DebugTool/types/helpers/BotGeneratorHelper.d.ts
@@ -1,207 +1,24 @@
import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper";
-import { Mods, ModsChances } from "../models/eft/common/tables/IBotType";
import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem";
-import { ITemplateItem, Slot } from "../models/eft/common/tables/ITemplateItem";
-import { EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig";
+import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
+import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
-import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
-import { ItemFilterService } from "../services/ItemFilterService";
import { LocalisationService } from "../services/LocalisationService";
-import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
-import { BotHelper } from "./BotHelper";
-import { BotWeaponGeneratorHelper } from "./BotWeaponGeneratorHelper";
-import { ContainerHelper } from "./ContainerHelper";
-import { InventoryHelper } from "./InventoryHelper";
import { ItemHelper } from "./ItemHelper";
-import { ProbabilityHelper } from "./ProbabilityHelper";
-import { ProfileHelper } from "./ProfileHelper";
-export declare class BotModLimits {
- scope: ItemCount;
- scopeMax: number;
- scopeBaseTypes: string[];
- flashlightLaser: ItemCount;
- flashlightLaserMax: number;
- flashlgihtLaserBaseTypes: string[];
-}
-export declare class ItemCount {
- count: number;
-}
export declare class BotGeneratorHelper {
protected logger: ILogger;
- protected jsonUtil: JsonUtil;
- protected hashUtil: HashUtil;
protected randomUtil: RandomUtil;
- protected probabilityHelper: ProbabilityHelper;
protected databaseServer: DatabaseServer;
protected durabilityLimitsHelper: DurabilityLimitsHelper;
protected itemHelper: ItemHelper;
- protected inventoryHelper: InventoryHelper;
- protected containerHelper: ContainerHelper;
- protected botEquipmentFilterService: BotEquipmentFilterService;
- protected itemFilterService: ItemFilterService;
- protected profileHelper: ProfileHelper;
- protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
- protected botHelper: BotHelper;
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected botConfig: IBotConfig;
- constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botHelper: BotHelper, localisationService: LocalisationService, configServer: ConfigServer);
- /**
- * Check mods are compatible and add to array
- * @param equipment Equipment item to add mods to
- * @param modPool Mod list to choose frm
- * @param parentId parentid of item to add mod to
- * @param parentTemplate template objet of item to add mods to
- * @param modSpawnChances dictionary of mod items and their chance to spawn for this bot type
- * @param botRole the bot role being generated for
- * @param forceSpawn should this mod be forced to spawn
- * @returns Item + compatible mods as an array
- */
- generateModsForEquipment(equipment: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, botRole: string, forceSpawn?: boolean): Item[];
- /**
- * Add mods to a weapon using the provided mod pool
- * @param sessionId session id
- * @param weapon Weapon to add mods to
- * @param modPool Pool of compatible mods to attach to weapon
- * @param weaponParentId parentId of weapon
- * @param parentWeaponTemplate Weapon which mods will be generated on
- * @param modSpawnChances Mod spawn chances
- * @param ammoTpl Ammo tpl to use when generating magazines/cartridges
- * @param botRole Role of bot weapon is generated for
- * @returns Weapon + mods array
- */
- generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponParentId: string, parentWeaponTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string, botLevel: number): Item[];
- /**
- *
- * @param modSlot Slot mod will fit into
- * @param isRandomisableSlot Will generate a randomised mod pool if true
- * @param modsParent Parent slot the item will be a part of
- * @param botEquipBlacklist Blacklist to prevent mods from being picked
- * @param itemModPool Pool of items to pick from
- * @param weapon array with only weapon tpl in it, ready for mods to be added
- * @param ammoTpl ammo tpl to use if slot requires a cartridge to be added (e.g. mod_magazine)
- * @param parentTemplate Parent item the mod will go into
- * @returns ITemplateItem
- */
- protected chooseModToPutIntoSlot(modSlot: string, isRandomisableSlot: boolean, modsParent: Slot, botEquipBlacklist: EquipmentFilterDetails, itemModPool: Record, weapon: Item[], ammoTpl: string, parentTemplate: ITemplateItem): [boolean, ITemplateItem];
- /**
- * Find mod tpls of a provided type and add to modPool
- * @param desiredSlotName slot to look up and add we are adding tpls for (e.g mod_scope)
- * @param modTemplate db object for modItem we get compatible mods from
- * @param modPool Pool of mods we are adding to
- */
- protected addCompatibleModsForProvidedMod(desiredSlotName: string, modTemplate: ITemplateItem, modPool: Mods, botEquipBlacklist: EquipmentFilterDetails): void;
- /**
- * Check if mod item is on limited list + has surpassed the limit set for it
- * @param botRole role the bot has e.g. assault
- * @param modTemplate mods template data
- * @param modLimits limits set for weapon being generated for this bot
- * @returns true if over item limit
- */
- protected modHasReachedItemLimit(botRole: string, modTemplate: ITemplateItem, modLimits: BotModLimits): boolean;
- /**
- * Initalise mod limits to be used when generating a weapon
- * @param botRole "assault", "bossTagilla" or "pmc"
- * @returns BotModLimits object
- */
- protected initModLimits(botRole: string): BotModLimits;
- /**
- * Generate a pool of mods for this bots mod type if bot has values inside `randomisedWeaponModSlots` array found in bot.json/equipment[botrole]
- * @param allowedMods Mods to be added to mod pool
- * @param botEquipBlacklist blacklist of items not allowed to be added to mod pool
- * @param modSlot Slot to generate mods for
- * @param itemModPool base mod pool to replace values of
- */
- protected generateDynamicWeaponModPool(allowedMods: string[], botEquipBlacklist: EquipmentFilterDetails, modSlot: string, itemModPool: Record): void;
- /**
- * Find all compatible mods for equipment item and add to modPool
- * @param itemDetails item to find mods for
- * @param modPool ModPool to add mods to
- * @param equipmentBlacklist equipment not allowed to be used by the bot
- * @param botEquipmentRole bot type to generate pool for (e.g. assault, pmcBot, pmc for usec/bear)
- */
- generateDynamicModPool(itemDetails: ITemplateItem, modPool: Mods, equipmentBlacklist: EquipmentFilterDetails[], botEquipmentRole: string): void;
- /**
- * Take a list of tpls and filter out blacklisted values using itemFilterService + botEquipmentBlacklist
- * @param allowedMods base mods to filter
- * @param botEquipBlacklist equipment blacklist
- * @param modSlot slot mods belong to
- * @returns Filtered array of mod tpls
- */
- protected filterWeaponModsByBlacklist(allowedMods: string[], botEquipBlacklist: EquipmentFilterDetails, modSlot: string): string[];
- /**
- * Check if the specific item type on the weapon has reached the set limit
- * @param modTpl log mod tpl if over type limit
- * @param currentCount current number of this item on gun
- * @param maxLimit mod limit allowed
- * @param botRole role of bot we're checking weapon of
- * @returns true if limit reached
- */
- protected weaponModLimitReached(modTpl: string, currentCount: {
- count: number;
- }, maxLimit: number, botRole: string): boolean;
- /**
- * Log errors if mod is not compatible with slot
- * @param modToAdd template of mod to check
- * @param itemSlot slot the item will be placed in
- * @param modSlot slot the mod will fill
- * @param parentTemplate tempalte of the mods parent item
- * @returns true if valid
- */
- protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], itemSlot: Slot, modSlot: string, parentTemplate: ITemplateItem): boolean;
- /**
- * Create a mod item with parameters as properties
- * @param modId _id
- * @param modTpl _tpl
- * @param parentId parentId
- * @param modSlot slotId
- * @param modTemplate Used to add additional properites in the upd object
- * @returns Item object
- */
- protected createModItem(modId: string, modTpl: string, parentId: string, modSlot: string, modTemplate: ITemplateItem, botRole: string): Item;
- /**
- * randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot
- * never return true for an item that has 0% spawn chance
- * @param itemSlot slot the item sits in
- * @param modSlot slot the mod sits in
- * @param modSpawnChances Chances for various mod spawns
- * @returns boolean true if it should spawn
- */
- protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances): boolean;
- /**
- * Get a list of containers that hold ammo
- * e.g. mod_magazine / patron_in_weapon_000
- * @returns string array
- */
- protected getAmmoContainers(): string[];
- /**
- * Get a Slot property for an item (chamber/cartridge/slot)
- * @param modSlot e.g patron_in_weapon
- * @param parentTemplate item template
- * @returns Slot item
- */
- protected getModItemSlot(modSlot: string, parentTemplate: ITemplateItem): Slot;
- /**
- * With the shotgun revolver (60db29ce99594040e04c4a27) 12.12 introduced CylinderMagazines.
- * Those magazines (e.g. 60dc519adf4c47305f6d410d) have a "Cartridges" entry with a _max_count=0.
- * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots.
- * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine"
- * @param items The items where the CylinderMagazine's camora are appended to
- * @param modPool modPool which should include available cartrigdes
- * @param parentId The CylinderMagazine's UID
- * @param parentTemplate The CylinderMagazine's template
- */
- protected fillCamora(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem): void;
- /**
- * Take a record of camoras and merge the compatable shells into one array
- * @param camorasWithShells camoras we want to merge into one array
- * @returns string array of shells fro luitple camora sources
- */
- protected mergeCamoraPoolsTogether(camorasWithShells: Record): string[];
+ constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, localisationService: LocalisationService, configServer: ConfigServer);
/**
* Adds properties to an item
* e.g. Repairable / HasHinge / Foldable / MaxDurability
@@ -212,6 +29,18 @@ export declare class BotGeneratorHelper {
generateExtraPropertiesForItem(itemTemplate: ITemplateItem, botRole?: string): {
upd?: Upd;
};
+ /**
+ * Get the chance for the light or laser to be set as active on weapon, default to 50% if no bot/equip settings found
+ * @param botRole role of bot with weapon
+ * @returns Percent chance to be active
+ */
+ protected getLightLaserActiveChance(botRole: string): number;
+ /**
+ * Get the chance for the faceshield to be set as enabled, default to 75% if no bot/equip settings found
+ * @param botRole role of bot with faceshield
+ * @returns Percent chance to be active
+ */
+ protected getFaceShieldActiveChance(botRole: string): number;
/**
* Create a repairable object for a weapon that containers durability + max durability properties
* @param itemTemplate weapon object being generated for
@@ -227,22 +56,16 @@ export declare class BotGeneratorHelper {
*/
protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable;
/**
- * Get a random mod from an items compatible mods Filter array
- * @param modTpl ????
- * @param parentSlot item mod will go into, used to get combatible items
- * @param modSlot Slot to get mod to fill
- * @param items items to ensure picked mod is compatible with
- * @returns item tpl
- */
- protected getModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string;
- /**
- * Can an item be added to an item without issue
- * @param items items to check compatiblilities with
- * @param tplToCheck tpl of the item to check for incompatibilities
+ * Can item be added to another item without conflict
+ * @param items Items to check compatiblilities with
+ * @param tplToCheck Tpl of the item to check for incompatibilities
* @param equipmentSlot Slot the item will be placed into
- * @returns false if no incompatibilties
+ * @returns false if no incompatibilties, also has incompatibility reason
*/
- isItemIncompatibleWithCurrentItems(items: Item[], tplToCheck: string, equipmentSlot: string): boolean;
+ isItemIncompatibleWithCurrentItems(items: Item[], tplToCheck: string, equipmentSlot: string): {
+ incompatible: boolean;
+ reason: string;
+ };
/**
* Convert a bots role to the equipment role used in config/bot.json
* @param botRole Role to convert
diff --git a/Live/CWX_DebugTool/types/helpers/BotHelper.d.ts b/Live/CWX_DebugTool/types/helpers/BotHelper.d.ts
index 2752a0e..9a43b8e 100644
--- a/Live/CWX_DebugTool/types/helpers/BotHelper.d.ts
+++ b/Live/CWX_DebugTool/types/helpers/BotHelper.d.ts
@@ -1,3 +1,4 @@
+import { MinMax } from "../models/common/MinMax";
import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType";
import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger";
@@ -59,6 +60,8 @@ export declare class BotHelper {
* @returns true if should be a pmc
*/
shouldBotBePmc(botRole: string): boolean;
+ rollChanceToBePmc(role: string, botConvertMinMax: MinMax): boolean;
+ botRoleIsPmc(botRole: string): boolean;
/**
* Get randomisation settings for bot from config/bot.json
* @param botLevel level of bot
@@ -66,4 +69,20 @@ export declare class BotHelper {
* @returns RandomisationDetails
*/
getBotRandomisationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails;
+ /**
+ * Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec
+ * @returns pmc role
+ */
+ getRandomisedPmcRole(): string;
+ /**
+ * Get the corrisponding side when sptBear or sptUsec is passed in
+ * @param botRole role to get side for
+ * @returns side (usec/bear)
+ */
+ getPmcSideByRole(botRole: string): string;
+ /**
+ * Get a randomised PMC side based on bot config value 'isUsec'
+ * @returns pmc side as string
+ */
+ protected getRandomisedPmcSide(): string;
}
diff --git a/Live/CWX_DebugTool/types/helpers/BotWeaponGeneratorHelper.d.ts b/Live/CWX_DebugTool/types/helpers/BotWeaponGeneratorHelper.d.ts
index 7e25f56..b087fa9 100644
--- a/Live/CWX_DebugTool/types/helpers/BotWeaponGeneratorHelper.d.ts
+++ b/Live/CWX_DebugTool/types/helpers/BotWeaponGeneratorHelper.d.ts
@@ -4,6 +4,7 @@ import { Item } from "../models/eft/common/tables/IItem";
import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
+import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { ContainerHelper } from "./ContainerHelper";
@@ -16,8 +17,9 @@ export declare class BotWeaponGeneratorHelper {
protected randomUtil: RandomUtil;
protected hashUtil: HashUtil;
protected inventoryHelper: InventoryHelper;
+ protected localisationService: LocalisationService;
protected containerHelper: ContainerHelper;
- constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper);
+ constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper);
/**
* Get a randomised number of bullets for a specific magazine
* @param magCounts min and max count of magazines
diff --git a/Live/CWX_DebugTool/types/helpers/DialogueHelper.d.ts b/Live/CWX_DebugTool/types/helpers/DialogueHelper.d.ts
index 88a726e..8f03b81 100644
--- a/Live/CWX_DebugTool/types/helpers/DialogueHelper.d.ts
+++ b/Live/CWX_DebugTool/types/helpers/DialogueHelper.d.ts
@@ -4,6 +4,7 @@ import { MessageType } from "../models/enums/MessageType";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer";
+import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { ItemHelper } from "./ItemHelper";
import { NotificationSendHelper } from "./NotificationSendHelper";
@@ -15,8 +16,9 @@ export declare class DialogueHelper {
protected databaseServer: DatabaseServer;
protected notifierHelper: NotifierHelper;
protected notificationSendHelper: NotificationSendHelper;
+ protected localisationService: LocalisationService;
protected itemHelper: ItemHelper;
- constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper);
+ constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper);
createMessageContext(templateId: string, messageType: MessageType, maxStoreTime: number): MessageContent;
/**
* Add a templated message to the dialogue.
diff --git a/Live/CWX_DebugTool/types/helpers/GameEventHelper.d.ts b/Live/CWX_DebugTool/types/helpers/GameEventHelper.d.ts
index fa25eff..f502c95 100644
--- a/Live/CWX_DebugTool/types/helpers/GameEventHelper.d.ts
+++ b/Live/CWX_DebugTool/types/helpers/GameEventHelper.d.ts
@@ -1,4 +1,4 @@
-import { ISeasonalEvent, ISeasonalEventConfig } from "../models/spt/config/ISeasonalEventConfig";
+import { ISeasonalEventConfig } from "../models/spt/config/ISeasonalEventConfig";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class GameEventHelper {
@@ -6,24 +6,4 @@ export declare class GameEventHelper {
protected configServer: ConfigServer;
protected seasonalEventConfig: ISeasonalEventConfig;
constructor(databaseServer: DatabaseServer, configServer: ConfigServer);
- get events(): Record;
- get christmasEventItems(): string[];
- itemIsChristmasRelated(itemId: string): boolean;
- christmasEventEnabled(): boolean;
- /**
- * Get the dates each seasonal event starts and ends
- * @returns Record with event name + start/end date
- */
- getEventDetails(): ISeasonalEvent[];
- /**
- * Is detection of seasonal events enabled (halloween / christmas)
- * @returns true if seasonal events should be checked for
- */
- isAutomaticEventDetectionEnabled(): boolean;
- /**
- * Get a dictionary of gear changes to apply to bots for a specific event e.g. Christmas/Halloween
- * @param eventName Name of event to get gear changes for
- * @returns bots with equipment changes
- */
- getEventBotGear(eventName: string): Record>>;
}
diff --git a/Live/CWX_DebugTool/types/helpers/HandbookHelper.d.ts b/Live/CWX_DebugTool/types/helpers/HandbookHelper.d.ts
index 1ab7800..05f8217 100644
--- a/Live/CWX_DebugTool/types/helpers/HandbookHelper.d.ts
+++ b/Live/CWX_DebugTool/types/helpers/HandbookHelper.d.ts
@@ -11,6 +11,7 @@ export declare class LookupCollection {
}
export declare class HandbookHelper {
protected databaseServer: DatabaseServer;
+ protected lookupCacheGenerated: boolean;
protected handbookPriceCache: LookupCollection;
constructor(databaseServer: DatabaseServer);
hydrateLookup(): void;
diff --git a/Live/CWX_DebugTool/types/helpers/ItemHelper.d.ts b/Live/CWX_DebugTool/types/helpers/ItemHelper.d.ts
index fc88a46..36ad1cf 100644
--- a/Live/CWX_DebugTool/types/helpers/ItemHelper.d.ts
+++ b/Live/CWX_DebugTool/types/helpers/ItemHelper.d.ts
@@ -5,12 +5,15 @@ import { IStaticAmmoDetails } from "../models/eft/common/tables/ILootBase";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
+import { ItemBaseClassService } from "../services/ItemBaseClassService";
import { LocaleService } from "../services/LocaleService";
+import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { MathUtil } from "../utils/MathUtil";
import { ObjectId } from "../utils/ObjectId";
import { RandomUtil } from "../utils/RandomUtil";
+import { HandbookHelper } from "./HandbookHelper";
declare class ItemHelper {
protected logger: ILogger;
protected hashUtil: HashUtil;
@@ -19,8 +22,11 @@ declare class ItemHelper {
protected objectId: ObjectId;
protected mathUtil: MathUtil;
protected databaseServer: DatabaseServer;
+ protected handbookHelper: HandbookHelper;
+ protected itemBaseClassService: ItemBaseClassService;
+ protected localisationService: LocalisationService;
protected localeService: LocaleService;
- constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, localeService: LocaleService);
+ constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService);
/**
* Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash
* @param {string} tpl the template id / tpl
@@ -31,10 +37,17 @@ declare class ItemHelper {
* Check if the tpl / template Id provided is a descendent of the baseclass
*
* @param {string} tpl the item template id to check
- * @param {string} baseclassTpl the baseclass to check for
+ * @param {string} baseClassTpl the baseclass to check for
* @return {boolean} is the tpl a descendent?
*/
- isOfBaseclass(tpl: string, baseclassTpl: string): boolean;
+ isOfBaseclass(tpl: string, baseClassTpl: string): boolean;
+ /**
+ * Check if item has any of the supplied base clases
+ * @param tpl Item to check base classes of
+ * @param baseClassTpls base classes to check for
+ * @returns true if any supplied base classes match
+ */
+ isOfBaseclasses(tpl: string, baseClassTpls: string[]): boolean;
/**
* Returns the item price based on the handbook or as a fallback from the prices.json if the item is not
* found in the handbook. If the price can't be found at all return 0
diff --git a/Live/CWX_DebugTool/types/helpers/QuestHelper.d.ts b/Live/CWX_DebugTool/types/helpers/QuestHelper.d.ts
index edbd2e1..363a9e1 100644
--- a/Live/CWX_DebugTool/types/helpers/QuestHelper.d.ts
+++ b/Live/CWX_DebugTool/types/helpers/QuestHelper.d.ts
@@ -10,6 +10,7 @@ import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { LocaleService } from "../services/LocaleService";
+import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil";
@@ -32,10 +33,11 @@ export declare class QuestHelper {
protected dialogueHelper: DialogueHelper;
protected profileHelper: ProfileHelper;
protected paymentHelper: PaymentHelper;
+ protected localisationService: LocalisationService;
protected traderHelper: TraderHelper;
protected configServer: ConfigServer;
protected questConfig: IQuestConfig;
- constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, configServer: ConfigServer);
+ constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, configServer: ConfigServer);
/**
* Get status of a quest by quest id
* @param pmcData Profile to search
diff --git a/Live/CWX_DebugTool/types/helpers/RagfairOfferHelper.d.ts b/Live/CWX_DebugTool/types/helpers/RagfairOfferHelper.d.ts
index b73f786..95be986 100644
--- a/Live/CWX_DebugTool/types/helpers/RagfairOfferHelper.d.ts
+++ b/Live/CWX_DebugTool/types/helpers/RagfairOfferHelper.d.ts
@@ -46,7 +46,7 @@ export declare class RagfairOfferHelper {
protected ragfairConfig: IRagfairConfig;
protected questConfig: IQuestConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer);
- getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[];
+ getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[];
getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[];
/**
* Check if trader offers' BuyRestrictionMax value has been reached
@@ -64,5 +64,5 @@ export declare class RagfairOfferHelper {
protected getProfileOffers(sessionID: string): IRagfairOffer[];
protected deleteOfferByOfferId(sessionID: string, offerId: string): void;
protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse;
- isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean;
+ isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean;
}
diff --git a/Live/CWX_DebugTool/types/helpers/TraderAssortHelper.d.ts b/Live/CWX_DebugTool/types/helpers/TraderAssortHelper.d.ts
index 025efd6..3861abd 100644
--- a/Live/CWX_DebugTool/types/helpers/TraderAssortHelper.d.ts
+++ b/Live/CWX_DebugTool/types/helpers/TraderAssortHelper.d.ts
@@ -7,6 +7,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { FenceService } from "../services/FenceService";
+import { LocalisationService } from "../services/LocalisationService";
import { TraderAssortService } from "../services/TraderAssortService";
import { JsonUtil } from "../utils/JsonUtil";
import { MathUtil } from "../utils/MathUtil";
@@ -27,11 +28,12 @@ export declare class TraderAssortHelper {
protected ragfairAssortGenerator: RagfairAssortGenerator;
protected ragfairOfferGenerator: RagfairOfferGenerator;
protected traderAssortService: TraderAssortService;
+ protected localisationService: LocalisationService;
protected traderHelper: TraderHelper;
protected fenceService: FenceService;
protected configServer: ConfigServer;
protected traderConfig: ITraderConfig;
- constructor(logger: ILogger, jsonUtil: JsonUtil, mathUtil: MathUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, profileHelper: ProfileHelper, assortHelper: AssortHelper, paymentHelper: PaymentHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferGenerator: RagfairOfferGenerator, traderAssortService: TraderAssortService, traderHelper: TraderHelper, fenceService: FenceService, configServer: ConfigServer);
+ constructor(logger: ILogger, jsonUtil: JsonUtil, mathUtil: MathUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, profileHelper: ProfileHelper, assortHelper: AssortHelper, paymentHelper: PaymentHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferGenerator: RagfairOfferGenerator, traderAssortService: TraderAssortService, localisationService: LocalisationService, traderHelper: TraderHelper, fenceService: FenceService, configServer: ConfigServer);
/**
* Get a traders assorts
* Can be used for returning ragfair / fence assorts
diff --git a/Live/CWX_DebugTool/types/loaders/PostDBModLoader.d.ts b/Live/CWX_DebugTool/types/loaders/PostDBModLoader.d.ts
index 5101b7b..87b60f9 100644
--- a/Live/CWX_DebugTool/types/loaders/PostDBModLoader.d.ts
+++ b/Live/CWX_DebugTool/types/loaders/PostDBModLoader.d.ts
@@ -4,7 +4,7 @@ import { PreAkiModLoader } from "./PreAkiModLoader";
export declare class PostDBModLoader implements OnLoad {
protected preAkiModLoader: PreAkiModLoader;
constructor(preAkiModLoader: PreAkiModLoader);
- onLoad(): void;
+ onLoad(): Promise;
getRoute(): string;
getModPath(mod: string): string;
protected executeMods(container: DependencyContainer): void;
diff --git a/Live/CWX_DebugTool/types/models/eft/common/tables/IQuest.d.ts b/Live/CWX_DebugTool/types/models/eft/common/tables/IQuest.d.ts
index c5b1cb2..d538126 100644
--- a/Live/CWX_DebugTool/types/models/eft/common/tables/IQuest.d.ts
+++ b/Live/CWX_DebugTool/types/models/eft/common/tables/IQuest.d.ts
@@ -37,7 +37,7 @@ export interface Conditions {
export interface AvailableForConditions {
_parent: string;
_props: AvailableForProps;
- dynamicLocale: boolean;
+ dynamicLocale?: boolean;
}
export interface AvailableForProps {
id: string;
diff --git a/Live/CWX_DebugTool/types/models/eft/game/IGameConfigResponse.d.ts b/Live/CWX_DebugTool/types/models/eft/game/IGameConfigResponse.d.ts
index eb37a39..e1b7587 100644
--- a/Live/CWX_DebugTool/types/models/eft/game/IGameConfigResponse.d.ts
+++ b/Live/CWX_DebugTool/types/models/eft/game/IGameConfigResponse.d.ts
@@ -7,11 +7,13 @@ export interface IGameConfigResponse {
activeProfileId: string;
backend: Backend;
utc_time: number;
+ /** Total in game time */
totalInGame: number;
reportAvailable: boolean;
twitchEventMember: boolean;
}
export interface Backend {
+ Lobby: string;
Trading: string;
Messaging: string;
Main: string;
diff --git a/Live/CWX_DebugTool/types/models/eft/hideout/IHideoutProduction.d.ts b/Live/CWX_DebugTool/types/models/eft/hideout/IHideoutProduction.d.ts
index ce878be..9295fb1 100644
--- a/Live/CWX_DebugTool/types/models/eft/hideout/IHideoutProduction.d.ts
+++ b/Live/CWX_DebugTool/types/models/eft/hideout/IHideoutProduction.d.ts
@@ -3,7 +3,7 @@ export interface IHideoutProduction {
areaType: number;
requirements: Requirement[];
productionTime: number;
- boosters: any;
+ boosters?: any;
endProduct: string;
continuous: boolean;
count: number;
diff --git a/Live/CWX_DebugTool/types/models/enums/BaseClasses.d.ts b/Live/CWX_DebugTool/types/models/enums/BaseClasses.d.ts
index 4eb6f7e..7d11510 100644
--- a/Live/CWX_DebugTool/types/models/enums/BaseClasses.d.ts
+++ b/Live/CWX_DebugTool/types/models/enums/BaseClasses.d.ts
@@ -8,6 +8,8 @@ export declare enum BaseClasses {
BACKPACK = "5448e53e4bdc2d60728b4567",
VISORS = "5448e5724bdc2ddf718b4568",
FOOD = "5448e8d04bdc2ddf718b4569",
+ GAS_BLOCK = "56ea9461d2720b67698b456f",
+ RAIL_COVER = "55818b1d4bdc2d5b648b4572",
DRINK = "5448e8d64bdc2dce718b4568",
BARTER_ITEM = "5448eb774bdc2d0a728b4567",
INFO = "5448ecbe4bdc2d60728b4568",
@@ -36,6 +38,7 @@ export declare enum BaseClasses {
THROW_WEAPON = "543be6564bdc2df4348b4568",
FOOD_DRINK = "543be6674bdc2df1348b4569",
PISTOL = "5447b5cf4bdc2d65278b4567",
+ REVOLVER = "617f1ef5e8b54b0998387733",
SMG = "5447b5e04bdc2d62278b4567",
ASSAULT_RIFLE = "5447b5f14bdc2d61278b4567",
ASSAULT_CARBINE = "5447b5fc4bdc2d87278b4567",
@@ -73,9 +76,10 @@ export declare enum BaseClasses {
TACTICAL_COMBO = "55818b164bdc2ddc698b456c",
FLASHLIGHT = "55818b084bdc2d5b648b4571",
MAGAZINE = "5448bc234bdc2d3c308b4569",
- LIGHT_LASER = "55818b0e4bdc2dde698b456e",
+ LIGHT_LASER_DESIGNATOR = "55818b0e4bdc2dde698b456e",
FLASH_HIDER = "550aa4bf4bdc2dd6348b456b",
COLLIMATOR = "55818ad54bdc2ddc698b4569",
+ IRON_SIGHT = "55818ac54bdc2d5b648b456e",
COMPACT_COLLIMATOR = "55818acf4bdc2dde698b456b",
COMPENSATOR = "550aa4af4bdc2dd4348b456e",
OPTIC_SCOPE = "55818ae44bdc2dde698b456c",
diff --git a/Live/CWX_DebugTool/types/models/enums/ExitStatis.d.ts b/Live/CWX_DebugTool/types/models/enums/ExitStatis.d.ts
new file mode 100644
index 0000000..78d9733
--- /dev/null
+++ b/Live/CWX_DebugTool/types/models/enums/ExitStatis.d.ts
@@ -0,0 +1,7 @@
+export declare enum ExitStatus {
+ SURVIVED = 0,
+ KILLED = 1,
+ LEFT = 2,
+ RUNNER = 3,
+ MISSINGINACTION = 4
+}
diff --git a/Live/CWX_DebugTool/types/models/spt/bots/BotGenerationDetails.d.ts b/Live/CWX_DebugTool/types/models/spt/bots/BotGenerationDetails.d.ts
index 256de03..26571a2 100644
--- a/Live/CWX_DebugTool/types/models/spt/bots/BotGenerationDetails.d.ts
+++ b/Live/CWX_DebugTool/types/models/spt/bots/BotGenerationDetails.d.ts
@@ -3,6 +3,8 @@ export interface BotGenerationDetails {
isPmc: boolean;
/** assault/pmcBot etc */
role: string;
+ /** Side of bot */
+ side: string;
/** Active players current level */
playerLevel: number;
/** Delta of highest level of bot */
diff --git a/Live/CWX_DebugTool/types/models/spt/callbacks/IDataCallbacks.d.ts b/Live/CWX_DebugTool/types/models/spt/callbacks/IDataCallbacks.d.ts
index a098560..b4f4f8c 100644
--- a/Live/CWX_DebugTool/types/models/spt/callbacks/IDataCallbacks.d.ts
+++ b/Live/CWX_DebugTool/types/models/spt/callbacks/IDataCallbacks.d.ts
@@ -6,7 +6,6 @@ import { IHideoutProduction } from "../../eft/hideout/IHideoutProduction";
import { IHideoutScavCase } from "../../eft/hideout/IHideoutScavCase";
import { IHideoutSettingsBase } from "../../eft/hideout/IHideoutSettingsBase";
import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData";
-import { ILanguageBase } from "../server/ILocaleBase";
import { ISettingsBase } from "../server/ISettingsBase";
export interface IDataCallbacks {
getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData;
@@ -20,7 +19,7 @@ export interface IDataCallbacks {
getHideoutAreas(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData;
gethideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData;
getHideoutScavcase(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData;
- getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData;
+ getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>;
getLocalesMenu(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData;
getLocalesGlobal(url: string, info: IEmptyRequestData, sessionID: string): string;
}
diff --git a/Live/CWX_DebugTool/types/models/spt/config/IBotConfig.d.ts b/Live/CWX_DebugTool/types/models/spt/config/IBotConfig.d.ts
index 83897db..e17992c 100644
--- a/Live/CWX_DebugTool/types/models/spt/config/IBotConfig.d.ts
+++ b/Live/CWX_DebugTool/types/models/spt/config/IBotConfig.d.ts
@@ -66,6 +66,7 @@ export interface LootNvalue {
}
export interface EquipmentFilters {
weaponModLimits: ModLimits;
+ weaponSightWhitelist: Record;
faceShieldIsActiveChancePercent?: number;
lightLaserIsActiveChancePercent?: number;
randomisation: RandomisationDetails[];
diff --git a/Live/CWX_DebugTool/types/models/spt/config/ILocationConfig.d.ts b/Live/CWX_DebugTool/types/models/spt/config/ILocationConfig.d.ts
index 0551d57..a012fae 100644
--- a/Live/CWX_DebugTool/types/models/spt/config/ILocationConfig.d.ts
+++ b/Live/CWX_DebugTool/types/models/spt/config/ILocationConfig.d.ts
@@ -1,8 +1,16 @@
+import { BossLocationSpawn, Wave } from "../../../models/eft/common/ILocationBase";
import { IBaseConfig } from "./IBaseConfig";
export interface ILocationConfig extends IBaseConfig {
kind: "aki-location";
looseLootMultiplier: LootMultiplier;
staticLootMultiplier: LootMultiplier;
+ customWaves: CustomWaves;
+ /** Open zones to add to map */
+ openZones: Record;
+}
+export interface CustomWaves {
+ boss: Record;
+ normal: Record;
}
export interface LootMultiplier {
bigmap: number;
diff --git a/Live/CWX_DebugTool/types/models/spt/server/ILocaleBase.d.ts b/Live/CWX_DebugTool/types/models/spt/server/ILocaleBase.d.ts
index 6e20b89..3cdaf6f 100644
--- a/Live/CWX_DebugTool/types/models/spt/server/ILocaleBase.d.ts
+++ b/Live/CWX_DebugTool/types/models/spt/server/ILocaleBase.d.ts
@@ -1,49 +1,5 @@
export interface ILocaleBase {
- global: Record;
+ global: Record>;
menu: Record;
- languages: ILanguageBase[];
-}
-export interface ILocaleGlobalBase {
- interface: Record;
- enum: any[];
- mail: Record;
- quest: Record;
- preset: Record;
- handbook: Record;
- season: Record;
- customization: Record;
- repeatableQuest: Record;
- templates: Record;
- locations: Record;
- banners: Record;
- trading: Record;
-}
-export interface ILocaleQuest {
- name: string;
- description: string;
- note: string;
- failMessageText: string;
- startedMessageText: string;
- successMessageText: string;
- conditions: Record;
- location: string;
-}
-export interface ILocalePreset {
- Name: string;
-}
-export interface ILocaleProps {
- Name: string;
- ShortName: string;
- Description: string;
-}
-export interface ILocaleTradingProps {
- FullName: string;
- FirstName: string;
- Nickname: string;
- Location: string;
- Description: string;
-}
-export interface ILanguageBase {
- ShortName: string;
- Name: string;
+ languages: Record;
}
diff --git a/Live/CWX_DebugTool/types/models/spt/server/ISettingsBase.d.ts b/Live/CWX_DebugTool/types/models/spt/server/ISettingsBase.d.ts
index c067cda..625ad5c 100644
--- a/Live/CWX_DebugTool/types/models/spt/server/ISettingsBase.d.ts
+++ b/Live/CWX_DebugTool/types/models/spt/server/ISettingsBase.d.ts
@@ -11,6 +11,7 @@ export interface Config {
FramerateLimit: FramerateLimit;
GroupStatusInterval: number;
KeepAliveInterval: number;
+ LobbyKeepAliveInterval: number;
Mark502and504AsNonImportant: boolean;
MemoryManagementSettings: MemoryManagementSettings;
NVidiaHighlights: boolean;
@@ -18,7 +19,10 @@ export interface Config {
PingServerResultSendInterval: number;
PingServersInterval: number;
ReleaseProfiler: ReleaseProfiler;
+ RequestConfirmationTimeouts: number[];
+ RequestsMadeThroughLobby: string[];
SecondCycleDelaySeconds: number;
+ ShouldEstablishLobbyConnection: boolean;
TurnOffLogging: boolean;
WeaponOverlapDistanceCulling: number;
WebDiagnosticsEnabled: boolean;
diff --git a/Live/CWX_DebugTool/types/routers/ItemEventRouter.d.ts b/Live/CWX_DebugTool/types/routers/ItemEventRouter.d.ts
index e80d16c..a9338ab 100644
--- a/Live/CWX_DebugTool/types/routers/ItemEventRouter.d.ts
+++ b/Live/CWX_DebugTool/types/routers/ItemEventRouter.d.ts
@@ -1,14 +1,16 @@
-import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
-import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest";
-import { ProfileHelper } from "../helpers/ProfileHelper";
import { ItemEventRouterDefinition } from "../di/Router";
+import { ProfileHelper } from "../helpers/ProfileHelper";
+import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest";
+import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { ILogger } from "../models/spt/utils/ILogger";
+import { LocalisationService } from "../services/LocalisationService";
import { EventOutputHolder } from "./EventOutputHolder";
export declare class ItemEventRouter {
protected logger: ILogger;
protected profileHelper: ProfileHelper;
protected itemEventRouters: ItemEventRouterDefinition[];
+ protected localisationService: LocalisationService;
protected eventOutputHolder: EventOutputHolder;
- constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], eventOutputHolder: EventOutputHolder);
+ constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], localisationService: LocalisationService, eventOutputHolder: EventOutputHolder);
handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse;
}
diff --git a/Live/CWX_DebugTool/types/servers/RagfairServer.d.ts b/Live/CWX_DebugTool/types/servers/RagfairServer.d.ts
index c93864b..f49654a 100644
--- a/Live/CWX_DebugTool/types/servers/RagfairServer.d.ts
+++ b/Live/CWX_DebugTool/types/servers/RagfairServer.d.ts
@@ -4,6 +4,7 @@ import { TraderHelper } from "../helpers/TraderHelper";
import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger";
+import { LocalisationService } from "../services/LocalisationService";
import { RagfairCategoriesService } from "../services/RagfairCategoriesService";
import { RagfairOfferService } from "../services/RagfairOfferService";
import { RagfairRequiredItemsService } from "../services/RagfairRequiredItemsService";
@@ -14,13 +15,14 @@ export declare class RagfairServer {
protected ragfairOfferService: RagfairOfferService;
protected ragfairCategoriesService: RagfairCategoriesService;
protected ragfairRequiredItemsService: RagfairRequiredItemsService;
+ protected localisationService: LocalisationService;
protected traderHelper: TraderHelper;
protected traderAssortHelper: TraderAssortHelper;
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
- constructor(logger: ILogger, ragfairOfferGenerator: RagfairOfferGenerator, ragfairOfferService: RagfairOfferService, ragfairCategoriesService: RagfairCategoriesService, ragfairRequiredItemsService: RagfairRequiredItemsService, traderHelper: TraderHelper, traderAssortHelper: TraderAssortHelper, configServer: ConfigServer);
- load(): void;
- update(): void;
+ constructor(logger: ILogger, ragfairOfferGenerator: RagfairOfferGenerator, ragfairOfferService: RagfairOfferService, ragfairCategoriesService: RagfairCategoriesService, ragfairRequiredItemsService: RagfairRequiredItemsService, localisationService: LocalisationService, traderHelper: TraderHelper, traderAssortHelper: TraderAssortHelper, configServer: ConfigServer);
+ load(): Promise;
+ update(): Promise;
/**
* Get traders who need to be periodically refreshed
* @returns string array of traders
diff --git a/Live/CWX_DebugTool/types/services/BotEquipmentFilterService.d.ts b/Live/CWX_DebugTool/types/services/BotEquipmentFilterService.d.ts
index 43e64b0..ef3b504 100644
--- a/Live/CWX_DebugTool/types/services/BotEquipmentFilterService.d.ts
+++ b/Live/CWX_DebugTool/types/services/BotEquipmentFilterService.d.ts
@@ -24,6 +24,18 @@ export declare class BotEquipmentFilterService {
* @param baseValues Values to update
*/
protected adjustChances(equipmentChanges: Record, baseValues: EquipmentChances | ModsChances): void;
+ /**
+ * Get equipment settings for bot
+ * @param botEquipmentRole equipment role to return
+ * @returns EquipmentFilters object
+ */
+ getBotEquipmentSettings(botEquipmentRole: string): EquipmentFilters;
+ /**
+ * Get weapon sight whitelist for a specific bot type
+ * @param botEquipmentRole equipment role of bot to look up
+ * @returns Dictionary of weapon type and their whitelisted scope types
+ */
+ getBotWeaponSightWhitelist(botEquipmentRole: string): Record;
/**
* Get an object that contains equipment and cartridge blacklists for a specified bot type
* @param botRole Role of the bot we want the blacklist for
diff --git a/Live/CWX_DebugTool/types/services/BotEquipmentModPoolService.d.ts b/Live/CWX_DebugTool/types/services/BotEquipmentModPoolService.d.ts
new file mode 100644
index 0000000..6724ad1
--- /dev/null
+++ b/Live/CWX_DebugTool/types/services/BotEquipmentModPoolService.d.ts
@@ -0,0 +1,65 @@
+import { ItemHelper } from "../helpers/ItemHelper";
+import { Mods } from "../models/eft/common/tables/IBotType";
+import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
+import { IBotConfig } from "../models/spt/config/IBotConfig";
+import { ILogger } from "../models/spt/utils/ILogger";
+import { ConfigServer } from "../servers/ConfigServer";
+import { DatabaseServer } from "../servers/DatabaseServer";
+import { VFS } from "../utils/VFS";
+/** Store a mapping between weapons, their slots and the items that fit those slots */
+export declare class BotEquipmentModPoolService {
+ protected logger: ILogger;
+ protected vfs: VFS;
+ protected itemHelper: ItemHelper;
+ protected databaseServer: DatabaseServer;
+ protected configServer: ConfigServer;
+ protected botConfig: IBotConfig;
+ protected weaponModPool: Mods;
+ protected gearModPool: Mods;
+ protected weaponPoolGenerated: boolean;
+ protected armorPoolGenerated: boolean;
+ constructor(logger: ILogger, vfs: VFS, itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer);
+ /**
+ * Store dictionary of mods for each item passed in
+ * @param items items to find related mods and store in modPool
+ */
+ protected generatePool(items: ITemplateItem[], poolType: string): void;
+ /**
+ * Empty the mod pool
+ */
+ resetPool(): void;
+ /**
+ * Get array of compatible mods for an items mod slot (generate pool if it doesnt exist already)
+ * @param itemTpl item to look up
+ * @param slotName slot to get compatible mods for
+ * @returns tpls that fit the slot
+ */
+ getCompatibleModsForWeaponSlot(itemTpl: string, slotName: string): string[];
+ /**
+ * Get array of compatible mods for an items mod slot (generate pool if it doesnt exist already)
+ * @param itemTpl item to look up
+ * @param slotName slot to get compatible mods for
+ * @returns tpls that fit the slot
+ */
+ getCompatibleModsFoGearSlot(itemTpl: string, slotName: string): string[];
+ /**
+ * Get mods for a piece of gear by its tpl
+ * @param itemTpl items tpl to look up mods for
+ * @returns Dictionary of mods (keys are mod slot names) with array of compatible mod tpls as value
+ */
+ getModsFoGearSlot(itemTpl: string): Record;
+ /**
+ * Get mods for a weapon by its tpl
+ * @param itemTpl Weapons tpl to look up mods for
+ * @returns Dictionary of mods (keys are mod slot names) with array of compatible mod tpls as value
+ */
+ getModsForWeaponSlot(itemTpl: string): Record;
+ /**
+ * Create weapon mod pool and set generated flag to true
+ */
+ protected generateWeaponPool(): void;
+ /**
+ * Create gear mod pool and set generated flag to true
+ */
+ protected generateGearPool(): void;
+}
diff --git a/Live/CWX_DebugTool/types/services/BotGenerationCacheService.d.ts b/Live/CWX_DebugTool/types/services/BotGenerationCacheService.d.ts
index 0be0576..a491b03 100644
--- a/Live/CWX_DebugTool/types/services/BotGenerationCacheService.d.ts
+++ b/Live/CWX_DebugTool/types/services/BotGenerationCacheService.d.ts
@@ -3,32 +3,34 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase";
import { ILogger } from "../models/spt/utils/ILogger";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
+import { LocalisationService } from "./LocalisationService";
export declare class BotGenerationCacheService {
protected logger: ILogger;
protected randomUtil: RandomUtil;
protected jsonUtil: JsonUtil;
+ protected localisationService: LocalisationService;
protected botHelper: BotHelper;
protected storedBots: Map;
- constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, botHelper: BotHelper);
+ constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, localisationService: LocalisationService, botHelper: BotHelper);
/**
* Store array of bots in cache, shuffle results before storage
* @param botsToStore Bots we want to store in the cache
*/
- storeBots(botsToStore: IBotBase[]): void;
+ storeBots(key: string, botsToStore: IBotBase[]): void;
/**
* Find and return a bot based on its role
* Remove bot from internal array so it can't be retreived again
- * @param role role to retreive (assault/bossTagilla etc)
+ * @param key role to retreive (assault/bossTagilla etc)
* @returns IBotBase object
*/
- getBot(role: string): IBotBase;
+ getBot(key: string): IBotBase;
/**
* Remove all cached bot profiles
*/
clearStoredBots(): void;
/**
- * Does cache have bots
- * @returns true if empty
+ * Does cache have a bot with requested key
+ * @returns false if empty
*/
- cacheHasBotOfRole(role: string): boolean;
+ cacheHasBotOfRole(key: string): boolean;
}
diff --git a/Live/CWX_DebugTool/types/services/BotLootCacheService.d.ts b/Live/CWX_DebugTool/types/services/BotLootCacheService.d.ts
index 00ffb9c..dab7c6d 100644
--- a/Live/CWX_DebugTool/types/services/BotLootCacheService.d.ts
+++ b/Live/CWX_DebugTool/types/services/BotLootCacheService.d.ts
@@ -5,15 +5,17 @@ import { BotLootCache, LootCacheType } from "../models/spt/bots/BotLootCache";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { JsonUtil } from "../utils/JsonUtil";
+import { LocalisationService } from "./LocalisationService";
import { RagfairPriceService } from "./RagfairPriceService";
export declare class BotLootCacheService {
protected logger: ILogger;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
protected pmcLootGenerator: PMCLootGenerator;
+ protected localisationService: LocalisationService;
protected ragfairPriceService: RagfairPriceService;
protected lootCache: Record;
- constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, pmcLootGenerator: PMCLootGenerator, ragfairPriceService: RagfairPriceService);
+ constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, pmcLootGenerator: PMCLootGenerator, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService);
/**
* Remove all cached bot loot data
*/
diff --git a/Live/CWX_DebugTool/types/services/BotWeaponModLimitService.d.ts b/Live/CWX_DebugTool/types/services/BotWeaponModLimitService.d.ts
new file mode 100644
index 0000000..f8ebc2f
--- /dev/null
+++ b/Live/CWX_DebugTool/types/services/BotWeaponModLimitService.d.ts
@@ -0,0 +1,54 @@
+import { ItemHelper } from "../helpers/ItemHelper";
+import { Item } from "../models/eft/common/tables/IItem";
+import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
+import { IBotConfig } from "../models/spt/config/IBotConfig";
+import { ILogger } from "../models/spt/utils/ILogger";
+import { ConfigServer } from "../servers/ConfigServer";
+export declare class BotModLimits {
+ scope: ItemCount;
+ scopeMax: number;
+ scopeBaseTypes: string[];
+ flashlightLaser: ItemCount;
+ flashlightLaserMax: number;
+ flashlgihtLaserBaseTypes: string[];
+}
+export declare class ItemCount {
+ count: number;
+}
+export declare class BotWeaponModLimitService {
+ protected logger: ILogger;
+ protected configServer: ConfigServer;
+ protected itemHelper: ItemHelper;
+ protected botConfig: IBotConfig;
+ constructor(logger: ILogger, configServer: ConfigServer, itemHelper: ItemHelper);
+ /**
+ * Initalise mod limits to be used when generating a weapon
+ * @param botRole "assault", "bossTagilla" or "pmc"
+ * @returns BotModLimits object
+ */
+ getWeaponModLimits(botRole: string): BotModLimits;
+ /**
+ * Check if weapon mod item is on limited list + has surpassed the limit set for it
+ * Exception: Always allow ncstar backup mount
+ * Exception: Always allow scopes with a scope for a parent
+ * Exception: Always disallow mounts that hold only scopes once scope limit reached
+ * Exception: Always disallow mounts that hold only flashlights once flashlight limit reached
+ * @param botRole role the bot has e.g. assault
+ * @param modTemplate mods template data
+ * @param modLimits limits set for weapon being generated for this bot
+ * @param modsParent The parent of the mod to be checked
+ * @returns true if over item limit
+ */
+ weaponModHasReachedLimit(botRole: string, modTemplate: ITemplateItem, modLimits: BotModLimits, modsParent: ITemplateItem, weapon: Item[]): boolean;
+ /**
+ * Check if the specific item type on the weapon has reached the set limit
+ * @param modTpl log mod tpl if over type limit
+ * @param currentCount current number of this item on gun
+ * @param maxLimit mod limit allowed
+ * @param botRole role of bot we're checking weapon of
+ * @returns true if limit reached
+ */
+ protected weaponModLimitReached(modTpl: string, currentCount: {
+ count: number;
+ }, maxLimit: number, botRole: string): boolean;
+}
diff --git a/Live/CWX_DebugTool/types/services/CustomLocationWaveService.d.ts b/Live/CWX_DebugTool/types/services/CustomLocationWaveService.d.ts
new file mode 100644
index 0000000..7d14f07
--- /dev/null
+++ b/Live/CWX_DebugTool/types/services/CustomLocationWaveService.d.ts
@@ -0,0 +1,42 @@
+import { BossLocationSpawn, Wave } from "../models/eft/common/ILocationBase";
+import { ILocationConfig } from "../models/spt/config/ILocationConfig";
+import { ILogger } from "../models/spt/utils/ILogger";
+import { ConfigServer } from "../servers/ConfigServer";
+import { DatabaseServer } from "../servers/DatabaseServer";
+import { JsonUtil } from "../utils/JsonUtil";
+import { RandomUtil } from "../utils/RandomUtil";
+export declare class CustomLocationWaveService {
+ protected logger: ILogger;
+ protected randomUtil: RandomUtil;
+ protected jsonUtil: JsonUtil;
+ protected databaseServer: DatabaseServer;
+ protected configServer: ConfigServer;
+ protected locationConfig: ILocationConfig;
+ constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, configServer: ConfigServer);
+ /**
+ * Add a boss wave to a map
+ * @param locationId e.g. factory4_day, bigmap
+ * @param waveToAdd Boss wave to add to map
+ */
+ addBossWaveToMap(locationId: string, waveToAdd: BossLocationSpawn): void;
+ /**
+ * Add a normal bot wave to a map
+ * @param locationId e.g. factory4_day, bigmap
+ * @param waveToAdd Wave to add to map
+ */
+ addNormalWaveToMap(locationId: string, waveToAdd: Wave): void;
+ /**
+ * Clear all custom boss waves from a map
+ * @param locationId e.g. factory4_day, bigmap
+ */
+ clearBossWavesForMap(locationId: string): void;
+ /**
+ * Clear all custom normal waves from a map
+ * @param locationId e.g. factory4_day, bigmap
+ */
+ clearNormalWavesForMap(locationId: string): void;
+ /**
+ * Add custom boss and normal waves to maps found in config/location.json to db
+ */
+ applyWaveChangesToAllMaps(): void;
+}
diff --git a/Live/CWX_DebugTool/types/services/FenceService.d.ts b/Live/CWX_DebugTool/types/services/FenceService.d.ts
index bdcdeb2..f8919f1 100644
--- a/Live/CWX_DebugTool/types/services/FenceService.d.ts
+++ b/Live/CWX_DebugTool/types/services/FenceService.d.ts
@@ -15,6 +15,7 @@ import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil";
import { ItemFilterService } from "./ItemFilterService";
+import { LocalisationService } from "./LocalisationService";
/**
* Handle actions surrounding Fence
* e.g. generating or refreshing assorts / get next refresh time
@@ -30,11 +31,12 @@ export declare class FenceService {
protected itemHelper: ItemHelper;
protected presetHelper: PresetHelper;
protected itemFilterService: ItemFilterService;
+ protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected fenceAssort: ITraderAssort;
protected traderConfig: ITraderConfig;
protected nextMiniRefreshTimestamp: number;
- constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, configServer: ConfigServer);
+ constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, localisationService: LocalisationService, configServer: ConfigServer);
protected setFenceAssort(fenceAssort: ITraderAssort): void;
/**
* Get assorts player can purchase
diff --git a/Live/CWX_DebugTool/types/services/InsuranceService.d.ts b/Live/CWX_DebugTool/types/services/InsuranceService.d.ts
index 6be8a2f..1154160 100644
--- a/Live/CWX_DebugTool/types/services/InsuranceService.d.ts
+++ b/Live/CWX_DebugTool/types/services/InsuranceService.d.ts
@@ -1,4 +1,5 @@
import { DialogueHelper } from "../helpers/DialogueHelper";
+import { HandbookHelper } from "../helpers/HandbookHelper";
import { SecureContainerHelper } from "../helpers/SecureContainerHelper";
import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
@@ -21,10 +22,11 @@ export declare class InsuranceService {
protected saveServer: SaveServer;
protected traderHelper: TraderHelper;
protected dialogueHelper: DialogueHelper;
+ protected handbookHelper: HandbookHelper;
protected configServer: ConfigServer;
protected insured: Record>;
protected insuranceConfig: IInsuranceConfig;
- constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, configServer: ConfigServer);
+ constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, configServer: ConfigServer);
insuranceExists(sessionId: string): boolean;
insuranceTraderArrayExists(sessionId: string, traderId: string): boolean;
getInsurance(sessionId: string): Record;
diff --git a/Live/CWX_DebugTool/types/services/ItemBaseClassService.d.ts b/Live/CWX_DebugTool/types/services/ItemBaseClassService.d.ts
new file mode 100644
index 0000000..3c60658
--- /dev/null
+++ b/Live/CWX_DebugTool/types/services/ItemBaseClassService.d.ts
@@ -0,0 +1,37 @@
+import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
+import { ILogger } from "../models/spt/utils/ILogger";
+import { DatabaseServer } from "../servers/DatabaseServer";
+/**
+ * Cache the baseids for each item in the tiems db inside a dictionary
+ */
+export declare class ItemBaseClassService {
+ protected logger: ILogger;
+ protected databaseServer: DatabaseServer;
+ protected itemBaseClassesCache: Record;
+ protected cacheGenerated: boolean;
+ constructor(logger: ILogger, databaseServer: DatabaseServer);
+ /**
+ * Create cache and store inside ItemBaseClassService
+ */
+ hydrateItemBaseClassCache(): void;
+ /**
+ * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary
+ * @param itemIdToUpdate item tpl to store base ids against in dictionary
+ * @param item item being checked
+ * @param allDbItems all items in db
+ */
+ protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void;
+ /**
+ * Does item tpl inherit from the requested base class
+ * @param itemTpl item to check base classes of
+ * @param baseClass base class to check for
+ * @returns true if item inherits from base class passed in
+ */
+ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean;
+ /**
+ * Get base classes item inherits from
+ * @param itemTpl item to get base classes for
+ * @returns array of base classes
+ */
+ getItemBaseClasses(itemTpl: string): string[];
+}
diff --git a/Live/CWX_DebugTool/types/services/LocaleService.d.ts b/Live/CWX_DebugTool/types/services/LocaleService.d.ts
index 8275b75..09c658b 100644
--- a/Live/CWX_DebugTool/types/services/LocaleService.d.ts
+++ b/Live/CWX_DebugTool/types/services/LocaleService.d.ts
@@ -1,5 +1,4 @@
import { ILocaleConfig } from "../models/spt/config/ILocaleConfig";
-import { ILocaleGlobalBase } from "../models/spt/server/ILocaleBase";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
@@ -14,9 +13,9 @@ export declare class LocaleService {
constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer);
/**
* Get the eft globals db file based on the configured locale in config/locale.json, if not found, fall back to 'en'
- * @returns ILocaleGlobalBase
+ * @returns dictionary
*/
- getLocaleDb(): ILocaleGlobalBase;
+ getLocaleDb(): Record;
/**
* Gets the game locale key from the locale.json file,
* if value is 'system' get system locale
diff --git a/Live/CWX_DebugTool/types/services/OpenZoneService.d.ts b/Live/CWX_DebugTool/types/services/OpenZoneService.d.ts
new file mode 100644
index 0000000..8e70b94
--- /dev/null
+++ b/Live/CWX_DebugTool/types/services/OpenZoneService.d.ts
@@ -0,0 +1,28 @@
+import { ILocationConfig } from "../models/spt/config/ILocationConfig";
+import { ILogger } from "../models/spt/utils/ILogger";
+import { ConfigServer } from "../servers/ConfigServer";
+import { DatabaseServer } from "../servers/DatabaseServer";
+import { JsonUtil } from "../utils/JsonUtil";
+import { RandomUtil } from "../utils/RandomUtil";
+import { LocalisationService } from "./LocalisationService";
+/** Service for adding new zones to a maps OpenZones property */
+export declare class OpenZoneService {
+ protected logger: ILogger;
+ protected randomUtil: RandomUtil;
+ protected jsonUtil: JsonUtil;
+ protected databaseServer: DatabaseServer;
+ protected localisationService: LocalisationService;
+ protected configServer: ConfigServer;
+ protected locationConfig: ILocationConfig;
+ constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer);
+ /**
+ * Add open zone to specified map
+ * @param locationId map location (e.g. factory4_day)
+ * @param zoneToAdd zone to add
+ */
+ addZoneToMap(locationId: string, zoneToAdd: string): void;
+ /**
+ * Add open zones to all maps found in config/location.json to db
+ */
+ applyZoneChangesToAllMaps(): void;
+}
diff --git a/Live/CWX_DebugTool/types/services/RagfairOfferService.d.ts b/Live/CWX_DebugTool/types/services/RagfairOfferService.d.ts
index 86c1e52..133e6a7 100644
--- a/Live/CWX_DebugTool/types/services/RagfairOfferService.d.ts
+++ b/Live/CWX_DebugTool/types/services/RagfairOfferService.d.ts
@@ -1,3 +1,4 @@
+import { RagfairOfferHolder } from "../utils/RagfairOfferHolder";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { RagfairServerHelper } from "../helpers/RagfairServerHelper";
import { Item } from "../models/eft/common/tables/IItem";
@@ -26,10 +27,9 @@ export declare class RagfairOfferService {
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected playerOffersLoaded: boolean;
- protected expiredOffers: Item[];
- /** offerId, offer */
- protected offers: Record;
+ protected expiredOffers: Record;
protected ragfairConfig: IRagfairConfig;
+ protected ragfairOfferHandler: RagfairOfferHolder;
constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer);
/**
* Get all offers
@@ -45,7 +45,7 @@ export declare class RagfairOfferService {
* Get an array of expired items not yet processed into new offers
* @returns items that need to be turned into offers
*/
- getExpiredOffers(): Item[];
+ getExpiredOfferItems(): Item[];
resetExpiredOffers(): void;
/**
* Does the offer exist on the ragfair
@@ -64,12 +64,6 @@ export declare class RagfairOfferService {
traderOffersNeedRefreshing(traderID: string): boolean;
addPlayerOffers(): void;
expireStaleOffers(): void;
- /**
- * Get an array of stale offers that are still shown to player
- * @returns IRagfairOffer array
- */
- protected getStaleOffers(): IRagfairOffer[];
- protected isStale(offer: IRagfairOffer, time: number): boolean;
protected processStaleOffer(staleOffer: IRagfairOffer): void;
protected returnPlayerOffer(offer: IRagfairOffer): IItemEventRouterResponse;
}
diff --git a/Live/CWX_DebugTool/types/services/RagfairPriceService.d.ts b/Live/CWX_DebugTool/types/services/RagfairPriceService.d.ts
index 4ac7794..3bd94b5 100644
--- a/Live/CWX_DebugTool/types/services/RagfairPriceService.d.ts
+++ b/Live/CWX_DebugTool/types/services/RagfairPriceService.d.ts
@@ -24,7 +24,7 @@ export declare class RagfairPriceService implements OnLoad {
protected generatedStaticPrices: boolean;
protected prices: IRagfairServerPrices;
constructor(handbookHelper: HandbookHelper, databaseServer: DatabaseServer, logger: ILogger, itemHelper: ItemHelper, presetHelper: PresetHelper, randomUtil: RandomUtil, configServer: ConfigServer);
- onLoad(): void;
+ onLoad(): Promise;
getRoute(): string;
/**
* Iterate over all items of type "Item" in db and get template price, store in cache
diff --git a/Live/CWX_DebugTool/types/services/RagfairRequiredItemsService.d.ts b/Live/CWX_DebugTool/types/services/RagfairRequiredItemsService.d.ts
index b05fc65..95c3ddb 100644
--- a/Live/CWX_DebugTool/types/services/RagfairRequiredItemsService.d.ts
+++ b/Live/CWX_DebugTool/types/services/RagfairRequiredItemsService.d.ts
@@ -7,6 +7,6 @@ export declare class RagfairRequiredItemsService {
protected ragfairOfferService: RagfairOfferService;
protected requiredItemsCache: {};
constructor(logger: ILogger, paymentHelper: PaymentHelper, ragfairOfferService: RagfairOfferService);
- getRequiredItems(searchId: string): any;
+ getRequiredItemsById(searchId: string): any;
buildRequiredItemTable(): void;
}
diff --git a/Live/CWX_DebugTool/types/services/SeasonalEventService.d.ts b/Live/CWX_DebugTool/types/services/SeasonalEventService.d.ts
new file mode 100644
index 0000000..80f5487
--- /dev/null
+++ b/Live/CWX_DebugTool/types/services/SeasonalEventService.d.ts
@@ -0,0 +1,69 @@
+import { Config } from "../models/eft/common/IGlobals";
+import { Inventory } from "../models/eft/common/tables/IBotType";
+import { ISeasonalEvent, ISeasonalEventConfig } from "../models/spt/config/ISeasonalEventConfig";
+import { ILogger } from "../models/spt/utils/ILogger";
+import { ConfigServer } from "../servers/ConfigServer";
+import { DatabaseServer } from "../servers/DatabaseServer";
+import { LocalisationService } from "./LocalisationService";
+export declare class SeasonalEventService {
+ protected logger: ILogger;
+ protected databaseServer: DatabaseServer;
+ protected localisationService: LocalisationService;
+ protected configServer: ConfigServer;
+ protected seasonalEventConfig: ISeasonalEventConfig;
+ constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer);
+ protected get events(): Record;
+ get christmasEventItems(): string[];
+ /**
+ * Get an array of christmas items found in bots inventories as loot
+ * @returns array
+ */
+ getChristmasEventItems(): string[];
+ itemIsChristmasRelated(itemId: string): boolean;
+ /**
+ * is christmas event active
+ * @returns true if active
+ */
+ christmasEventEnabled(): boolean;
+ /**
+ * Is detection of seasonal events enabled (halloween / christmas)
+ * @returns true if seasonal events should be checked for
+ */
+ isAutomaticEventDetectionEnabled(): boolean;
+ /**
+ * Get a dictionary of gear changes to apply to bots for a specific event e.g. Christmas/Halloween
+ * @param eventName Name of event to get gear changes for
+ * @returns bots with equipment changes
+ */
+ protected getEventBotGear(eventName: string): Record>>;
+ /**
+ * Get the dates each seasonal event starts and ends
+ * @returns Record with event name + start/end date
+ */
+ getEventDetails(): ISeasonalEvent[];
+ /**
+ * Check if current date falls inside any of the seasons events pased in, if so, handle them
+ */
+ checkForAndEnableSeasonalEvents(): void;
+ /**
+ * Iterate through bots inventory and loot to find and remove christmas items (as defined in SeasonalEventService)
+ * @param nodeInventory Bots inventory to iterate over
+ */
+ removeChristmasItemsFromBotInventory(nodeInventory: Inventory): void;
+ /**
+ * Make adjusted to server code based on the name of the event passed in
+ * @param globalConfig globals.json
+ * @param eventName Name of the event to enable. e.g. Christmas
+ */
+ protected updateGlobalEvents(globalConfig: Config, eventName: string): void;
+ /**
+ * Read in data from seasonalEvents.json and add found equipment items to bots
+ * @param eventName Name of the event to read equipment in from config
+ */
+ protected addEventGearToScavs(eventName: string): void;
+ protected addPumpkinsToScavBackpacks(): void;
+ /**
+ * Set Khorovod(dancing tree) chance to 100% on all maps that support it
+ */
+ protected enableDancingTree(): void;
+}
diff --git a/Live/CWX_DebugTool/types/services/mod/onLoad/OnLoadMod.d.ts b/Live/CWX_DebugTool/types/services/mod/onLoad/OnLoadMod.d.ts
index 53fb062..82909c3 100644
--- a/Live/CWX_DebugTool/types/services/mod/onLoad/OnLoadMod.d.ts
+++ b/Live/CWX_DebugTool/types/services/mod/onLoad/OnLoadMod.d.ts
@@ -3,6 +3,6 @@ export declare class OnLoadMod extends OnLoad {
private onLoadOverride;
private getRouteOverride;
constructor(onLoadOverride: () => void, getRouteOverride: () => string);
- onLoad(): void;
+ onLoad(): Promise;
getRoute(): string;
}
diff --git a/Live/CWX_DebugTool/types/services/mod/onUpdate/OnUpdateMod.d.ts b/Live/CWX_DebugTool/types/services/mod/onUpdate/OnUpdateMod.d.ts
index ee89043..edd2a2c 100644
--- a/Live/CWX_DebugTool/types/services/mod/onUpdate/OnUpdateMod.d.ts
+++ b/Live/CWX_DebugTool/types/services/mod/onUpdate/OnUpdateMod.d.ts
@@ -3,6 +3,6 @@ export declare class OnUpdateMod extends OnUpdate {
private onUpdateOverride;
private getRouteOverride;
constructor(onUpdateOverride: (timeSinceLastRun: number) => boolean, getRouteOverride: () => string);
- onUpdate(timeSinceLastRun: number): boolean;
+ onUpdate(timeSinceLastRun: number): Promise;
getRoute(): string;
}
diff --git a/Live/CWX_DebugTool/types/utils/App.d.ts b/Live/CWX_DebugTool/types/utils/App.d.ts
index cc8a5af..b947c83 100644
--- a/Live/CWX_DebugTool/types/utils/App.d.ts
+++ b/Live/CWX_DebugTool/types/utils/App.d.ts
@@ -11,7 +11,7 @@ export declare class App {
protected onUpdateComponents: OnUpdate[];
protected onUpdateLastRun: {};
constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]);
- load(): void;
- protected update(onUpdateComponents: OnUpdate[]): void;
+ load(): Promise;
+ protected update(onUpdateComponents: OnUpdate[]): Promise;
protected logUpdateException(err: any, updateable: OnUpdate): void;
}
diff --git a/Live/CWX_DebugTool/types/utils/DatabaseImporter.d.ts b/Live/CWX_DebugTool/types/utils/DatabaseImporter.d.ts
index 31670ae..ed400da 100644
--- a/Live/CWX_DebugTool/types/utils/DatabaseImporter.d.ts
+++ b/Live/CWX_DebugTool/types/utils/DatabaseImporter.d.ts
@@ -14,13 +14,13 @@ export declare class DatabaseImporter extends OnLoad {
protected databaseServer: DatabaseServer;
protected imageRouter: ImageRouter;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, localisationService: LocalisationService, databaseServer: DatabaseServer, imageRouter: ImageRouter);
- onLoad(): void;
+ onLoad(): Promise;
/**
* Read all json files in database folder and map into a json object
* @param filepath path to database folder
*/
- protected hydrateDatabase(filepath: string): void;
+ protected hydrateDatabase(filepath: string): Promise;
getRoute(): string;
- loadRecursive(filepath: string): IDatabaseTables;
+ loadRecursive(filepath: string): Promise;
loadImages(filepath: string): void;
}
diff --git a/Live/CWX_DebugTool/types/utils/JsonUtil.d.ts b/Live/CWX_DebugTool/types/utils/JsonUtil.d.ts
index 71e95f6..2591142 100644
--- a/Live/CWX_DebugTool/types/utils/JsonUtil.d.ts
+++ b/Live/CWX_DebugTool/types/utils/JsonUtil.d.ts
@@ -6,6 +6,7 @@ export declare class JsonUtil {
protected hashUtil: HashUtil;
protected logger: ILogger;
protected fileHashes: any;
+ protected jsonCacheExists: boolean;
constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger);
/**
* From object to string
diff --git a/Live/CWX_DebugTool/types/utils/RagfairOfferHolder.d.ts b/Live/CWX_DebugTool/types/utils/RagfairOfferHolder.d.ts
new file mode 100644
index 0000000..46d9e23
--- /dev/null
+++ b/Live/CWX_DebugTool/types/utils/RagfairOfferHolder.d.ts
@@ -0,0 +1,24 @@
+import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer";
+export declare class RagfairOfferHolder {
+ private offersById;
+ private offersByTemplate;
+ private offersByTrader;
+ constructor();
+ getOfferById(id: string): IRagfairOffer;
+ getOffersByTemplate(templateId: string): Array;
+ getOffersByTrader(traderId: string): Array;
+ getOffers(): Array;
+ addOffers(offers: Array): void;
+ addOffer(offer: IRagfairOffer): void;
+ removeOffer(offer: IRagfairOffer): void;
+ removeOffers(offers: Array): void;
+ removeOfferByTrader(traderId: string): void;
+ /**
+ * Get an array of stale offers that are still shown to player
+ * @returns IRagfairOffer array
+ */
+ getStaleOffers(time: number): Array;
+ private addOfferByTemplates;
+ private addOfferByTrader;
+ protected isStale(offer: IRagfairOffer, time: number): boolean;
+}
diff --git a/Live/CWX_DebugTool/types/utils/Watermark.d.ts b/Live/CWX_DebugTool/types/utils/Watermark.d.ts
index e02eba2..f870cf1 100644
--- a/Live/CWX_DebugTool/types/utils/Watermark.d.ts
+++ b/Live/CWX_DebugTool/types/utils/Watermark.d.ts
@@ -30,7 +30,11 @@ export declare class Watermark {
* @returns string
*/
getVersionTag(withEftVersion?: boolean): string;
- getVersionLabel(): string;
+ /**
+ * Get text shown in game on screen, can't be translated as it breaks bsgs client when certian characters are used
+ * @returns string
+ */
+ getInGameVersionLabel(): string;
/** Set window title */
setTitle(): void;
/** Reset console cursor to top */
diff --git a/Live/CWX_MasterKey/CWX_MasterKey 1.3.9/bepInEx/plugins/CWX-MasterKey.dll b/Live/CWX_MasterKey/CWX_MasterKey 1.4.0/bepInEx/plugins/CWX-MasterKey.dll
similarity index 80%
rename from Live/CWX_MasterKey/CWX_MasterKey 1.3.9/bepInEx/plugins/CWX-MasterKey.dll
rename to Live/CWX_MasterKey/CWX_MasterKey 1.4.0/bepInEx/plugins/CWX-MasterKey.dll
index 8099672..219f2bb 100644
Binary files a/Live/CWX_MasterKey/CWX_MasterKey 1.3.9/bepInEx/plugins/CWX-MasterKey.dll and b/Live/CWX_MasterKey/CWX_MasterKey 1.4.0/bepInEx/plugins/CWX-MasterKey.dll differ
diff --git a/Live/CWX_MasterKey/CWX_MasterKey 1.3.9/user/mods/CWX-MasterKey 1.3.9/LICENSE.txt b/Live/CWX_MasterKey/CWX_MasterKey 1.4.0/user/mods/CWX-MasterKey 1.4.0/LICENSE.txt
similarity index 100%
rename from Live/CWX_MasterKey/CWX_MasterKey 1.3.9/user/mods/CWX-MasterKey 1.3.9/LICENSE.txt
rename to Live/CWX_MasterKey/CWX_MasterKey 1.4.0/user/mods/CWX-MasterKey 1.4.0/LICENSE.txt
diff --git a/Live/CWX_MasterKey/CWX_MasterKey 1.3.9/user/mods/CWX-MasterKey 1.3.9/package.json b/Live/CWX_MasterKey/CWX_MasterKey 1.4.0/user/mods/CWX-MasterKey 1.4.0/package.json
similarity index 91%
rename from Live/CWX_MasterKey/CWX_MasterKey 1.3.9/user/mods/CWX-MasterKey 1.3.9/package.json
rename to Live/CWX_MasterKey/CWX_MasterKey 1.4.0/user/mods/CWX-MasterKey 1.4.0/package.json
index d5f1081..955217d 100644
--- a/Live/CWX_MasterKey/CWX_MasterKey 1.3.9/user/mods/CWX-MasterKey 1.3.9/package.json
+++ b/Live/CWX_MasterKey/CWX_MasterKey 1.4.0/user/mods/CWX-MasterKey 1.4.0/package.json
@@ -1,10 +1,10 @@
{
"name": "MasterKey",
"author": "CWX",
- "version": "1.3.9",
+ "version": "1.4.0",
"license": "NCSA",
"main": "src/mod.js",
- "akiVersion": "3.3.0",
+ "akiVersion": "3.4.0",
"scripts": {
"setup": "npm i",
"build": "node ./packageBuild.ts"
diff --git a/Live/CWX_MasterKey/CWX_MasterKey 1.3.9/user/mods/CWX-MasterKey 1.3.9/src/config.json b/Live/CWX_MasterKey/CWX_MasterKey 1.4.0/user/mods/CWX-MasterKey 1.4.0/src/config.json
similarity index 100%
rename from Live/CWX_MasterKey/CWX_MasterKey 1.3.9/user/mods/CWX-MasterKey 1.3.9/src/config.json
rename to Live/CWX_MasterKey/CWX_MasterKey 1.4.0/user/mods/CWX-MasterKey 1.4.0/src/config.json
diff --git a/Live/CWX_MasterKey/CWX_MasterKey 1.3.9/user/mods/CWX-MasterKey 1.3.9/src/mod.ts b/Live/CWX_MasterKey/CWX_MasterKey 1.4.0/user/mods/CWX-MasterKey 1.4.0/src/mod.ts
similarity index 100%
rename from Live/CWX_MasterKey/CWX_MasterKey 1.3.9/user/mods/CWX-MasterKey 1.3.9/src/mod.ts
rename to Live/CWX_MasterKey/CWX_MasterKey 1.4.0/user/mods/CWX-MasterKey 1.4.0/src/mod.ts
diff --git a/Live/CWX_MasterKey/CWX_MasterKey.csproj b/Live/CWX_MasterKey/CWX_MasterKey.csproj
index 9a2a9e9..d77a906 100644
--- a/Live/CWX_MasterKey/CWX_MasterKey.csproj
+++ b/Live/CWX_MasterKey/CWX_MasterKey.csproj
@@ -3,7 +3,7 @@
net472
CWX-MasterKey
- 1.3.9
+ 1.4.0
diff --git a/Live/CWX_MasterKey/MasterKey.cs b/Live/CWX_MasterKey/MasterKey.cs
index 9b828e4..452f5b8 100644
--- a/Live/CWX_MasterKey/MasterKey.cs
+++ b/Live/CWX_MasterKey/MasterKey.cs
@@ -2,7 +2,7 @@
namespace CWX_MasterKey
{
- [BepInPlugin("com.CWX.MasterKey", "CWX-MasterKey", "1.3.9")]
+ [BepInPlugin("com.CWX.MasterKey", "CWX-MasterKey", "1.4.0")]
public class MasterKey : BaseUnityPlugin
{
private void Awake()
diff --git a/Live/CWX_MasterKey/server/dist/package.json b/Live/CWX_MasterKey/server/dist/package.json
index d5f1081..955217d 100644
--- a/Live/CWX_MasterKey/server/dist/package.json
+++ b/Live/CWX_MasterKey/server/dist/package.json
@@ -1,10 +1,10 @@
{
"name": "MasterKey",
"author": "CWX",
- "version": "1.3.9",
+ "version": "1.4.0",
"license": "NCSA",
"main": "src/mod.js",
- "akiVersion": "3.3.0",
+ "akiVersion": "3.4.0",
"scripts": {
"setup": "npm i",
"build": "node ./packageBuild.ts"
diff --git a/Live/CWX_MasterKey/server/package.json b/Live/CWX_MasterKey/server/package.json
index d5f1081..955217d 100644
--- a/Live/CWX_MasterKey/server/package.json
+++ b/Live/CWX_MasterKey/server/package.json
@@ -1,10 +1,10 @@
{
"name": "MasterKey",
"author": "CWX",
- "version": "1.3.9",
+ "version": "1.4.0",
"license": "NCSA",
"main": "src/mod.js",
- "akiVersion": "3.3.0",
+ "akiVersion": "3.4.0",
"scripts": {
"setup": "npm i",
"build": "node ./packageBuild.ts"
diff --git a/Live/CWX_MasterKey/server/types/callbacks/DataCallbacks.d.ts b/Live/CWX_MasterKey/server/types/callbacks/DataCallbacks.d.ts
index 2efcf81..1f359e5 100644
--- a/Live/CWX_MasterKey/server/types/callbacks/DataCallbacks.d.ts
+++ b/Live/CWX_MasterKey/server/types/callbacks/DataCallbacks.d.ts
@@ -8,7 +8,6 @@ import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction";
import { IHideoutScavCase } from "../models/eft/hideout/IHideoutScavCase";
import { IHideoutSettingsBase } from "../models/eft/hideout/IHideoutSettingsBase";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
-import { ILanguageBase } from "../models/spt/server/ILocaleBase";
import { ISettingsBase } from "../models/spt/server/ISettingsBase";
import { DatabaseServer } from "../servers/DatabaseServer";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
@@ -54,7 +53,7 @@ export declare class DataCallbacks {
getHideoutAreas(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData;
gethideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData;
getHideoutScavcase(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData;
- getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData;
+ getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>;
getLocalesMenu(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData;
getLocalesGlobal(url: string, info: IEmptyRequestData, sessionID: string): string;
}
diff --git a/Live/CWX_MasterKey/server/types/callbacks/DialogueCallbacks.d.ts b/Live/CWX_MasterKey/server/types/callbacks/DialogueCallbacks.d.ts
index 7b2eeae..862c029 100644
--- a/Live/CWX_MasterKey/server/types/callbacks/DialogueCallbacks.d.ts
+++ b/Live/CWX_MasterKey/server/types/callbacks/DialogueCallbacks.d.ts
@@ -1,6 +1,7 @@
import { DialogueController } from "../controllers/DialogueController";
import { OnUpdate } from "../di/OnUpdate";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
+import { IChatServer } from "../models/eft/dialog/IChatServer";
import { IFriendRequestData } from "../models/eft/dialog/IFriendRequestData";
import { IGetAllAttachmentsRequestData } from "../models/eft/dialog/IGetAllAttachmentsRequestData";
import { IGetAllAttachmentsResponse } from "../models/eft/dialog/IGetAllAttachmentsResponse";
@@ -35,7 +36,7 @@ export declare class DialogueCallbacks extends OnUpdate {
* Handles client/chatServer/list
* @returns
*/
- getChatServerList(url: string, info: IGetChatServerListRequestData, sessionID: string): IGetBodyResponseData;
+ getChatServerList(url: string, info: IGetChatServerListRequestData, sessionID: string): IGetBodyResponseData;
getMailDialogList(url: string, info: IGetMailDialogListRequestData, sessionID: string): IGetBodyResponseData;
getMailDialogView(url: string, info: IGetMailDialogViewRequestData, sessionID: string): IGetBodyResponseData;
getMailDialogInfo(url: string, info: IGetMailDialogInfoRequestData, sessionID: string): IGetBodyResponseData;
@@ -52,6 +53,6 @@ export declare class DialogueCallbacks extends OnUpdate {
listInbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData;
friendRequest(url: string, request: IFriendRequestData, sessionID: string): INullResponseData;
sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData;
- onUpdate(timeSinceLastRun: number): boolean;
+ onUpdate(timeSinceLastRun: number): Promise;
getRoute(): string;
}
diff --git a/Live/CWX_MasterKey/server/types/callbacks/HandbookCallbacks.d.ts b/Live/CWX_MasterKey/server/types/callbacks/HandbookCallbacks.d.ts
index 891e375..1bb6241 100644
--- a/Live/CWX_MasterKey/server/types/callbacks/HandbookCallbacks.d.ts
+++ b/Live/CWX_MasterKey/server/types/callbacks/HandbookCallbacks.d.ts
@@ -3,6 +3,6 @@ import { OnLoad } from "../di/OnLoad";
export declare class HandbookCallbacks extends OnLoad {
protected handbookController: HandbookController;
constructor(handbookController: HandbookController);
- onLoad(): void;
+ onLoad(): Promise;
getRoute(): string;
}
diff --git a/Live/CWX_MasterKey/server/types/callbacks/HideoutCallbacks.d.ts b/Live/CWX_MasterKey/server/types/callbacks/HideoutCallbacks.d.ts
index e39e806..56450a9 100644
--- a/Live/CWX_MasterKey/server/types/callbacks/HideoutCallbacks.d.ts
+++ b/Live/CWX_MasterKey/server/types/callbacks/HideoutCallbacks.d.ts
@@ -91,6 +91,6 @@ export declare class HideoutCallbacks extends OnUpdate {
* @returns
*/
takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse;
- onUpdate(timeSinceLastRun: number): boolean;
+ onUpdate(timeSinceLastRun: number): Promise;
getRoute(): string;
}
diff --git a/Live/CWX_MasterKey/server/types/callbacks/HttpCallbacks.d.ts b/Live/CWX_MasterKey/server/types/callbacks/HttpCallbacks.d.ts
index 43928a1..299a32c 100644
--- a/Live/CWX_MasterKey/server/types/callbacks/HttpCallbacks.d.ts
+++ b/Live/CWX_MasterKey/server/types/callbacks/HttpCallbacks.d.ts
@@ -3,7 +3,7 @@ import { HttpServer } from "../servers/HttpServer";
export declare class HttpCallbacks extends OnLoad {
protected httpServer: HttpServer;
constructor(httpServer: HttpServer);
- onLoad(): void;
+ onLoad(): Promise;
getRoute(): string;
getImage(): string;
}
diff --git a/Live/CWX_MasterKey/server/types/callbacks/InsuranceCallbacks.d.ts b/Live/CWX_MasterKey/server/types/callbacks/InsuranceCallbacks.d.ts
index a171e1c..11aef4a 100644
--- a/Live/CWX_MasterKey/server/types/callbacks/InsuranceCallbacks.d.ts
+++ b/Live/CWX_MasterKey/server/types/callbacks/InsuranceCallbacks.d.ts
@@ -27,6 +27,6 @@ export declare class InsuranceCallbacks extends OnUpdate {
* @returns IItemEventRouterResponse
*/
insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse;
- onUpdate(secondsSinceLastRun: number): boolean;
+ onUpdate(secondsSinceLastRun: number): Promise;
getRoute(): string;
}
diff --git a/Live/CWX_MasterKey/server/types/callbacks/ModCallbacks.d.ts b/Live/CWX_MasterKey/server/types/callbacks/ModCallbacks.d.ts
index aec2f59..9ebb750 100644
--- a/Live/CWX_MasterKey/server/types/callbacks/ModCallbacks.d.ts
+++ b/Live/CWX_MasterKey/server/types/callbacks/ModCallbacks.d.ts
@@ -3,6 +3,7 @@ import { PostAkiModLoader } from "../loaders/PostAkiModLoader";
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
+import { LocalisationService } from "../services/LocalisationService";
import { HttpFileUtil } from "../utils/HttpFileUtil";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
declare class ModCallbacks extends OnLoad {
@@ -10,10 +11,11 @@ declare class ModCallbacks extends OnLoad {
protected httpResponse: HttpResponseUtil;
protected httpFileUtil: HttpFileUtil;
protected postAkiModLoader: PostAkiModLoader;
+ protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected httpConfig: IHttpConfig;
- constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, postAkiModLoader: PostAkiModLoader, configServer: ConfigServer);
- onLoad(): void;
+ constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, postAkiModLoader: PostAkiModLoader, localisationService: LocalisationService, configServer: ConfigServer);
+ onLoad(): Promise;
getRoute(): string;
sendBundle(sessionID: string, req: any, resp: any, body: any): void;
getBundles(url: string, info: any, sessionID: string): string;
diff --git a/Live/CWX_MasterKey/server/types/callbacks/PresetCallbacks.d.ts b/Live/CWX_MasterKey/server/types/callbacks/PresetCallbacks.d.ts
index 4553f8f..681bb99 100644
--- a/Live/CWX_MasterKey/server/types/callbacks/PresetCallbacks.d.ts
+++ b/Live/CWX_MasterKey/server/types/callbacks/PresetCallbacks.d.ts
@@ -3,6 +3,6 @@ import { OnLoad } from "../di/OnLoad";
export declare class PresetCallbacks extends OnLoad {
protected presetController: PresetController;
constructor(presetController: PresetController);
- onLoad(): void;
+ onLoad(): Promise;
getRoute(): string;
}
diff --git a/Live/CWX_MasterKey/server/types/callbacks/RagfairCallbacks.d.ts b/Live/CWX_MasterKey/server/types/callbacks/RagfairCallbacks.d.ts
index 37f3807..15597bf 100644
--- a/Live/CWX_MasterKey/server/types/callbacks/RagfairCallbacks.d.ts
+++ b/Live/CWX_MasterKey/server/types/callbacks/RagfairCallbacks.d.ts
@@ -14,7 +14,6 @@ import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferReque
import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData";
import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
-import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { RagfairServer } from "../servers/RagfairServer";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
@@ -24,14 +23,13 @@ import { JsonUtil } from "../utils/JsonUtil";
*/
export declare class RagfairCallbacks extends OnLoadOnUpdate {
protected httpResponse: HttpResponseUtil;
- protected logger: ILogger;
protected jsonUtil: JsonUtil;
protected ragfairServer: RagfairServer;
protected ragfairController: RagfairController;
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
- constructor(httpResponse: HttpResponseUtil, logger: ILogger, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, configServer: ConfigServer);
- onLoad(): void;
+ constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, configServer: ConfigServer);
+ onLoad(): Promise;
getRoute(): string;
search(url: string, info: ISearchRequestData, sessionID: string): IGetBodyResponseData;
getMarketPrice(url: string, info: IGetMarketPriceRequestData, sessionID: string): IGetBodyResponseData;
@@ -39,6 +37,6 @@ export declare class RagfairCallbacks extends OnLoadOnUpdate {
addOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse;
removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse;
extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse;
- onUpdate(timeSinceLastRun: number): boolean;
+ onUpdate(timeSinceLastRun: number): Promise;
sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData;
}
diff --git a/Live/CWX_MasterKey/server/types/callbacks/SaveCallbacks.d.ts b/Live/CWX_MasterKey/server/types/callbacks/SaveCallbacks.d.ts
index bbb6e53..ab29ddc 100644
--- a/Live/CWX_MasterKey/server/types/callbacks/SaveCallbacks.d.ts
+++ b/Live/CWX_MasterKey/server/types/callbacks/SaveCallbacks.d.ts
@@ -3,7 +3,7 @@ import { SaveServer } from "../servers/SaveServer";
export declare class SaveCallbacks extends OnLoadOnUpdate {
protected saveServer: SaveServer;
constructor(saveServer: SaveServer);
- onLoad(): void;
+ onLoad(): Promise;
getRoute(): string;
- onUpdate(secondsSinceLastRun: number): boolean;
+ onUpdate(secondsSinceLastRun: number): Promise;
}
diff --git a/Live/CWX_MasterKey/server/types/callbacks/TraderCallbacks.d.ts b/Live/CWX_MasterKey/server/types/callbacks/TraderCallbacks.d.ts
index 40a1455..1efde87 100644
--- a/Live/CWX_MasterKey/server/types/callbacks/TraderCallbacks.d.ts
+++ b/Live/CWX_MasterKey/server/types/callbacks/TraderCallbacks.d.ts
@@ -8,8 +8,8 @@ export declare class TraderCallbacks extends OnLoadOnUpdate {
protected httpResponse: HttpResponseUtil;
protected traderController: TraderController;
constructor(httpResponse: HttpResponseUtil, traderController: TraderController);
- onLoad(): void;
- onUpdate(): boolean;
+ onLoad(): Promise;
+ onUpdate(): Promise;
getRoute(): string;
getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData;
/**
diff --git a/Live/CWX_MasterKey/server/types/controllers/BotController.d.ts b/Live/CWX_MasterKey/server/types/controllers/BotController.d.ts
index 51c0c68..a80aaed 100644
--- a/Live/CWX_MasterKey/server/types/controllers/BotController.d.ts
+++ b/Live/CWX_MasterKey/server/types/controllers/BotController.d.ts
@@ -57,6 +57,12 @@ export declare class BotController {
* @returns IBotBase array
*/
generate(sessionId: string, info: IGenerateBotsRequestData): IBotBase[];
+ /**
+ * Get the difficulty passed in, if its not "asoline", get selected difficulty from config
+ * @param requestedDifficulty
+ * @returns
+ */
+ getPMCDifficulty(requestedDifficulty: string): string;
/**
* Get the max number of bots allowed on a map
* Looks up location player is entering when getting cap value
diff --git a/Live/CWX_MasterKey/server/types/controllers/CustomizationController.d.ts b/Live/CWX_MasterKey/server/types/controllers/CustomizationController.d.ts
index 5fe51e3..a4ef8cf 100644
--- a/Live/CWX_MasterKey/server/types/controllers/CustomizationController.d.ts
+++ b/Live/CWX_MasterKey/server/types/controllers/CustomizationController.d.ts
@@ -8,13 +8,15 @@ import { ILogger } from "../models/spt/utils/ILogger";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer";
+import { LocalisationService } from "../services/LocalisationService";
export declare class CustomizationController {
protected logger: ILogger;
protected eventOutputHolder: EventOutputHolder;
protected databaseServer: DatabaseServer;
protected saveServer: SaveServer;
+ protected localisationService: LocalisationService;
protected profileHelper: ProfileHelper;
- constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper);
+ constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper);
getTraderSuits(traderID: string, sessionID: string): ISuit[];
wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse;
buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse;
diff --git a/Live/CWX_MasterKey/server/types/controllers/DialogueController.d.ts b/Live/CWX_MasterKey/server/types/controllers/DialogueController.d.ts
index 9c8b728..98d3d52 100644
--- a/Live/CWX_MasterKey/server/types/controllers/DialogueController.d.ts
+++ b/Live/CWX_MasterKey/server/types/controllers/DialogueController.d.ts
@@ -27,6 +27,7 @@ export declare class DialogueController {
*/
getDialogueInfo(dialogueID: string, sessionID: string): DialogueInfo;
/**
+ * Handle player clicking 'messenger' and seeing all the messages they've recieved
* Set the content of the dialogue on the details panel, showing all the messages
* for the specified dialogue.
* @param dialogueID Dialog id
diff --git a/Live/CWX_MasterKey/server/types/controllers/GameController.d.ts b/Live/CWX_MasterKey/server/types/controllers/GameController.d.ts
index f4f5849..b23ccf7 100644
--- a/Live/CWX_MasterKey/server/types/controllers/GameController.d.ts
+++ b/Live/CWX_MasterKey/server/types/controllers/GameController.d.ts
@@ -1,59 +1,50 @@
import { ApplicationContext } from "../context/ApplicationContext";
-import { GameEventHelper } from "../helpers/GameEventHelper";
import { HttpServerHelper } from "../helpers/HttpServerHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
+import { PreAkiModLoader } from "../loaders/PreAkiModLoader";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
-import { Config } from "../models/eft/common/IGlobals";
+import { IPmcData } from "../models/eft/common/IPmcData";
import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse";
import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
import { IServerDetails } from "../models/eft/game/IServerDetails";
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
-import { ISeasonalEvent } from "../models/spt/config/ISeasonalEventConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
-import { LocaleService } from "../services/LocaleService";
import { LocalisationService } from "../services/LocalisationService";
import { ProfileFixerService } from "../services/ProfileFixerService";
-import { Watermark } from "../utils/Watermark";
+import { SeasonalEventService } from "../services/SeasonalEventService";
export declare class GameController {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
- protected watermark: Watermark;
+ protected preAkiModLoader: PreAkiModLoader;
protected httpServerHelper: HttpServerHelper;
- protected localeService: LocaleService;
protected profileHelper: ProfileHelper;
protected profileFixerService: ProfileFixerService;
protected localisationService: LocalisationService;
- protected gameEventHelper: GameEventHelper;
+ protected seasonalEventService: SeasonalEventService;
protected applicationContext: ApplicationContext;
protected configServer: ConfigServer;
protected httpConfig: IHttpConfig;
protected coreConfig: ICoreConfig;
- constructor(logger: ILogger, databaseServer: DatabaseServer, watermark: Watermark, httpServerHelper: HttpServerHelper, localeService: LocaleService, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, gameEventHelper: GameEventHelper, applicationContext: ApplicationContext, configServer: ConfigServer);
+ constructor(logger: ILogger, databaseServer: DatabaseServer, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer);
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
/**
- * Check if current date falls inside any of the seasons events pased in, if so, handle them
- * @param seasonalEvents events to check for
+ * Get a list of installed mods and save their details to the profile being used
+ * @param fullProfile Profile to add mod details to
*/
- protected checkForAndEnableSeasonalEvents(seasonalEvents: ISeasonalEvent[]): void;
+ protected saveActiveModsToProfile(fullProfile: IAkiProfile): void;
/**
- * Make adjusted to server code based on the name of the event passed in
- * @param globalConfig globals.json
- * @param eventName Name of the event to enable. e.g. Christmas
+ * Add the logged in players name to PMC name pool
+ * @param pmcProfile
*/
- protected updateGlobalEvents(globalConfig: Config, eventName: string): void;
+ protected addPlayerToPMCNames(pmcProfile: IPmcData): void;
/**
- * Read in data from seasonalEvents.json and add found equipment items to bots
- * @param eventName Name of the event to read equipment in from config
+ * Blank out the "test" mail message from prapor
*/
- protected addEventGearToScavs(eventName: string): void;
- /**
- * Set Khorovod(dancing tree) chance to 100% on all maps that support it
- */
- protected enableDancingTree(): void;
+ protected removePraporTestMessage(): void;
/**
* Make non-trigger-spawned raiders spawn earlier + always
*/
@@ -61,6 +52,5 @@ export declare class GameController {
protected logProfileDetails(fullProfile: IAkiProfile): void;
getGameConfig(sessionID: string): IGameConfigResponse;
getServer(): IServerDetails[];
- protected addPumpkinsToScavBackpacks(): void;
getValidGameVersion(): ICheckVersionResponse;
}
diff --git a/Live/CWX_MasterKey/server/types/controllers/HealthController.d.ts b/Live/CWX_MasterKey/server/types/controllers/HealthController.d.ts
index ce67993..97cf7ef 100644
--- a/Live/CWX_MasterKey/server/types/controllers/HealthController.d.ts
+++ b/Live/CWX_MasterKey/server/types/controllers/HealthController.d.ts
@@ -1,23 +1,25 @@
-import { ItemHelper } from "../helpers/ItemHelper";
-import { PaymentService } from "../services/PaymentService";
-import { InventoryHelper } from "../helpers/InventoryHelper";
import { HealthHelper } from "../helpers/HealthHelper";
+import { InventoryHelper } from "../helpers/InventoryHelper";
+import { ItemHelper } from "../helpers/ItemHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IHealthTreatmentRequestData } from "../models/eft/health/IHealthTreatmentRequestData";
import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestData";
import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData";
import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
-import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ILogger } from "../models/spt/utils/ILogger";
+import { EventOutputHolder } from "../routers/EventOutputHolder";
+import { LocalisationService } from "../services/LocalisationService";
+import { PaymentService } from "../services/PaymentService";
export declare class HealthController {
protected logger: ILogger;
protected eventOutputHolder: EventOutputHolder;
protected itemHelper: ItemHelper;
protected paymentService: PaymentService;
protected inventoryHelper: InventoryHelper;
+ protected localisationService: LocalisationService;
protected healthHelper: HealthHelper;
- constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper);
+ constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, localisationService: LocalisationService, healthHelper: HealthHelper);
/**
* stores in-raid player health
* @param pmcData Player profile
diff --git a/Live/CWX_MasterKey/server/types/controllers/MatchController.d.ts b/Live/CWX_MasterKey/server/types/controllers/MatchController.d.ts
index 2b0d150..2c78405 100644
--- a/Live/CWX_MasterKey/server/types/controllers/MatchController.d.ts
+++ b/Live/CWX_MasterKey/server/types/controllers/MatchController.d.ts
@@ -18,7 +18,9 @@ import { ConfigServer } from "../servers/ConfigServer";
import { SaveServer } from "../servers/SaveServer";
import { BotGenerationCacheService } from "../services/BotGenerationCacheService";
import { BotLootCacheService } from "../services/BotLootCacheService";
+import { CustomLocationWaveService } from "../services/CustomLocationWaveService";
import { MatchLocationService } from "../services/MatchLocationService";
+import { OpenZoneService } from "../services/OpenZoneService";
import { ProfileSnapshotService } from "../services/ProfileSnapshotService";
export declare class MatchController {
protected logger: ILogger;
@@ -29,12 +31,14 @@ export declare class MatchController {
protected botLootCacheService: BotLootCacheService;
protected configServer: ConfigServer;
protected profileSnapshotService: ProfileSnapshotService;
+ protected customLocationWaveService: CustomLocationWaveService;
+ protected openZoneService: OpenZoneService;
protected botGenerationCacheService: BotGenerationCacheService;
protected applicationContext: ApplicationContext;
protected matchConfig: IMatchConfig;
protected inraidConfig: IInRaidConfig;
protected botConfig: IBotConfig;
- constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext);
+ constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext);
getEnabled(): boolean;
getProfile(info: IGetProfileRequestData): IPmcData[];
createGroup(sessionID: string, info: ICreateGroupRequestData): any;
diff --git a/Live/CWX_MasterKey/server/types/controllers/QuestController.d.ts b/Live/CWX_MasterKey/server/types/controllers/QuestController.d.ts
index 842207f..b57eb40 100644
--- a/Live/CWX_MasterKey/server/types/controllers/QuestController.d.ts
+++ b/Live/CWX_MasterKey/server/types/controllers/QuestController.d.ts
@@ -5,6 +5,7 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper";
import { QuestHelper } from "../helpers/QuestHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IQuest, Reward } from "../models/eft/common/tables/IQuest";
+import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData";
import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRequestData";
@@ -15,11 +16,14 @@ import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { LocaleService } from "../services/LocaleService";
+import { LocalisationService } from "../services/LocalisationService";
import { PlayerService } from "../services/PlayerService";
+import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { TimeUtil } from "../utils/TimeUtil";
export declare class QuestController {
protected logger: ILogger;
protected timeUtil: TimeUtil;
+ protected httpResponseUtil: HttpResponseUtil;
protected eventOutputHolder: EventOutputHolder;
protected databaseServer: DatabaseServer;
protected itemHelper: ItemHelper;
@@ -29,9 +33,10 @@ export declare class QuestController {
protected questConditionHelper: QuestConditionHelper;
protected playerService: PlayerService;
protected localeService: LocaleService;
+ protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected questConfig: IQuestConfig;
- constructor(logger: ILogger, timeUtil: TimeUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer);
+ constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer);
/**
* Get all quests visible to player
* Exclude quests with incomplete preconditions (level/loyalty)
@@ -55,7 +60,30 @@ export declare class QuestController {
* @returns client response
*/
acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
+ /**
+ * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead
+ * @param startedMessageTextId startedMessageText property from IQuest
+ * @param questDescriptionId description property from IQuest
+ * @returns message id
+ */
+ protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string;
+ /**
+ * Handle the client accepting a repeatable quest and starting it
+ * Send starting rewards if any to player and
+ * Send start notification if any to player
+ * @param pmcData Profile to update with new quest
+ * @param acceptedQuest Quest being accepted
+ * @param sessionID Session id
+ * @returns IItemEventRouterResponse
+ */
acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
+ /**
+ * Look for an accepted quest inside player profile, return matching
+ * @param pmcData Profile to search through
+ * @param acceptedQuest Quest to search for
+ * @returns IRepeatableQuest
+ */
+ protected getRepeatableQuestFromProfile(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData): IRepeatableQuest;
/**
* Update completed quest in profile
* Add newly unlocked quests to profile
diff --git a/Live/CWX_MasterKey/server/types/controllers/RagfairController.d.ts b/Live/CWX_MasterKey/server/types/controllers/RagfairController.d.ts
index 95702f2..36a919f 100644
--- a/Live/CWX_MasterKey/server/types/controllers/RagfairController.d.ts
+++ b/Live/CWX_MasterKey/server/types/controllers/RagfairController.d.ts
@@ -67,16 +67,16 @@ export declare class RagfairController {
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer);
- getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult;
+ getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult;
/**
* Get offers for the client based on type of search being performed
* @param searchRequest Client search request data
* @param itemsToAdd
- * @param assorts
+ * @param traderAssorts Trader assorts
* @param pmcProfile Player profile
* @returns array of offers
*/
- protected getOffersForSearchType(searchRequest: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[];
+ protected getOffersForSearchType(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[];
/**
* Get categories for the type of search being performed, linked/required/all
* @param searchRequest Client search request data
@@ -100,8 +100,9 @@ export declare class RagfairController {
/**
* Update a trader flea offer with buy restrictions stored in the traders assort
* @param offer flea offer to update
+ * @param profile full profile of player
*/
- protected setTraderOfferPurchaseLimits(offer: IRagfairOffer): void;
+ protected setTraderOfferPurchaseLimits(offer: IRagfairOffer, profile: IAkiProfile): void;
protected isLinkedSearch(info: ISearchRequestData): boolean;
protected isRequiredSearch(info: ISearchRequestData): boolean;
update(): void;
diff --git a/Live/CWX_MasterKey/server/types/controllers/RepeatableQuestController.d.ts b/Live/CWX_MasterKey/server/types/controllers/RepeatableQuestController.d.ts
index 333583b..fee4d44 100644
--- a/Live/CWX_MasterKey/server/types/controllers/RepeatableQuestController.d.ts
+++ b/Live/CWX_MasterKey/server/types/controllers/RepeatableQuestController.d.ts
@@ -20,6 +20,7 @@ import { ItemFilterService } from "../services/ItemFilterService";
import { LocalisationService } from "../services/LocalisationService";
import { PaymentService } from "../services/PaymentService";
import { ProfileFixerService } from "../services/ProfileFixerService";
+import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { MathUtil } from "../utils/MathUtil";
import { ObjectId } from "../utils/ObjectId";
@@ -56,6 +57,7 @@ export declare class RepeatableQuestController {
protected timeUtil: TimeUtil;
protected logger: ILogger;
protected randomUtil: RandomUtil;
+ protected httpResponse: HttpResponseUtil;
protected mathUtil: MathUtil;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
@@ -71,7 +73,7 @@ export declare class RepeatableQuestController {
protected itemFilterService: ItemFilterService;
protected configServer: ConfigServer;
protected questConfig: IQuestConfig;
- constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, localisationService: LocalisationService, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer);
+ constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, localisationService: LocalisationService, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer);
/**
* This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint
* Returns an array of objects in the format of repeatable quests to the client.
@@ -98,6 +100,13 @@ export declare class RepeatableQuestController {
* @returns {array} array of "repeatableQuestObjects" as descibed above
*/
getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[];
+ /**
+ * Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists
+ * @param repeatableConfig daily/weekly config
+ * @param pmcData Profile to search
+ * @returns IPmcDataRepeatableQuest
+ */
+ protected getRepeatableQuestSubTypeFromProfile(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): IPmcDataRepeatableQuest;
/**
* This method is called by GetClientRepeatableQuests and creates one element of quest type format (see assets/database/templates/repeatableQuests.json).
* It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest
@@ -146,6 +155,12 @@ export declare class RepeatableQuestController {
* @returns {object} object of quest type format for "Elimination" (see assets/database/templates/repeatableQuests.json)
*/
generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination;
+ /**
+ * Cpnvert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567)
+ * @param locationKey e.g factory4_day
+ * @returns guid
+ */
+ protected getQuestLocationByMapId(locationKey: string): string;
/**
* Exploration repeatable quests can specify a required extraction point.
* This method creates the according object which will be appended to the conditions array
diff --git a/Live/CWX_MasterKey/server/types/controllers/TradeController.d.ts b/Live/CWX_MasterKey/server/types/controllers/TradeController.d.ts
index 0ed0556..6c35d66 100644
--- a/Live/CWX_MasterKey/server/types/controllers/TradeController.d.ts
+++ b/Live/CWX_MasterKey/server/types/controllers/TradeController.d.ts
@@ -8,13 +8,15 @@ import { Upd } from "../models/eft/common/tables/IItem";
import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ILogger } from "../models/spt/utils/ILogger";
+import { HttpResponseUtil } from "../utils/HttpResponseUtil";
declare class TradeController {
protected logger: ILogger;
protected eventOutputHolder: EventOutputHolder;
protected tradeHelper: TradeHelper;
protected profileHelper: ProfileHelper;
protected ragfairServer: RagfairServer;
- constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer);
+ protected httpResponse: HttpResponseUtil;
+ constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil);
confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse;
confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse;
}
diff --git a/Live/CWX_MasterKey/server/types/controllers/TraderController.d.ts b/Live/CWX_MasterKey/server/types/controllers/TraderController.d.ts
index d7afe95..b67aec9 100644
--- a/Live/CWX_MasterKey/server/types/controllers/TraderController.d.ts
+++ b/Live/CWX_MasterKey/server/types/controllers/TraderController.d.ts
@@ -7,6 +7,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { FenceService } from "../services/FenceService";
import { TraderAssortService } from "../services/TraderAssortService";
+import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService";
import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil";
export declare class TraderController {
@@ -17,10 +18,11 @@ export declare class TraderController {
protected traderHelper: TraderHelper;
protected timeUtil: TimeUtil;
protected traderAssortService: TraderAssortService;
+ protected traderPurchasePersisterService: TraderPurchasePersisterService;
protected fenceService: FenceService;
protected fenceBaseAssortGenerator: FenceBaseAssortGenerator;
protected jsonUtil: JsonUtil;
- constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil);
+ constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil);
/**
* Runs when onLoad event is fired
* Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService
diff --git a/Live/CWX_MasterKey/server/types/di/OnLoad.d.ts b/Live/CWX_MasterKey/server/types/di/OnLoad.d.ts
index 064d07d..4a28f13 100644
--- a/Live/CWX_MasterKey/server/types/di/OnLoad.d.ts
+++ b/Live/CWX_MasterKey/server/types/di/OnLoad.d.ts
@@ -1,4 +1,4 @@
export declare class OnLoad {
- onLoad(): void;
+ onLoad(): Promise;
getRoute(): string;
}
diff --git a/Live/CWX_MasterKey/server/types/di/OnLoadOnUpdate.d.ts b/Live/CWX_MasterKey/server/types/di/OnLoadOnUpdate.d.ts
index 8bd3dc3..eaa297c 100644
--- a/Live/CWX_MasterKey/server/types/di/OnLoadOnUpdate.d.ts
+++ b/Live/CWX_MasterKey/server/types/di/OnLoadOnUpdate.d.ts
@@ -1,7 +1,7 @@
import { OnLoad } from "./OnLoad";
import { OnUpdate } from "./OnUpdate";
export declare class OnLoadOnUpdate implements OnLoad, OnUpdate {
- onUpdate(timeSinceLastRun: number): boolean;
- onLoad(): void;
+ onUpdate(timeSinceLastRun: number): Promise;
+ onLoad(): Promise;
getRoute(): string;
}
diff --git a/Live/CWX_MasterKey/server/types/di/OnUpdate.d.ts b/Live/CWX_MasterKey/server/types/di/OnUpdate.d.ts
index 7fbbe09..6839719 100644
--- a/Live/CWX_MasterKey/server/types/di/OnUpdate.d.ts
+++ b/Live/CWX_MasterKey/server/types/di/OnUpdate.d.ts
@@ -1,4 +1,4 @@
export declare class OnUpdate {
- onUpdate(timeSinceLastRun: number): boolean;
+ onUpdate(timeSinceLastRun: number): Promise;
getRoute(): string;
}
diff --git a/Live/CWX_MasterKey/server/types/generators/BotEquipmentModGenerator.d.ts b/Live/CWX_MasterKey/server/types/generators/BotEquipmentModGenerator.d.ts
new file mode 100644
index 0000000..5b937ca
--- /dev/null
+++ b/Live/CWX_MasterKey/server/types/generators/BotEquipmentModGenerator.d.ts
@@ -0,0 +1,200 @@
+import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
+import { BotHelper } from "../helpers/BotHelper";
+import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
+import { ItemHelper } from "../helpers/ItemHelper";
+import { ProbabilityHelper } from "../helpers/ProbabilityHelper";
+import { ProfileHelper } from "../helpers/ProfileHelper";
+import { Mods, ModsChances } from "../models/eft/common/tables/IBotType";
+import { Item } from "../models/eft/common/tables/IItem";
+import { ITemplateItem, Slot } from "../models/eft/common/tables/ITemplateItem";
+import { EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig";
+import { ILogger } from "../models/spt/utils/ILogger";
+import { ConfigServer } from "../servers/ConfigServer";
+import { DatabaseServer } from "../servers/DatabaseServer";
+import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
+import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService";
+import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService";
+import { ItemFilterService } from "../services/ItemFilterService";
+import { LocalisationService } from "../services/LocalisationService";
+import { HashUtil } from "../utils/HashUtil";
+import { JsonUtil } from "../utils/JsonUtil";
+import { RandomUtil } from "../utils/RandomUtil";
+export declare class BotEquipmentModGenerator {
+ protected logger: ILogger;
+ protected jsonUtil: JsonUtil;
+ protected hashUtil: HashUtil;
+ protected randomUtil: RandomUtil;
+ protected probabilityHelper: ProbabilityHelper;
+ protected databaseServer: DatabaseServer;
+ protected itemHelper: ItemHelper;
+ protected botEquipmentFilterService: BotEquipmentFilterService;
+ protected itemFilterService: ItemFilterService;
+ protected profileHelper: ProfileHelper;
+ protected botWeaponModLimitService: BotWeaponModLimitService;
+ protected botHelper: BotHelper;
+ protected botGeneratorHelper: BotGeneratorHelper;
+ protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
+ protected localisationService: LocalisationService;
+ protected botEquipmentModPoolService: BotEquipmentModPoolService;
+ protected configServer: ConfigServer;
+ protected botConfig: IBotConfig;
+ constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer);
+ /**
+ * Check mods are compatible and add to array
+ * @param equipment Equipment item to add mods to
+ * @param modPool Mod list to choose frm
+ * @param parentId parentid of item to add mod to
+ * @param parentTemplate template objet of item to add mods to
+ * @param modSpawnChances dictionary of mod items and their chance to spawn for this bot type
+ * @param botRole the bot role being generated for
+ * @param forceSpawn should this mod be forced to spawn
+ * @returns Item + compatible mods as an array
+ */
+ generateModsForEquipment(equipment: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, botRole: string, forceSpawn?: boolean): Item[];
+ /**
+ * Add mods to a weapon using the provided mod pool
+ * @param sessionId session id
+ * @param weapon Weapon to add mods to
+ * @param modPool Pool of compatible mods to attach to weapon
+ * @param weaponParentId parentId of weapon
+ * @param parentTemplate Weapon which mods will be generated on
+ * @param modSpawnChances Mod spawn chances
+ * @param ammoTpl Ammo tpl to use when generating magazines/cartridges
+ * @param botRole Role of bot weapon is generated for
+ * @param botLevel lvel of the bot weapon is being generated for
+ * @param modLimits limits placed on certian mod types per gun
+ * @param botEquipmentRole role of bot when accessing bot.json equipment config settings
+ * @returns Weapon + mods array
+ */
+ generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponParentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string, botLevel: number, modLimits: BotModLimits, botEquipmentRole: string): Item[];
+ /**
+ * Is this modslot a front or rear sight
+ * @param modSlot Slot to check
+ * @returns true if it's a front/rear sight
+ */
+ protected modIsFrontOrRearSight(modSlot: string): boolean;
+ /**
+ * Does the provided mod details show the mod can hold a scope
+ * @param modSlot e.g. mod_scope, mod_mount
+ * @param modsParentId Parent id of mod item
+ * @returns true if it can hold a scope
+ */
+ protected modSlotCanHoldScope(modSlot: string, modsParentId: string): boolean;
+ /**
+ * Set all scope mod chances to 100%
+ * @param modSpawnChances Chances objet to update
+ */
+ protected setScopeSpawnChancesToFull(modSpawnChances: ModsChances): void;
+ protected sortModKeys(unsortedKeys: string[]): string[];
+ /**
+ * Get a Slot property for an item (chamber/cartridge/slot)
+ * @param modSlot e.g patron_in_weapon
+ * @param parentTemplate item template
+ * @returns Slot item
+ */
+ protected getModItemSlot(modSlot: string, parentTemplate: ITemplateItem): Slot;
+ /**
+ * randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot
+ * never return true for an item that has 0% spawn chance
+ * @param itemSlot slot the item sits in
+ * @param modSlot slot the mod sits in
+ * @param modSpawnChances Chances for various mod spawns
+ * @returns boolean true if it should spawn
+ */
+ protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances): boolean;
+ /**
+ *
+ * @param modSlot Slot mod will fit into
+ * @param isRandomisableSlot Will generate a randomised mod pool if true
+ * @param modsParent Parent slot the item will be a part of
+ * @param botEquipBlacklist Blacklist to prevent mods from being picked
+ * @param itemModPool Pool of items to pick from
+ * @param weapon array with only weapon tpl in it, ready for mods to be added
+ * @param ammoTpl ammo tpl to use if slot requires a cartridge to be added (e.g. mod_magazine)
+ * @param parentTemplate Parent item the mod will go into
+ * @returns ITemplateItem
+ */
+ protected chooseModToPutIntoSlot(modSlot: string, isRandomisableSlot: boolean, botWeaponSightWhitelist: Record, botEquipBlacklist: EquipmentFilterDetails, itemModPool: Record, weapon: Item[], ammoTpl: string, parentTemplate: ITemplateItem): [boolean, ITemplateItem];
+ /**
+ * Create a mod item with parameters as properties
+ * @param modId _id
+ * @param modTpl _tpl
+ * @param parentId parentId
+ * @param modSlot slotId
+ * @param modTemplate Used to add additional properites in the upd object
+ * @returns Item object
+ */
+ protected createModItem(modId: string, modTpl: string, parentId: string, modSlot: string, modTemplate: ITemplateItem, botRole: string): Item;
+ /**
+ * Get a list of containers that hold ammo
+ * e.g. mod_magazine / patron_in_weapon_000
+ * @returns string array
+ */
+ protected getAmmoContainers(): string[];
+ /**
+ * Get a random mod from an items compatible mods Filter array
+ * @param modTpl ???? default value to return if nothing found
+ * @param parentSlot item mod will go into, used to get combatible items
+ * @param modSlot Slot to get mod to fill
+ * @param items items to ensure picked mod is compatible with
+ * @returns item tpl
+ */
+ protected getModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string;
+ /**
+ * Log errors if mod is not compatible with slot
+ * @param modToAdd template of mod to check
+ * @param itemSlot slot the item will be placed in
+ * @param modSlot slot the mod will fill
+ * @param parentTemplate tempalte of the mods parent item
+ * @returns true if valid
+ */
+ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], itemSlot: Slot, modSlot: string, parentTemplate: ITemplateItem): boolean;
+ /**
+ * Find mod tpls of a provided type and add to modPool
+ * @param desiredSlotName slot to look up and add we are adding tpls for (e.g mod_scope)
+ * @param modTemplate db object for modItem we get compatible mods from
+ * @param modPool Pool of mods we are adding to
+ */
+ protected addCompatibleModsForProvidedMod(desiredSlotName: string, modTemplate: ITemplateItem, modPool: Mods, botEquipBlacklist: EquipmentFilterDetails): void;
+ /**
+ * Get the possible items that fit a slot
+ * @param parentItemId item tpl to get compatible items for
+ * @param modSlot Slot item should fit in
+ * @param botEquipBlacklist equipment that should not be picked
+ * @returns array of compatible items for that slot
+ */
+ protected getDynamicModPool(parentItemId: string, modSlot: string, botEquipBlacklist: EquipmentFilterDetails): string[];
+ /**
+ * Take a list of tpls and filter out blacklisted values using itemFilterService + botEquipmentBlacklist
+ * @param allowedMods base mods to filter
+ * @param botEquipBlacklist equipment blacklist
+ * @param modSlot slot mods belong to
+ * @returns Filtered array of mod tpls
+ */
+ protected filterWeaponModsByBlacklist(allowedMods: string[], botEquipBlacklist: EquipmentFilterDetails, modSlot: string): string[];
+ /**
+ * With the shotgun revolver (60db29ce99594040e04c4a27) 12.12 introduced CylinderMagazines.
+ * Those magazines (e.g. 60dc519adf4c47305f6d410d) have a "Cartridges" entry with a _max_count=0.
+ * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots.
+ * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine"
+ * @param items The items where the CylinderMagazine's camora are appended to
+ * @param modPool modPool which should include available cartrigdes
+ * @param parentId The CylinderMagazine's UID
+ * @param parentTemplate The CylinderMagazine's template
+ */
+ protected fillCamora(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem): void;
+ /**
+ * Take a record of camoras and merge the compatable shells into one array
+ * @param camorasWithShells camoras we want to merge into one array
+ * @returns string array of shells fro luitple camora sources
+ */
+ protected mergeCamoraPoolsTogether(camorasWithShells: Record): string[];
+ /**
+ * Filter out non-whitelisted weapon scopes
+ * @param weapon Weapon scopes will be added to
+ * @param scopes Full scope pool
+ * @param botWeaponSightWhitelist whitelist of scope types by weapon base type
+ * @returns array of scope tpls that have been filtered
+ */
+ protected filterSightsByWeaponType(weapon: Item, scopes: string[], botWeaponSightWhitelist: Record): string[];
+}
diff --git a/Live/CWX_MasterKey/server/types/generators/BotGenerator.d.ts b/Live/CWX_MasterKey/server/types/generators/BotGenerator.d.ts
index 08ad50a..2675146 100644
--- a/Live/CWX_MasterKey/server/types/generators/BotGenerator.d.ts
+++ b/Live/CWX_MasterKey/server/types/generators/BotGenerator.d.ts
@@ -1,16 +1,16 @@
import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper";
import { BotHelper } from "../helpers/BotHelper";
-import { GameEventHelper } from "../helpers/GameEventHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Health as PmcHealth, IBotBase, Skills } from "../models/eft/common/tables/IBotBase";
-import { Health, IBotType, Inventory } from "../models/eft/common/tables/IBotType";
+import { Health, IBotType } from "../models/eft/common/tables/IBotType";
import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails";
import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
+import { SeasonalEventService } from "../services/SeasonalEventService";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
@@ -29,10 +29,10 @@ export declare class BotGenerator {
protected weightedRandomHelper: WeightedRandomHelper;
protected botHelper: BotHelper;
protected botDifficultyHelper: BotDifficultyHelper;
- protected gameEventHelper: GameEventHelper;
+ protected seasonalEventService: SeasonalEventService;
protected configServer: ConfigServer;
protected botConfig: IBotConfig;
- constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, gameEventHelper: GameEventHelper, configServer: ConfigServer);
+ constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
/**
* Generate a player scav bot object
* @param role e.g. assault / pmcbot
@@ -42,23 +42,12 @@ export declare class BotGenerator {
*/
generatePlayerScav(sessionId: string, role: string, difficulty: string, botTemplate: IBotType): IBotBase;
/**
- * Generate an array of bot objects based on a condition for a raid with
- * @param sessionId session id
- * @param botGenerationDetails details on how to generate the bots
- * @returns Generated bots in array
+ * Create x number of bots of the type/side/difficulty defined in botGenerationDetails
+ * @param sessionId Session id
+ * @param botGenerationDetails details on how to generate bots
+ * @returns array of bots
*/
- generateByCondition(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase[];
- /**
- * Get the PMCs wildSpawnType value
- * @param role "usec" / "bear"
- * @returns wildSpawnType value as string
- */
- protected getPmcRoleByDescription(role: string): string;
- /**
- * Get a randomised PMC side based on bot config value 'isUsec'
- * @returns pmc side as string
- */
- protected getRandomisedPmcSide(): string;
+ prepareAndGenerateBots(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase[];
/**
* Get a clone of the database\bots\base.json file
* @returns IBotBase object
@@ -94,11 +83,6 @@ export declare class BotGenerator {
*/
protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth;
protected generateSkills(skillsObj: Skills): Skills;
- /**
- * Iterate through bots inventory and loot to find and remove christmas items (as defined in GameEventHelper)
- * @param nodeInventory Bots inventory to iterate over
- */
- protected removeChristmasItemsFromBotInventory(nodeInventory: Inventory): void;
/**
* Generate a random Id for a bot and apply to bots _id and aid value
* @param bot bot to update
@@ -106,12 +90,6 @@ export declare class BotGenerator {
*/
protected generateId(bot: IBotBase): IBotBase;
protected generateInventoryID(profile: IBotBase): IBotBase;
- /**
- * Get the difficulty passed in, if its not "asoline", get selected difficulty from config
- * @param requestedDifficulty
- * @returns
- */
- protected getPMCDifficulty(requestedDifficulty: string): string;
/**
* Add a side-specific (usec/bear) dogtag item to a bots inventory
* @param bot bot to add dogtag to
diff --git a/Live/CWX_MasterKey/server/types/generators/BotInventoryGenerator.d.ts b/Live/CWX_MasterKey/server/types/generators/BotInventoryGenerator.d.ts
index a3b5eaa..83a548b 100644
--- a/Live/CWX_MasterKey/server/types/generators/BotInventoryGenerator.d.ts
+++ b/Live/CWX_MasterKey/server/types/generators/BotInventoryGenerator.d.ts
@@ -4,13 +4,15 @@ import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType";
import { EquipmentSlots } from "../models/enums/EquipmentSlots";
-import { IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig";
+import { EquipmentFilterDetails, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
+import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService";
import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { RandomUtil } from "../utils/RandomUtil";
+import { BotEquipmentModGenerator } from "./BotEquipmentModGenerator";
import { BotLootGenerator } from "./BotLootGenerator";
import { BotWeaponGenerator } from "./BotWeaponGenerator";
export declare class BotInventoryGenerator {
@@ -24,9 +26,11 @@ export declare class BotInventoryGenerator {
protected botHelper: BotHelper;
protected weightedRandomHelper: WeightedRandomHelper;
protected localisationService: LocalisationService;
+ protected botEquipmentModPoolService: BotEquipmentModPoolService;
+ protected botEquipmentModGenerator: BotEquipmentModGenerator;
protected configServer: ConfigServer;
protected botConfig: IBotConfig;
- constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, configServer: ConfigServer);
+ constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer);
/**
* Add equipment/weapons/loot to bot
* @param sessionId Session id
@@ -62,6 +66,13 @@ export declare class BotInventoryGenerator {
* @param randomisationDetails settings from bot.json to adjust how item is generated
*/
protected generateEquipment(equipmentSlot: string, equipmentPool: Record, modPool: Mods, spawnChances: Chances, botRole: string, inventory: PmcInventory, randomisationDetails: RandomisationDetails): void;
+ /**
+ * Get all possible mods for item and filter down based on equipment blacklist from bot.json config
+ * @param itemTpl Item mod pool is being retreived and filtered
+ * @param equipmentBlacklist blacklist to filter mod pool with
+ * @returns Filtered pool of mods
+ */
+ protected getFilteredDynamicModsForItem(itemTpl: string, equipmentBlacklist: EquipmentFilterDetails[]): Record;
/**
* Work out what weapons bot should have equipped and add them to bot inventory
* @param templateInventory bot/x.json data from db
diff --git a/Live/CWX_MasterKey/server/types/generators/BotWeaponGenerator.d.ts b/Live/CWX_MasterKey/server/types/generators/BotWeaponGenerator.d.ts
index b2eaf3b..938d61c 100644
--- a/Live/CWX_MasterKey/server/types/generators/BotWeaponGenerator.d.ts
+++ b/Live/CWX_MasterKey/server/types/generators/BotWeaponGenerator.d.ts
@@ -12,10 +12,12 @@ import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
+import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService";
import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
+import { BotEquipmentModGenerator } from "./BotEquipmentModGenerator";
import { IInventoryMagGen } from "./weapongen/IInventoryMagGen";
export declare class BotWeaponGenerator {
protected jsonUtil: JsonUtil;
@@ -28,11 +30,13 @@ export declare class BotWeaponGenerator {
protected randomUtil: RandomUtil;
protected configServer: ConfigServer;
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
+ protected botWeaponModLimitService: BotWeaponModLimitService;
+ protected botEquipmentModGenerator: BotEquipmentModGenerator;
protected localisationService: LocalisationService;
protected inventoryMagGenComponents: IInventoryMagGen[];
protected readonly modMagazineSlotId = "mod_magazine";
protected botConfig: IBotConfig;
- constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]);
+ constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]);
/**
* Pick a random weapon based on weightings and generate a functional weapon
* @param equipmentSlot Primary/secondary/holster
diff --git a/Live/CWX_MasterKey/server/types/generators/LocationGenerator.d.ts b/Live/CWX_MasterKey/server/types/generators/LocationGenerator.d.ts
index cc61dcf..a80ae3c 100644
--- a/Live/CWX_MasterKey/server/types/generators/LocationGenerator.d.ts
+++ b/Live/CWX_MasterKey/server/types/generators/LocationGenerator.d.ts
@@ -1,5 +1,4 @@
import { ContainerHelper } from "../helpers/ContainerHelper";
-import { GameEventHelper } from "../helpers/GameEventHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { PresetHelper } from "../helpers/PresetHelper";
import { RagfairServerHelper } from "../helpers/RagfairServerHelper";
@@ -9,6 +8,8 @@ import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticL
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
+import { LocalisationService } from "../services/LocalisationService";
+import { SeasonalEventService } from "../services/SeasonalEventService";
import { JsonUtil } from "../utils/JsonUtil";
import { MathUtil } from "../utils/MathUtil";
import { ObjectId } from "../utils/ObjectId";
@@ -26,12 +27,13 @@ export declare class LocationGenerator {
protected ragfairServerHelper: RagfairServerHelper;
protected itemHelper: ItemHelper;
protected mathUtil: MathUtil;
- protected gameEventHelper: GameEventHelper;
+ protected seasonalEventService: SeasonalEventService;
protected containerHelper: ContainerHelper;
protected presetHelper: PresetHelper;
+ protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected locationConfig: ILocationConfig;
- constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, gameEventHelper: GameEventHelper, containerHelper: ContainerHelper, presetHelper: PresetHelper, configServer: ConfigServer);
+ constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer);
generateContainerLoot(containerIn: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerProps;
protected getLooseLootMultiplerForLocation(location: string): number;
protected getStaticLootMultiplerForLocation(location: string): number;
diff --git a/Live/CWX_MasterKey/server/types/generators/LootGenerator.d.ts b/Live/CWX_MasterKey/server/types/generators/LootGenerator.d.ts
index bc0d7ec..0d2ef24 100644
--- a/Live/CWX_MasterKey/server/types/generators/LootGenerator.d.ts
+++ b/Live/CWX_MasterKey/server/types/generators/LootGenerator.d.ts
@@ -6,6 +6,7 @@ import { LootRequest } from "../models/spt/services/LootRequest";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { ItemFilterService } from "../services/ItemFilterService";
+import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { RandomUtil } from "../utils/RandomUtil";
export declare class LootGenerator {
@@ -14,8 +15,9 @@ export declare class LootGenerator {
protected databaseServer: DatabaseServer;
protected randomUtil: RandomUtil;
protected itemHelper: ItemHelper;
+ protected localisationService: LocalisationService;
protected itemFilterService: ItemFilterService;
- constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, itemFilterService: ItemFilterService);
+ constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService);
/**
* Generate a list of items based on configuration options parameter
* @param options parameters to adjust how loot is generated
diff --git a/Live/CWX_MasterKey/server/types/generators/PlayerScavGenerator.d.ts b/Live/CWX_MasterKey/server/types/generators/PlayerScavGenerator.d.ts
index bb2c730..9fee88b 100644
--- a/Live/CWX_MasterKey/server/types/generators/PlayerScavGenerator.d.ts
+++ b/Live/CWX_MasterKey/server/types/generators/PlayerScavGenerator.d.ts
@@ -10,6 +10,7 @@ import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer";
import { BotLootCacheService } from "../services/BotLootCacheService";
import { FenceService } from "../services/FenceService";
+import { LocalisationService } from "../services/LocalisationService";
import { JsonUtil } from "../utils/JsonUtil";
import { BotGenerator } from "./BotGenerator";
export declare class PlayerScavGenerator {
@@ -21,10 +22,11 @@ export declare class PlayerScavGenerator {
protected jsonUtil: JsonUtil;
protected fenceService: FenceService;
protected botLootCacheService: BotLootCacheService;
+ protected localisationService: LocalisationService;
protected botGenerator: BotGenerator;
protected configServer: ConfigServer;
protected playerScavConfig: IPlayerScavConfig;
- constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, jsonUtil: JsonUtil, fenceService: FenceService, botLootCacheService: BotLootCacheService, botGenerator: BotGenerator, configServer: ConfigServer);
+ constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, botHelper: BotHelper, jsonUtil: JsonUtil, fenceService: FenceService, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, botGenerator: BotGenerator, configServer: ConfigServer);
/**
* Update a player profile to include a new player scav profile
* @param sessionID session id to specify what profile is updated
diff --git a/Live/CWX_MasterKey/server/types/generators/RagfairOfferGenerator.d.ts b/Live/CWX_MasterKey/server/types/generators/RagfairOfferGenerator.d.ts
index 23882d2..338cd5c 100644
--- a/Live/CWX_MasterKey/server/types/generators/RagfairOfferGenerator.d.ts
+++ b/Live/CWX_MasterKey/server/types/generators/RagfairOfferGenerator.d.ts
@@ -7,7 +7,7 @@ import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { IBarterScheme } from "../models/eft/common/tables/ITrader";
import { IRagfairOffer, OfferRequirement } from "../models/eft/ragfair/IRagfairOffer";
-import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
+import { Dynamic, IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
@@ -88,7 +88,16 @@ export declare class RagfairOfferGenerator {
* Create multiple offers for items by using a unique list of items we've generated previously
* @param expiredOffers optional, expired offers to regenerate
*/
- generateDynamicOffers(expiredOffers?: Item[]): void;
+ generateDynamicOffers(expiredOffers?: Item[]): Promise;
+ protected createOffersForItems(assortItemIndex: string, assortItemsToProcess: Item[], expiredOffers: Item[], config: Dynamic): Promise;
+ /**
+ * Create one flea offer for a specific item
+ * @param items Item to create offer for
+ * @param isPreset Is item a weapon preset
+ * @param itemDetails raw db item details
+ * @returns
+ */
+ protected createSingleOfferForItem(items: Item[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise
- ;
/**
* Generate trader offers on flea using the traders assort data
* @param traderID Trader to generate offers for
@@ -110,7 +119,7 @@ export declare class RagfairOfferGenerator {
*/
protected createBarterRequirement(offerItems: Item[]): IBarterScheme[];
/**
- * Get an array of flea prices + item tpl, cached in generator class
+ * Get an array of flea prices + item tpl, cached in generator class inside `allowedFleaPriceItemsForBarter`
* @returns array with tpl/price values
*/
protected getFleaPricesAsArray(): {
diff --git a/Live/CWX_MasterKey/server/types/generators/ScavCaseRewardGenerator.d.ts b/Live/CWX_MasterKey/server/types/generators/ScavCaseRewardGenerator.d.ts
index 89cb5c8..f9ac623 100644
--- a/Live/CWX_MasterKey/server/types/generators/ScavCaseRewardGenerator.d.ts
+++ b/Live/CWX_MasterKey/server/types/generators/ScavCaseRewardGenerator.d.ts
@@ -37,12 +37,6 @@ export declare class ScavCaseRewardGenerator {
* @returns filtered array of db items
*/
protected getDbItems(): ITemplateItem[];
- /**
- * Check if a template id has a blacklisted parent id
- * @param tplid template id to check
- * @returns true if item is blacklisted
- */
- protected itemHasBlacklistedParent(tplid: string): boolean;
/**
* Pick a number of items to be rewards, the count is defined by the values in
* @param items item pool to pick rewards from
diff --git a/Live/CWX_MasterKey/server/types/helpers/AssortHelper.d.ts b/Live/CWX_MasterKey/server/types/helpers/AssortHelper.d.ts
index bfc157f..de8b5bf 100644
--- a/Live/CWX_MasterKey/server/types/helpers/AssortHelper.d.ts
+++ b/Live/CWX_MasterKey/server/types/helpers/AssortHelper.d.ts
@@ -2,14 +2,16 @@ import { IPmcData } from "../models/eft/common/IPmcData";
import { ITraderAssort } from "../models/eft/common/tables/ITrader";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
+import { LocalisationService } from "../services/LocalisationService";
import { ItemHelper } from "./ItemHelper";
import { QuestHelper } from "./QuestHelper";
export declare class AssortHelper {
protected logger: ILogger;
protected itemHelper: ItemHelper;
protected databaseServer: DatabaseServer;
+ protected localisationService: LocalisationService;
protected questHelper: QuestHelper;
- constructor(logger: ILogger, itemHelper: ItemHelper, databaseServer: DatabaseServer, questHelper: QuestHelper);
+ constructor(logger: ILogger, itemHelper: ItemHelper, databaseServer: DatabaseServer, localisationService: LocalisationService, questHelper: QuestHelper);
/**
* Remove assorts from a trader that have not been unlocked yet
* @param pmcProfile player profile
diff --git a/Live/CWX_MasterKey/server/types/helpers/BotGeneratorHelper.d.ts b/Live/CWX_MasterKey/server/types/helpers/BotGeneratorHelper.d.ts
index 9ee017f..d9ce968 100644
--- a/Live/CWX_MasterKey/server/types/helpers/BotGeneratorHelper.d.ts
+++ b/Live/CWX_MasterKey/server/types/helpers/BotGeneratorHelper.d.ts
@@ -1,207 +1,24 @@
import { DurabilityLimitsHelper } from "../helpers/DurabilityLimitsHelper";
-import { Mods, ModsChances } from "../models/eft/common/tables/IBotType";
import { Item, Repairable, Upd } from "../models/eft/common/tables/IItem";
-import { ITemplateItem, Slot } from "../models/eft/common/tables/ITemplateItem";
-import { EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig";
+import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
+import { EquipmentFilters, IBotConfig } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
-import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
-import { ItemFilterService } from "../services/ItemFilterService";
import { LocalisationService } from "../services/LocalisationService";
-import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
-import { BotHelper } from "./BotHelper";
-import { BotWeaponGeneratorHelper } from "./BotWeaponGeneratorHelper";
-import { ContainerHelper } from "./ContainerHelper";
-import { InventoryHelper } from "./InventoryHelper";
import { ItemHelper } from "./ItemHelper";
-import { ProbabilityHelper } from "./ProbabilityHelper";
-import { ProfileHelper } from "./ProfileHelper";
-export declare class BotModLimits {
- scope: ItemCount;
- scopeMax: number;
- scopeBaseTypes: string[];
- flashlightLaser: ItemCount;
- flashlightLaserMax: number;
- flashlgihtLaserBaseTypes: string[];
-}
-export declare class ItemCount {
- count: number;
-}
export declare class BotGeneratorHelper {
protected logger: ILogger;
- protected jsonUtil: JsonUtil;
- protected hashUtil: HashUtil;
protected randomUtil: RandomUtil;
- protected probabilityHelper: ProbabilityHelper;
protected databaseServer: DatabaseServer;
protected durabilityLimitsHelper: DurabilityLimitsHelper;
protected itemHelper: ItemHelper;
- protected inventoryHelper: InventoryHelper;
- protected containerHelper: ContainerHelper;
- protected botEquipmentFilterService: BotEquipmentFilterService;
- protected itemFilterService: ItemFilterService;
- protected profileHelper: ProfileHelper;
- protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
- protected botHelper: BotHelper;
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected botConfig: IBotConfig;
- constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botHelper: BotHelper, localisationService: LocalisationService, configServer: ConfigServer);
- /**
- * Check mods are compatible and add to array
- * @param equipment Equipment item to add mods to
- * @param modPool Mod list to choose frm
- * @param parentId parentid of item to add mod to
- * @param parentTemplate template objet of item to add mods to
- * @param modSpawnChances dictionary of mod items and their chance to spawn for this bot type
- * @param botRole the bot role being generated for
- * @param forceSpawn should this mod be forced to spawn
- * @returns Item + compatible mods as an array
- */
- generateModsForEquipment(equipment: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, botRole: string, forceSpawn?: boolean): Item[];
- /**
- * Add mods to a weapon using the provided mod pool
- * @param sessionId session id
- * @param weapon Weapon to add mods to
- * @param modPool Pool of compatible mods to attach to weapon
- * @param weaponParentId parentId of weapon
- * @param parentWeaponTemplate Weapon which mods will be generated on
- * @param modSpawnChances Mod spawn chances
- * @param ammoTpl Ammo tpl to use when generating magazines/cartridges
- * @param botRole Role of bot weapon is generated for
- * @returns Weapon + mods array
- */
- generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponParentId: string, parentWeaponTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string, botLevel: number): Item[];
- /**
- *
- * @param modSlot Slot mod will fit into
- * @param isRandomisableSlot Will generate a randomised mod pool if true
- * @param modsParent Parent slot the item will be a part of
- * @param botEquipBlacklist Blacklist to prevent mods from being picked
- * @param itemModPool Pool of items to pick from
- * @param weapon array with only weapon tpl in it, ready for mods to be added
- * @param ammoTpl ammo tpl to use if slot requires a cartridge to be added (e.g. mod_magazine)
- * @param parentTemplate Parent item the mod will go into
- * @returns ITemplateItem
- */
- protected chooseModToPutIntoSlot(modSlot: string, isRandomisableSlot: boolean, modsParent: Slot, botEquipBlacklist: EquipmentFilterDetails, itemModPool: Record, weapon: Item[], ammoTpl: string, parentTemplate: ITemplateItem): [boolean, ITemplateItem];
- /**
- * Find mod tpls of a provided type and add to modPool
- * @param desiredSlotName slot to look up and add we are adding tpls for (e.g mod_scope)
- * @param modTemplate db object for modItem we get compatible mods from
- * @param modPool Pool of mods we are adding to
- */
- protected addCompatibleModsForProvidedMod(desiredSlotName: string, modTemplate: ITemplateItem, modPool: Mods, botEquipBlacklist: EquipmentFilterDetails): void;
- /**
- * Check if mod item is on limited list + has surpassed the limit set for it
- * @param botRole role the bot has e.g. assault
- * @param modTemplate mods template data
- * @param modLimits limits set for weapon being generated for this bot
- * @returns true if over item limit
- */
- protected modHasReachedItemLimit(botRole: string, modTemplate: ITemplateItem, modLimits: BotModLimits): boolean;
- /**
- * Initalise mod limits to be used when generating a weapon
- * @param botRole "assault", "bossTagilla" or "pmc"
- * @returns BotModLimits object
- */
- protected initModLimits(botRole: string): BotModLimits;
- /**
- * Generate a pool of mods for this bots mod type if bot has values inside `randomisedWeaponModSlots` array found in bot.json/equipment[botrole]
- * @param allowedMods Mods to be added to mod pool
- * @param botEquipBlacklist blacklist of items not allowed to be added to mod pool
- * @param modSlot Slot to generate mods for
- * @param itemModPool base mod pool to replace values of
- */
- protected generateDynamicWeaponModPool(allowedMods: string[], botEquipBlacklist: EquipmentFilterDetails, modSlot: string, itemModPool: Record): void;
- /**
- * Find all compatible mods for equipment item and add to modPool
- * @param itemDetails item to find mods for
- * @param modPool ModPool to add mods to
- * @param equipmentBlacklist equipment not allowed to be used by the bot
- * @param botEquipmentRole bot type to generate pool for (e.g. assault, pmcBot, pmc for usec/bear)
- */
- generateDynamicModPool(itemDetails: ITemplateItem, modPool: Mods, equipmentBlacklist: EquipmentFilterDetails[], botEquipmentRole: string): void;
- /**
- * Take a list of tpls and filter out blacklisted values using itemFilterService + botEquipmentBlacklist
- * @param allowedMods base mods to filter
- * @param botEquipBlacklist equipment blacklist
- * @param modSlot slot mods belong to
- * @returns Filtered array of mod tpls
- */
- protected filterWeaponModsByBlacklist(allowedMods: string[], botEquipBlacklist: EquipmentFilterDetails, modSlot: string): string[];
- /**
- * Check if the specific item type on the weapon has reached the set limit
- * @param modTpl log mod tpl if over type limit
- * @param currentCount current number of this item on gun
- * @param maxLimit mod limit allowed
- * @param botRole role of bot we're checking weapon of
- * @returns true if limit reached
- */
- protected weaponModLimitReached(modTpl: string, currentCount: {
- count: number;
- }, maxLimit: number, botRole: string): boolean;
- /**
- * Log errors if mod is not compatible with slot
- * @param modToAdd template of mod to check
- * @param itemSlot slot the item will be placed in
- * @param modSlot slot the mod will fill
- * @param parentTemplate tempalte of the mods parent item
- * @returns true if valid
- */
- protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], itemSlot: Slot, modSlot: string, parentTemplate: ITemplateItem): boolean;
- /**
- * Create a mod item with parameters as properties
- * @param modId _id
- * @param modTpl _tpl
- * @param parentId parentId
- * @param modSlot slotId
- * @param modTemplate Used to add additional properites in the upd object
- * @returns Item object
- */
- protected createModItem(modId: string, modTpl: string, parentId: string, modSlot: string, modTemplate: ITemplateItem, botRole: string): Item;
- /**
- * randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot
- * never return true for an item that has 0% spawn chance
- * @param itemSlot slot the item sits in
- * @param modSlot slot the mod sits in
- * @param modSpawnChances Chances for various mod spawns
- * @returns boolean true if it should spawn
- */
- protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances): boolean;
- /**
- * Get a list of containers that hold ammo
- * e.g. mod_magazine / patron_in_weapon_000
- * @returns string array
- */
- protected getAmmoContainers(): string[];
- /**
- * Get a Slot property for an item (chamber/cartridge/slot)
- * @param modSlot e.g patron_in_weapon
- * @param parentTemplate item template
- * @returns Slot item
- */
- protected getModItemSlot(modSlot: string, parentTemplate: ITemplateItem): Slot;
- /**
- * With the shotgun revolver (60db29ce99594040e04c4a27) 12.12 introduced CylinderMagazines.
- * Those magazines (e.g. 60dc519adf4c47305f6d410d) have a "Cartridges" entry with a _max_count=0.
- * Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots.
- * This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine"
- * @param items The items where the CylinderMagazine's camora are appended to
- * @param modPool modPool which should include available cartrigdes
- * @param parentId The CylinderMagazine's UID
- * @param parentTemplate The CylinderMagazine's template
- */
- protected fillCamora(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem): void;
- /**
- * Take a record of camoras and merge the compatable shells into one array
- * @param camorasWithShells camoras we want to merge into one array
- * @returns string array of shells fro luitple camora sources
- */
- protected mergeCamoraPoolsTogether(camorasWithShells: Record): string[];
+ constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer, durabilityLimitsHelper: DurabilityLimitsHelper, itemHelper: ItemHelper, localisationService: LocalisationService, configServer: ConfigServer);
/**
* Adds properties to an item
* e.g. Repairable / HasHinge / Foldable / MaxDurability
@@ -212,6 +29,14 @@ export declare class BotGeneratorHelper {
generateExtraPropertiesForItem(itemTemplate: ITemplateItem, botRole?: string): {
upd?: Upd;
};
+ /**
+ * Get the chance for the weapon attachment or helmet equipment to be set as activated
+ * @param botRole role of bot with weapon/helmet
+ * @param setting the setting of the weapon attachment/helmet equipment to be activated
+ * @param defaultValue default value for the chance of activation if the botrole or bot equipment role is null
+ * @returns Percent chance to be active
+ */
+ protected getBotEquipmentSettingFromConfig(botRole: string, setting: keyof EquipmentFilters, defaultValue: number): number;
/**
* Create a repairable object for a weapon that containers durability + max durability properties
* @param itemTemplate weapon object being generated for
@@ -227,22 +52,16 @@ export declare class BotGeneratorHelper {
*/
protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole: string): Repairable;
/**
- * Get a random mod from an items compatible mods Filter array
- * @param modTpl ????
- * @param parentSlot item mod will go into, used to get combatible items
- * @param modSlot Slot to get mod to fill
- * @param items items to ensure picked mod is compatible with
- * @returns item tpl
- */
- protected getModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string;
- /**
- * Can an item be added to an item without issue
- * @param items items to check compatiblilities with
- * @param tplToCheck tpl of the item to check for incompatibilities
+ * Can item be added to another item without conflict
+ * @param items Items to check compatiblilities with
+ * @param tplToCheck Tpl of the item to check for incompatibilities
* @param equipmentSlot Slot the item will be placed into
- * @returns false if no incompatibilties
+ * @returns false if no incompatibilties, also has incompatibility reason
*/
- isItemIncompatibleWithCurrentItems(items: Item[], tplToCheck: string, equipmentSlot: string): boolean;
+ isItemIncompatibleWithCurrentItems(items: Item[], tplToCheck: string, equipmentSlot: string): {
+ incompatible: boolean;
+ reason: string;
+ };
/**
* Convert a bots role to the equipment role used in config/bot.json
* @param botRole Role to convert
diff --git a/Live/CWX_MasterKey/server/types/helpers/BotHelper.d.ts b/Live/CWX_MasterKey/server/types/helpers/BotHelper.d.ts
index 2752a0e..9a43b8e 100644
--- a/Live/CWX_MasterKey/server/types/helpers/BotHelper.d.ts
+++ b/Live/CWX_MasterKey/server/types/helpers/BotHelper.d.ts
@@ -1,3 +1,4 @@
+import { MinMax } from "../models/common/MinMax";
import { Difficulty, IBotType } from "../models/eft/common/tables/IBotType";
import { EquipmentFilters, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger";
@@ -59,6 +60,8 @@ export declare class BotHelper {
* @returns true if should be a pmc
*/
shouldBotBePmc(botRole: string): boolean;
+ rollChanceToBePmc(role: string, botConvertMinMax: MinMax): boolean;
+ botRoleIsPmc(botRole: string): boolean;
/**
* Get randomisation settings for bot from config/bot.json
* @param botLevel level of bot
@@ -66,4 +69,20 @@ export declare class BotHelper {
* @returns RandomisationDetails
*/
getBotRandomisationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails;
+ /**
+ * Choose between sptBear and sptUsec at random based on the % defined in botConfig.pmc.isUsec
+ * @returns pmc role
+ */
+ getRandomisedPmcRole(): string;
+ /**
+ * Get the corrisponding side when sptBear or sptUsec is passed in
+ * @param botRole role to get side for
+ * @returns side (usec/bear)
+ */
+ getPmcSideByRole(botRole: string): string;
+ /**
+ * Get a randomised PMC side based on bot config value 'isUsec'
+ * @returns pmc side as string
+ */
+ protected getRandomisedPmcSide(): string;
}
diff --git a/Live/CWX_MasterKey/server/types/helpers/BotWeaponGeneratorHelper.d.ts b/Live/CWX_MasterKey/server/types/helpers/BotWeaponGeneratorHelper.d.ts
index 7e25f56..b087fa9 100644
--- a/Live/CWX_MasterKey/server/types/helpers/BotWeaponGeneratorHelper.d.ts
+++ b/Live/CWX_MasterKey/server/types/helpers/BotWeaponGeneratorHelper.d.ts
@@ -4,6 +4,7 @@ import { Item } from "../models/eft/common/tables/IItem";
import { Grid, ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
+import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { ContainerHelper } from "./ContainerHelper";
@@ -16,8 +17,9 @@ export declare class BotWeaponGeneratorHelper {
protected randomUtil: RandomUtil;
protected hashUtil: HashUtil;
protected inventoryHelper: InventoryHelper;
+ protected localisationService: LocalisationService;
protected containerHelper: ContainerHelper;
- constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, containerHelper: ContainerHelper);
+ constructor(logger: ILogger, databaseServer: DatabaseServer, itemHelper: ItemHelper, randomUtil: RandomUtil, hashUtil: HashUtil, inventoryHelper: InventoryHelper, localisationService: LocalisationService, containerHelper: ContainerHelper);
/**
* Get a randomised number of bullets for a specific magazine
* @param magCounts min and max count of magazines
diff --git a/Live/CWX_MasterKey/server/types/helpers/DialogueHelper.d.ts b/Live/CWX_MasterKey/server/types/helpers/DialogueHelper.d.ts
index 88a726e..8f03b81 100644
--- a/Live/CWX_MasterKey/server/types/helpers/DialogueHelper.d.ts
+++ b/Live/CWX_MasterKey/server/types/helpers/DialogueHelper.d.ts
@@ -4,6 +4,7 @@ import { MessageType } from "../models/enums/MessageType";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer";
+import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { ItemHelper } from "./ItemHelper";
import { NotificationSendHelper } from "./NotificationSendHelper";
@@ -15,8 +16,9 @@ export declare class DialogueHelper {
protected databaseServer: DatabaseServer;
protected notifierHelper: NotifierHelper;
protected notificationSendHelper: NotificationSendHelper;
+ protected localisationService: LocalisationService;
protected itemHelper: ItemHelper;
- constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, itemHelper: ItemHelper);
+ constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, notifierHelper: NotifierHelper, notificationSendHelper: NotificationSendHelper, localisationService: LocalisationService, itemHelper: ItemHelper);
createMessageContext(templateId: string, messageType: MessageType, maxStoreTime: number): MessageContent;
/**
* Add a templated message to the dialogue.
diff --git a/Live/CWX_MasterKey/server/types/helpers/GameEventHelper.d.ts b/Live/CWX_MasterKey/server/types/helpers/GameEventHelper.d.ts
index fa25eff..f502c95 100644
--- a/Live/CWX_MasterKey/server/types/helpers/GameEventHelper.d.ts
+++ b/Live/CWX_MasterKey/server/types/helpers/GameEventHelper.d.ts
@@ -1,4 +1,4 @@
-import { ISeasonalEvent, ISeasonalEventConfig } from "../models/spt/config/ISeasonalEventConfig";
+import { ISeasonalEventConfig } from "../models/spt/config/ISeasonalEventConfig";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class GameEventHelper {
@@ -6,24 +6,4 @@ export declare class GameEventHelper {
protected configServer: ConfigServer;
protected seasonalEventConfig: ISeasonalEventConfig;
constructor(databaseServer: DatabaseServer, configServer: ConfigServer);
- get events(): Record;
- get christmasEventItems(): string[];
- itemIsChristmasRelated(itemId: string): boolean;
- christmasEventEnabled(): boolean;
- /**
- * Get the dates each seasonal event starts and ends
- * @returns Record with event name + start/end date
- */
- getEventDetails(): ISeasonalEvent[];
- /**
- * Is detection of seasonal events enabled (halloween / christmas)
- * @returns true if seasonal events should be checked for
- */
- isAutomaticEventDetectionEnabled(): boolean;
- /**
- * Get a dictionary of gear changes to apply to bots for a specific event e.g. Christmas/Halloween
- * @param eventName Name of event to get gear changes for
- * @returns bots with equipment changes
- */
- getEventBotGear(eventName: string): Record>>;
}
diff --git a/Live/CWX_MasterKey/server/types/helpers/HandbookHelper.d.ts b/Live/CWX_MasterKey/server/types/helpers/HandbookHelper.d.ts
index 1ab7800..aa329a9 100644
--- a/Live/CWX_MasterKey/server/types/helpers/HandbookHelper.d.ts
+++ b/Live/CWX_MasterKey/server/types/helpers/HandbookHelper.d.ts
@@ -11,6 +11,7 @@ export declare class LookupCollection {
}
export declare class HandbookHelper {
protected databaseServer: DatabaseServer;
+ protected lookupCacheGenerated: boolean;
protected handbookPriceCache: LookupCollection;
constructor(databaseServer: DatabaseServer);
hydrateLookup(): void;
@@ -35,18 +36,18 @@ export declare class HandbookHelper {
isCategory(category: string): boolean;
childrenCategories(x: string): string[];
/**
- * Convert currency into roubles
- * @param {number} value
- * @param {string} currencyFrom
- * @returns get rouble value of inputted currency
- */
- inRUB(value: number, currencyFrom: string): number;
- /**
- * Gets Ruble to Currency conversion Value
- * @param {number} value
- * @param {string} currencyTo
- * @returns number
+ * Convert non-roubles into roubles
+ * @param nonRoubleCurrencyCount Currency count to convert
+ * @param currencyTypeFrom What current currency is
+ * @returns Count in roubles
*/
- fromRUB(value: number, currencyTo: string): number;
+ inRUB(nonRoubleCurrencyCount: number, currencyTypeFrom: string): number;
+ /**
+ * Convert roubles into another currency
+ * @param roubleCurrencyCount roubles to convert
+ * @param currencyTypeTo Currency to convert roubles into
+ * @returns currency count in desired type
+ */
+ fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number;
}
export {};
diff --git a/Live/CWX_MasterKey/server/types/helpers/HealthHelper.d.ts b/Live/CWX_MasterKey/server/types/helpers/HealthHelper.d.ts
index 3116c9c..50b7559 100644
--- a/Live/CWX_MasterKey/server/types/helpers/HealthHelper.d.ts
+++ b/Live/CWX_MasterKey/server/types/helpers/HealthHelper.d.ts
@@ -1,4 +1,5 @@
import { IPmcData } from "../models/eft/common/IPmcData";
+import { Effect } from "../models/eft/health/Effect";
import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData";
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { IHealthConfig } from "../models/spt/config/IHealthConfig";
@@ -46,6 +47,6 @@ export declare class HealthHelper {
* @param effectBodyPart body part to edit
* @param effectType Effect to add to body part
*/
- protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string): void;
+ protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: Effect): void;
protected isEmpty(map: any): boolean;
}
diff --git a/Live/CWX_MasterKey/server/types/helpers/InRaidHelper.d.ts b/Live/CWX_MasterKey/server/types/helpers/InRaidHelper.d.ts
index 962df38..c7b7329 100644
--- a/Live/CWX_MasterKey/server/types/helpers/InRaidHelper.d.ts
+++ b/Live/CWX_MasterKey/server/types/helpers/InRaidHelper.d.ts
@@ -5,6 +5,7 @@ import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequ
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer";
+import { LocalisationService } from "../services/LocalisationService";
import { ProfileFixerService } from "../services/ProfileFixerService";
import { JsonUtil } from "../utils/JsonUtil";
import { InventoryHelper } from "./InventoryHelper";
@@ -16,8 +17,9 @@ export declare class InRaidHelper {
protected databaseServer: DatabaseServer;
protected inventoryHelper: InventoryHelper;
protected paymentHelper: PaymentHelper;
+ protected localisationService: LocalisationService;
protected profileFixerService: ProfileFixerService;
- constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, paymentHelper: PaymentHelper, profileFixerService: ProfileFixerService);
+ constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService);
/**
* Check an array of items and add an upd object to money items with a stack count of 1
* Single stack money items have no upd object and thus no StackObjectsCount, causing issues
diff --git a/Live/CWX_MasterKey/server/types/helpers/ItemHelper.d.ts b/Live/CWX_MasterKey/server/types/helpers/ItemHelper.d.ts
index fc88a46..9639923 100644
--- a/Live/CWX_MasterKey/server/types/helpers/ItemHelper.d.ts
+++ b/Live/CWX_MasterKey/server/types/helpers/ItemHelper.d.ts
@@ -5,12 +5,15 @@ import { IStaticAmmoDetails } from "../models/eft/common/tables/ILootBase";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
+import { ItemBaseClassService } from "../services/ItemBaseClassService";
import { LocaleService } from "../services/LocaleService";
+import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { MathUtil } from "../utils/MathUtil";
import { ObjectId } from "../utils/ObjectId";
import { RandomUtil } from "../utils/RandomUtil";
+import { HandbookHelper } from "./HandbookHelper";
declare class ItemHelper {
protected logger: ILogger;
protected hashUtil: HashUtil;
@@ -19,8 +22,11 @@ declare class ItemHelper {
protected objectId: ObjectId;
protected mathUtil: MathUtil;
protected databaseServer: DatabaseServer;
+ protected handbookHelper: HandbookHelper;
+ protected itemBaseClassService: ItemBaseClassService;
+ protected localisationService: LocalisationService;
protected localeService: LocaleService;
- constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, localeService: LocaleService);
+ constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, localisationService: LocalisationService, localeService: LocaleService);
/**
* Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash
* @param {string} tpl the template id / tpl
@@ -31,10 +37,17 @@ declare class ItemHelper {
* Check if the tpl / template Id provided is a descendent of the baseclass
*
* @param {string} tpl the item template id to check
- * @param {string} baseclassTpl the baseclass to check for
+ * @param {string} baseClassTpl the baseclass to check for
* @return {boolean} is the tpl a descendent?
*/
- isOfBaseclass(tpl: string, baseclassTpl: string): boolean;
+ isOfBaseclass(tpl: string, baseClassTpl: string): boolean;
+ /**
+ * Check if item has any of the supplied base clases
+ * @param tpl Item to check base classes of
+ * @param baseClassTpls base classes to check for
+ * @returns true if any supplied base classes match
+ */
+ isOfBaseclasses(tpl: string, baseClassTpls: string[]): boolean;
/**
* Returns the item price based on the handbook or as a fallback from the prices.json if the item is not
* found in the handbook. If the price can't be found at all return 0
@@ -179,7 +192,7 @@ declare class ItemHelper {
*/
replaceIDs(pmcData: IPmcData, items: Item[], insuredItems?: InsuredItem[], fastPanel?: any): any[];
/**
- * Recursivly loop down through an items hierarchy to see if any of the ids match the supplied list, return true if any do
+ * WARNING, SLOW. Recursivly loop down through an items hierarchy to see if any of the ids match the supplied list, return true if any do
* @param {string} tpl
* @param {Array} tplsToCheck
* @returns boolean
diff --git a/Live/CWX_MasterKey/server/types/helpers/PresetHelper.d.ts b/Live/CWX_MasterKey/server/types/helpers/PresetHelper.d.ts
index a469582..cea210e 100644
--- a/Live/CWX_MasterKey/server/types/helpers/PresetHelper.d.ts
+++ b/Live/CWX_MasterKey/server/types/helpers/PresetHelper.d.ts
@@ -5,8 +5,10 @@ export declare class PresetHelper {
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
protected lookup: Record;
+ protected defaultPresets: Record;
constructor(jsonUtil: JsonUtil, databaseServer: DatabaseServer);
hydratePresetStore(input: Record): void;
+ getDefaultPresets(): Record;
isPreset(id: string): boolean;
hasPreset(templateId: string): boolean;
getPreset(id: string): Preset;
diff --git a/Live/CWX_MasterKey/server/types/helpers/ProfileHelper.d.ts b/Live/CWX_MasterKey/server/types/helpers/ProfileHelper.d.ts
index 9c6560a..7c1b12a 100644
--- a/Live/CWX_MasterKey/server/types/helpers/ProfileHelper.d.ts
+++ b/Live/CWX_MasterKey/server/types/helpers/ProfileHelper.d.ts
@@ -5,7 +5,6 @@ import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNic
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer";
-import { FenceService } from "../services/FenceService";
import { ProfileSnapshotService } from "../services/ProfileSnapshotService";
import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil";
@@ -20,9 +19,13 @@ export declare class ProfileHelper {
protected databaseServer: DatabaseServer;
protected itemHelper: ItemHelper;
protected profileSnapshotService: ProfileSnapshotService;
- protected fenceService: FenceService;
- constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, fenceService: FenceService);
+ constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService);
resetProfileQuestCondition(sessionID: string, conditionId: string): void;
+ /**
+ * Get all profiles from server
+ * @returns Dictionary of profiles
+ */
+ getProfiles(): Record;
getCompleteProfile(sessionID: string): IPmcData[];
/**
* Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen
diff --git a/Live/CWX_MasterKey/server/types/helpers/QuestHelper.d.ts b/Live/CWX_MasterKey/server/types/helpers/QuestHelper.d.ts
index edbd2e1..6bd1444 100644
--- a/Live/CWX_MasterKey/server/types/helpers/QuestHelper.d.ts
+++ b/Live/CWX_MasterKey/server/types/helpers/QuestHelper.d.ts
@@ -10,6 +10,7 @@ import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { LocaleService } from "../services/LocaleService";
+import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil";
@@ -32,10 +33,11 @@ export declare class QuestHelper {
protected dialogueHelper: DialogueHelper;
protected profileHelper: ProfileHelper;
protected paymentHelper: PaymentHelper;
+ protected localisationService: LocalisationService;
protected traderHelper: TraderHelper;
protected configServer: ConfigServer;
protected questConfig: IQuestConfig;
- constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, configServer: ConfigServer);
+ constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, configServer: ConfigServer);
/**
* Get status of a quest by quest id
* @param pmcData Profile to search
@@ -66,12 +68,12 @@ export declare class QuestHelper {
* @param progressAmount Amount of skill points to add to skill
*/
rewardSkillPoints(sessionID: string, pmcData: IPmcData, output: IItemEventRouterResponse, skillName: string, progressAmount: number): void;
- getQuestLocale(questId: string): any;
/**
- * Debug Routine for showing some information on the
- * quest list in question.
+ * Get quest name by quest id
+ * @param questId id to get
+ * @returns
*/
- dumpQuests(quests: any): void;
+ getQuestNameFromLocale(questId: string): string;
/**
* Check if trader has sufficient loyalty to fullfill quest requirement
* @param questProperties Quest props
diff --git a/Live/CWX_MasterKey/server/types/helpers/RagfairOfferHelper.d.ts b/Live/CWX_MasterKey/server/types/helpers/RagfairOfferHelper.d.ts
index b73f786..95be986 100644
--- a/Live/CWX_MasterKey/server/types/helpers/RagfairOfferHelper.d.ts
+++ b/Live/CWX_MasterKey/server/types/helpers/RagfairOfferHelper.d.ts
@@ -46,7 +46,7 @@ export declare class RagfairOfferHelper {
protected ragfairConfig: IRagfairConfig;
protected questConfig: IQuestConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer);
- getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[];
+ getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[];
getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[];
/**
* Check if trader offers' BuyRestrictionMax value has been reached
@@ -64,5 +64,5 @@ export declare class RagfairOfferHelper {
protected getProfileOffers(sessionID: string): IRagfairOffer[];
protected deleteOfferByOfferId(sessionID: string, offerId: string): void;
protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse;
- isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean;
+ isDisplayableOffer(info: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean;
}
diff --git a/Live/CWX_MasterKey/server/types/helpers/RagfairSellHelper.d.ts b/Live/CWX_MasterKey/server/types/helpers/RagfairSellHelper.d.ts
index 91b8a20..60809b5 100644
--- a/Live/CWX_MasterKey/server/types/helpers/RagfairSellHelper.d.ts
+++ b/Live/CWX_MasterKey/server/types/helpers/RagfairSellHelper.d.ts
@@ -11,7 +11,21 @@ export declare class RagfairSellHelper {
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer);
- calculateSellChance(baseChancePercent: number, offerPriceRub: number, playerListedPriceRub: number): number;
+ /**
+ * Get the percent chance to sell an item based on its average listed price vs player chosen listing price
+ * @param baseChancePercent Base chance to sell item
+ * @param averageOfferPriceRub Price of average offer in roubles
+ * @param playerListedPriceRub Price player listed item for in roubles
+ * @returns percent value
+ */
+ calculateSellChance(baseChancePercent: number, averageOfferPriceRub: number, playerListedPriceRub: number): number;
+ /**
+ * Get percent chance to sell an item when price is below items average listing price
+ * @param playerListedPriceRub Price player listed item for in roubles
+ * @param averageOfferPriceRub Price of average offer in roubles
+ * @returns percent value
+ */
+ protected getSellMultiplierWhenPlayerPriceIsBelowAverageListingPrice(averageOfferPriceRub: number, playerListedPriceRub: number): number;
/**
* Determine if the offer being listed will be sold
* @param sellChancePercent chance item will sell
diff --git a/Live/CWX_MasterKey/server/types/helpers/RagfairServerHelper.d.ts b/Live/CWX_MasterKey/server/types/helpers/RagfairServerHelper.d.ts
index ec388d8..bfe6cc3 100644
--- a/Live/CWX_MasterKey/server/types/helpers/RagfairServerHelper.d.ts
+++ b/Live/CWX_MasterKey/server/types/helpers/RagfairServerHelper.d.ts
@@ -42,7 +42,7 @@ export declare class RagfairServerHelper {
protected isItemBlacklisted(itemTemplateId: string): boolean;
isTrader(userID: string): boolean;
isPlayer(userID: string): boolean;
- returnItems(sessionID: string, items: any[]): void;
+ returnItems(sessionID: string, items: Item[]): void;
calculateDynamicStackCount(tplId: string, isWeaponPreset: boolean): number;
/**
* Choose a currency at random with bias
diff --git a/Live/CWX_MasterKey/server/types/helpers/RepairHelper.d.ts b/Live/CWX_MasterKey/server/types/helpers/RepairHelper.d.ts
index 5b09320..9983d4d 100644
--- a/Live/CWX_MasterKey/server/types/helpers/RepairHelper.d.ts
+++ b/Live/CWX_MasterKey/server/types/helpers/RepairHelper.d.ts
@@ -15,7 +15,7 @@ export declare class RepairHelper {
protected repairConfig: IRepairConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, configServer: ConfigServer);
/**
- *
+ * Alter an items durability after a repair by trader/repair kit
* @param itemToRepair item to update durability details
* @param itemToRepairDetails db details of item to repair
* @param isArmor Is item being repaired a piece of armor
diff --git a/Live/CWX_MasterKey/server/types/helpers/TradeHelper.d.ts b/Live/CWX_MasterKey/server/types/helpers/TradeHelper.d.ts
index 2a8f0b7..218a461 100644
--- a/Live/CWX_MasterKey/server/types/helpers/TradeHelper.d.ts
+++ b/Live/CWX_MasterKey/server/types/helpers/TradeHelper.d.ts
@@ -6,8 +6,10 @@ import { Item, Upd } from "../models/eft/common/tables/IItem";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IProcessBuyTradeRequestData } from "../models/eft/trade/IProcessBuyTradeRequestData";
import { IProcessSellTradeRequestData } from "../models/eft/trade/IProcessSellTradeRequestData";
+import { ITraderConfig } from "../models/spt/config/ITraderConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { EventOutputHolder } from "../routers/EventOutputHolder";
+import { ConfigServer } from "../servers/ConfigServer";
import { RagfairServer } from "../servers/RagfairServer";
import { FenceService } from "../services/FenceService";
import { PaymentService } from "../services/PaymentService";
@@ -20,7 +22,9 @@ export declare class TradeHelper {
protected fenceService: FenceService;
protected inventoryHelper: InventoryHelper;
protected ragfairServer: RagfairServer;
- constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer);
+ protected configServer: ConfigServer;
+ protected traderConfig: ITraderConfig;
+ constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer, configServer: ConfigServer);
/**
* Buy item from flea or trader
* @param pmcData
diff --git a/Live/CWX_MasterKey/server/types/helpers/TraderAssortHelper.d.ts b/Live/CWX_MasterKey/server/types/helpers/TraderAssortHelper.d.ts
index 025efd6..c3915c6 100644
--- a/Live/CWX_MasterKey/server/types/helpers/TraderAssortHelper.d.ts
+++ b/Live/CWX_MasterKey/server/types/helpers/TraderAssortHelper.d.ts
@@ -7,7 +7,9 @@ import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { FenceService } from "../services/FenceService";
+import { LocalisationService } from "../services/LocalisationService";
import { TraderAssortService } from "../services/TraderAssortService";
+import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService";
import { JsonUtil } from "../utils/JsonUtil";
import { MathUtil } from "../utils/MathUtil";
import { TimeUtil } from "../utils/TimeUtil";
@@ -27,11 +29,13 @@ export declare class TraderAssortHelper {
protected ragfairAssortGenerator: RagfairAssortGenerator;
protected ragfairOfferGenerator: RagfairOfferGenerator;
protected traderAssortService: TraderAssortService;
+ protected localisationService: LocalisationService;
+ protected traderPurchasePersisterService: TraderPurchasePersisterService;
protected traderHelper: TraderHelper;
protected fenceService: FenceService;
protected configServer: ConfigServer;
protected traderConfig: ITraderConfig;
- constructor(logger: ILogger, jsonUtil: JsonUtil, mathUtil: MathUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, profileHelper: ProfileHelper, assortHelper: AssortHelper, paymentHelper: PaymentHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferGenerator: RagfairOfferGenerator, traderAssortService: TraderAssortService, traderHelper: TraderHelper, fenceService: FenceService, configServer: ConfigServer);
+ constructor(logger: ILogger, jsonUtil: JsonUtil, mathUtil: MathUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, profileHelper: ProfileHelper, assortHelper: AssortHelper, paymentHelper: PaymentHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferGenerator: RagfairOfferGenerator, traderAssortService: TraderAssortService, localisationService: LocalisationService, traderPurchasePersisterService: TraderPurchasePersisterService, traderHelper: TraderHelper, fenceService: FenceService, configServer: ConfigServer);
/**
* Get a traders assorts
* Can be used for returning ragfair / fence assorts
diff --git a/Live/CWX_MasterKey/server/types/helpers/TraderHelper.d.ts b/Live/CWX_MasterKey/server/types/helpers/TraderHelper.d.ts
index 0dc93e8..62a3492 100644
--- a/Live/CWX_MasterKey/server/types/helpers/TraderHelper.d.ts
+++ b/Live/CWX_MasterKey/server/types/helpers/TraderHelper.d.ts
@@ -8,6 +8,7 @@ import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer";
import { FenceService } from "../services/FenceService";
+import { LocalisationService } from "../services/LocalisationService";
import { PlayerService } from "../services/PlayerService";
import { TimeUtil } from "../utils/TimeUtil";
import { HandbookHelper } from "./HandbookHelper";
@@ -23,11 +24,12 @@ export declare class TraderHelper {
protected itemHelper: ItemHelper;
protected handbookHelper: HandbookHelper;
protected playerService: PlayerService;
+ protected localisationService: LocalisationService;
protected fenceService: FenceService;
protected timeUtil: TimeUtil;
protected configServer: ConfigServer;
protected traderConfig: ITraderConfig;
- constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer);
+ constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer);
getTrader(traderID: string, sessionID: string): ITraderBase;
getTraderAssortsById(traderId: string): ITraderAssort;
/**
@@ -53,19 +55,26 @@ export declare class TraderHelper {
getPurchasesData(traderID: string, sessionID: string): Record;
/**
* Should item be skipped when selling to trader according to its sell categories and other checks
- * @param pmcData
- * @param item
- * @param sellCategory
+ * @param pmcData Profile
+ * @param item Item to be checked is sellable to trader
+ * @param sellCategory categories trader will buy
+ * @param traderId Trader item is being checked can be sold to
* @returns true if should NOT be sold to trader
*/
- protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[]): boolean;
+ protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[], traderId: string): boolean;
/**
- * Can this weapon be sold to a trader with its current durabiltiy level
- * @param traderID
- * @param item
- * @returns boolean
+ * Check if item has durability so low it precludes it from being sold to the trader (inclusive)
+ * @param item Item to check durability of
+ * @param traderId Trader item is sold to
+ * @returns
*/
- protected isWeaponBelowTraderBuyDurability(traderID: string, item: Item): boolean;
+ protected itemIsBelowSellableDurabilityThreshhold(item: Item, traderId: string): boolean;
+ /**
+ * Get the percentage threshold value a trader will buy armor/weapons above
+ * @param traderId Trader to look up
+ * @returns percentage
+ */
+ protected getTraderDurabiltyPurchaseThreshold(traderId: string): number;
/**
* Get the price of an item and all of its attached children
* Take into account bonuses/adjsutments e.g. discounts
@@ -113,10 +122,22 @@ export declare class TraderHelper {
getTraderUpdateSeconds(traderId: string): number;
/**
* check if an item is allowed to be sold to a trader
- * @param traderFilters array of allowed categories
+ * @param categoriesTraderBuys array of allowed categories
* @param tplToCheck itemTpl of inventory
- * @returns boolean
+ * @returns boolean if item can be sold to trader
*/
- traderFilter(traderFilters: string[], tplToCheck: string): boolean;
+ doesTraderBuyItem(categoriesTraderBuys: string[], tplToCheck: string): boolean;
getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel;
+ /**
+ * Store the purchase of an assort from a trader in the player profile
+ * @param sessionID Session id
+ * @param newPurchaseDetails New item assort id + count
+ */
+ addTraderPurchasesToPlayerProfile(sessionID: string, newPurchaseDetails: {
+ items: {
+ item_id: string;
+ count: number;
+ }[];
+ tid: string;
+ }): void;
}
diff --git a/Live/CWX_MasterKey/server/types/loaders/PostDBModLoader.d.ts b/Live/CWX_MasterKey/server/types/loaders/PostDBModLoader.d.ts
index 5101b7b..87b60f9 100644
--- a/Live/CWX_MasterKey/server/types/loaders/PostDBModLoader.d.ts
+++ b/Live/CWX_MasterKey/server/types/loaders/PostDBModLoader.d.ts
@@ -4,7 +4,7 @@ import { PreAkiModLoader } from "./PreAkiModLoader";
export declare class PostDBModLoader implements OnLoad {
protected preAkiModLoader: PreAkiModLoader;
constructor(preAkiModLoader: PreAkiModLoader);
- onLoad(): void;
+ onLoad(): Promise;
getRoute(): string;
getModPath(mod: string): string;
protected executeMods(container: DependencyContainer): void;
diff --git a/Live/CWX_MasterKey/server/types/loaders/PreAkiModLoader.d.ts b/Live/CWX_MasterKey/server/types/loaders/PreAkiModLoader.d.ts
index f486a28..212aaf3 100644
--- a/Live/CWX_MasterKey/server/types/loaders/PreAkiModLoader.d.ts
+++ b/Live/CWX_MasterKey/server/types/loaders/PreAkiModLoader.d.ts
@@ -34,6 +34,7 @@ export declare class PreAkiModLoader implements IModLoader {
* @returns Array of mod names in load order
*/
getImportedModsNames(): string[];
+ getImportedModDetails(): Record;
getModPath(mod: string): string;
protected importClass(name: string, filepath: string, container: DependencyContainer): void;
protected importMods(): Promise;
diff --git a/Live/CWX_MasterKey/server/types/models/eft/common/tables/IBotType.d.ts b/Live/CWX_MasterKey/server/types/models/eft/common/tables/IBotType.d.ts
index 55b4bd9..e02d990 100644
--- a/Live/CWX_MasterKey/server/types/models/eft/common/tables/IBotType.d.ts
+++ b/Live/CWX_MasterKey/server/types/models/eft/common/tables/IBotType.d.ts
@@ -57,6 +57,10 @@ export interface ModsChances {
mod_pistol_grip: number;
mod_reciever: number;
mod_scope: number;
+ mod_scope_000: number;
+ mod_scope_001: number;
+ mod_scope_002: number;
+ mod_scope_003: number;
mod_sight_front: number;
mod_sight_rear: number;
mod_stock: number;
@@ -152,4 +156,4 @@ export interface Items {
SpecialLoot: string[];
TacticalVest: string[];
}
-export declare type Mods = Record>;
+export type Mods = Record>;
diff --git a/Live/CWX_MasterKey/server/types/models/eft/common/tables/IQuest.d.ts b/Live/CWX_MasterKey/server/types/models/eft/common/tables/IQuest.d.ts
index c5b1cb2..d538126 100644
--- a/Live/CWX_MasterKey/server/types/models/eft/common/tables/IQuest.d.ts
+++ b/Live/CWX_MasterKey/server/types/models/eft/common/tables/IQuest.d.ts
@@ -37,7 +37,7 @@ export interface Conditions {
export interface AvailableForConditions {
_parent: string;
_props: AvailableForProps;
- dynamicLocale: boolean;
+ dynamicLocale?: boolean;
}
export interface AvailableForProps {
id: string;
diff --git a/Live/CWX_MasterKey/server/types/models/eft/common/tables/IRepeatableQuests.d.ts b/Live/CWX_MasterKey/server/types/models/eft/common/tables/IRepeatableQuests.d.ts
index e23ec73..6a02958 100644
--- a/Live/CWX_MasterKey/server/types/models/eft/common/tables/IRepeatableQuests.d.ts
+++ b/Live/CWX_MasterKey/server/types/models/eft/common/tables/IRepeatableQuests.d.ts
@@ -25,7 +25,7 @@ export interface IPmcDataRepeatableQuest {
endTime: number;
changeRequirement: TChangeRequirementRecord;
}
-export declare type TChangeRequirementRecord = Record;
+export type TChangeRequirementRecord = Record;
export interface IChangeRequirement {
changeCost: IChangeCost[];
changeStandingCost: number;
diff --git a/Live/CWX_MasterKey/server/types/models/eft/common/tables/ITrader.d.ts b/Live/CWX_MasterKey/server/types/models/eft/common/tables/ITrader.d.ts
index 37b2d61..246a5b8 100644
--- a/Live/CWX_MasterKey/server/types/models/eft/common/tables/ITrader.d.ts
+++ b/Live/CWX_MasterKey/server/types/models/eft/common/tables/ITrader.d.ts
@@ -54,8 +54,9 @@ export interface Repair {
currency: string;
currency_coefficient: number;
excluded_category: string[];
+ /** Doesn't exist in client object */
excluded_id_list: any[];
- quality: string;
+ quality: number;
}
export interface ITraderAssort {
nextResupply: number;
diff --git a/Live/CWX_MasterKey/server/types/models/eft/dialog/IChatServer.d.ts b/Live/CWX_MasterKey/server/types/models/eft/dialog/IChatServer.d.ts
new file mode 100644
index 0000000..48cacc4
--- /dev/null
+++ b/Live/CWX_MasterKey/server/types/models/eft/dialog/IChatServer.d.ts
@@ -0,0 +1,16 @@
+export interface IChatServer {
+ _id: string;
+ RegistrationId: number;
+ VersionId: string;
+ Ip: string;
+ Port: number;
+ DateTime: number;
+ Chats: IChat[];
+ Regions: string[];
+ /** Possibly removed */
+ IsDeveloper?: boolean;
+}
+export interface IChat {
+ _id: string;
+ Members: number;
+}
diff --git a/Live/CWX_MasterKey/server/types/models/eft/dialog/IGetFriendListDataResponse.d.ts b/Live/CWX_MasterKey/server/types/models/eft/dialog/IGetFriendListDataResponse.d.ts
index 8a29319..f8d700c 100644
--- a/Live/CWX_MasterKey/server/types/models/eft/dialog/IGetFriendListDataResponse.d.ts
+++ b/Live/CWX_MasterKey/server/types/models/eft/dialog/IGetFriendListDataResponse.d.ts
@@ -1,7 +1,7 @@
import { MemberCategory } from "../../enums/MemberCategory";
export interface IGetFriendListDataResponse {
Friends: Friend[];
- Ignore: any[];
+ Ignore: string[];
InIgnoreList: string[];
}
export interface Friend {
diff --git a/Live/CWX_MasterKey/server/types/models/eft/game/IGameConfigResponse.d.ts b/Live/CWX_MasterKey/server/types/models/eft/game/IGameConfigResponse.d.ts
index eb37a39..e1b7587 100644
--- a/Live/CWX_MasterKey/server/types/models/eft/game/IGameConfigResponse.d.ts
+++ b/Live/CWX_MasterKey/server/types/models/eft/game/IGameConfigResponse.d.ts
@@ -7,11 +7,13 @@ export interface IGameConfigResponse {
activeProfileId: string;
backend: Backend;
utc_time: number;
+ /** Total in game time */
totalInGame: number;
reportAvailable: boolean;
twitchEventMember: boolean;
}
export interface Backend {
+ Lobby: string;
Trading: string;
Messaging: string;
Main: string;
diff --git a/Live/CWX_MasterKey/server/types/models/eft/hideout/IHideoutProduction.d.ts b/Live/CWX_MasterKey/server/types/models/eft/hideout/IHideoutProduction.d.ts
index ce878be..9295fb1 100644
--- a/Live/CWX_MasterKey/server/types/models/eft/hideout/IHideoutProduction.d.ts
+++ b/Live/CWX_MasterKey/server/types/models/eft/hideout/IHideoutProduction.d.ts
@@ -3,7 +3,7 @@ export interface IHideoutProduction {
areaType: number;
requirements: Requirement[];
productionTime: number;
- boosters: any;
+ boosters?: any;
endProduct: string;
continuous: boolean;
count: number;
diff --git a/Live/CWX_MasterKey/server/types/models/eft/insurance/IGetInsuranceCostResponseData.d.ts b/Live/CWX_MasterKey/server/types/models/eft/insurance/IGetInsuranceCostResponseData.d.ts
index bf209c6..4579fdb 100644
--- a/Live/CWX_MasterKey/server/types/models/eft/insurance/IGetInsuranceCostResponseData.d.ts
+++ b/Live/CWX_MasterKey/server/types/models/eft/insurance/IGetInsuranceCostResponseData.d.ts
@@ -1 +1 @@
-export declare type IGetInsuranceCostResponseData = Record>;
+export type IGetInsuranceCostResponseData = Record>;
diff --git a/Live/CWX_MasterKey/server/types/models/eft/inventory/IAddItemRequestData.d.ts b/Live/CWX_MasterKey/server/types/models/eft/inventory/IAddItemRequestData.d.ts
index 53db97a..61516d6 100644
--- a/Live/CWX_MasterKey/server/types/models/eft/inventory/IAddItemRequestData.d.ts
+++ b/Live/CWX_MasterKey/server/types/models/eft/inventory/IAddItemRequestData.d.ts
@@ -1,4 +1,9 @@
export interface IAddItemRequestData {
tid: string;
- items: any[];
+ items: AddItem[];
+}
+export interface AddItem {
+ count: number;
+ isPreset?: boolean;
+ item_id: string;
}
diff --git a/Live/CWX_MasterKey/server/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts b/Live/CWX_MasterKey/server/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts
index b45e459..6d7c190 100644
--- a/Live/CWX_MasterKey/server/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts
+++ b/Live/CWX_MasterKey/server/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts
@@ -16,7 +16,7 @@ export interface ToLocation {
export interface Container {
id: string;
container: string;
- location: Location | number;
+ location?: Location | number;
}
export interface Location {
x: number;
diff --git a/Live/CWX_MasterKey/server/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/Live/CWX_MasterKey/server/types/models/eft/itemEvent/IItemEventRouterBase.d.ts
index 60ab284..6b18df3 100644
--- a/Live/CWX_MasterKey/server/types/models/eft/itemEvent/IItemEventRouterBase.d.ts
+++ b/Live/CWX_MasterKey/server/types/models/eft/itemEvent/IItemEventRouterBase.d.ts
@@ -7,7 +7,7 @@ export interface IItemEventRouterBase {
warnings: Warning[];
profileChanges: TProfileChanges | "";
}
-export declare type TProfileChanges = Record;
+export type TProfileChanges = Record;
export interface Warning {
index: number;
errmsg: string;
diff --git a/Live/CWX_MasterKey/server/types/models/eft/launcher/IRemoveProfileData.d.ts b/Live/CWX_MasterKey/server/types/models/eft/launcher/IRemoveProfileData.d.ts
index d31c9ac..4cc5618 100644
--- a/Live/CWX_MasterKey/server/types/models/eft/launcher/IRemoveProfileData.d.ts
+++ b/Live/CWX_MasterKey/server/types/models/eft/launcher/IRemoveProfileData.d.ts
@@ -1,2 +1,2 @@
import { ILoginRequestData } from "./ILoginRequestData";
-export declare type IRemoveProfileData = ILoginRequestData;
+export type IRemoveProfileData = ILoginRequestData;
diff --git a/Live/CWX_MasterKey/server/types/models/eft/profile/IAkiProfile.d.ts b/Live/CWX_MasterKey/server/types/models/eft/profile/IAkiProfile.d.ts
index cf28c12..2cea0c8 100644
--- a/Live/CWX_MasterKey/server/types/models/eft/profile/IAkiProfile.d.ts
+++ b/Live/CWX_MasterKey/server/types/models/eft/profile/IAkiProfile.d.ts
@@ -11,6 +11,12 @@ export interface IAkiProfile {
vitality: Vitality;
inraid: Inraid;
insurance: Insurance[];
+ /** Assort purchases made by player since last trader refresh */
+ traderPurchases?: Record>;
+}
+export declare class TraderPurchaseData {
+ count: number;
+ purchaseTimestamp: number;
}
export interface Info {
id: string;
@@ -93,6 +99,13 @@ export interface DateTime {
}
export interface Aki {
version: string;
+ mods?: ModDetails[];
+}
+export interface ModDetails {
+ name: string;
+ version: string;
+ author: string;
+ dateAdded: number;
}
export interface Vitality {
health: Health;
diff --git a/Live/CWX_MasterKey/server/types/models/enums/BaseClasses.d.ts b/Live/CWX_MasterKey/server/types/models/enums/BaseClasses.d.ts
index 4eb6f7e..7d11510 100644
--- a/Live/CWX_MasterKey/server/types/models/enums/BaseClasses.d.ts
+++ b/Live/CWX_MasterKey/server/types/models/enums/BaseClasses.d.ts
@@ -8,6 +8,8 @@ export declare enum BaseClasses {
BACKPACK = "5448e53e4bdc2d60728b4567",
VISORS = "5448e5724bdc2ddf718b4568",
FOOD = "5448e8d04bdc2ddf718b4569",
+ GAS_BLOCK = "56ea9461d2720b67698b456f",
+ RAIL_COVER = "55818b1d4bdc2d5b648b4572",
DRINK = "5448e8d64bdc2dce718b4568",
BARTER_ITEM = "5448eb774bdc2d0a728b4567",
INFO = "5448ecbe4bdc2d60728b4568",
@@ -36,6 +38,7 @@ export declare enum BaseClasses {
THROW_WEAPON = "543be6564bdc2df4348b4568",
FOOD_DRINK = "543be6674bdc2df1348b4569",
PISTOL = "5447b5cf4bdc2d65278b4567",
+ REVOLVER = "617f1ef5e8b54b0998387733",
SMG = "5447b5e04bdc2d62278b4567",
ASSAULT_RIFLE = "5447b5f14bdc2d61278b4567",
ASSAULT_CARBINE = "5447b5fc4bdc2d87278b4567",
@@ -73,9 +76,10 @@ export declare enum BaseClasses {
TACTICAL_COMBO = "55818b164bdc2ddc698b456c",
FLASHLIGHT = "55818b084bdc2d5b648b4571",
MAGAZINE = "5448bc234bdc2d3c308b4569",
- LIGHT_LASER = "55818b0e4bdc2dde698b456e",
+ LIGHT_LASER_DESIGNATOR = "55818b0e4bdc2dde698b456e",
FLASH_HIDER = "550aa4bf4bdc2dd6348b456b",
COLLIMATOR = "55818ad54bdc2ddc698b4569",
+ IRON_SIGHT = "55818ac54bdc2d5b648b456e",
COMPACT_COLLIMATOR = "55818acf4bdc2dde698b456b",
COMPENSATOR = "550aa4af4bdc2dd4348b456e",
OPTIC_SCOPE = "55818ae44bdc2dde698b456c",
diff --git a/Live/CWX_MasterKey/server/types/models/enums/ExitStatis.d.ts b/Live/CWX_MasterKey/server/types/models/enums/ExitStatis.d.ts
new file mode 100644
index 0000000..78d9733
--- /dev/null
+++ b/Live/CWX_MasterKey/server/types/models/enums/ExitStatis.d.ts
@@ -0,0 +1,7 @@
+export declare enum ExitStatus {
+ SURVIVED = 0,
+ KILLED = 1,
+ LEFT = 2,
+ RUNNER = 3,
+ MISSINGINACTION = 4
+}
diff --git a/Live/CWX_MasterKey/server/types/models/external/HttpFramework.d.ts b/Live/CWX_MasterKey/server/types/models/external/HttpFramework.d.ts
index 3b4a56a..64a37d6 100644
--- a/Live/CWX_MasterKey/server/types/models/external/HttpFramework.d.ts
+++ b/Live/CWX_MasterKey/server/types/models/external/HttpFramework.d.ts
@@ -1,6 +1,6 @@
///
import { IncomingMessage, ServerResponse } from "http";
-export declare type HandleFn = (_: string, req: IncomingMessage, resp: ServerResponse) => void;
+export type HandleFn = (_: string, req: IncomingMessage, resp: ServerResponse) => void;
/**
* Associates handlers, HTTP methods and a base url to a listener using a proxy
* @param basePath The base path
diff --git a/Live/CWX_MasterKey/server/types/models/spt/bots/BotGenerationDetails.d.ts b/Live/CWX_MasterKey/server/types/models/spt/bots/BotGenerationDetails.d.ts
index 256de03..26571a2 100644
--- a/Live/CWX_MasterKey/server/types/models/spt/bots/BotGenerationDetails.d.ts
+++ b/Live/CWX_MasterKey/server/types/models/spt/bots/BotGenerationDetails.d.ts
@@ -3,6 +3,8 @@ export interface BotGenerationDetails {
isPmc: boolean;
/** assault/pmcBot etc */
role: string;
+ /** Side of bot */
+ side: string;
/** Active players current level */
playerLevel: number;
/** Delta of highest level of bot */
diff --git a/Live/CWX_MasterKey/server/types/models/spt/callbacks/IDataCallbacks.d.ts b/Live/CWX_MasterKey/server/types/models/spt/callbacks/IDataCallbacks.d.ts
index a098560..b4f4f8c 100644
--- a/Live/CWX_MasterKey/server/types/models/spt/callbacks/IDataCallbacks.d.ts
+++ b/Live/CWX_MasterKey/server/types/models/spt/callbacks/IDataCallbacks.d.ts
@@ -6,7 +6,6 @@ import { IHideoutProduction } from "../../eft/hideout/IHideoutProduction";
import { IHideoutScavCase } from "../../eft/hideout/IHideoutScavCase";
import { IHideoutSettingsBase } from "../../eft/hideout/IHideoutSettingsBase";
import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData";
-import { ILanguageBase } from "../server/ILocaleBase";
import { ISettingsBase } from "../server/ISettingsBase";
export interface IDataCallbacks {
getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData;
@@ -20,7 +19,7 @@ export interface IDataCallbacks {
getHideoutAreas(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData;
gethideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData;
getHideoutScavcase(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData;
- getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData;
+ getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>;
getLocalesMenu(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData;
getLocalesGlobal(url: string, info: IEmptyRequestData, sessionID: string): string;
}
diff --git a/Live/CWX_MasterKey/server/types/models/spt/config/IBotConfig.d.ts b/Live/CWX_MasterKey/server/types/models/spt/config/IBotConfig.d.ts
index 83897db..4b1a621 100644
--- a/Live/CWX_MasterKey/server/types/models/spt/config/IBotConfig.d.ts
+++ b/Live/CWX_MasterKey/server/types/models/spt/config/IBotConfig.d.ts
@@ -66,8 +66,10 @@ export interface LootNvalue {
}
export interface EquipmentFilters {
weaponModLimits: ModLimits;
+ weaponSightWhitelist: Record;
faceShieldIsActiveChancePercent?: number;
lightLaserIsActiveChancePercent?: number;
+ nvgIsActiveChancePercent?: number;
randomisation: RandomisationDetails[];
blacklist: EquipmentFilterDetails[];
whitelist: EquipmentFilterDetails[];
diff --git a/Live/CWX_MasterKey/server/types/models/spt/config/ILocationConfig.d.ts b/Live/CWX_MasterKey/server/types/models/spt/config/ILocationConfig.d.ts
index 0551d57..a012fae 100644
--- a/Live/CWX_MasterKey/server/types/models/spt/config/ILocationConfig.d.ts
+++ b/Live/CWX_MasterKey/server/types/models/spt/config/ILocationConfig.d.ts
@@ -1,8 +1,16 @@
+import { BossLocationSpawn, Wave } from "../../../models/eft/common/ILocationBase";
import { IBaseConfig } from "./IBaseConfig";
export interface ILocationConfig extends IBaseConfig {
kind: "aki-location";
looseLootMultiplier: LootMultiplier;
staticLootMultiplier: LootMultiplier;
+ customWaves: CustomWaves;
+ /** Open zones to add to map */
+ openZones: Record;
+}
+export interface CustomWaves {
+ boss: Record;
+ normal: Record;
}
export interface LootMultiplier {
bigmap: number;
diff --git a/Live/CWX_MasterKey/server/types/models/spt/config/IQuestConfig.d.ts b/Live/CWX_MasterKey/server/types/models/spt/config/IQuestConfig.d.ts
index 45c9aae..951f1a7 100644
--- a/Live/CWX_MasterKey/server/types/models/spt/config/IQuestConfig.d.ts
+++ b/Live/CWX_MasterKey/server/types/models/spt/config/IQuestConfig.d.ts
@@ -4,6 +4,7 @@ export interface IQuestConfig extends IBaseConfig {
kind: "aki-quest";
redeemTime: number;
repeatableQuests: IRepeatableQuestConfig[];
+ locationIdMap: Record;
bearOnlyQuests: string[];
usecOnlyQuests: string[];
}
diff --git a/Live/CWX_MasterKey/server/types/models/spt/config/ITraderConfig.d.ts b/Live/CWX_MasterKey/server/types/models/spt/config/ITraderConfig.d.ts
index 8342c99..b1ec484 100644
--- a/Live/CWX_MasterKey/server/types/models/spt/config/ITraderConfig.d.ts
+++ b/Live/CWX_MasterKey/server/types/models/spt/config/ITraderConfig.d.ts
@@ -1,10 +1,13 @@
+import { MinMax } from "../../../models/common/MinMax";
import { IBaseConfig } from "./IBaseConfig";
export interface ITraderConfig extends IBaseConfig {
kind: "aki-trader";
updateTime: UpdateTime[];
updateTimeDefault: number;
+ /** What % of max durability an item needs to sell to a trader*/
+ durabilityPurchaseThreshhold: Record;
traderPriceMultipler: number;
- minDurabilityForSale: number;
+ persistPurchaseDataInProfile: boolean;
fence: FenceConfig;
}
export interface UpdateTime {
@@ -17,6 +20,8 @@ export interface FenceConfig {
assortSize: number;
maxPresetsPercent: number;
presetPriceMult: number;
+ armorMaxDurabilityPercentMinMax: MinMax;
+ presetMaxDurabilityPercentMinMax: MinMax;
itemPriceMult: number;
regenerateAssortsOnRefresh: boolean;
itemTypeLimits: Record;
diff --git a/Live/CWX_MasterKey/server/types/models/spt/server/ILocaleBase.d.ts b/Live/CWX_MasterKey/server/types/models/spt/server/ILocaleBase.d.ts
index 6e20b89..3cdaf6f 100644
--- a/Live/CWX_MasterKey/server/types/models/spt/server/ILocaleBase.d.ts
+++ b/Live/CWX_MasterKey/server/types/models/spt/server/ILocaleBase.d.ts
@@ -1,49 +1,5 @@
export interface ILocaleBase {
- global: Record;
+ global: Record>;
menu: Record;
- languages: ILanguageBase[];
-}
-export interface ILocaleGlobalBase {
- interface: Record;
- enum: any[];
- mail: Record;
- quest: Record;
- preset: Record;
- handbook: Record;
- season: Record;
- customization: Record;
- repeatableQuest: Record;
- templates: Record;
- locations: Record;
- banners: Record;
- trading: Record;
-}
-export interface ILocaleQuest {
- name: string;
- description: string;
- note: string;
- failMessageText: string;
- startedMessageText: string;
- successMessageText: string;
- conditions: Record;
- location: string;
-}
-export interface ILocalePreset {
- Name: string;
-}
-export interface ILocaleProps {
- Name: string;
- ShortName: string;
- Description: string;
-}
-export interface ILocaleTradingProps {
- FullName: string;
- FirstName: string;
- Nickname: string;
- Location: string;
- Description: string;
-}
-export interface ILanguageBase {
- ShortName: string;
- Name: string;
+ languages: Record;
}
diff --git a/Live/CWX_MasterKey/server/types/models/spt/server/ISettingsBase.d.ts b/Live/CWX_MasterKey/server/types/models/spt/server/ISettingsBase.d.ts
index c067cda..625ad5c 100644
--- a/Live/CWX_MasterKey/server/types/models/spt/server/ISettingsBase.d.ts
+++ b/Live/CWX_MasterKey/server/types/models/spt/server/ISettingsBase.d.ts
@@ -11,6 +11,7 @@ export interface Config {
FramerateLimit: FramerateLimit;
GroupStatusInterval: number;
KeepAliveInterval: number;
+ LobbyKeepAliveInterval: number;
Mark502and504AsNonImportant: boolean;
MemoryManagementSettings: MemoryManagementSettings;
NVidiaHighlights: boolean;
@@ -18,7 +19,10 @@ export interface Config {
PingServerResultSendInterval: number;
PingServersInterval: number;
ReleaseProfiler: ReleaseProfiler;
+ RequestConfirmationTimeouts: number[];
+ RequestsMadeThroughLobby: string[];
SecondCycleDelaySeconds: number;
+ ShouldEstablishLobbyConnection: boolean;
TurnOffLogging: boolean;
WeaponOverlapDistanceCulling: number;
WebDiagnosticsEnabled: boolean;
diff --git a/Live/CWX_MasterKey/server/types/routers/ItemEventRouter.d.ts b/Live/CWX_MasterKey/server/types/routers/ItemEventRouter.d.ts
index e80d16c..a9338ab 100644
--- a/Live/CWX_MasterKey/server/types/routers/ItemEventRouter.d.ts
+++ b/Live/CWX_MasterKey/server/types/routers/ItemEventRouter.d.ts
@@ -1,14 +1,16 @@
-import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
-import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest";
-import { ProfileHelper } from "../helpers/ProfileHelper";
import { ItemEventRouterDefinition } from "../di/Router";
+import { ProfileHelper } from "../helpers/ProfileHelper";
+import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest";
+import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { ILogger } from "../models/spt/utils/ILogger";
+import { LocalisationService } from "../services/LocalisationService";
import { EventOutputHolder } from "./EventOutputHolder";
export declare class ItemEventRouter {
protected logger: ILogger;
protected profileHelper: ProfileHelper;
protected itemEventRouters: ItemEventRouterDefinition[];
+ protected localisationService: LocalisationService;
protected eventOutputHolder: EventOutputHolder;
- constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], eventOutputHolder: EventOutputHolder);
+ constructor(logger: ILogger, profileHelper: ProfileHelper, itemEventRouters: ItemEventRouterDefinition[], localisationService: LocalisationService, eventOutputHolder: EventOutputHolder);
handleEvents(info: IItemEventRouterRequest, sessionID: string): IItemEventRouterResponse;
}
diff --git a/Live/CWX_MasterKey/server/types/servers/RagfairServer.d.ts b/Live/CWX_MasterKey/server/types/servers/RagfairServer.d.ts
index c93864b..f49654a 100644
--- a/Live/CWX_MasterKey/server/types/servers/RagfairServer.d.ts
+++ b/Live/CWX_MasterKey/server/types/servers/RagfairServer.d.ts
@@ -4,6 +4,7 @@ import { TraderHelper } from "../helpers/TraderHelper";
import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger";
+import { LocalisationService } from "../services/LocalisationService";
import { RagfairCategoriesService } from "../services/RagfairCategoriesService";
import { RagfairOfferService } from "../services/RagfairOfferService";
import { RagfairRequiredItemsService } from "../services/RagfairRequiredItemsService";
@@ -14,13 +15,14 @@ export declare class RagfairServer {
protected ragfairOfferService: RagfairOfferService;
protected ragfairCategoriesService: RagfairCategoriesService;
protected ragfairRequiredItemsService: RagfairRequiredItemsService;
+ protected localisationService: LocalisationService;
protected traderHelper: TraderHelper;
protected traderAssortHelper: TraderAssortHelper;
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
- constructor(logger: ILogger, ragfairOfferGenerator: RagfairOfferGenerator, ragfairOfferService: RagfairOfferService, ragfairCategoriesService: RagfairCategoriesService, ragfairRequiredItemsService: RagfairRequiredItemsService, traderHelper: TraderHelper, traderAssortHelper: TraderAssortHelper, configServer: ConfigServer);
- load(): void;
- update(): void;
+ constructor(logger: ILogger, ragfairOfferGenerator: RagfairOfferGenerator, ragfairOfferService: RagfairOfferService, ragfairCategoriesService: RagfairCategoriesService, ragfairRequiredItemsService: RagfairRequiredItemsService, localisationService: LocalisationService, traderHelper: TraderHelper, traderAssortHelper: TraderAssortHelper, configServer: ConfigServer);
+ load(): Promise;
+ update(): Promise;
/**
* Get traders who need to be periodically refreshed
* @returns string array of traders
diff --git a/Live/CWX_MasterKey/server/types/services/BotEquipmentFilterService.d.ts b/Live/CWX_MasterKey/server/types/services/BotEquipmentFilterService.d.ts
index 43e64b0..ef3b504 100644
--- a/Live/CWX_MasterKey/server/types/services/BotEquipmentFilterService.d.ts
+++ b/Live/CWX_MasterKey/server/types/services/BotEquipmentFilterService.d.ts
@@ -24,6 +24,18 @@ export declare class BotEquipmentFilterService {
* @param baseValues Values to update
*/
protected adjustChances(equipmentChanges: Record, baseValues: EquipmentChances | ModsChances): void;
+ /**
+ * Get equipment settings for bot
+ * @param botEquipmentRole equipment role to return
+ * @returns EquipmentFilters object
+ */
+ getBotEquipmentSettings(botEquipmentRole: string): EquipmentFilters;
+ /**
+ * Get weapon sight whitelist for a specific bot type
+ * @param botEquipmentRole equipment role of bot to look up
+ * @returns Dictionary of weapon type and their whitelisted scope types
+ */
+ getBotWeaponSightWhitelist(botEquipmentRole: string): Record;
/**
* Get an object that contains equipment and cartridge blacklists for a specified bot type
* @param botRole Role of the bot we want the blacklist for
diff --git a/Live/CWX_MasterKey/server/types/services/BotEquipmentModPoolService.d.ts b/Live/CWX_MasterKey/server/types/services/BotEquipmentModPoolService.d.ts
new file mode 100644
index 0000000..adf59ff
--- /dev/null
+++ b/Live/CWX_MasterKey/server/types/services/BotEquipmentModPoolService.d.ts
@@ -0,0 +1,65 @@
+import { ItemHelper } from "../helpers/ItemHelper";
+import { Mods } from "../models/eft/common/tables/IBotType";
+import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
+import { IBotConfig } from "../models/spt/config/IBotConfig";
+import { ILogger } from "../models/spt/utils/ILogger";
+import { ConfigServer } from "../servers/ConfigServer";
+import { DatabaseServer } from "../servers/DatabaseServer";
+import { VFS } from "../utils/VFS";
+/** Store a mapping between weapons, their slots and the items that fit those slots */
+export declare class BotEquipmentModPoolService {
+ protected logger: ILogger;
+ protected vfs: VFS;
+ protected itemHelper: ItemHelper;
+ protected databaseServer: DatabaseServer;
+ protected configServer: ConfigServer;
+ protected botConfig: IBotConfig;
+ protected weaponModPool: Mods;
+ protected gearModPool: Mods;
+ protected weaponPoolGenerated: boolean;
+ protected armorPoolGenerated: boolean;
+ constructor(logger: ILogger, vfs: VFS, itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer);
+ /**
+ * Store dictionary of mods for each item passed in
+ * @param items items to find related mods and store in modPool
+ */
+ protected generatePool(items: ITemplateItem[], poolType: string): void;
+ /**
+ * Empty the mod pool
+ */
+ resetPool(): void;
+ /**
+ * Get array of compatible mods for an items mod slot (generate pool if it doesnt exist already)
+ * @param itemTpl item to look up
+ * @param slotName slot to get compatible mods for
+ * @returns tpls that fit the slot
+ */
+ getCompatibleModsForWeaponSlot(itemTpl: string, slotName: string): string[];
+ /**
+ * Get array of compatible mods for an items mod slot (generate pool if it doesnt exist already)
+ * @param itemTpl item to look up
+ * @param slotName slot to get compatible mods for
+ * @returns tpls that fit the slot
+ */
+ getCompatibleModsFoGearSlot(itemTpl: string, slotName: string): string[];
+ /**
+ * Get mods for a piece of gear by its tpl
+ * @param itemTpl items tpl to look up mods for
+ * @returns Dictionary of mods (keys are mod slot names) with array of compatible mod tpls as value
+ */
+ getModsForGearSlot(itemTpl: string): Record;
+ /**
+ * Get mods for a weapon by its tpl
+ * @param itemTpl Weapons tpl to look up mods for
+ * @returns Dictionary of mods (keys are mod slot names) with array of compatible mod tpls as value
+ */
+ getModsForWeaponSlot(itemTpl: string): Record;
+ /**
+ * Create weapon mod pool and set generated flag to true
+ */
+ protected generateWeaponPool(): void;
+ /**
+ * Create gear mod pool and set generated flag to true
+ */
+ protected generateGearPool(): void;
+}
diff --git a/Live/CWX_MasterKey/server/types/services/BotGenerationCacheService.d.ts b/Live/CWX_MasterKey/server/types/services/BotGenerationCacheService.d.ts
index 0be0576..a491b03 100644
--- a/Live/CWX_MasterKey/server/types/services/BotGenerationCacheService.d.ts
+++ b/Live/CWX_MasterKey/server/types/services/BotGenerationCacheService.d.ts
@@ -3,32 +3,34 @@ import { IBotBase } from "../models/eft/common/tables/IBotBase";
import { ILogger } from "../models/spt/utils/ILogger";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
+import { LocalisationService } from "./LocalisationService";
export declare class BotGenerationCacheService {
protected logger: ILogger;
protected randomUtil: RandomUtil;
protected jsonUtil: JsonUtil;
+ protected localisationService: LocalisationService;
protected botHelper: BotHelper;
protected storedBots: Map;
- constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, botHelper: BotHelper);
+ constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, localisationService: LocalisationService, botHelper: BotHelper);
/**
* Store array of bots in cache, shuffle results before storage
* @param botsToStore Bots we want to store in the cache
*/
- storeBots(botsToStore: IBotBase[]): void;
+ storeBots(key: string, botsToStore: IBotBase[]): void;
/**
* Find and return a bot based on its role
* Remove bot from internal array so it can't be retreived again
- * @param role role to retreive (assault/bossTagilla etc)
+ * @param key role to retreive (assault/bossTagilla etc)
* @returns IBotBase object
*/
- getBot(role: string): IBotBase;
+ getBot(key: string): IBotBase;
/**
* Remove all cached bot profiles
*/
clearStoredBots(): void;
/**
- * Does cache have bots
- * @returns true if empty
+ * Does cache have a bot with requested key
+ * @returns false if empty
*/
- cacheHasBotOfRole(role: string): boolean;
+ cacheHasBotOfRole(key: string): boolean;
}
diff --git a/Live/CWX_MasterKey/server/types/services/BotLootCacheService.d.ts b/Live/CWX_MasterKey/server/types/services/BotLootCacheService.d.ts
index 00ffb9c..dab7c6d 100644
--- a/Live/CWX_MasterKey/server/types/services/BotLootCacheService.d.ts
+++ b/Live/CWX_MasterKey/server/types/services/BotLootCacheService.d.ts
@@ -5,15 +5,17 @@ import { BotLootCache, LootCacheType } from "../models/spt/bots/BotLootCache";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { JsonUtil } from "../utils/JsonUtil";
+import { LocalisationService } from "./LocalisationService";
import { RagfairPriceService } from "./RagfairPriceService";
export declare class BotLootCacheService {
protected logger: ILogger;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
protected pmcLootGenerator: PMCLootGenerator;
+ protected localisationService: LocalisationService;
protected ragfairPriceService: RagfairPriceService;
protected lootCache: Record;
- constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, pmcLootGenerator: PMCLootGenerator, ragfairPriceService: RagfairPriceService);
+ constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, pmcLootGenerator: PMCLootGenerator, localisationService: LocalisationService, ragfairPriceService: RagfairPriceService);
/**
* Remove all cached bot loot data
*/
diff --git a/Live/CWX_MasterKey/server/types/services/BotWeaponModLimitService.d.ts b/Live/CWX_MasterKey/server/types/services/BotWeaponModLimitService.d.ts
new file mode 100644
index 0000000..f8ebc2f
--- /dev/null
+++ b/Live/CWX_MasterKey/server/types/services/BotWeaponModLimitService.d.ts
@@ -0,0 +1,54 @@
+import { ItemHelper } from "../helpers/ItemHelper";
+import { Item } from "../models/eft/common/tables/IItem";
+import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
+import { IBotConfig } from "../models/spt/config/IBotConfig";
+import { ILogger } from "../models/spt/utils/ILogger";
+import { ConfigServer } from "../servers/ConfigServer";
+export declare class BotModLimits {
+ scope: ItemCount;
+ scopeMax: number;
+ scopeBaseTypes: string[];
+ flashlightLaser: ItemCount;
+ flashlightLaserMax: number;
+ flashlgihtLaserBaseTypes: string[];
+}
+export declare class ItemCount {
+ count: number;
+}
+export declare class BotWeaponModLimitService {
+ protected logger: ILogger;
+ protected configServer: ConfigServer;
+ protected itemHelper: ItemHelper;
+ protected botConfig: IBotConfig;
+ constructor(logger: ILogger, configServer: ConfigServer, itemHelper: ItemHelper);
+ /**
+ * Initalise mod limits to be used when generating a weapon
+ * @param botRole "assault", "bossTagilla" or "pmc"
+ * @returns BotModLimits object
+ */
+ getWeaponModLimits(botRole: string): BotModLimits;
+ /**
+ * Check if weapon mod item is on limited list + has surpassed the limit set for it
+ * Exception: Always allow ncstar backup mount
+ * Exception: Always allow scopes with a scope for a parent
+ * Exception: Always disallow mounts that hold only scopes once scope limit reached
+ * Exception: Always disallow mounts that hold only flashlights once flashlight limit reached
+ * @param botRole role the bot has e.g. assault
+ * @param modTemplate mods template data
+ * @param modLimits limits set for weapon being generated for this bot
+ * @param modsParent The parent of the mod to be checked
+ * @returns true if over item limit
+ */
+ weaponModHasReachedLimit(botRole: string, modTemplate: ITemplateItem, modLimits: BotModLimits, modsParent: ITemplateItem, weapon: Item[]): boolean;
+ /**
+ * Check if the specific item type on the weapon has reached the set limit
+ * @param modTpl log mod tpl if over type limit
+ * @param currentCount current number of this item on gun
+ * @param maxLimit mod limit allowed
+ * @param botRole role of bot we're checking weapon of
+ * @returns true if limit reached
+ */
+ protected weaponModLimitReached(modTpl: string, currentCount: {
+ count: number;
+ }, maxLimit: number, botRole: string): boolean;
+}
diff --git a/Live/CWX_MasterKey/server/types/services/CustomLocationWaveService.d.ts b/Live/CWX_MasterKey/server/types/services/CustomLocationWaveService.d.ts
new file mode 100644
index 0000000..7d14f07
--- /dev/null
+++ b/Live/CWX_MasterKey/server/types/services/CustomLocationWaveService.d.ts
@@ -0,0 +1,42 @@
+import { BossLocationSpawn, Wave } from "../models/eft/common/ILocationBase";
+import { ILocationConfig } from "../models/spt/config/ILocationConfig";
+import { ILogger } from "../models/spt/utils/ILogger";
+import { ConfigServer } from "../servers/ConfigServer";
+import { DatabaseServer } from "../servers/DatabaseServer";
+import { JsonUtil } from "../utils/JsonUtil";
+import { RandomUtil } from "../utils/RandomUtil";
+export declare class CustomLocationWaveService {
+ protected logger: ILogger;
+ protected randomUtil: RandomUtil;
+ protected jsonUtil: JsonUtil;
+ protected databaseServer: DatabaseServer;
+ protected configServer: ConfigServer;
+ protected locationConfig: ILocationConfig;
+ constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, configServer: ConfigServer);
+ /**
+ * Add a boss wave to a map
+ * @param locationId e.g. factory4_day, bigmap
+ * @param waveToAdd Boss wave to add to map
+ */
+ addBossWaveToMap(locationId: string, waveToAdd: BossLocationSpawn): void;
+ /**
+ * Add a normal bot wave to a map
+ * @param locationId e.g. factory4_day, bigmap
+ * @param waveToAdd Wave to add to map
+ */
+ addNormalWaveToMap(locationId: string, waveToAdd: Wave): void;
+ /**
+ * Clear all custom boss waves from a map
+ * @param locationId e.g. factory4_day, bigmap
+ */
+ clearBossWavesForMap(locationId: string): void;
+ /**
+ * Clear all custom normal waves from a map
+ * @param locationId e.g. factory4_day, bigmap
+ */
+ clearNormalWavesForMap(locationId: string): void;
+ /**
+ * Add custom boss and normal waves to maps found in config/location.json to db
+ */
+ applyWaveChangesToAllMaps(): void;
+}
diff --git a/Live/CWX_MasterKey/server/types/services/FenceService.d.ts b/Live/CWX_MasterKey/server/types/services/FenceService.d.ts
index bdcdeb2..cb20500 100644
--- a/Live/CWX_MasterKey/server/types/services/FenceService.d.ts
+++ b/Live/CWX_MasterKey/server/types/services/FenceService.d.ts
@@ -15,6 +15,7 @@ import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil";
import { ItemFilterService } from "./ItemFilterService";
+import { LocalisationService } from "./LocalisationService";
/**
* Handle actions surrounding Fence
* e.g. generating or refreshing assorts / get next refresh time
@@ -30,11 +31,12 @@ export declare class FenceService {
protected itemHelper: ItemHelper;
protected presetHelper: PresetHelper;
protected itemFilterService: ItemFilterService;
+ protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected fenceAssort: ITraderAssort;
protected traderConfig: ITraderConfig;
protected nextMiniRefreshTimestamp: number;
- constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, configServer: ConfigServer);
+ constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, localisationService: LocalisationService, configServer: ConfigServer);
protected setFenceAssort(fenceAssort: ITraderAssort): void;
/**
* Get assorts player can purchase
@@ -91,9 +93,9 @@ export declare class FenceService {
*/
getOfferCount(): number;
/**
- * Create a trader assort for fence
+ * Create trader assorts for fence and store in fenceService cache
*/
- generateFenceAssortCache(): void;
+ generateFenceAssorts(): void;
/**
* Create skeleton to hold assort items
* @returns ITraderAssort object
diff --git a/Live/CWX_MasterKey/server/types/services/InsuranceService.d.ts b/Live/CWX_MasterKey/server/types/services/InsuranceService.d.ts
index 6be8a2f..9328b54 100644
--- a/Live/CWX_MasterKey/server/types/services/InsuranceService.d.ts
+++ b/Live/CWX_MasterKey/server/types/services/InsuranceService.d.ts
@@ -1,4 +1,5 @@
import { DialogueHelper } from "../helpers/DialogueHelper";
+import { HandbookHelper } from "../helpers/HandbookHelper";
import { SecureContainerHelper } from "../helpers/SecureContainerHelper";
import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
@@ -12,6 +13,7 @@ import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer";
import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil";
+import { LocalisationService } from "./LocalisationService";
export declare class InsuranceService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
@@ -21,14 +23,16 @@ export declare class InsuranceService {
protected saveServer: SaveServer;
protected traderHelper: TraderHelper;
protected dialogueHelper: DialogueHelper;
+ protected handbookHelper: HandbookHelper;
+ protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected insured: Record>;
protected insuranceConfig: IInsuranceConfig;
- constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, configServer: ConfigServer);
+ constructor(logger: ILogger, databaseServer: DatabaseServer, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, configServer: ConfigServer);
insuranceExists(sessionId: string): boolean;
insuranceTraderArrayExists(sessionId: string, traderId: string): boolean;
getInsurance(sessionId: string): Record;
- getInsuranceItems(sessionId: string, traderId: string): any[];
+ getInsuranceItems(sessionId: string, traderId: string): Item[];
resetInsurance(sessionId: string): void;
resetInsuranceTraderArray(sessionId: string, traderId: string): void;
addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: any): void;
diff --git a/Live/CWX_MasterKey/server/types/services/ItemBaseClassService.d.ts b/Live/CWX_MasterKey/server/types/services/ItemBaseClassService.d.ts
new file mode 100644
index 0000000..d7bc4bc
--- /dev/null
+++ b/Live/CWX_MasterKey/server/types/services/ItemBaseClassService.d.ts
@@ -0,0 +1,39 @@
+import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
+import { ILogger } from "../models/spt/utils/ILogger";
+import { DatabaseServer } from "../servers/DatabaseServer";
+import { LocalisationService } from "./LocalisationService";
+/**
+ * Cache the baseids for each item in the tiems db inside a dictionary
+ */
+export declare class ItemBaseClassService {
+ protected logger: ILogger;
+ protected localisationService: LocalisationService;
+ protected databaseServer: DatabaseServer;
+ protected itemBaseClassesCache: Record;
+ protected cacheGenerated: boolean;
+ constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer);
+ /**
+ * Create cache and store inside ItemBaseClassService
+ */
+ hydrateItemBaseClassCache(): void;
+ /**
+ * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary
+ * @param itemIdToUpdate item tpl to store base ids against in dictionary
+ * @param item item being checked
+ * @param allDbItems all items in db
+ */
+ protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void;
+ /**
+ * Does item tpl inherit from the requested base class
+ * @param itemTpl item to check base classes of
+ * @param baseClass base class to check for
+ * @returns true if item inherits from base class passed in
+ */
+ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean;
+ /**
+ * Get base classes item inherits from
+ * @param itemTpl item to get base classes for
+ * @returns array of base classes
+ */
+ getItemBaseClasses(itemTpl: string): string[];
+}
diff --git a/Live/CWX_MasterKey/server/types/services/LocaleService.d.ts b/Live/CWX_MasterKey/server/types/services/LocaleService.d.ts
index 8275b75..09c658b 100644
--- a/Live/CWX_MasterKey/server/types/services/LocaleService.d.ts
+++ b/Live/CWX_MasterKey/server/types/services/LocaleService.d.ts
@@ -1,5 +1,4 @@
import { ILocaleConfig } from "../models/spt/config/ILocaleConfig";
-import { ILocaleGlobalBase } from "../models/spt/server/ILocaleBase";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
@@ -14,9 +13,9 @@ export declare class LocaleService {
constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer);
/**
* Get the eft globals db file based on the configured locale in config/locale.json, if not found, fall back to 'en'
- * @returns ILocaleGlobalBase
+ * @returns dictionary
*/
- getLocaleDb(): ILocaleGlobalBase;
+ getLocaleDb(): Record;
/**
* Gets the game locale key from the locale.json file,
* if value is 'system' get system locale
diff --git a/Live/CWX_MasterKey/server/types/services/OpenZoneService.d.ts b/Live/CWX_MasterKey/server/types/services/OpenZoneService.d.ts
new file mode 100644
index 0000000..8e70b94
--- /dev/null
+++ b/Live/CWX_MasterKey/server/types/services/OpenZoneService.d.ts
@@ -0,0 +1,28 @@
+import { ILocationConfig } from "../models/spt/config/ILocationConfig";
+import { ILogger } from "../models/spt/utils/ILogger";
+import { ConfigServer } from "../servers/ConfigServer";
+import { DatabaseServer } from "../servers/DatabaseServer";
+import { JsonUtil } from "../utils/JsonUtil";
+import { RandomUtil } from "../utils/RandomUtil";
+import { LocalisationService } from "./LocalisationService";
+/** Service for adding new zones to a maps OpenZones property */
+export declare class OpenZoneService {
+ protected logger: ILogger;
+ protected randomUtil: RandomUtil;
+ protected jsonUtil: JsonUtil;
+ protected databaseServer: DatabaseServer;
+ protected localisationService: LocalisationService;
+ protected configServer: ConfigServer;
+ protected locationConfig: ILocationConfig;
+ constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, localisationService: LocalisationService, configServer: ConfigServer);
+ /**
+ * Add open zone to specified map
+ * @param locationId map location (e.g. factory4_day)
+ * @param zoneToAdd zone to add
+ */
+ addZoneToMap(locationId: string, zoneToAdd: string): void;
+ /**
+ * Add open zones to all maps found in config/location.json to db
+ */
+ applyZoneChangesToAllMaps(): void;
+}
diff --git a/Live/CWX_MasterKey/server/types/services/PaymentService.d.ts b/Live/CWX_MasterKey/server/types/services/PaymentService.d.ts
index c9ce95a..26f1952 100644
--- a/Live/CWX_MasterKey/server/types/services/PaymentService.d.ts
+++ b/Live/CWX_MasterKey/server/types/services/PaymentService.d.ts
@@ -60,9 +60,9 @@ export declare class PaymentService {
/**
* Prioritise player stash first over player inventory
* Post-raid healing would often take money out of the players pockets/secure container
- * @param a Firsat money stack item
+ * @param a First money stack item
* @param b Second money stack item
- * @returns sorted item
+ * @returns sort order
*/
- protected moneySort(a: Item, b: Item): number;
+ protected prioritiseStashSort(a: Item, b: Item): number;
}
diff --git a/Live/CWX_MasterKey/server/types/services/RagfairOfferService.d.ts b/Live/CWX_MasterKey/server/types/services/RagfairOfferService.d.ts
index 86c1e52..133e6a7 100644
--- a/Live/CWX_MasterKey/server/types/services/RagfairOfferService.d.ts
+++ b/Live/CWX_MasterKey/server/types/services/RagfairOfferService.d.ts
@@ -1,3 +1,4 @@
+import { RagfairOfferHolder } from "../utils/RagfairOfferHolder";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { RagfairServerHelper } from "../helpers/RagfairServerHelper";
import { Item } from "../models/eft/common/tables/IItem";
@@ -26,10 +27,9 @@ export declare class RagfairOfferService {
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected playerOffersLoaded: boolean;
- protected expiredOffers: Item[];
- /** offerId, offer */
- protected offers: Record;
+ protected expiredOffers: Record;
protected ragfairConfig: IRagfairConfig;
+ protected ragfairOfferHandler: RagfairOfferHolder;
constructor(logger: ILogger, timeUtil: TimeUtil, databaseServer: DatabaseServer, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, ragfairCategoriesService: RagfairCategoriesService, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer);
/**
* Get all offers
@@ -45,7 +45,7 @@ export declare class RagfairOfferService {
* Get an array of expired items not yet processed into new offers
* @returns items that need to be turned into offers
*/
- getExpiredOffers(): Item[];
+ getExpiredOfferItems(): Item[];
resetExpiredOffers(): void;
/**
* Does the offer exist on the ragfair
@@ -64,12 +64,6 @@ export declare class RagfairOfferService {
traderOffersNeedRefreshing(traderID: string): boolean;
addPlayerOffers(): void;
expireStaleOffers(): void;
- /**
- * Get an array of stale offers that are still shown to player
- * @returns IRagfairOffer array
- */
- protected getStaleOffers(): IRagfairOffer[];
- protected isStale(offer: IRagfairOffer, time: number): boolean;
protected processStaleOffer(staleOffer: IRagfairOffer): void;
protected returnPlayerOffer(offer: IRagfairOffer): IItemEventRouterResponse;
}
diff --git a/Live/CWX_MasterKey/server/types/services/RagfairPriceService.d.ts b/Live/CWX_MasterKey/server/types/services/RagfairPriceService.d.ts
index 4ac7794..cf0459c 100644
--- a/Live/CWX_MasterKey/server/types/services/RagfairPriceService.d.ts
+++ b/Live/CWX_MasterKey/server/types/services/RagfairPriceService.d.ts
@@ -11,6 +11,9 @@ import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { RandomUtil } from "../utils/RandomUtil";
import { OnLoad } from "../di/OnLoad";
+/**
+ * Stores flea prices for items as well as methods to interact with them
+ */
export declare class RagfairPriceService implements OnLoad {
protected handbookHelper: HandbookHelper;
protected databaseServer: DatabaseServer;
@@ -24,12 +27,18 @@ export declare class RagfairPriceService implements OnLoad {
protected generatedStaticPrices: boolean;
protected prices: IRagfairServerPrices;
constructor(handbookHelper: HandbookHelper, databaseServer: DatabaseServer, logger: ILogger, itemHelper: ItemHelper, presetHelper: PresetHelper, randomUtil: RandomUtil, configServer: ConfigServer);
- onLoad(): void;
+ /**
+ * Generate static (handbook) and dynamic (prices.json) flea prices, store inside class as dictionaries
+ */
+ onLoad(): Promise;
getRoute(): string;
/**
* Iterate over all items of type "Item" in db and get template price, store in cache
*/
generateStaticPrices(): void;
+ /**
+ * Create a dictionary and store prices from prices.json in it
+ */
protected generateDynamicPrices(): void;
/**
* Get the dynamic price for an item. If value doesn't exist, use static (handbook0) value.
@@ -51,6 +60,10 @@ export declare class RagfairPriceService implements OnLoad {
* @returns price in roubles
*/
getStaticPriceForItem(itemTpl: string): number;
+ /**
+ * Get prices for all items on flea, priorities dynamic prices from prices.json, use handbook prices if missing
+ * @returns Dictionary of item tpls and rouble cost
+ */
getAllFleaPrices(): Record;
/**
* Get the percentage difference between two values
@@ -59,7 +72,18 @@ export declare class RagfairPriceService implements OnLoad {
* @returns different in percent
*/
protected getPriceDifference(a: number, b: number): number;
+ /**
+ * Get the rouble price for an assorts barter scheme
+ * @param barterScheme
+ * @returns Rouble price
+ */
getBarterPrice(barterScheme: IBarterScheme[]): number;
+ /**
+ * Generate a currency cost for an item and its mods
+ * @param items Item with mods to get price for
+ * @param desiredCurrency Currency price desired in
+ * @returns cost of item in desired currency
+ */
getDynamicOfferPrice(items: Item[], desiredCurrency: string): number;
/**
* Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json
diff --git a/Live/CWX_MasterKey/server/types/services/RagfairRequiredItemsService.d.ts b/Live/CWX_MasterKey/server/types/services/RagfairRequiredItemsService.d.ts
index b05fc65..95c3ddb 100644
--- a/Live/CWX_MasterKey/server/types/services/RagfairRequiredItemsService.d.ts
+++ b/Live/CWX_MasterKey/server/types/services/RagfairRequiredItemsService.d.ts
@@ -7,6 +7,6 @@ export declare class RagfairRequiredItemsService {
protected ragfairOfferService: RagfairOfferService;
protected requiredItemsCache: {};
constructor(logger: ILogger, paymentHelper: PaymentHelper, ragfairOfferService: RagfairOfferService);
- getRequiredItems(searchId: string): any;
+ getRequiredItemsById(searchId: string): any;
buildRequiredItemTable(): void;
}
diff --git a/Live/CWX_MasterKey/server/types/services/SeasonalEventService.d.ts b/Live/CWX_MasterKey/server/types/services/SeasonalEventService.d.ts
new file mode 100644
index 0000000..ac765ff
--- /dev/null
+++ b/Live/CWX_MasterKey/server/types/services/SeasonalEventService.d.ts
@@ -0,0 +1,72 @@
+import { BotHelper } from "../helpers/BotHelper";
+import { Config } from "../models/eft/common/IGlobals";
+import { Inventory } from "../models/eft/common/tables/IBotType";
+import { ISeasonalEvent, ISeasonalEventConfig } from "../models/spt/config/ISeasonalEventConfig";
+import { ILogger } from "../models/spt/utils/ILogger";
+import { ConfigServer } from "../servers/ConfigServer";
+import { DatabaseServer } from "../servers/DatabaseServer";
+import { LocalisationService } from "./LocalisationService";
+export declare class SeasonalEventService {
+ protected logger: ILogger;
+ protected databaseServer: DatabaseServer;
+ protected localisationService: LocalisationService;
+ protected botHelper: BotHelper;
+ protected configServer: ConfigServer;
+ protected seasonalEventConfig: ISeasonalEventConfig;
+ constructor(logger: ILogger, databaseServer: DatabaseServer, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer);
+ protected get events(): Record;
+ protected get christmasEventItems(): string[];
+ /**
+ * Get an array of christmas items found in bots inventories as loot
+ * @returns array
+ */
+ getChristmasEventItems(): string[];
+ itemIsChristmasRelated(itemId: string): boolean;
+ /**
+ * is christmas event active
+ * @returns true if active
+ */
+ christmasEventEnabled(): boolean;
+ /**
+ * Is detection of seasonal events enabled (halloween / christmas)
+ * @returns true if seasonal events should be checked for
+ */
+ isAutomaticEventDetectionEnabled(): boolean;
+ /**
+ * Get a dictionary of gear changes to apply to bots for a specific event e.g. Christmas/Halloween
+ * @param eventName Name of event to get gear changes for
+ * @returns bots with equipment changes
+ */
+ protected getEventBotGear(eventName: string): Record>>;
+ /**
+ * Get the dates each seasonal event starts and ends at
+ * @returns Record with event name + start/end date
+ */
+ getEventDetails(): ISeasonalEvent[];
+ /**
+ * Check if current date falls inside any of the seasons events pased in, if so, handle them
+ */
+ checkForAndEnableSeasonalEvents(): void;
+ /**
+ * Iterate through bots inventory and loot to find and remove christmas items (as defined in SeasonalEventService)
+ * @param nodeInventory Bots inventory to iterate over
+ * @param botRole the role of the bot being processed
+ */
+ removeChristmasItemsFromBotInventory(nodeInventory: Inventory, botRole: string): void;
+ /**
+ * Make adjusted to server code based on the name of the event passed in
+ * @param globalConfig globals.json
+ * @param eventName Name of the event to enable. e.g. Christmas
+ */
+ protected updateGlobalEvents(globalConfig: Config, eventName: string): void;
+ /**
+ * Read in data from seasonalEvents.json and add found equipment items to bots
+ * @param eventName Name of the event to read equipment in from config
+ */
+ protected addEventGearToScavs(eventName: string): void;
+ protected addPumpkinsToScavBackpacks(): void;
+ /**
+ * Set Khorovod(dancing tree) chance to 100% on all maps that support it
+ */
+ protected enableDancingTree(): void;
+}
diff --git a/Live/CWX_MasterKey/server/types/services/TraderPurchasePersisterService.d.ts b/Live/CWX_MasterKey/server/types/services/TraderPurchasePersisterService.d.ts
new file mode 100644
index 0000000..7e7c88f
--- /dev/null
+++ b/Live/CWX_MasterKey/server/types/services/TraderPurchasePersisterService.d.ts
@@ -0,0 +1,34 @@
+import { ProfileHelper } from "../helpers/ProfileHelper";
+import { TraderPurchaseData } from "../models/eft/profile/IAkiProfile";
+import { ITraderConfig } from "../models/spt/config/ITraderConfig";
+import { ILogger } from "../models/spt/utils/ILogger";
+import { ConfigServer } from "../servers/ConfigServer";
+import { TimeUtil } from "../utils/TimeUtil";
+/**
+ * Help with storing limited item purchases from traders in profile to persist them over server restarts
+ */
+export declare class TraderPurchasePersisterService {
+ protected logger: ILogger;
+ protected timeUtil: TimeUtil;
+ protected profileHelper: ProfileHelper;
+ protected configServer: ConfigServer;
+ protected traderConfig: ITraderConfig;
+ constructor(logger: ILogger, timeUtil: TimeUtil, profileHelper: ProfileHelper, configServer: ConfigServer);
+ /**
+ * Get the purchases made from a trader for this profile before the last trader reset
+ * @param sessionId Session id
+ * @param traderId Trader to loop up purchases for
+ * @returns Dict of assort id and count purchased
+ */
+ getProfileTraderPurchases(sessionId: string, traderId: string): Record;
+ /**
+ * Remove all trader purchase records from all profiles that exist
+ * @param traderId Traders id
+ */
+ resetTraderPurchasesStoredInProfile(traderId: string): void;
+ /**
+ * Iterate over all server profiles and remove specific trader purchase data that has passed the trader refesh time
+ * @param traderId Trader id
+ */
+ removeStalePurchasesFromProfiles(traderId: string): void;
+}
diff --git a/Live/CWX_MasterKey/server/types/services/mod/onLoad/OnLoadMod.d.ts b/Live/CWX_MasterKey/server/types/services/mod/onLoad/OnLoadMod.d.ts
index 53fb062..82909c3 100644
--- a/Live/CWX_MasterKey/server/types/services/mod/onLoad/OnLoadMod.d.ts
+++ b/Live/CWX_MasterKey/server/types/services/mod/onLoad/OnLoadMod.d.ts
@@ -3,6 +3,6 @@ export declare class OnLoadMod extends OnLoad {
private onLoadOverride;
private getRouteOverride;
constructor(onLoadOverride: () => void, getRouteOverride: () => string);
- onLoad(): void;
+ onLoad(): Promise;
getRoute(): string;
}
diff --git a/Live/CWX_MasterKey/server/types/services/mod/onUpdate/OnUpdateMod.d.ts b/Live/CWX_MasterKey/server/types/services/mod/onUpdate/OnUpdateMod.d.ts
index ee89043..edd2a2c 100644
--- a/Live/CWX_MasterKey/server/types/services/mod/onUpdate/OnUpdateMod.d.ts
+++ b/Live/CWX_MasterKey/server/types/services/mod/onUpdate/OnUpdateMod.d.ts
@@ -3,6 +3,6 @@ export declare class OnUpdateMod extends OnUpdate {
private onUpdateOverride;
private getRouteOverride;
constructor(onUpdateOverride: (timeSinceLastRun: number) => boolean, getRouteOverride: () => string);
- onUpdate(timeSinceLastRun: number): boolean;
+ onUpdate(timeSinceLastRun: number): Promise;
getRoute(): string;
}
diff --git a/Live/CWX_MasterKey/server/types/utils/App.d.ts b/Live/CWX_MasterKey/server/types/utils/App.d.ts
index cc8a5af..b947c83 100644
--- a/Live/CWX_MasterKey/server/types/utils/App.d.ts
+++ b/Live/CWX_MasterKey/server/types/utils/App.d.ts
@@ -11,7 +11,7 @@ export declare class App {
protected onUpdateComponents: OnUpdate[];
protected onUpdateLastRun: {};
constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]);
- load(): void;
- protected update(onUpdateComponents: OnUpdate[]): void;
+ load(): Promise;
+ protected update(onUpdateComponents: OnUpdate[]): Promise;
protected logUpdateException(err: any, updateable: OnUpdate): void;
}
diff --git a/Live/CWX_MasterKey/server/types/utils/DatabaseImporter.d.ts b/Live/CWX_MasterKey/server/types/utils/DatabaseImporter.d.ts
index 31670ae..0c39aa8 100644
--- a/Live/CWX_MasterKey/server/types/utils/DatabaseImporter.d.ts
+++ b/Live/CWX_MasterKey/server/types/utils/DatabaseImporter.d.ts
@@ -14,13 +14,24 @@ export declare class DatabaseImporter extends OnLoad {
protected databaseServer: DatabaseServer;
protected imageRouter: ImageRouter;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, localisationService: LocalisationService, databaseServer: DatabaseServer, imageRouter: ImageRouter);
- onLoad(): void;
+ onLoad(): Promise;
/**
* Read all json files in database folder and map into a json object
* @param filepath path to database folder
*/
- protected hydrateDatabase(filepath: string): void;
+ protected hydrateDatabase(filepath: string): Promise;
getRoute(): string;
+ /**
+ * Load files into js objects recursively (asynchronous)
+ * @param filepath Path to folder with files
+ * @returns
+ */
+ loadRecursiveAsync(filepath: string): Promise;
+ /**
+ * Load files into js objects recursively (synchronous)
+ * @param filepath Path to folder with files
+ * @returns
+ */
loadRecursive(filepath: string): IDatabaseTables;
loadImages(filepath: string): void;
}
diff --git a/Live/CWX_MasterKey/server/types/utils/JsonUtil.d.ts b/Live/CWX_MasterKey/server/types/utils/JsonUtil.d.ts
index 71e95f6..2591142 100644
--- a/Live/CWX_MasterKey/server/types/utils/JsonUtil.d.ts
+++ b/Live/CWX_MasterKey/server/types/utils/JsonUtil.d.ts
@@ -6,6 +6,7 @@ export declare class JsonUtil {
protected hashUtil: HashUtil;
protected logger: ILogger;
protected fileHashes: any;
+ protected jsonCacheExists: boolean;
constructor(vfs: VFS, hashUtil: HashUtil, logger: ILogger);
/**
* From object to string
diff --git a/Live/CWX_MasterKey/server/types/utils/RagfairOfferHolder.d.ts b/Live/CWX_MasterKey/server/types/utils/RagfairOfferHolder.d.ts
new file mode 100644
index 0000000..46d9e23
--- /dev/null
+++ b/Live/CWX_MasterKey/server/types/utils/RagfairOfferHolder.d.ts
@@ -0,0 +1,24 @@
+import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer";
+export declare class RagfairOfferHolder {
+ private offersById;
+ private offersByTemplate;
+ private offersByTrader;
+ constructor();
+ getOfferById(id: string): IRagfairOffer;
+ getOffersByTemplate(templateId: string): Array;
+ getOffersByTrader(traderId: string): Array;
+ getOffers(): Array;
+ addOffers(offers: Array): void;
+ addOffer(offer: IRagfairOffer): void;
+ removeOffer(offer: IRagfairOffer): void;
+ removeOffers(offers: Array): void;
+ removeOfferByTrader(traderId: string): void;
+ /**
+ * Get an array of stale offers that are still shown to player
+ * @returns IRagfairOffer array
+ */
+ getStaleOffers(time: number): Array;
+ private addOfferByTemplates;
+ private addOfferByTrader;
+ protected isStale(offer: IRagfairOffer, time: number): boolean;
+}
diff --git a/Live/CWX_MasterKey/server/types/utils/Watermark.d.ts b/Live/CWX_MasterKey/server/types/utils/Watermark.d.ts
index e02eba2..f870cf1 100644
--- a/Live/CWX_MasterKey/server/types/utils/Watermark.d.ts
+++ b/Live/CWX_MasterKey/server/types/utils/Watermark.d.ts
@@ -30,7 +30,11 @@ export declare class Watermark {
* @returns string
*/
getVersionTag(withEftVersion?: boolean): string;
- getVersionLabel(): string;
+ /**
+ * Get text shown in game on screen, can't be translated as it breaks bsgs client when certian characters are used
+ * @returns string
+ */
+ getInGameVersionLabel(): string;
/** Set window title */
setTitle(): void;
/** Reset console cursor to top */
diff --git a/Live/CWX_WeatherPatcher/CWX_WeatherPatcher 2.4.7/BepInEx/plugins/CWX-WeatherPatcher.dll b/Live/CWX_WeatherPatcher/CWX_WeatherPatcher 2.4.7/BepInEx/plugins/CWX-WeatherPatcher.dll
deleted file mode 100644
index 6fe37cc..0000000
Binary files a/Live/CWX_WeatherPatcher/CWX_WeatherPatcher 2.4.7/BepInEx/plugins/CWX-WeatherPatcher.dll and /dev/null differ
diff --git a/Live/CWX_WeatherPatcher/CWX_WeatherPatcher 2.4.8/BepInEx/plugins/CWX-WeatherPatcher.dll b/Live/CWX_WeatherPatcher/CWX_WeatherPatcher 2.4.8/BepInEx/plugins/CWX-WeatherPatcher.dll
new file mode 100644
index 0000000..3239931
Binary files /dev/null and b/Live/CWX_WeatherPatcher/CWX_WeatherPatcher 2.4.8/BepInEx/plugins/CWX-WeatherPatcher.dll differ
diff --git a/Live/CWX_WeatherPatcher/CWX_WeatherPatcher.csproj b/Live/CWX_WeatherPatcher/CWX_WeatherPatcher.csproj
index e3bd319..fb49176 100644
--- a/Live/CWX_WeatherPatcher/CWX_WeatherPatcher.csproj
+++ b/Live/CWX_WeatherPatcher/CWX_WeatherPatcher.csproj
@@ -3,7 +3,7 @@
net472
CWX-WeatherPatcher
- 2.4.6
+ 2.4.8
@@ -19,6 +19,9 @@
..\..\..\Shared\BepInEx\BepInEx.dll
+
+ ..\..\..\Shared\EFT\Comfort.dll
+
..\..\..\Shared\EFT\UnityEngine.dll
diff --git a/Live/CWX_WeatherPatcher/GameWorldPatch.cs b/Live/CWX_WeatherPatcher/GameWorldPatch.cs
index 5faa3b4..95a11ce 100644
--- a/Live/CWX_WeatherPatcher/GameWorldPatch.cs
+++ b/Live/CWX_WeatherPatcher/GameWorldPatch.cs
@@ -1,6 +1,7 @@
using System.Reflection;
using Aki.Reflection.Patching;
using EFT;
+using UnityEngine;
namespace CWX_WeatherPatcher
{
@@ -14,6 +15,7 @@ namespace CWX_WeatherPatcher
[PatchPostfix]
private static void PatchPostFix()
{
+ Debug.LogError("logging for gameworld patch");
WeatherPatcher.Fix();
}
}
diff --git a/Live/CWX_WeatherPatcher/WeatherPatcher.cs b/Live/CWX_WeatherPatcher/WeatherPatcher.cs
index 02532c9..facd787 100644
--- a/Live/CWX_WeatherPatcher/WeatherPatcher.cs
+++ b/Live/CWX_WeatherPatcher/WeatherPatcher.cs
@@ -3,7 +3,7 @@ using EFT.Weather;
namespace CWX_WeatherPatcher
{
- [BepInPlugin("com.CWX.WeatherPatcher", "CWX-WeatherPatcher", "2.4.6")]
+ [BepInPlugin("com.CWX.WeatherPatcher", "CWX-WeatherPatcher", "2.4.8")]
public class WeatherPatcher : BaseUnityPlugin
{
private void Awake()