3.2.1 update
This commit is contained in:
parent
3586f650d2
commit
cdba0e1ecc
@ -4,7 +4,7 @@
|
||||
"main": "src/mod.js",
|
||||
"license": "MIT",
|
||||
"author": "Chomp",
|
||||
"akiVersion": "3.1.1",
|
||||
"akiVersion": "3.2.1",
|
||||
"scripts": {
|
||||
"setup:environment": "npm i",
|
||||
"build:unzipped": "copyfiles -e \"./node_modules/**/*.*\" -e \"./dist/**/*.*\" -e \"./package-lock.json\" -e \"./tsconfig.json\" -e \"./README.txt\" -e \"./mod.code-workspace\" \"./**/*.*\" ./dist",
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { InsuranceController } from "../controllers/InsuranceController";
|
||||
import { OnLoadOnUpdate } from "../di/OnLoadOnUpdate";
|
||||
import { OnUpdate } from "../di/OnUpdate";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { IGetInsuranceCostRequestData } from "../models/eft/insurance/IGetInsuranceCostRequestData";
|
||||
@ -10,14 +10,13 @@ import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { InsuranceService } from "../services/InsuranceService";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
export declare class InsuranceCallbacks extends OnLoadOnUpdate {
|
||||
export declare class InsuranceCallbacks extends OnUpdate {
|
||||
protected insuranceController: InsuranceController;
|
||||
protected insuranceService: InsuranceService;
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected configServer: ConfigServer;
|
||||
protected insuranceConfig: IInsuranceConfig;
|
||||
constructor(insuranceController: InsuranceController, insuranceService: InsuranceService, httpResponse: HttpResponseUtil, configServer: ConfigServer);
|
||||
onLoad(): void;
|
||||
getInsuranceCost(url: string, info: IGetInsuranceCostRequestData, sessionID: string): IGetBodyResponseData<IGetInsuranceCostResponseData>;
|
||||
insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
onUpdate(secondsSinceLastRun: number): boolean;
|
||||
|
@ -9,10 +9,10 @@ export declare class TraderCallbacks extends OnLoadOnUpdate {
|
||||
protected traderController: TraderController;
|
||||
constructor(httpResponse: HttpResponseUtil, traderController: TraderController);
|
||||
onLoad(): void;
|
||||
onUpdate(): boolean;
|
||||
getRoute(): string;
|
||||
getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase[]>;
|
||||
getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, IBarterScheme[][]>>;
|
||||
getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase>;
|
||||
getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderAssort>;
|
||||
onUpdate(): boolean;
|
||||
}
|
||||
|
@ -25,4 +25,5 @@ export declare class GameController {
|
||||
protected logProfileDetails(fullProfile: IAkiProfile): void;
|
||||
getGameConfig(sessionID: string): IGameConfigResponse;
|
||||
getServer(): any[];
|
||||
getValidGameVersion(): any;
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ import { HashUtil } from "../utils/HashUtil";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
export declare class HideoutController {
|
||||
protected logger: ILogger;
|
||||
protected hashUtil: HashUtil;
|
||||
@ -45,9 +46,10 @@ export declare class HideoutController {
|
||||
protected hideoutHelper: HideoutHelper;
|
||||
protected scavCaseRewardGenerator: ScavCaseRewardGenerator;
|
||||
protected configServer: ConfigServer;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected static nameBackendCountersCrafting: string;
|
||||
protected hideoutConfig: IHideoutConfig;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil);
|
||||
upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
|
@ -5,9 +5,11 @@ import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { QuestHelper } from "../helpers/QuestHelper";
|
||||
import { TraderHelper } from "../helpers/TraderHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData";
|
||||
import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData";
|
||||
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
@ -15,6 +17,7 @@ import { InsuranceService } from "../services/InsuranceService";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class InraidController {
|
||||
protected logger: ILogger;
|
||||
protected saveServer: SaveServer;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
@ -29,7 +32,7 @@ export declare class InraidController {
|
||||
protected inRaidHelper: InRaidHelper;
|
||||
protected configServer: ConfigServer;
|
||||
protected inraidConfig: IInRaidConfig;
|
||||
constructor(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, configServer: ConfigServer);
|
||||
addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void;
|
||||
saveProgress(offraidData: ISaveProgressRequestData, sessionID: string): void;
|
||||
/**
|
||||
@ -38,7 +41,7 @@ export declare class InraidController {
|
||||
* @param pmcData player profile
|
||||
* @param isPlayerScav Was the player a pScav
|
||||
*/
|
||||
private markOrRemoveFoundInRaidItems;
|
||||
private handlePostRaidPlayerScavProcess;
|
||||
private handlePostRaidPlayerScavKarmaChanges;
|
||||
protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void;
|
||||
protected handlePostRaidPlayerScavProcess(scavData: IPmcData, sessionID: string, offraidData: ISaveProgressRequestData, pmcData: IPmcData, isDead: boolean): void;
|
||||
protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData, sessionID: string): void;
|
||||
}
|
||||
|
@ -11,21 +11,25 @@ import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult";
|
||||
import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData";
|
||||
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
|
||||
import { IMatchConfig } from "../models/spt/config/IMatchConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { BotLootCacheService } from "../services/BotLootCacheService";
|
||||
import { MatchLocationService } from "../services/MatchLocationService";
|
||||
import { ProfileSnapshotService } from "../services/ProfileSnapshotService";
|
||||
export declare class MatchController {
|
||||
protected logger: ILogger;
|
||||
protected saveServer: SaveServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected matchLocationService: MatchLocationService;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected botLootCacheService: BotLootCacheService;
|
||||
protected configServer: ConfigServer;
|
||||
protected profileSnapshotService: ProfileSnapshotService;
|
||||
protected applicationContext: ApplicationContext;
|
||||
protected matchConfig: IMatchConfig;
|
||||
protected inraidConfig: IInRaidConfig;
|
||||
constructor(saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, applicationContext: ApplicationContext);
|
||||
constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, applicationContext: ApplicationContext);
|
||||
getEnabled(): boolean;
|
||||
getProfile(info: IGetProfileRequestData): IPmcData[];
|
||||
createGroup(sessionID: string, info: ICreateGroupRequestData): any;
|
||||
|
@ -17,10 +17,25 @@ export declare class TraderController {
|
||||
protected traderAssortService: TraderAssortService;
|
||||
protected jsonUtil: JsonUtil;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, jsonUtil: JsonUtil);
|
||||
/**
|
||||
* Runs when onLoad event is fired
|
||||
* Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService
|
||||
* Store timestamp of next assort refresh in nextResupply property of traders .base object
|
||||
*/
|
||||
load(): void;
|
||||
getTrader(traderID: string, sessionID: string): ITraderBase;
|
||||
/**
|
||||
* Runs when onUpdate is fired
|
||||
* If current time is > nextResupply(expire) time of trader, refresh traders assorts and
|
||||
* @returns has run
|
||||
*/
|
||||
update(): boolean;
|
||||
/**
|
||||
* Return an array of all traders
|
||||
* @param sessionID Session id
|
||||
* @returns array if ITraderBase objects
|
||||
*/
|
||||
getAllTraders(sessionID: string): ITraderBase[];
|
||||
updateTraders(): boolean;
|
||||
getTrader(sessionID: string, traderID: string): ITraderBase;
|
||||
getAssort(sessionId: string, traderId: string): ITraderAssort;
|
||||
getPurchasesData(traderID: string, sessionID: string): Record<string, IBarterScheme[][]>;
|
||||
getPurchasesData(sessionID: string, traderID: string): Record<string, IBarterScheme[][]>;
|
||||
}
|
||||
|
@ -41,15 +41,37 @@ export declare class RagfairOfferGenerator {
|
||||
createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer;
|
||||
protected getTraderId(userID: string): string;
|
||||
protected getRating(userID: string): number;
|
||||
/**
|
||||
* Is the offers user rating growing
|
||||
* @param userID user to check rating of
|
||||
* @returns true if its growing
|
||||
*/
|
||||
protected getRatingGrowing(userID: string): boolean;
|
||||
/**
|
||||
* Get number of section until offer should expire
|
||||
* @param userID Id of the offer owner
|
||||
* @param time Time the offer is posted
|
||||
* @returns number of seconds until offer expires
|
||||
*/
|
||||
protected getOfferEndTime(userID: string, time: number): number;
|
||||
/**
|
||||
* Create multiple offers for items by using a unique list of items we've generated previously
|
||||
* @param expiredOffers
|
||||
* @param expiredOffers optional, expired offers to regenerate
|
||||
*/
|
||||
generateDynamicOffers(expiredOffers?: Item[]): void;
|
||||
generateTraderOffers(traderID: string): void;
|
||||
/**
|
||||
* Generate trader offers on flea using the traders assort data
|
||||
* @param traderID Trader to generate offers for
|
||||
*/
|
||||
generateFleaOffersForTrader(traderID: string): void;
|
||||
protected getItemCondition(userID: string, items: Item[], itemDetails: ITemplateItem): Item[];
|
||||
/**
|
||||
* Add missing conditions to an item if needed
|
||||
* Durabiltiy for repairable items
|
||||
* HpResource for medical items
|
||||
* @param item item to add conditions to
|
||||
* @returns Item with conditions added
|
||||
*/
|
||||
protected addMissingCondition(item: Item): Item;
|
||||
protected getOfferRequirements(items: Item[]): {
|
||||
count: number;
|
||||
@ -57,6 +79,14 @@ export declare class RagfairOfferGenerator {
|
||||
}[];
|
||||
/**
|
||||
* Create a flea offer and store it in the Ragfair server offers array
|
||||
* @param userID owner of the offer
|
||||
* @param time time offer is put up
|
||||
* @param items items in the offer
|
||||
* @param barterScheme
|
||||
* @param loyalLevel
|
||||
* @param price price of offer
|
||||
* @param sellInOnePiece
|
||||
* @returns
|
||||
*/
|
||||
createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer;
|
||||
}
|
||||
|
@ -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 { ProfileFixerService } from "../services/ProfileFixerService";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { InventoryHelper } from "./InventoryHelper";
|
||||
import { PaymentHelper } from "./PaymentHelper";
|
||||
@ -15,7 +16,8 @@ export declare class InRaidHelper {
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected inventoryHelper: InventoryHelper;
|
||||
protected paymentHelper: PaymentHelper;
|
||||
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, paymentHelper: PaymentHelper);
|
||||
protected profileFixerService: ProfileFixerService;
|
||||
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, paymentHelper: PaymentHelper, profileFixerService: ProfileFixerService);
|
||||
/**
|
||||
* Reset the SPT inraid property stored in a profile to 'none'
|
||||
* @param sessionID Session id
|
||||
|
@ -43,6 +43,7 @@ export declare class InventoryHelper {
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, httpResponse: HttpResponseUtil, fenceService: FenceService, databaseServer: DatabaseServer, paymentHelper: PaymentHelper, traderAssortHelper: TraderAssortHelper, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, containerHelper: ContainerHelper, profileHelper: ProfileHelper, configServer: ConfigServer);
|
||||
addItem(pmcData: IPmcData, body: IAddItemRequestData, output: IItemEventRouterResponse, sessionID: string, callback: any, foundInRaid?: boolean, addUpd?: any): IItemEventRouterResponse;
|
||||
removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): Record<number, number>;
|
||||
protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): Record<number, number>;
|
||||
protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash;
|
||||
|
@ -2,22 +2,26 @@ import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Stats } from "../models/eft/common/tables/IBotBase";
|
||||
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
|
||||
import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData";
|
||||
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";
|
||||
import { Watermark } from "../utils/Watermark";
|
||||
import { ItemHelper } from "./ItemHelper";
|
||||
export declare class ProfileHelper {
|
||||
protected logger: ILogger;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected watermark: Watermark;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected saveServer: SaveServer;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected profileSnapshotService: ProfileSnapshotService;
|
||||
protected fenceService: FenceService;
|
||||
constructor(jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, fenceService: FenceService);
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, fenceService: FenceService);
|
||||
resetProfileQuestCondition(sessionID: string, conditionId: string): void;
|
||||
getCompleteProfile(sessionID: string): IPmcData[];
|
||||
isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean;
|
||||
|
@ -42,7 +42,15 @@ export declare class QuestHelper {
|
||||
*/
|
||||
evaluateLevel(pmcProfile: IPmcData, cond: AvailableForConditions): boolean;
|
||||
getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[];
|
||||
rewardSkillPoints(sessionID: string, pmcData: IPmcData, output: IItemEventRouterResponse, skillName: string, progress: number): void;
|
||||
/**
|
||||
* Increase skill points of a skill on player profile
|
||||
* @param sessionID Session id
|
||||
* @param pmcData Player profile
|
||||
* @param output output object to send back to client
|
||||
* @param skillName Name of skill to increase skill points of
|
||||
* @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
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { RagfairAssortGenerator } from "../generators/RagfairAssortGenerator";
|
||||
import { RagfairOfferGenerator } from "../generators/RagfairOfferGenerator";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { ITraderAssort } from "../models/eft/common/tables/ITrader";
|
||||
import { ITrader, ITraderAssort } from "../models/eft/common/tables/ITrader";
|
||||
import { ITraderConfig } from "../models/spt/config/ITraderConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
@ -10,13 +11,16 @@ import { FenceService } from "../services/FenceService";
|
||||
import { TraderAssortService } from "../services/TraderAssortService";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { MathUtil } from "../utils/MathUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
import { AssortHelper } from "./AssortHelper";
|
||||
import { PaymentHelper } from "./PaymentHelper";
|
||||
import { ProfileHelper } from "./ProfileHelper";
|
||||
import { TraderHelper } from "./TraderHelper";
|
||||
export declare class TraderAssortHelper {
|
||||
protected logger: ILogger;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected mathUtil: MathUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected assortHelper: AssortHelper;
|
||||
@ -24,18 +28,37 @@ export declare class TraderAssortHelper {
|
||||
protected ragfairAssortGenerator: RagfairAssortGenerator;
|
||||
protected ragfairOfferGenerator: RagfairOfferGenerator;
|
||||
protected traderAssortService: TraderAssortService;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected fenceService: FenceService;
|
||||
protected configServer: ConfigServer;
|
||||
protected traderConfig: ITraderConfig;
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, profileHelper: ProfileHelper, assortHelper: AssortHelper, paymentHelper: PaymentHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferGenerator: RagfairOfferGenerator, traderAssortService: TraderAssortService, 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, traderHelper: TraderHelper, fenceService: FenceService, configServer: ConfigServer);
|
||||
/**
|
||||
* Get a traders assorts
|
||||
* Can be used for returning ragfair / fence assorts
|
||||
* Filter out assorts not unlocked due to level OR quest completion
|
||||
* @param sessionId session id
|
||||
* @param traderId trader id
|
||||
* @returns a traders assorts
|
||||
* @param traderId traders id
|
||||
* @returns a traders' assorts
|
||||
*/
|
||||
getAssort(sessionId: string, traderId: string): ITraderAssort;
|
||||
/**
|
||||
* if the fence assorts have expired, re-generate them
|
||||
* @param pmcProfile Players profile
|
||||
*/
|
||||
refreshFenceAssortIfExpired(pmcProfile: IPmcData): void;
|
||||
/**
|
||||
* Reset a traders assorts and move nextResupply value to future
|
||||
* Flag trader as needing a flea offer reset to be picked up by flea update() function
|
||||
* @param trader trader details to alter
|
||||
*/
|
||||
resetExpiredTrader(trader: ITrader): void;
|
||||
/**
|
||||
* Does the supplied trader need its assorts refreshed
|
||||
* @param traderID Trader to check
|
||||
* @returns true they need refreshing
|
||||
*/
|
||||
traderAssortsHaveExpired(traderID: string): boolean;
|
||||
/**
|
||||
* Iterate over all assorts barter_scheme values, find barters selling for money and multiply by multipler in config
|
||||
* @param traderAssort Assorts to multiple price of
|
||||
|
@ -9,6 +9,7 @@ import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { FenceService } from "../services/FenceService";
|
||||
import { PlayerService } from "../services/PlayerService";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
import { HandbookHelper } from "./HandbookHelper";
|
||||
import { ItemHelper } from "./ItemHelper";
|
||||
import { PaymentHelper } from "./PaymentHelper";
|
||||
@ -23,9 +24,10 @@ export declare class TraderHelper {
|
||||
protected handbookHelper: HandbookHelper;
|
||||
protected playerService: PlayerService;
|
||||
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, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer);
|
||||
getTrader(traderID: string, sessionID: string): ITraderBase;
|
||||
getTraderAssortsById(traderId: string): ITraderAssort;
|
||||
/**
|
||||
@ -97,6 +99,17 @@ export declare class TraderHelper {
|
||||
* @param sessionID session id
|
||||
*/
|
||||
lvlUp(traderID: string, sessionID: string): void;
|
||||
/**
|
||||
* Get the next update timestamp for a trader
|
||||
* @param traderID Trader to look up update value for
|
||||
* @returns future timestamp
|
||||
*/
|
||||
getNextUpdateTimestamp(traderID: string): number;
|
||||
/**
|
||||
* Get the reset time between trader assort refreshes in seconds
|
||||
* @param traderId Trader to look up
|
||||
* @returns Time in seconds
|
||||
*/
|
||||
getTraderUpdateSeconds(traderId: string): number;
|
||||
/**
|
||||
* check if an item is allowed to be sold to a trader
|
||||
|
@ -32,6 +32,17 @@ export declare class PreAkiModLoader implements IModLoader {
|
||||
getModPath(mod: string): string;
|
||||
protected importClass(name: string, filepath: string, container: DependencyContainer): void;
|
||||
protected importMods(): Promise<void>;
|
||||
/**
|
||||
* Check for duplciate mods loaded, show error if duplicate mod found
|
||||
* @param modPackageData dictionary of mod package.json data
|
||||
*/
|
||||
protected checkForDuplicateMods(modPackageData: Record<string, IPackageJsonData>): void;
|
||||
/**
|
||||
* Check for and return duplicate strings inside an array
|
||||
* @param stringArray Array to check for duplicates
|
||||
* @returns string array of duplicates, empty if none found
|
||||
*/
|
||||
protected getDuplicates(stringArray: string[]): string[];
|
||||
/**
|
||||
*
|
||||
* @param mods Get an array of broken/invalid mods by name
|
||||
|
@ -137,7 +137,7 @@ export interface BotLocationModifier {
|
||||
VisibleDistance: number;
|
||||
}
|
||||
export interface MinMaxBot {
|
||||
WildSpawnType: string;
|
||||
WildSpawnType: WildSpawnType;
|
||||
max: number;
|
||||
min: number;
|
||||
}
|
||||
@ -195,7 +195,7 @@ export interface Wave {
|
||||
BotPreset: string;
|
||||
BotSide: string;
|
||||
SpawnPoints: string;
|
||||
WildSpawnType: string;
|
||||
WildSpawnType: WildSpawnType;
|
||||
isPlayers: boolean;
|
||||
number: number;
|
||||
slots_max: number;
|
||||
@ -203,3 +203,7 @@ export interface Wave {
|
||||
time_max: number;
|
||||
time_min: number;
|
||||
}
|
||||
export declare enum WildSpawnType {
|
||||
ASSAULT = "assault",
|
||||
MARKSMAN = "marksman"
|
||||
}
|
||||
|
@ -66,13 +66,13 @@ export interface IBan {
|
||||
dateTime: number;
|
||||
}
|
||||
export declare enum BanType {
|
||||
Chat = 0,
|
||||
RagFair = 1,
|
||||
Voip = 2,
|
||||
Trading = 3,
|
||||
Online = 4,
|
||||
Friends = 5,
|
||||
ChangeNickname = 6
|
||||
CHAT = 0,
|
||||
RAGFAIR = 1,
|
||||
VOIP = 2,
|
||||
TRADING = 3,
|
||||
ONLINE = 4,
|
||||
FRIENDS = 5,
|
||||
CHANGE_NICKNAME = 6
|
||||
}
|
||||
export interface Customization {
|
||||
Head: string;
|
||||
@ -312,11 +312,11 @@ export interface Notes {
|
||||
export interface CarExtractCounts {
|
||||
}
|
||||
export declare enum SurvivorClass {
|
||||
Unknown = 0,
|
||||
Neutralizer = 1,
|
||||
Marauder = 2,
|
||||
Paramedic = 3,
|
||||
Survivor = 4
|
||||
UNKNOWN = 0,
|
||||
NEUTRALIZER = 1,
|
||||
MARAUDER = 2,
|
||||
PARAMEDIC = 3,
|
||||
SURVIVOR = 4
|
||||
}
|
||||
export interface Quest {
|
||||
qid: string;
|
||||
|
@ -7,7 +7,7 @@ export interface ITrader {
|
||||
suits?: ISuit[];
|
||||
}
|
||||
export interface ITraderBase {
|
||||
refreshAssort: boolean;
|
||||
refreshTraderRagfairOffers: boolean;
|
||||
_id: string;
|
||||
avatar: string;
|
||||
balance_dol: number;
|
||||
@ -58,7 +58,7 @@ export interface Repair {
|
||||
quality: string;
|
||||
}
|
||||
export interface ITraderAssort {
|
||||
nextResupply?: number;
|
||||
nextResupply: number;
|
||||
items: Item[];
|
||||
barter_scheme: Record<string, IBarterScheme[][]>;
|
||||
loyal_level_items: Record<string, number>;
|
||||
|
@ -1,5 +1,5 @@
|
||||
export declare enum Effect {
|
||||
Fracture = "Fracture",
|
||||
LightBleeding = "LightBleeding",
|
||||
HeavyBleeding = "HeavyBleeding"
|
||||
FRACTURE = "Fracture",
|
||||
LIGHT_BLEEDING = "LightBleeding",
|
||||
HEAVY_BLEEDING = "HeavyBleeding"
|
||||
}
|
||||
|
@ -7,12 +7,12 @@ export interface IOffraidHealRequestData extends IBaseInteractionRequestData {
|
||||
time: number;
|
||||
}
|
||||
export declare enum BodyPart {
|
||||
Head = 0,
|
||||
Chest = 1,
|
||||
Stomach = 2,
|
||||
LeftArm = 3,
|
||||
RightArm = 4,
|
||||
LeftLeg = 5,
|
||||
RightLeg = 6,
|
||||
Common = 7
|
||||
HEAD = "Head",
|
||||
CHEST = "Chest",
|
||||
STOMACH = "Stomach",
|
||||
LEFT_ARM = "LeftArm",
|
||||
RIGHT_ARM = "RightArm",
|
||||
LEFT_LEG = "LeftLeg",
|
||||
RIGHT_LEG = "RightLeg",
|
||||
COMMON = "Common"
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
export interface INotifierChannel {
|
||||
"server": string;
|
||||
"channel_id": string;
|
||||
"url": string;
|
||||
"notifierServer": string;
|
||||
"ws": string;
|
||||
server: string;
|
||||
channel_id: string;
|
||||
url: string;
|
||||
notifierServer: string;
|
||||
ws: string;
|
||||
}
|
||||
import { Message } from "../profile/IAkiProfile";
|
||||
export interface INotification {
|
||||
|
@ -1,7 +1,7 @@
|
||||
export declare enum BotAmount {
|
||||
AsOnline = "AsOnline",
|
||||
Low = "Low",
|
||||
Medium = "Medium",
|
||||
High = "High",
|
||||
Horde = "Horde"
|
||||
AS_ONLINE = "AsOnline",
|
||||
LOW = "Low",
|
||||
MEDIUM = "Medium",
|
||||
HIGH = "High",
|
||||
HORDE = "Horde"
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
export declare enum BotDifficulty {
|
||||
AsOnline = "AsOnline",
|
||||
Easy = "Easy",
|
||||
Medium = "Medium",
|
||||
Hard = "Hard",
|
||||
Impossible = "Impossible",
|
||||
Random = "Random"
|
||||
AS_ONLINE = "AsOnline",
|
||||
EASY = "Easy",
|
||||
MEDIUM = "Medium",
|
||||
HARD = "Hard",
|
||||
IMPOSSIBLE = "Impossible",
|
||||
RANDOM = "Random"
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
export declare enum MemberCategory {
|
||||
Default = 0,
|
||||
Developer = 1,
|
||||
UniqueId = 2,
|
||||
Trader = 4,
|
||||
Group = 8,
|
||||
System = 16,
|
||||
ChatModerator = 32,
|
||||
ChatModeratorWithPermanentBan = 64,
|
||||
UnitTest = 128,
|
||||
Sherpa = 256,
|
||||
Emissary = 512
|
||||
DEFAULT = 0,
|
||||
DEVELOPER = 1,
|
||||
UNIQUE_ID = 2,
|
||||
TRADER = 4,
|
||||
GROUP = 8,
|
||||
SYSTEM = 16,
|
||||
CHAT_MODERATOR = 32,
|
||||
CHAT_MODERATOR_WITH_PERMANENT_BAN = 64,
|
||||
UNIT_TEST = 128,
|
||||
SHERPA = 256,
|
||||
EMISSARY = 512
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
export declare enum QuestRewardType {
|
||||
Skill = "Skill",
|
||||
Experience = "Experience",
|
||||
TraderStanding = "TraderStanding",
|
||||
TraderUnlock = "TraderUnlock",
|
||||
Item = "Item",
|
||||
AssortmentUnlock = "AssortmentUnlock"
|
||||
SKILL = "Skill",
|
||||
EXPERIENCE = "Experience",
|
||||
TRADER_STANDING = "TraderStanding",
|
||||
TRADER_UNLOCK = "TraderUnlock",
|
||||
ITEM = "Item",
|
||||
ASSORTMENT_UNLOCK = "AssortmentUnlock"
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
export declare enum RaidMode {
|
||||
Online = "Online",
|
||||
Local = "Local",
|
||||
Coop = "Coop"
|
||||
ONLINE = "Online",
|
||||
LOCAL = "Local",
|
||||
COOP = "Coop"
|
||||
}
|
||||
|
@ -11,13 +11,13 @@ export declare class BotLootCache {
|
||||
grenadeItems: ITemplateItem[];
|
||||
}
|
||||
export declare enum LootCacheType {
|
||||
Special = "Special",
|
||||
Backpack = "Backpack",
|
||||
Pocket = "Pocket",
|
||||
Vest = "Vest",
|
||||
Combined = "Combined",
|
||||
HealingItems = "HealingItems",
|
||||
DrugItems = "DrugItems",
|
||||
StimItems = "StimItems",
|
||||
GrenadeItems = "GrenadeItems"
|
||||
SPECIAL = "Special",
|
||||
BACKPACK = "Backpack",
|
||||
POCKET = "Pocket",
|
||||
VEST = "Vest",
|
||||
COMBINED = "Combined",
|
||||
HEALING_ITEMS = "HealingItems",
|
||||
DRUG_ITEMS = "DrugItems",
|
||||
STIM_ITEMS = "StimItems",
|
||||
GRENADE_ITEMS = "GrenadeItems"
|
||||
}
|
||||
|
@ -2,6 +2,10 @@ import { IBaseConfig } from "./IBaseConfig";
|
||||
export interface IHideoutConfig extends IBaseConfig {
|
||||
kind: "aki-hideout";
|
||||
runIntervalSeconds: number;
|
||||
fuelDrainRateMultipler: number;
|
||||
hoursForSkillCrafting: number;
|
||||
generatorSpeedWithoutFuel: number;
|
||||
generatorFuelFlowRate: number;
|
||||
airFilterUnitFlowRate: number;
|
||||
/** SEE HIDEOUTHELPER BEFORE CHANGING CONFIG */
|
||||
gpuBoostRate: number;
|
||||
}
|
||||
|
@ -27,7 +27,13 @@ export interface Reputation {
|
||||
gain: number;
|
||||
loss: number;
|
||||
}
|
||||
export declare class OfferAdjustment {
|
||||
maxPriceDifferenceBelowHandbookPercent: number;
|
||||
handbookPriceMultipier: number;
|
||||
priceThreshholdRub: number;
|
||||
}
|
||||
export interface Dynamic {
|
||||
offerAdjustment: OfferAdjustment;
|
||||
expiredOfferThreshold: number;
|
||||
offerItemCount: MinMax;
|
||||
price: MinMax;
|
||||
|
@ -1,11 +1,11 @@
|
||||
export declare enum LogBackgroundColor {
|
||||
default = "",
|
||||
black = "blackBG",
|
||||
red = "redBG",
|
||||
green = "greenBG",
|
||||
yellow = "yellowBG",
|
||||
blue = "blueBG",
|
||||
magenta = "magentaBG",
|
||||
cyan = "cyanBG",
|
||||
white = "whiteBG"
|
||||
DEFAULT = "",
|
||||
BLACK = "blackBG",
|
||||
RED = "redBG",
|
||||
GREEN = "greenBG",
|
||||
YELLOW = "yellowBG",
|
||||
BLUE = "blueBG",
|
||||
MAGENTA = "magentaBG",
|
||||
CYAN = "cyanBG",
|
||||
WHITE = "whiteBG"
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
export declare enum LogTextColor {
|
||||
black = "black",
|
||||
red = "red",
|
||||
green = "green",
|
||||
yellow = "yellow",
|
||||
blue = "blue",
|
||||
magenta = "magenta",
|
||||
cyan = "cyan",
|
||||
white = "white",
|
||||
gray = ""
|
||||
BLACK = "black",
|
||||
RED = "red",
|
||||
GREEN = "green",
|
||||
YELLOW = "yellow",
|
||||
BLUE = "blue",
|
||||
MAGENTA = "magenta",
|
||||
CYAN = "cyan",
|
||||
WHITE = "white",
|
||||
GRAY = ""
|
||||
}
|
||||
|
@ -13,10 +13,10 @@ export interface ILocaleGlobalBase {
|
||||
season: Record<string, string>;
|
||||
customization: Record<string, ILocaleProps>;
|
||||
repeatableQuest: Record<string, string>;
|
||||
templates: ILocaleTemplateBase;
|
||||
locations: ILocaleLocationsBase;
|
||||
banners: ILocaleBannersBase;
|
||||
trading: ILocaleTradingBase;
|
||||
templates: Record<string, ILocaleProps>;
|
||||
locations: Record<string, ILocaleProps>;
|
||||
banners: Record<string, ILocaleProps>;
|
||||
trading: Record<string, ILocaleTradingProps>;
|
||||
}
|
||||
export interface ILocaleQuest {
|
||||
name: string;
|
||||
@ -31,23 +31,11 @@ export interface ILocaleQuest {
|
||||
export interface ILocalePreset {
|
||||
Name: string;
|
||||
}
|
||||
export interface ILocaleTemplateBase {
|
||||
templates: Record<string, ILocaleProps>;
|
||||
}
|
||||
export interface ILocaleLocationsBase {
|
||||
locations: Record<string, ILocaleProps>;
|
||||
}
|
||||
export interface ILocaleBannersBase {
|
||||
locations: Record<string, ILocaleProps>;
|
||||
}
|
||||
export interface ILocaleProps {
|
||||
Name: string;
|
||||
ShortName: string;
|
||||
Description: string;
|
||||
}
|
||||
export interface ILocaleTradingBase {
|
||||
locations: Record<string, ILocaleTradingProps>;
|
||||
}
|
||||
export interface ILocaleTradingProps {
|
||||
FullName: string;
|
||||
FirstName: string;
|
||||
|
@ -1,4 +1,6 @@
|
||||
import { RagfairOfferGenerator } from "../generators/RagfairOfferGenerator";
|
||||
import { TraderAssortHelper } from "../helpers/TraderAssortHelper";
|
||||
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";
|
||||
@ -12,11 +14,18 @@ export declare class RagfairServer {
|
||||
protected ragfairOfferService: RagfairOfferService;
|
||||
protected ragfairCategoriesService: RagfairCategoriesService;
|
||||
protected ragfairRequiredItemsService: RagfairRequiredItemsService;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected traderAssortHelper: TraderAssortHelper;
|
||||
protected configServer: ConfigServer;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
constructor(logger: ILogger, ragfairOfferGenerator: RagfairOfferGenerator, ragfairOfferService: RagfairOfferService, ragfairCategoriesService: RagfairCategoriesService, ragfairRequiredItemsService: RagfairRequiredItemsService, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, ragfairOfferGenerator: RagfairOfferGenerator, ragfairOfferService: RagfairOfferService, ragfairCategoriesService: RagfairCategoriesService, ragfairRequiredItemsService: RagfairRequiredItemsService, traderHelper: TraderHelper, traderAssortHelper: TraderAssortHelper, configServer: ConfigServer);
|
||||
load(): void;
|
||||
update(): void;
|
||||
/**
|
||||
* Get traders who need to be periodically refreshed
|
||||
* @returns string array of traders
|
||||
*/
|
||||
protected getUpdateableTraders(): string[];
|
||||
getAllCategories(): Record<string, number>;
|
||||
getBespokeCategories(offers: IRagfairOffer[]): Record<string, number>;
|
||||
/**
|
||||
|
@ -11,10 +11,12 @@ import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class FenceService {
|
||||
protected logger: ILogger;
|
||||
protected hashUtil: HashUtil;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected handbookHelper: HandbookHelper;
|
||||
@ -23,11 +25,24 @@ export declare class FenceService {
|
||||
protected configServer: ConfigServer;
|
||||
protected fenceAssort: ITraderAssort;
|
||||
protected traderConfig: ITraderConfig;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, configServer: ConfigServer);
|
||||
protected setFenceAssort(fenceAssort: ITraderAssort): void;
|
||||
getFenceAssorts(): ITraderAssort;
|
||||
hasExpiredCache(refreshAssort: boolean): boolean;
|
||||
/**
|
||||
* Get the count of items fence offers
|
||||
* @returns number
|
||||
*/
|
||||
getOfferCount(): number;
|
||||
generateFenceAssortCache(pmcData: IPmcData): void;
|
||||
/**
|
||||
* Get the next update timestamp for fence
|
||||
* @returns future timestamp
|
||||
*/
|
||||
getNextFenceUpdateTimestamp(): number;
|
||||
/**
|
||||
* Get fence refresh time in seconds
|
||||
*/
|
||||
protected getFenceRefreshTime(): number;
|
||||
/**
|
||||
* Get the fence level the passed in profile has
|
||||
* @param pmcData Player profile
|
||||
|
30
TypeScript/10ScopesAndTypes/types/services/ProfileSnapshotService.d.ts
vendored
Normal file
30
TypeScript/10ScopesAndTypes/types/services/ProfileSnapshotService.d.ts
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
export declare class ProfileSnapshotService {
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected storedProfileSnapshots: Record<string, IAkiProfile>;
|
||||
constructor(jsonUtil: JsonUtil);
|
||||
/**
|
||||
* Store a profile into an in-memory object
|
||||
* @param sessionID session id - acts as the key
|
||||
* @param profile - profile to save
|
||||
*/
|
||||
storeProfileSnapshot(sessionID: string, profile: IAkiProfile): void;
|
||||
/**
|
||||
* Retreve a stored profile
|
||||
* @param sessionID key
|
||||
* @returns A player profile object
|
||||
*/
|
||||
getProfileSnapshot(sessionID: string): IAkiProfile;
|
||||
/**
|
||||
* Does a profile exists against the provided key
|
||||
* @param sessionID key
|
||||
* @returns true if exists
|
||||
*/
|
||||
hasProfileSnapshot(sessionID: string): boolean;
|
||||
/**
|
||||
* Remove a stored profile by key
|
||||
* @param sessionID key
|
||||
*/
|
||||
clearProfileSnapshot(sessionID: string): void;
|
||||
}
|
@ -24,7 +24,6 @@ export declare class RagfairOfferService {
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected configServer: ConfigServer;
|
||||
protected playerOffersLoaded: boolean;
|
||||
protected toUpdate: Record<string, boolean>;
|
||||
protected expiredOffers: Item[];
|
||||
protected offers: IRagfairOffer[];
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
@ -38,8 +37,6 @@ export declare class RagfairOfferService {
|
||||
getOffersOfType(templateId: string): IRagfairOffer[];
|
||||
addOffer(offer: IRagfairOffer): void;
|
||||
addOfferToExpired(staleOffer: IRagfairOffer): void;
|
||||
setTraderUpdateStatus(traderId: string, shouldUpdate: boolean): void;
|
||||
shouldTraderBeUpdated(traderID: string): boolean;
|
||||
getExpiredOfferCount(): number;
|
||||
/**
|
||||
* Get an array of expired items not yet processed into new offers
|
||||
@ -53,12 +50,15 @@ export declare class RagfairOfferService {
|
||||
* @returns offer exists - true
|
||||
*/
|
||||
doesOfferExist(offerId: string): boolean;
|
||||
getTraders(): Record<string, boolean>;
|
||||
flagTraderForUpdate(expiredOfferUserId: string): void;
|
||||
removeOfferById(offerId: string): void;
|
||||
removeOfferStack(offerID: string, amount: number): void;
|
||||
removeAllOffersByTrader(traderId: string): void;
|
||||
addTradersToUpdateList(): void;
|
||||
/**
|
||||
* Do the trader offers on flea need to be refreshed
|
||||
* @param traderID Trader to check
|
||||
* @returns true if they do
|
||||
*/
|
||||
traderOffersNeedRefreshing(traderID: string): boolean;
|
||||
addPlayerOffers(): void;
|
||||
expireStaleOffers(): void;
|
||||
/**
|
||||
|
@ -27,6 +27,20 @@ export declare class RagfairPriceService {
|
||||
getDynamicPrice(itemTpl: string): number;
|
||||
getAllFleaPrices(): Record<string, number>;
|
||||
getFleaPriceForItem(tplId: string): number;
|
||||
/**
|
||||
* Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json
|
||||
* @param itemPrice price of item
|
||||
* @param itemTpl item template Id being checked
|
||||
* @returns adjusted price value in roubles
|
||||
*/
|
||||
protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number;
|
||||
/**
|
||||
* Get the percentage difference between two values
|
||||
* @param a numerical value a
|
||||
* @param b numerical value b
|
||||
* @returns different in percent
|
||||
*/
|
||||
protected getPriceDifference(a: number, b: number): number;
|
||||
getStaticPriceForItem(tplId: string): number;
|
||||
getBarterPrice(barterScheme: IBarterScheme[]): number;
|
||||
getDynamicOfferPrice(items: Item[], desiredCurrency: string): number;
|
||||
|
@ -2,5 +2,10 @@ import { ITraderAssort } from "../models/eft/common/tables/ITrader";
|
||||
export declare class TraderAssortService {
|
||||
protected pristineTraderAssorts: Record<string, ITraderAssort>;
|
||||
getPristineTraderAssort(traderId: string): ITraderAssort;
|
||||
/**
|
||||
* Store trader assorts inside a class property
|
||||
* @param traderId Traderid to store assorts against
|
||||
* @param assort Assorts to store
|
||||
*/
|
||||
setPristineTraderAssort(traderId: string, assort: ITraderAssort): void;
|
||||
}
|
||||
|
@ -4,6 +4,10 @@ export declare class TimeUtil {
|
||||
formatDate(date: Date): string;
|
||||
getDate(): string;
|
||||
getTime(): string;
|
||||
/**
|
||||
* Get timestamp in seconds
|
||||
* @returns
|
||||
*/
|
||||
getTimestamp(): number;
|
||||
/**
|
||||
* mail in eft requires time be in a specific format
|
||||
|
@ -4,7 +4,7 @@
|
||||
"author": "Chomp",
|
||||
"license": "MIT",
|
||||
"main": "src/mod.js",
|
||||
"akiVersion": "3.1.1",
|
||||
"akiVersion": "3.2.1",
|
||||
"isBundleMod": true,
|
||||
"scripts": {
|
||||
"setup:environment": "npm i",
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { InsuranceController } from "../controllers/InsuranceController";
|
||||
import { OnLoadOnUpdate } from "../di/OnLoadOnUpdate";
|
||||
import { OnUpdate } from "../di/OnUpdate";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { IGetInsuranceCostRequestData } from "../models/eft/insurance/IGetInsuranceCostRequestData";
|
||||
@ -10,14 +10,13 @@ import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { InsuranceService } from "../services/InsuranceService";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
export declare class InsuranceCallbacks extends OnLoadOnUpdate {
|
||||
export declare class InsuranceCallbacks extends OnUpdate {
|
||||
protected insuranceController: InsuranceController;
|
||||
protected insuranceService: InsuranceService;
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected configServer: ConfigServer;
|
||||
protected insuranceConfig: IInsuranceConfig;
|
||||
constructor(insuranceController: InsuranceController, insuranceService: InsuranceService, httpResponse: HttpResponseUtil, configServer: ConfigServer);
|
||||
onLoad(): void;
|
||||
getInsuranceCost(url: string, info: IGetInsuranceCostRequestData, sessionID: string): IGetBodyResponseData<IGetInsuranceCostResponseData>;
|
||||
insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
onUpdate(secondsSinceLastRun: number): boolean;
|
||||
|
@ -9,10 +9,10 @@ export declare class TraderCallbacks extends OnLoadOnUpdate {
|
||||
protected traderController: TraderController;
|
||||
constructor(httpResponse: HttpResponseUtil, traderController: TraderController);
|
||||
onLoad(): void;
|
||||
onUpdate(): boolean;
|
||||
getRoute(): string;
|
||||
getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase[]>;
|
||||
getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, IBarterScheme[][]>>;
|
||||
getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase>;
|
||||
getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderAssort>;
|
||||
onUpdate(): boolean;
|
||||
}
|
||||
|
@ -25,4 +25,5 @@ export declare class GameController {
|
||||
protected logProfileDetails(fullProfile: IAkiProfile): void;
|
||||
getGameConfig(sessionID: string): IGameConfigResponse;
|
||||
getServer(): any[];
|
||||
getValidGameVersion(): any;
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ import { HashUtil } from "../utils/HashUtil";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
export declare class HideoutController {
|
||||
protected logger: ILogger;
|
||||
protected hashUtil: HashUtil;
|
||||
@ -45,9 +46,10 @@ export declare class HideoutController {
|
||||
protected hideoutHelper: HideoutHelper;
|
||||
protected scavCaseRewardGenerator: ScavCaseRewardGenerator;
|
||||
protected configServer: ConfigServer;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected static nameBackendCountersCrafting: string;
|
||||
protected hideoutConfig: IHideoutConfig;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil);
|
||||
upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
|
@ -5,9 +5,11 @@ import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { QuestHelper } from "../helpers/QuestHelper";
|
||||
import { TraderHelper } from "../helpers/TraderHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData";
|
||||
import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData";
|
||||
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
@ -15,6 +17,7 @@ import { InsuranceService } from "../services/InsuranceService";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class InraidController {
|
||||
protected logger: ILogger;
|
||||
protected saveServer: SaveServer;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
@ -29,7 +32,7 @@ export declare class InraidController {
|
||||
protected inRaidHelper: InRaidHelper;
|
||||
protected configServer: ConfigServer;
|
||||
protected inraidConfig: IInRaidConfig;
|
||||
constructor(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, configServer: ConfigServer);
|
||||
addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void;
|
||||
saveProgress(offraidData: ISaveProgressRequestData, sessionID: string): void;
|
||||
/**
|
||||
@ -38,7 +41,7 @@ export declare class InraidController {
|
||||
* @param pmcData player profile
|
||||
* @param isPlayerScav Was the player a pScav
|
||||
*/
|
||||
private markOrRemoveFoundInRaidItems;
|
||||
private handlePostRaidPlayerScavProcess;
|
||||
private handlePostRaidPlayerScavKarmaChanges;
|
||||
protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void;
|
||||
protected handlePostRaidPlayerScavProcess(scavData: IPmcData, sessionID: string, offraidData: ISaveProgressRequestData, pmcData: IPmcData, isDead: boolean): void;
|
||||
protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData, sessionID: string): void;
|
||||
}
|
||||
|
@ -11,21 +11,25 @@ import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult";
|
||||
import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData";
|
||||
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
|
||||
import { IMatchConfig } from "../models/spt/config/IMatchConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { BotLootCacheService } from "../services/BotLootCacheService";
|
||||
import { MatchLocationService } from "../services/MatchLocationService";
|
||||
import { ProfileSnapshotService } from "../services/ProfileSnapshotService";
|
||||
export declare class MatchController {
|
||||
protected logger: ILogger;
|
||||
protected saveServer: SaveServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected matchLocationService: MatchLocationService;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected botLootCacheService: BotLootCacheService;
|
||||
protected configServer: ConfigServer;
|
||||
protected profileSnapshotService: ProfileSnapshotService;
|
||||
protected applicationContext: ApplicationContext;
|
||||
protected matchConfig: IMatchConfig;
|
||||
protected inraidConfig: IInRaidConfig;
|
||||
constructor(saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, applicationContext: ApplicationContext);
|
||||
constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, applicationContext: ApplicationContext);
|
||||
getEnabled(): boolean;
|
||||
getProfile(info: IGetProfileRequestData): IPmcData[];
|
||||
createGroup(sessionID: string, info: ICreateGroupRequestData): any;
|
||||
|
@ -17,10 +17,25 @@ export declare class TraderController {
|
||||
protected traderAssortService: TraderAssortService;
|
||||
protected jsonUtil: JsonUtil;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, jsonUtil: JsonUtil);
|
||||
/**
|
||||
* Runs when onLoad event is fired
|
||||
* Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService
|
||||
* Store timestamp of next assort refresh in nextResupply property of traders .base object
|
||||
*/
|
||||
load(): void;
|
||||
getTrader(traderID: string, sessionID: string): ITraderBase;
|
||||
/**
|
||||
* Runs when onUpdate is fired
|
||||
* If current time is > nextResupply(expire) time of trader, refresh traders assorts and
|
||||
* @returns has run
|
||||
*/
|
||||
update(): boolean;
|
||||
/**
|
||||
* Return an array of all traders
|
||||
* @param sessionID Session id
|
||||
* @returns array if ITraderBase objects
|
||||
*/
|
||||
getAllTraders(sessionID: string): ITraderBase[];
|
||||
updateTraders(): boolean;
|
||||
getTrader(sessionID: string, traderID: string): ITraderBase;
|
||||
getAssort(sessionId: string, traderId: string): ITraderAssort;
|
||||
getPurchasesData(traderID: string, sessionID: string): Record<string, IBarterScheme[][]>;
|
||||
getPurchasesData(sessionID: string, traderID: string): Record<string, IBarterScheme[][]>;
|
||||
}
|
||||
|
@ -41,15 +41,37 @@ export declare class RagfairOfferGenerator {
|
||||
createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer;
|
||||
protected getTraderId(userID: string): string;
|
||||
protected getRating(userID: string): number;
|
||||
/**
|
||||
* Is the offers user rating growing
|
||||
* @param userID user to check rating of
|
||||
* @returns true if its growing
|
||||
*/
|
||||
protected getRatingGrowing(userID: string): boolean;
|
||||
/**
|
||||
* Get number of section until offer should expire
|
||||
* @param userID Id of the offer owner
|
||||
* @param time Time the offer is posted
|
||||
* @returns number of seconds until offer expires
|
||||
*/
|
||||
protected getOfferEndTime(userID: string, time: number): number;
|
||||
/**
|
||||
* Create multiple offers for items by using a unique list of items we've generated previously
|
||||
* @param expiredOffers
|
||||
* @param expiredOffers optional, expired offers to regenerate
|
||||
*/
|
||||
generateDynamicOffers(expiredOffers?: Item[]): void;
|
||||
generateTraderOffers(traderID: string): void;
|
||||
/**
|
||||
* Generate trader offers on flea using the traders assort data
|
||||
* @param traderID Trader to generate offers for
|
||||
*/
|
||||
generateFleaOffersForTrader(traderID: string): void;
|
||||
protected getItemCondition(userID: string, items: Item[], itemDetails: ITemplateItem): Item[];
|
||||
/**
|
||||
* Add missing conditions to an item if needed
|
||||
* Durabiltiy for repairable items
|
||||
* HpResource for medical items
|
||||
* @param item item to add conditions to
|
||||
* @returns Item with conditions added
|
||||
*/
|
||||
protected addMissingCondition(item: Item): Item;
|
||||
protected getOfferRequirements(items: Item[]): {
|
||||
count: number;
|
||||
@ -57,6 +79,14 @@ export declare class RagfairOfferGenerator {
|
||||
}[];
|
||||
/**
|
||||
* Create a flea offer and store it in the Ragfair server offers array
|
||||
* @param userID owner of the offer
|
||||
* @param time time offer is put up
|
||||
* @param items items in the offer
|
||||
* @param barterScheme
|
||||
* @param loyalLevel
|
||||
* @param price price of offer
|
||||
* @param sellInOnePiece
|
||||
* @returns
|
||||
*/
|
||||
createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer;
|
||||
}
|
||||
|
@ -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 { ProfileFixerService } from "../services/ProfileFixerService";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { InventoryHelper } from "./InventoryHelper";
|
||||
import { PaymentHelper } from "./PaymentHelper";
|
||||
@ -15,7 +16,8 @@ export declare class InRaidHelper {
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected inventoryHelper: InventoryHelper;
|
||||
protected paymentHelper: PaymentHelper;
|
||||
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, paymentHelper: PaymentHelper);
|
||||
protected profileFixerService: ProfileFixerService;
|
||||
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, paymentHelper: PaymentHelper, profileFixerService: ProfileFixerService);
|
||||
/**
|
||||
* Reset the SPT inraid property stored in a profile to 'none'
|
||||
* @param sessionID Session id
|
||||
|
@ -43,6 +43,7 @@ export declare class InventoryHelper {
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, httpResponse: HttpResponseUtil, fenceService: FenceService, databaseServer: DatabaseServer, paymentHelper: PaymentHelper, traderAssortHelper: TraderAssortHelper, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, containerHelper: ContainerHelper, profileHelper: ProfileHelper, configServer: ConfigServer);
|
||||
addItem(pmcData: IPmcData, body: IAddItemRequestData, output: IItemEventRouterResponse, sessionID: string, callback: any, foundInRaid?: boolean, addUpd?: any): IItemEventRouterResponse;
|
||||
removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): Record<number, number>;
|
||||
protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): Record<number, number>;
|
||||
protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash;
|
||||
|
@ -2,22 +2,26 @@ import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Stats } from "../models/eft/common/tables/IBotBase";
|
||||
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
|
||||
import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData";
|
||||
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";
|
||||
import { Watermark } from "../utils/Watermark";
|
||||
import { ItemHelper } from "./ItemHelper";
|
||||
export declare class ProfileHelper {
|
||||
protected logger: ILogger;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected watermark: Watermark;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected saveServer: SaveServer;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected profileSnapshotService: ProfileSnapshotService;
|
||||
protected fenceService: FenceService;
|
||||
constructor(jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, fenceService: FenceService);
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, fenceService: FenceService);
|
||||
resetProfileQuestCondition(sessionID: string, conditionId: string): void;
|
||||
getCompleteProfile(sessionID: string): IPmcData[];
|
||||
isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean;
|
||||
|
@ -42,7 +42,15 @@ export declare class QuestHelper {
|
||||
*/
|
||||
evaluateLevel(pmcProfile: IPmcData, cond: AvailableForConditions): boolean;
|
||||
getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[];
|
||||
rewardSkillPoints(sessionID: string, pmcData: IPmcData, output: IItemEventRouterResponse, skillName: string, progress: number): void;
|
||||
/**
|
||||
* Increase skill points of a skill on player profile
|
||||
* @param sessionID Session id
|
||||
* @param pmcData Player profile
|
||||
* @param output output object to send back to client
|
||||
* @param skillName Name of skill to increase skill points of
|
||||
* @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
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { RagfairAssortGenerator } from "../generators/RagfairAssortGenerator";
|
||||
import { RagfairOfferGenerator } from "../generators/RagfairOfferGenerator";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { ITraderAssort } from "../models/eft/common/tables/ITrader";
|
||||
import { ITrader, ITraderAssort } from "../models/eft/common/tables/ITrader";
|
||||
import { ITraderConfig } from "../models/spt/config/ITraderConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
@ -10,13 +11,16 @@ import { FenceService } from "../services/FenceService";
|
||||
import { TraderAssortService } from "../services/TraderAssortService";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { MathUtil } from "../utils/MathUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
import { AssortHelper } from "./AssortHelper";
|
||||
import { PaymentHelper } from "./PaymentHelper";
|
||||
import { ProfileHelper } from "./ProfileHelper";
|
||||
import { TraderHelper } from "./TraderHelper";
|
||||
export declare class TraderAssortHelper {
|
||||
protected logger: ILogger;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected mathUtil: MathUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected assortHelper: AssortHelper;
|
||||
@ -24,18 +28,37 @@ export declare class TraderAssortHelper {
|
||||
protected ragfairAssortGenerator: RagfairAssortGenerator;
|
||||
protected ragfairOfferGenerator: RagfairOfferGenerator;
|
||||
protected traderAssortService: TraderAssortService;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected fenceService: FenceService;
|
||||
protected configServer: ConfigServer;
|
||||
protected traderConfig: ITraderConfig;
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, profileHelper: ProfileHelper, assortHelper: AssortHelper, paymentHelper: PaymentHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferGenerator: RagfairOfferGenerator, traderAssortService: TraderAssortService, 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, traderHelper: TraderHelper, fenceService: FenceService, configServer: ConfigServer);
|
||||
/**
|
||||
* Get a traders assorts
|
||||
* Can be used for returning ragfair / fence assorts
|
||||
* Filter out assorts not unlocked due to level OR quest completion
|
||||
* @param sessionId session id
|
||||
* @param traderId trader id
|
||||
* @returns a traders assorts
|
||||
* @param traderId traders id
|
||||
* @returns a traders' assorts
|
||||
*/
|
||||
getAssort(sessionId: string, traderId: string): ITraderAssort;
|
||||
/**
|
||||
* if the fence assorts have expired, re-generate them
|
||||
* @param pmcProfile Players profile
|
||||
*/
|
||||
refreshFenceAssortIfExpired(pmcProfile: IPmcData): void;
|
||||
/**
|
||||
* Reset a traders assorts and move nextResupply value to future
|
||||
* Flag trader as needing a flea offer reset to be picked up by flea update() function
|
||||
* @param trader trader details to alter
|
||||
*/
|
||||
resetExpiredTrader(trader: ITrader): void;
|
||||
/**
|
||||
* Does the supplied trader need its assorts refreshed
|
||||
* @param traderID Trader to check
|
||||
* @returns true they need refreshing
|
||||
*/
|
||||
traderAssortsHaveExpired(traderID: string): boolean;
|
||||
/**
|
||||
* Iterate over all assorts barter_scheme values, find barters selling for money and multiply by multipler in config
|
||||
* @param traderAssort Assorts to multiple price of
|
||||
|
@ -9,6 +9,7 @@ import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { FenceService } from "../services/FenceService";
|
||||
import { PlayerService } from "../services/PlayerService";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
import { HandbookHelper } from "./HandbookHelper";
|
||||
import { ItemHelper } from "./ItemHelper";
|
||||
import { PaymentHelper } from "./PaymentHelper";
|
||||
@ -23,9 +24,10 @@ export declare class TraderHelper {
|
||||
protected handbookHelper: HandbookHelper;
|
||||
protected playerService: PlayerService;
|
||||
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, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer);
|
||||
getTrader(traderID: string, sessionID: string): ITraderBase;
|
||||
getTraderAssortsById(traderId: string): ITraderAssort;
|
||||
/**
|
||||
@ -97,6 +99,17 @@ export declare class TraderHelper {
|
||||
* @param sessionID session id
|
||||
*/
|
||||
lvlUp(traderID: string, sessionID: string): void;
|
||||
/**
|
||||
* Get the next update timestamp for a trader
|
||||
* @param traderID Trader to look up update value for
|
||||
* @returns future timestamp
|
||||
*/
|
||||
getNextUpdateTimestamp(traderID: string): number;
|
||||
/**
|
||||
* Get the reset time between trader assort refreshes in seconds
|
||||
* @param traderId Trader to look up
|
||||
* @returns Time in seconds
|
||||
*/
|
||||
getTraderUpdateSeconds(traderId: string): number;
|
||||
/**
|
||||
* check if an item is allowed to be sold to a trader
|
||||
|
@ -32,6 +32,17 @@ export declare class PreAkiModLoader implements IModLoader {
|
||||
getModPath(mod: string): string;
|
||||
protected importClass(name: string, filepath: string, container: DependencyContainer): void;
|
||||
protected importMods(): Promise<void>;
|
||||
/**
|
||||
* Check for duplciate mods loaded, show error if duplicate mod found
|
||||
* @param modPackageData dictionary of mod package.json data
|
||||
*/
|
||||
protected checkForDuplicateMods(modPackageData: Record<string, IPackageJsonData>): void;
|
||||
/**
|
||||
* Check for and return duplicate strings inside an array
|
||||
* @param stringArray Array to check for duplicates
|
||||
* @returns string array of duplicates, empty if none found
|
||||
*/
|
||||
protected getDuplicates(stringArray: string[]): string[];
|
||||
/**
|
||||
*
|
||||
* @param mods Get an array of broken/invalid mods by name
|
||||
|
@ -137,7 +137,7 @@ export interface BotLocationModifier {
|
||||
VisibleDistance: number;
|
||||
}
|
||||
export interface MinMaxBot {
|
||||
WildSpawnType: string;
|
||||
WildSpawnType: WildSpawnType;
|
||||
max: number;
|
||||
min: number;
|
||||
}
|
||||
@ -195,7 +195,7 @@ export interface Wave {
|
||||
BotPreset: string;
|
||||
BotSide: string;
|
||||
SpawnPoints: string;
|
||||
WildSpawnType: string;
|
||||
WildSpawnType: WildSpawnType;
|
||||
isPlayers: boolean;
|
||||
number: number;
|
||||
slots_max: number;
|
||||
@ -203,3 +203,7 @@ export interface Wave {
|
||||
time_max: number;
|
||||
time_min: number;
|
||||
}
|
||||
export declare enum WildSpawnType {
|
||||
ASSAULT = "assault",
|
||||
MARKSMAN = "marksman"
|
||||
}
|
||||
|
@ -66,13 +66,13 @@ export interface IBan {
|
||||
dateTime: number;
|
||||
}
|
||||
export declare enum BanType {
|
||||
Chat = 0,
|
||||
RagFair = 1,
|
||||
Voip = 2,
|
||||
Trading = 3,
|
||||
Online = 4,
|
||||
Friends = 5,
|
||||
ChangeNickname = 6
|
||||
CHAT = 0,
|
||||
RAGFAIR = 1,
|
||||
VOIP = 2,
|
||||
TRADING = 3,
|
||||
ONLINE = 4,
|
||||
FRIENDS = 5,
|
||||
CHANGE_NICKNAME = 6
|
||||
}
|
||||
export interface Customization {
|
||||
Head: string;
|
||||
@ -312,11 +312,11 @@ export interface Notes {
|
||||
export interface CarExtractCounts {
|
||||
}
|
||||
export declare enum SurvivorClass {
|
||||
Unknown = 0,
|
||||
Neutralizer = 1,
|
||||
Marauder = 2,
|
||||
Paramedic = 3,
|
||||
Survivor = 4
|
||||
UNKNOWN = 0,
|
||||
NEUTRALIZER = 1,
|
||||
MARAUDER = 2,
|
||||
PARAMEDIC = 3,
|
||||
SURVIVOR = 4
|
||||
}
|
||||
export interface Quest {
|
||||
qid: string;
|
||||
|
@ -7,7 +7,7 @@ export interface ITrader {
|
||||
suits?: ISuit[];
|
||||
}
|
||||
export interface ITraderBase {
|
||||
refreshAssort: boolean;
|
||||
refreshTraderRagfairOffers: boolean;
|
||||
_id: string;
|
||||
avatar: string;
|
||||
balance_dol: number;
|
||||
@ -58,7 +58,7 @@ export interface Repair {
|
||||
quality: string;
|
||||
}
|
||||
export interface ITraderAssort {
|
||||
nextResupply?: number;
|
||||
nextResupply: number;
|
||||
items: Item[];
|
||||
barter_scheme: Record<string, IBarterScheme[][]>;
|
||||
loyal_level_items: Record<string, number>;
|
||||
|
@ -1,5 +1,5 @@
|
||||
export declare enum Effect {
|
||||
Fracture = "Fracture",
|
||||
LightBleeding = "LightBleeding",
|
||||
HeavyBleeding = "HeavyBleeding"
|
||||
FRACTURE = "Fracture",
|
||||
LIGHT_BLEEDING = "LightBleeding",
|
||||
HEAVY_BLEEDING = "HeavyBleeding"
|
||||
}
|
||||
|
@ -7,12 +7,12 @@ export interface IOffraidHealRequestData extends IBaseInteractionRequestData {
|
||||
time: number;
|
||||
}
|
||||
export declare enum BodyPart {
|
||||
Head = 0,
|
||||
Chest = 1,
|
||||
Stomach = 2,
|
||||
LeftArm = 3,
|
||||
RightArm = 4,
|
||||
LeftLeg = 5,
|
||||
RightLeg = 6,
|
||||
Common = 7
|
||||
HEAD = "Head",
|
||||
CHEST = "Chest",
|
||||
STOMACH = "Stomach",
|
||||
LEFT_ARM = "LeftArm",
|
||||
RIGHT_ARM = "RightArm",
|
||||
LEFT_LEG = "LeftLeg",
|
||||
RIGHT_LEG = "RightLeg",
|
||||
COMMON = "Common"
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
export interface INotifierChannel {
|
||||
"server": string;
|
||||
"channel_id": string;
|
||||
"url": string;
|
||||
"notifierServer": string;
|
||||
"ws": string;
|
||||
server: string;
|
||||
channel_id: string;
|
||||
url: string;
|
||||
notifierServer: string;
|
||||
ws: string;
|
||||
}
|
||||
import { Message } from "../profile/IAkiProfile";
|
||||
export interface INotification {
|
||||
|
@ -1,7 +1,7 @@
|
||||
export declare enum BotAmount {
|
||||
AsOnline = "AsOnline",
|
||||
Low = "Low",
|
||||
Medium = "Medium",
|
||||
High = "High",
|
||||
Horde = "Horde"
|
||||
AS_ONLINE = "AsOnline",
|
||||
LOW = "Low",
|
||||
MEDIUM = "Medium",
|
||||
HIGH = "High",
|
||||
HORDE = "Horde"
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
export declare enum BotDifficulty {
|
||||
AsOnline = "AsOnline",
|
||||
Easy = "Easy",
|
||||
Medium = "Medium",
|
||||
Hard = "Hard",
|
||||
Impossible = "Impossible",
|
||||
Random = "Random"
|
||||
AS_ONLINE = "AsOnline",
|
||||
EASY = "Easy",
|
||||
MEDIUM = "Medium",
|
||||
HARD = "Hard",
|
||||
IMPOSSIBLE = "Impossible",
|
||||
RANDOM = "Random"
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
export declare enum MemberCategory {
|
||||
Default = 0,
|
||||
Developer = 1,
|
||||
UniqueId = 2,
|
||||
Trader = 4,
|
||||
Group = 8,
|
||||
System = 16,
|
||||
ChatModerator = 32,
|
||||
ChatModeratorWithPermanentBan = 64,
|
||||
UnitTest = 128,
|
||||
Sherpa = 256,
|
||||
Emissary = 512
|
||||
DEFAULT = 0,
|
||||
DEVELOPER = 1,
|
||||
UNIQUE_ID = 2,
|
||||
TRADER = 4,
|
||||
GROUP = 8,
|
||||
SYSTEM = 16,
|
||||
CHAT_MODERATOR = 32,
|
||||
CHAT_MODERATOR_WITH_PERMANENT_BAN = 64,
|
||||
UNIT_TEST = 128,
|
||||
SHERPA = 256,
|
||||
EMISSARY = 512
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
export declare enum QuestRewardType {
|
||||
Skill = "Skill",
|
||||
Experience = "Experience",
|
||||
TraderStanding = "TraderStanding",
|
||||
TraderUnlock = "TraderUnlock",
|
||||
Item = "Item",
|
||||
AssortmentUnlock = "AssortmentUnlock"
|
||||
SKILL = "Skill",
|
||||
EXPERIENCE = "Experience",
|
||||
TRADER_STANDING = "TraderStanding",
|
||||
TRADER_UNLOCK = "TraderUnlock",
|
||||
ITEM = "Item",
|
||||
ASSORTMENT_UNLOCK = "AssortmentUnlock"
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
export declare enum RaidMode {
|
||||
Online = "Online",
|
||||
Local = "Local",
|
||||
Coop = "Coop"
|
||||
ONLINE = "Online",
|
||||
LOCAL = "Local",
|
||||
COOP = "Coop"
|
||||
}
|
||||
|
@ -11,13 +11,13 @@ export declare class BotLootCache {
|
||||
grenadeItems: ITemplateItem[];
|
||||
}
|
||||
export declare enum LootCacheType {
|
||||
Special = "Special",
|
||||
Backpack = "Backpack",
|
||||
Pocket = "Pocket",
|
||||
Vest = "Vest",
|
||||
Combined = "Combined",
|
||||
HealingItems = "HealingItems",
|
||||
DrugItems = "DrugItems",
|
||||
StimItems = "StimItems",
|
||||
GrenadeItems = "GrenadeItems"
|
||||
SPECIAL = "Special",
|
||||
BACKPACK = "Backpack",
|
||||
POCKET = "Pocket",
|
||||
VEST = "Vest",
|
||||
COMBINED = "Combined",
|
||||
HEALING_ITEMS = "HealingItems",
|
||||
DRUG_ITEMS = "DrugItems",
|
||||
STIM_ITEMS = "StimItems",
|
||||
GRENADE_ITEMS = "GrenadeItems"
|
||||
}
|
||||
|
@ -2,6 +2,10 @@ import { IBaseConfig } from "./IBaseConfig";
|
||||
export interface IHideoutConfig extends IBaseConfig {
|
||||
kind: "aki-hideout";
|
||||
runIntervalSeconds: number;
|
||||
fuelDrainRateMultipler: number;
|
||||
hoursForSkillCrafting: number;
|
||||
generatorSpeedWithoutFuel: number;
|
||||
generatorFuelFlowRate: number;
|
||||
airFilterUnitFlowRate: number;
|
||||
/** SEE HIDEOUTHELPER BEFORE CHANGING CONFIG */
|
||||
gpuBoostRate: number;
|
||||
}
|
||||
|
@ -27,7 +27,13 @@ export interface Reputation {
|
||||
gain: number;
|
||||
loss: number;
|
||||
}
|
||||
export declare class OfferAdjustment {
|
||||
maxPriceDifferenceBelowHandbookPercent: number;
|
||||
handbookPriceMultipier: number;
|
||||
priceThreshholdRub: number;
|
||||
}
|
||||
export interface Dynamic {
|
||||
offerAdjustment: OfferAdjustment;
|
||||
expiredOfferThreshold: number;
|
||||
offerItemCount: MinMax;
|
||||
price: MinMax;
|
||||
|
@ -1,11 +1,11 @@
|
||||
export declare enum LogBackgroundColor {
|
||||
default = "",
|
||||
black = "blackBG",
|
||||
red = "redBG",
|
||||
green = "greenBG",
|
||||
yellow = "yellowBG",
|
||||
blue = "blueBG",
|
||||
magenta = "magentaBG",
|
||||
cyan = "cyanBG",
|
||||
white = "whiteBG"
|
||||
DEFAULT = "",
|
||||
BLACK = "blackBG",
|
||||
RED = "redBG",
|
||||
GREEN = "greenBG",
|
||||
YELLOW = "yellowBG",
|
||||
BLUE = "blueBG",
|
||||
MAGENTA = "magentaBG",
|
||||
CYAN = "cyanBG",
|
||||
WHITE = "whiteBG"
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
export declare enum LogTextColor {
|
||||
black = "black",
|
||||
red = "red",
|
||||
green = "green",
|
||||
yellow = "yellow",
|
||||
blue = "blue",
|
||||
magenta = "magenta",
|
||||
cyan = "cyan",
|
||||
white = "white",
|
||||
gray = ""
|
||||
BLACK = "black",
|
||||
RED = "red",
|
||||
GREEN = "green",
|
||||
YELLOW = "yellow",
|
||||
BLUE = "blue",
|
||||
MAGENTA = "magenta",
|
||||
CYAN = "cyan",
|
||||
WHITE = "white",
|
||||
GRAY = ""
|
||||
}
|
||||
|
@ -13,10 +13,10 @@ export interface ILocaleGlobalBase {
|
||||
season: Record<string, string>;
|
||||
customization: Record<string, ILocaleProps>;
|
||||
repeatableQuest: Record<string, string>;
|
||||
templates: ILocaleTemplateBase;
|
||||
locations: ILocaleLocationsBase;
|
||||
banners: ILocaleBannersBase;
|
||||
trading: ILocaleTradingBase;
|
||||
templates: Record<string, ILocaleProps>;
|
||||
locations: Record<string, ILocaleProps>;
|
||||
banners: Record<string, ILocaleProps>;
|
||||
trading: Record<string, ILocaleTradingProps>;
|
||||
}
|
||||
export interface ILocaleQuest {
|
||||
name: string;
|
||||
@ -31,23 +31,11 @@ export interface ILocaleQuest {
|
||||
export interface ILocalePreset {
|
||||
Name: string;
|
||||
}
|
||||
export interface ILocaleTemplateBase {
|
||||
templates: Record<string, ILocaleProps>;
|
||||
}
|
||||
export interface ILocaleLocationsBase {
|
||||
locations: Record<string, ILocaleProps>;
|
||||
}
|
||||
export interface ILocaleBannersBase {
|
||||
locations: Record<string, ILocaleProps>;
|
||||
}
|
||||
export interface ILocaleProps {
|
||||
Name: string;
|
||||
ShortName: string;
|
||||
Description: string;
|
||||
}
|
||||
export interface ILocaleTradingBase {
|
||||
locations: Record<string, ILocaleTradingProps>;
|
||||
}
|
||||
export interface ILocaleTradingProps {
|
||||
FullName: string;
|
||||
FirstName: string;
|
||||
|
@ -1,4 +1,6 @@
|
||||
import { RagfairOfferGenerator } from "../generators/RagfairOfferGenerator";
|
||||
import { TraderAssortHelper } from "../helpers/TraderAssortHelper";
|
||||
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";
|
||||
@ -12,11 +14,18 @@ export declare class RagfairServer {
|
||||
protected ragfairOfferService: RagfairOfferService;
|
||||
protected ragfairCategoriesService: RagfairCategoriesService;
|
||||
protected ragfairRequiredItemsService: RagfairRequiredItemsService;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected traderAssortHelper: TraderAssortHelper;
|
||||
protected configServer: ConfigServer;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
constructor(logger: ILogger, ragfairOfferGenerator: RagfairOfferGenerator, ragfairOfferService: RagfairOfferService, ragfairCategoriesService: RagfairCategoriesService, ragfairRequiredItemsService: RagfairRequiredItemsService, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, ragfairOfferGenerator: RagfairOfferGenerator, ragfairOfferService: RagfairOfferService, ragfairCategoriesService: RagfairCategoriesService, ragfairRequiredItemsService: RagfairRequiredItemsService, traderHelper: TraderHelper, traderAssortHelper: TraderAssortHelper, configServer: ConfigServer);
|
||||
load(): void;
|
||||
update(): void;
|
||||
/**
|
||||
* Get traders who need to be periodically refreshed
|
||||
* @returns string array of traders
|
||||
*/
|
||||
protected getUpdateableTraders(): string[];
|
||||
getAllCategories(): Record<string, number>;
|
||||
getBespokeCategories(offers: IRagfairOffer[]): Record<string, number>;
|
||||
/**
|
||||
|
@ -11,10 +11,12 @@ import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class FenceService {
|
||||
protected logger: ILogger;
|
||||
protected hashUtil: HashUtil;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected handbookHelper: HandbookHelper;
|
||||
@ -23,11 +25,24 @@ export declare class FenceService {
|
||||
protected configServer: ConfigServer;
|
||||
protected fenceAssort: ITraderAssort;
|
||||
protected traderConfig: ITraderConfig;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, configServer: ConfigServer);
|
||||
protected setFenceAssort(fenceAssort: ITraderAssort): void;
|
||||
getFenceAssorts(): ITraderAssort;
|
||||
hasExpiredCache(refreshAssort: boolean): boolean;
|
||||
/**
|
||||
* Get the count of items fence offers
|
||||
* @returns number
|
||||
*/
|
||||
getOfferCount(): number;
|
||||
generateFenceAssortCache(pmcData: IPmcData): void;
|
||||
/**
|
||||
* Get the next update timestamp for fence
|
||||
* @returns future timestamp
|
||||
*/
|
||||
getNextFenceUpdateTimestamp(): number;
|
||||
/**
|
||||
* Get fence refresh time in seconds
|
||||
*/
|
||||
protected getFenceRefreshTime(): number;
|
||||
/**
|
||||
* Get the fence level the passed in profile has
|
||||
* @param pmcData Player profile
|
||||
|
30
TypeScript/11BundleLoadingSample/types/services/ProfileSnapshotService.d.ts
vendored
Normal file
30
TypeScript/11BundleLoadingSample/types/services/ProfileSnapshotService.d.ts
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
export declare class ProfileSnapshotService {
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected storedProfileSnapshots: Record<string, IAkiProfile>;
|
||||
constructor(jsonUtil: JsonUtil);
|
||||
/**
|
||||
* Store a profile into an in-memory object
|
||||
* @param sessionID session id - acts as the key
|
||||
* @param profile - profile to save
|
||||
*/
|
||||
storeProfileSnapshot(sessionID: string, profile: IAkiProfile): void;
|
||||
/**
|
||||
* Retreve a stored profile
|
||||
* @param sessionID key
|
||||
* @returns A player profile object
|
||||
*/
|
||||
getProfileSnapshot(sessionID: string): IAkiProfile;
|
||||
/**
|
||||
* Does a profile exists against the provided key
|
||||
* @param sessionID key
|
||||
* @returns true if exists
|
||||
*/
|
||||
hasProfileSnapshot(sessionID: string): boolean;
|
||||
/**
|
||||
* Remove a stored profile by key
|
||||
* @param sessionID key
|
||||
*/
|
||||
clearProfileSnapshot(sessionID: string): void;
|
||||
}
|
@ -24,7 +24,6 @@ export declare class RagfairOfferService {
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected configServer: ConfigServer;
|
||||
protected playerOffersLoaded: boolean;
|
||||
protected toUpdate: Record<string, boolean>;
|
||||
protected expiredOffers: Item[];
|
||||
protected offers: IRagfairOffer[];
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
@ -38,8 +37,6 @@ export declare class RagfairOfferService {
|
||||
getOffersOfType(templateId: string): IRagfairOffer[];
|
||||
addOffer(offer: IRagfairOffer): void;
|
||||
addOfferToExpired(staleOffer: IRagfairOffer): void;
|
||||
setTraderUpdateStatus(traderId: string, shouldUpdate: boolean): void;
|
||||
shouldTraderBeUpdated(traderID: string): boolean;
|
||||
getExpiredOfferCount(): number;
|
||||
/**
|
||||
* Get an array of expired items not yet processed into new offers
|
||||
@ -53,12 +50,15 @@ export declare class RagfairOfferService {
|
||||
* @returns offer exists - true
|
||||
*/
|
||||
doesOfferExist(offerId: string): boolean;
|
||||
getTraders(): Record<string, boolean>;
|
||||
flagTraderForUpdate(expiredOfferUserId: string): void;
|
||||
removeOfferById(offerId: string): void;
|
||||
removeOfferStack(offerID: string, amount: number): void;
|
||||
removeAllOffersByTrader(traderId: string): void;
|
||||
addTradersToUpdateList(): void;
|
||||
/**
|
||||
* Do the trader offers on flea need to be refreshed
|
||||
* @param traderID Trader to check
|
||||
* @returns true if they do
|
||||
*/
|
||||
traderOffersNeedRefreshing(traderID: string): boolean;
|
||||
addPlayerOffers(): void;
|
||||
expireStaleOffers(): void;
|
||||
/**
|
||||
|
@ -27,6 +27,20 @@ export declare class RagfairPriceService {
|
||||
getDynamicPrice(itemTpl: string): number;
|
||||
getAllFleaPrices(): Record<string, number>;
|
||||
getFleaPriceForItem(tplId: string): number;
|
||||
/**
|
||||
* Check to see if an items price is below its handbook price and adjust accoring to values set to config/ragfair.json
|
||||
* @param itemPrice price of item
|
||||
* @param itemTpl item template Id being checked
|
||||
* @returns adjusted price value in roubles
|
||||
*/
|
||||
protected adjustPriceIfBelowHandbook(itemPrice: number, itemTpl: string): number;
|
||||
/**
|
||||
* Get the percentage difference between two values
|
||||
* @param a numerical value a
|
||||
* @param b numerical value b
|
||||
* @returns different in percent
|
||||
*/
|
||||
protected getPriceDifference(a: number, b: number): number;
|
||||
getStaticPriceForItem(tplId: string): number;
|
||||
getBarterPrice(barterScheme: IBarterScheme[]): number;
|
||||
getDynamicOfferPrice(items: Item[], desiredCurrency: string): number;
|
||||
|
@ -2,5 +2,10 @@ import { ITraderAssort } from "../models/eft/common/tables/ITrader";
|
||||
export declare class TraderAssortService {
|
||||
protected pristineTraderAssorts: Record<string, ITraderAssort>;
|
||||
getPristineTraderAssort(traderId: string): ITraderAssort;
|
||||
/**
|
||||
* Store trader assorts inside a class property
|
||||
* @param traderId Traderid to store assorts against
|
||||
* @param assort Assorts to store
|
||||
*/
|
||||
setPristineTraderAssort(traderId: string, assort: ITraderAssort): void;
|
||||
}
|
||||
|
@ -4,6 +4,10 @@ export declare class TimeUtil {
|
||||
formatDate(date: Date): string;
|
||||
getDate(): string;
|
||||
getTime(): string;
|
||||
/**
|
||||
* Get timestamp in seconds
|
||||
* @returns
|
||||
*/
|
||||
getTimestamp(): number;
|
||||
/**
|
||||
* mail in eft requires time be in a specific format
|
||||
|
@ -4,7 +4,7 @@
|
||||
"main": "src/mod.js",
|
||||
"license": "MIT",
|
||||
"author": "Chomp",
|
||||
"akiVersion": "3.1.1",
|
||||
"akiVersion": "3.2.1",
|
||||
"scripts": {
|
||||
"setup:environment": "npm i",
|
||||
"build:unzipped": "copyfiles -e \"./node_modules/**/*.*\" -e \"./dist/**/*.*\" -e \"./package-lock.json\" -e \"./tsconfig.json\" -e \"./README.txt\" -e \"./mod.code-workspace\" \"./**/*.*\" ./dist",
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { InsuranceController } from "../controllers/InsuranceController";
|
||||
import { OnLoadOnUpdate } from "../di/OnLoadOnUpdate";
|
||||
import { OnUpdate } from "../di/OnUpdate";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { IGetInsuranceCostRequestData } from "../models/eft/insurance/IGetInsuranceCostRequestData";
|
||||
@ -10,14 +10,13 @@ import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { InsuranceService } from "../services/InsuranceService";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
export declare class InsuranceCallbacks extends OnLoadOnUpdate {
|
||||
export declare class InsuranceCallbacks extends OnUpdate {
|
||||
protected insuranceController: InsuranceController;
|
||||
protected insuranceService: InsuranceService;
|
||||
protected httpResponse: HttpResponseUtil;
|
||||
protected configServer: ConfigServer;
|
||||
protected insuranceConfig: IInsuranceConfig;
|
||||
constructor(insuranceController: InsuranceController, insuranceService: InsuranceService, httpResponse: HttpResponseUtil, configServer: ConfigServer);
|
||||
onLoad(): void;
|
||||
getInsuranceCost(url: string, info: IGetInsuranceCostRequestData, sessionID: string): IGetBodyResponseData<IGetInsuranceCostResponseData>;
|
||||
insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
onUpdate(secondsSinceLastRun: number): boolean;
|
||||
|
@ -9,10 +9,10 @@ export declare class TraderCallbacks extends OnLoadOnUpdate {
|
||||
protected traderController: TraderController;
|
||||
constructor(httpResponse: HttpResponseUtil, traderController: TraderController);
|
||||
onLoad(): void;
|
||||
onUpdate(): boolean;
|
||||
getRoute(): string;
|
||||
getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase[]>;
|
||||
getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, IBarterScheme[][]>>;
|
||||
getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase>;
|
||||
getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderAssort>;
|
||||
onUpdate(): boolean;
|
||||
}
|
||||
|
@ -25,4 +25,5 @@ export declare class GameController {
|
||||
protected logProfileDetails(fullProfile: IAkiProfile): void;
|
||||
getGameConfig(sessionID: string): IGameConfigResponse;
|
||||
getServer(): any[];
|
||||
getValidGameVersion(): any;
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ import { HashUtil } from "../utils/HashUtil";
|
||||
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
export declare class HideoutController {
|
||||
protected logger: ILogger;
|
||||
protected hashUtil: HashUtil;
|
||||
@ -45,9 +46,10 @@ export declare class HideoutController {
|
||||
protected hideoutHelper: HideoutHelper;
|
||||
protected scavCaseRewardGenerator: ScavCaseRewardGenerator;
|
||||
protected configServer: ConfigServer;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected static nameBackendCountersCrafting: string;
|
||||
protected hideoutConfig: IHideoutConfig;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil);
|
||||
upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
/**
|
||||
|
@ -5,9 +5,11 @@ import { ItemHelper } from "../helpers/ItemHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { QuestHelper } from "../helpers/QuestHelper";
|
||||
import { TraderHelper } from "../helpers/TraderHelper";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData";
|
||||
import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData";
|
||||
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
@ -15,6 +17,7 @@ import { InsuranceService } from "../services/InsuranceService";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class InraidController {
|
||||
protected logger: ILogger;
|
||||
protected saveServer: SaveServer;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
@ -29,7 +32,7 @@ export declare class InraidController {
|
||||
protected inRaidHelper: InRaidHelper;
|
||||
protected configServer: ConfigServer;
|
||||
protected inraidConfig: IInRaidConfig;
|
||||
constructor(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, configServer: ConfigServer);
|
||||
addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void;
|
||||
saveProgress(offraidData: ISaveProgressRequestData, sessionID: string): void;
|
||||
/**
|
||||
@ -38,7 +41,7 @@ export declare class InraidController {
|
||||
* @param pmcData player profile
|
||||
* @param isPlayerScav Was the player a pScav
|
||||
*/
|
||||
private markOrRemoveFoundInRaidItems;
|
||||
private handlePostRaidPlayerScavProcess;
|
||||
private handlePostRaidPlayerScavKarmaChanges;
|
||||
protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void;
|
||||
protected handlePostRaidPlayerScavProcess(scavData: IPmcData, sessionID: string, offraidData: ISaveProgressRequestData, pmcData: IPmcData, isDead: boolean): void;
|
||||
protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData, sessionID: string): void;
|
||||
}
|
||||
|
@ -11,21 +11,25 @@ import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult";
|
||||
import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData";
|
||||
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
|
||||
import { IMatchConfig } from "../models/spt/config/IMatchConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { BotLootCacheService } from "../services/BotLootCacheService";
|
||||
import { MatchLocationService } from "../services/MatchLocationService";
|
||||
import { ProfileSnapshotService } from "../services/ProfileSnapshotService";
|
||||
export declare class MatchController {
|
||||
protected logger: ILogger;
|
||||
protected saveServer: SaveServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected matchLocationService: MatchLocationService;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected botLootCacheService: BotLootCacheService;
|
||||
protected configServer: ConfigServer;
|
||||
protected profileSnapshotService: ProfileSnapshotService;
|
||||
protected applicationContext: ApplicationContext;
|
||||
protected matchConfig: IMatchConfig;
|
||||
protected inraidConfig: IInRaidConfig;
|
||||
constructor(saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, applicationContext: ApplicationContext);
|
||||
constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, applicationContext: ApplicationContext);
|
||||
getEnabled(): boolean;
|
||||
getProfile(info: IGetProfileRequestData): IPmcData[];
|
||||
createGroup(sessionID: string, info: ICreateGroupRequestData): any;
|
||||
|
@ -17,10 +17,25 @@ export declare class TraderController {
|
||||
protected traderAssortService: TraderAssortService;
|
||||
protected jsonUtil: JsonUtil;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, jsonUtil: JsonUtil);
|
||||
/**
|
||||
* Runs when onLoad event is fired
|
||||
* Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService
|
||||
* Store timestamp of next assort refresh in nextResupply property of traders .base object
|
||||
*/
|
||||
load(): void;
|
||||
getTrader(traderID: string, sessionID: string): ITraderBase;
|
||||
/**
|
||||
* Runs when onUpdate is fired
|
||||
* If current time is > nextResupply(expire) time of trader, refresh traders assorts and
|
||||
* @returns has run
|
||||
*/
|
||||
update(): boolean;
|
||||
/**
|
||||
* Return an array of all traders
|
||||
* @param sessionID Session id
|
||||
* @returns array if ITraderBase objects
|
||||
*/
|
||||
getAllTraders(sessionID: string): ITraderBase[];
|
||||
updateTraders(): boolean;
|
||||
getTrader(sessionID: string, traderID: string): ITraderBase;
|
||||
getAssort(sessionId: string, traderId: string): ITraderAssort;
|
||||
getPurchasesData(traderID: string, sessionID: string): Record<string, IBarterScheme[][]>;
|
||||
getPurchasesData(sessionID: string, traderID: string): Record<string, IBarterScheme[][]>;
|
||||
}
|
||||
|
@ -41,15 +41,37 @@ export declare class RagfairOfferGenerator {
|
||||
createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer;
|
||||
protected getTraderId(userID: string): string;
|
||||
protected getRating(userID: string): number;
|
||||
/**
|
||||
* Is the offers user rating growing
|
||||
* @param userID user to check rating of
|
||||
* @returns true if its growing
|
||||
*/
|
||||
protected getRatingGrowing(userID: string): boolean;
|
||||
/**
|
||||
* Get number of section until offer should expire
|
||||
* @param userID Id of the offer owner
|
||||
* @param time Time the offer is posted
|
||||
* @returns number of seconds until offer expires
|
||||
*/
|
||||
protected getOfferEndTime(userID: string, time: number): number;
|
||||
/**
|
||||
* Create multiple offers for items by using a unique list of items we've generated previously
|
||||
* @param expiredOffers
|
||||
* @param expiredOffers optional, expired offers to regenerate
|
||||
*/
|
||||
generateDynamicOffers(expiredOffers?: Item[]): void;
|
||||
generateTraderOffers(traderID: string): void;
|
||||
/**
|
||||
* Generate trader offers on flea using the traders assort data
|
||||
* @param traderID Trader to generate offers for
|
||||
*/
|
||||
generateFleaOffersForTrader(traderID: string): void;
|
||||
protected getItemCondition(userID: string, items: Item[], itemDetails: ITemplateItem): Item[];
|
||||
/**
|
||||
* Add missing conditions to an item if needed
|
||||
* Durabiltiy for repairable items
|
||||
* HpResource for medical items
|
||||
* @param item item to add conditions to
|
||||
* @returns Item with conditions added
|
||||
*/
|
||||
protected addMissingCondition(item: Item): Item;
|
||||
protected getOfferRequirements(items: Item[]): {
|
||||
count: number;
|
||||
@ -57,6 +79,14 @@ export declare class RagfairOfferGenerator {
|
||||
}[];
|
||||
/**
|
||||
* Create a flea offer and store it in the Ragfair server offers array
|
||||
* @param userID owner of the offer
|
||||
* @param time time offer is put up
|
||||
* @param items items in the offer
|
||||
* @param barterScheme
|
||||
* @param loyalLevel
|
||||
* @param price price of offer
|
||||
* @param sellInOnePiece
|
||||
* @returns
|
||||
*/
|
||||
createFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece?: boolean): IRagfairOffer;
|
||||
}
|
||||
|
@ -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 { ProfileFixerService } from "../services/ProfileFixerService";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { InventoryHelper } from "./InventoryHelper";
|
||||
import { PaymentHelper } from "./PaymentHelper";
|
||||
@ -15,7 +16,8 @@ export declare class InRaidHelper {
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected inventoryHelper: InventoryHelper;
|
||||
protected paymentHelper: PaymentHelper;
|
||||
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, paymentHelper: PaymentHelper);
|
||||
protected profileFixerService: ProfileFixerService;
|
||||
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, databaseServer: DatabaseServer, inventoryHelper: InventoryHelper, paymentHelper: PaymentHelper, profileFixerService: ProfileFixerService);
|
||||
/**
|
||||
* Reset the SPT inraid property stored in a profile to 'none'
|
||||
* @param sessionID Session id
|
||||
|
@ -43,6 +43,7 @@ export declare class InventoryHelper {
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, httpResponse: HttpResponseUtil, fenceService: FenceService, databaseServer: DatabaseServer, paymentHelper: PaymentHelper, traderAssortHelper: TraderAssortHelper, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, containerHelper: ContainerHelper, profileHelper: ProfileHelper, configServer: ConfigServer);
|
||||
addItem(pmcData: IPmcData, body: IAddItemRequestData, output: IItemEventRouterResponse, sessionID: string, callback: any, foundInRaid?: boolean, addUpd?: any): IItemEventRouterResponse;
|
||||
removeItem(pmcData: IPmcData, itemId: string, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
removeItemByCount(pmcData: IPmcData, itemId: string, count: number, sessionID: string, output?: IItemEventRouterResponse): IItemEventRouterResponse;
|
||||
getItemSize(itemTpl: string, itemID: string, inventoryItem: Item[]): Record<number, number>;
|
||||
protected getSizeByInventoryItemHash(itemTpl: string, itemID: string, inventoryItemHash: InventoryHelper.InventoryItemHash): Record<number, number>;
|
||||
protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash;
|
||||
|
@ -2,22 +2,26 @@ import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Stats } from "../models/eft/common/tables/IBotBase";
|
||||
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
|
||||
import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData";
|
||||
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";
|
||||
import { Watermark } from "../utils/Watermark";
|
||||
import { ItemHelper } from "./ItemHelper";
|
||||
export declare class ProfileHelper {
|
||||
protected logger: ILogger;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected watermark: Watermark;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected saveServer: SaveServer;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected profileSnapshotService: ProfileSnapshotService;
|
||||
protected fenceService: FenceService;
|
||||
constructor(jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, fenceService: FenceService);
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, fenceService: FenceService);
|
||||
resetProfileQuestCondition(sessionID: string, conditionId: string): void;
|
||||
getCompleteProfile(sessionID: string): IPmcData[];
|
||||
isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean;
|
||||
|
@ -42,7 +42,15 @@ export declare class QuestHelper {
|
||||
*/
|
||||
evaluateLevel(pmcProfile: IPmcData, cond: AvailableForConditions): boolean;
|
||||
getDeltaQuests(before: IQuest[], after: IQuest[]): IQuest[];
|
||||
rewardSkillPoints(sessionID: string, pmcData: IPmcData, output: IItemEventRouterResponse, skillName: string, progress: number): void;
|
||||
/**
|
||||
* Increase skill points of a skill on player profile
|
||||
* @param sessionID Session id
|
||||
* @param pmcData Player profile
|
||||
* @param output output object to send back to client
|
||||
* @param skillName Name of skill to increase skill points of
|
||||
* @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
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { RagfairAssortGenerator } from "../generators/RagfairAssortGenerator";
|
||||
import { RagfairOfferGenerator } from "../generators/RagfairOfferGenerator";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { ITraderAssort } from "../models/eft/common/tables/ITrader";
|
||||
import { ITrader, ITraderAssort } from "../models/eft/common/tables/ITrader";
|
||||
import { ITraderConfig } from "../models/spt/config/ITraderConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
@ -10,13 +11,16 @@ import { FenceService } from "../services/FenceService";
|
||||
import { TraderAssortService } from "../services/TraderAssortService";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { MathUtil } from "../utils/MathUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
import { AssortHelper } from "./AssortHelper";
|
||||
import { PaymentHelper } from "./PaymentHelper";
|
||||
import { ProfileHelper } from "./ProfileHelper";
|
||||
import { TraderHelper } from "./TraderHelper";
|
||||
export declare class TraderAssortHelper {
|
||||
protected logger: ILogger;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected mathUtil: MathUtil;
|
||||
protected timeUtil: TimeUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected assortHelper: AssortHelper;
|
||||
@ -24,18 +28,37 @@ export declare class TraderAssortHelper {
|
||||
protected ragfairAssortGenerator: RagfairAssortGenerator;
|
||||
protected ragfairOfferGenerator: RagfairOfferGenerator;
|
||||
protected traderAssortService: TraderAssortService;
|
||||
protected traderHelper: TraderHelper;
|
||||
protected fenceService: FenceService;
|
||||
protected configServer: ConfigServer;
|
||||
protected traderConfig: ITraderConfig;
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, mathUtil: MathUtil, databaseServer: DatabaseServer, profileHelper: ProfileHelper, assortHelper: AssortHelper, paymentHelper: PaymentHelper, ragfairAssortGenerator: RagfairAssortGenerator, ragfairOfferGenerator: RagfairOfferGenerator, traderAssortService: TraderAssortService, 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, traderHelper: TraderHelper, fenceService: FenceService, configServer: ConfigServer);
|
||||
/**
|
||||
* Get a traders assorts
|
||||
* Can be used for returning ragfair / fence assorts
|
||||
* Filter out assorts not unlocked due to level OR quest completion
|
||||
* @param sessionId session id
|
||||
* @param traderId trader id
|
||||
* @returns a traders assorts
|
||||
* @param traderId traders id
|
||||
* @returns a traders' assorts
|
||||
*/
|
||||
getAssort(sessionId: string, traderId: string): ITraderAssort;
|
||||
/**
|
||||
* if the fence assorts have expired, re-generate them
|
||||
* @param pmcProfile Players profile
|
||||
*/
|
||||
refreshFenceAssortIfExpired(pmcProfile: IPmcData): void;
|
||||
/**
|
||||
* Reset a traders assorts and move nextResupply value to future
|
||||
* Flag trader as needing a flea offer reset to be picked up by flea update() function
|
||||
* @param trader trader details to alter
|
||||
*/
|
||||
resetExpiredTrader(trader: ITrader): void;
|
||||
/**
|
||||
* Does the supplied trader need its assorts refreshed
|
||||
* @param traderID Trader to check
|
||||
* @returns true they need refreshing
|
||||
*/
|
||||
traderAssortsHaveExpired(traderID: string): boolean;
|
||||
/**
|
||||
* Iterate over all assorts barter_scheme values, find barters selling for money and multiply by multipler in config
|
||||
* @param traderAssort Assorts to multiple price of
|
||||
|
@ -9,6 +9,7 @@ import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { FenceService } from "../services/FenceService";
|
||||
import { PlayerService } from "../services/PlayerService";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
import { HandbookHelper } from "./HandbookHelper";
|
||||
import { ItemHelper } from "./ItemHelper";
|
||||
import { PaymentHelper } from "./PaymentHelper";
|
||||
@ -23,9 +24,10 @@ export declare class TraderHelper {
|
||||
protected handbookHelper: HandbookHelper;
|
||||
protected playerService: PlayerService;
|
||||
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, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer);
|
||||
getTrader(traderID: string, sessionID: string): ITraderBase;
|
||||
getTraderAssortsById(traderId: string): ITraderAssort;
|
||||
/**
|
||||
@ -97,6 +99,17 @@ export declare class TraderHelper {
|
||||
* @param sessionID session id
|
||||
*/
|
||||
lvlUp(traderID: string, sessionID: string): void;
|
||||
/**
|
||||
* Get the next update timestamp for a trader
|
||||
* @param traderID Trader to look up update value for
|
||||
* @returns future timestamp
|
||||
*/
|
||||
getNextUpdateTimestamp(traderID: string): number;
|
||||
/**
|
||||
* Get the reset time between trader assort refreshes in seconds
|
||||
* @param traderId Trader to look up
|
||||
* @returns Time in seconds
|
||||
*/
|
||||
getTraderUpdateSeconds(traderId: string): number;
|
||||
/**
|
||||
* check if an item is allowed to be sold to a trader
|
||||
|
@ -32,6 +32,17 @@ export declare class PreAkiModLoader implements IModLoader {
|
||||
getModPath(mod: string): string;
|
||||
protected importClass(name: string, filepath: string, container: DependencyContainer): void;
|
||||
protected importMods(): Promise<void>;
|
||||
/**
|
||||
* Check for duplciate mods loaded, show error if duplicate mod found
|
||||
* @param modPackageData dictionary of mod package.json data
|
||||
*/
|
||||
protected checkForDuplicateMods(modPackageData: Record<string, IPackageJsonData>): void;
|
||||
/**
|
||||
* Check for and return duplicate strings inside an array
|
||||
* @param stringArray Array to check for duplicates
|
||||
* @returns string array of duplicates, empty if none found
|
||||
*/
|
||||
protected getDuplicates(stringArray: string[]): string[];
|
||||
/**
|
||||
*
|
||||
* @param mods Get an array of broken/invalid mods by name
|
||||
|
@ -137,7 +137,7 @@ export interface BotLocationModifier {
|
||||
VisibleDistance: number;
|
||||
}
|
||||
export interface MinMaxBot {
|
||||
WildSpawnType: string;
|
||||
WildSpawnType: WildSpawnType;
|
||||
max: number;
|
||||
min: number;
|
||||
}
|
||||
@ -195,7 +195,7 @@ export interface Wave {
|
||||
BotPreset: string;
|
||||
BotSide: string;
|
||||
SpawnPoints: string;
|
||||
WildSpawnType: string;
|
||||
WildSpawnType: WildSpawnType;
|
||||
isPlayers: boolean;
|
||||
number: number;
|
||||
slots_max: number;
|
||||
@ -203,3 +203,7 @@ export interface Wave {
|
||||
time_max: number;
|
||||
time_min: number;
|
||||
}
|
||||
export declare enum WildSpawnType {
|
||||
ASSAULT = "assault",
|
||||
MARKSMAN = "marksman"
|
||||
}
|
||||
|
@ -66,13 +66,13 @@ export interface IBan {
|
||||
dateTime: number;
|
||||
}
|
||||
export declare enum BanType {
|
||||
Chat = 0,
|
||||
RagFair = 1,
|
||||
Voip = 2,
|
||||
Trading = 3,
|
||||
Online = 4,
|
||||
Friends = 5,
|
||||
ChangeNickname = 6
|
||||
CHAT = 0,
|
||||
RAGFAIR = 1,
|
||||
VOIP = 2,
|
||||
TRADING = 3,
|
||||
ONLINE = 4,
|
||||
FRIENDS = 5,
|
||||
CHANGE_NICKNAME = 6
|
||||
}
|
||||
export interface Customization {
|
||||
Head: string;
|
||||
@ -312,11 +312,11 @@ export interface Notes {
|
||||
export interface CarExtractCounts {
|
||||
}
|
||||
export declare enum SurvivorClass {
|
||||
Unknown = 0,
|
||||
Neutralizer = 1,
|
||||
Marauder = 2,
|
||||
Paramedic = 3,
|
||||
Survivor = 4
|
||||
UNKNOWN = 0,
|
||||
NEUTRALIZER = 1,
|
||||
MARAUDER = 2,
|
||||
PARAMEDIC = 3,
|
||||
SURVIVOR = 4
|
||||
}
|
||||
export interface Quest {
|
||||
qid: string;
|
||||
|
@ -7,7 +7,7 @@ export interface ITrader {
|
||||
suits?: ISuit[];
|
||||
}
|
||||
export interface ITraderBase {
|
||||
refreshAssort: boolean;
|
||||
refreshTraderRagfairOffers: boolean;
|
||||
_id: string;
|
||||
avatar: string;
|
||||
balance_dol: number;
|
||||
@ -58,7 +58,7 @@ export interface Repair {
|
||||
quality: string;
|
||||
}
|
||||
export interface ITraderAssort {
|
||||
nextResupply?: number;
|
||||
nextResupply: number;
|
||||
items: Item[];
|
||||
barter_scheme: Record<string, IBarterScheme[][]>;
|
||||
loyal_level_items: Record<string, number>;
|
||||
|
@ -1,5 +1,5 @@
|
||||
export declare enum Effect {
|
||||
Fracture = "Fracture",
|
||||
LightBleeding = "LightBleeding",
|
||||
HeavyBleeding = "HeavyBleeding"
|
||||
FRACTURE = "Fracture",
|
||||
LIGHT_BLEEDING = "LightBleeding",
|
||||
HEAVY_BLEEDING = "HeavyBleeding"
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user