diff --git a/TypeScript/1LogToConsole/types/context/ApplicationContext.d.ts b/TypeScript/1LogToConsole/types/context/ApplicationContext.d.ts index a155bcd..28bbdf7 100644 --- a/TypeScript/1LogToConsole/types/context/ApplicationContext.d.ts +++ b/TypeScript/1LogToConsole/types/context/ApplicationContext.d.ts @@ -3,6 +3,15 @@ import { ContextVariableType } from "./ContextVariableType"; export declare class ApplicationContext { private variables; private static holderMaxSize; + /** + * Called like: + * + * const registerPlayerInfo = this.applicationContext.getLatestValue(ContextVariableType.REGISTER_PLAYER_REQUEST).getValue(); + * + * const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.MATCH_INFO).getValue(); + * @param type + * @returns + */ getLatestValue(type: ContextVariableType): ContextVariable; getValues(type: ContextVariableType): ContextVariable[]; addValue(type: ContextVariableType, value: any): void; diff --git a/TypeScript/1LogToConsole/types/context/ContextVariableType.d.ts b/TypeScript/1LogToConsole/types/context/ContextVariableType.d.ts index a7dd9b5..fa5390f 100644 --- a/TypeScript/1LogToConsole/types/context/ContextVariableType.d.ts +++ b/TypeScript/1LogToConsole/types/context/ContextVariableType.d.ts @@ -4,5 +4,7 @@ export declare enum ContextVariableType { /** Currently acive raid information */ MATCH_INFO = 1, /** Timestamp when client first connected */ - CLIENT_START_TIMESTAMP = 2 + CLIENT_START_TIMESTAMP = 2, + /** When player is loading into map and loot is requested */ + REGISTER_PLAYER_REQUEST = 3 } diff --git a/TypeScript/1LogToConsole/types/controllers/InraidController.d.ts b/TypeScript/1LogToConsole/types/controllers/InraidController.d.ts index 39a6396..f954eff 100644 --- a/TypeScript/1LogToConsole/types/controllers/InraidController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/InraidController.d.ts @@ -1,3 +1,4 @@ +import { ApplicationContext } from "../context/ApplicationContext"; import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; import { HealthHelper } from "../helpers/HealthHelper"; import { InRaidHelper } from "../helpers/InRaidHelper"; @@ -35,12 +36,13 @@ export declare class InraidController { protected traderHelper: TraderHelper; protected insuranceService: InsuranceService; protected inRaidHelper: InRaidHelper; + protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected airdropConfig: IAirdropConfig; protected inraidConfig: IInRaidConfig; - constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, configServer: ConfigServer); + constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer); /** - * Save locationid to active profiles inraid object + * Save locationId to active profiles inraid object AND app context * @param sessionID Session id * @param info Register player request */ diff --git a/TypeScript/1LogToConsole/types/helpers/PresetHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/PresetHelper.d.ts index a469582..cea210e 100644 --- a/TypeScript/1LogToConsole/types/helpers/PresetHelper.d.ts +++ b/TypeScript/1LogToConsole/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/TypeScript/1LogToConsole/types/helpers/TradeHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/TradeHelper.d.ts index 218a461..94ec382 100644 --- a/TypeScript/1LogToConsole/types/helpers/TradeHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/TradeHelper.d.ts @@ -37,7 +37,7 @@ export declare class TradeHelper { buyItem(pmcData: IPmcData, buyRequestData: IProcessBuyTradeRequestData, sessionID: string, foundInRaid: boolean, upd: Upd): IItemEventRouterResponse; /** * Sell item to trader - * @param pmcData + * @param pmcData Profile to update * @param body * @param sessionID * @returns diff --git a/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts index a6b79b0..b1ec484 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts @@ -1,3 +1,4 @@ +import { MinMax } from "../../../models/common/MinMax"; import { IBaseConfig } from "./IBaseConfig"; export interface ITraderConfig extends IBaseConfig { kind: "aki-trader"; @@ -19,6 +20,8 @@ export interface FenceConfig { assortSize: number; maxPresetsPercent: number; presetPriceMult: number; + armorMaxDurabilityPercentMinMax: MinMax; + presetMaxDurabilityPercentMinMax: MinMax; itemPriceMult: number; regenerateAssortsOnRefresh: boolean; itemTypeLimits: Record;