Update types
This commit is contained in:
parent
3aa2cbee09
commit
8fa9938398
@ -6,19 +6,23 @@ import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
|
||||
import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
|
||||
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
|
||||
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
|
||||
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { Watermark } from "../utils/Watermark";
|
||||
export declare class GameController {
|
||||
protected logger: ILogger;
|
||||
protected watermark: Watermark;
|
||||
protected httpServerHelper: HttpServerHelper;
|
||||
protected localeService: LocaleService;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected gameHelper: GameHelper;
|
||||
protected configServer: ConfigServer;
|
||||
protected httpConfig: IHttpConfig;
|
||||
constructor(logger: ILogger, watermark: Watermark, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, gameHelper: GameHelper, configServer: ConfigServer);
|
||||
protected coreConfig: ICoreConfig;
|
||||
constructor(logger: ILogger, watermark: Watermark, httpServerHelper: HttpServerHelper, localeService: LocaleService, profileHelper: ProfileHelper, gameHelper: GameHelper, configServer: ConfigServer);
|
||||
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string): void;
|
||||
protected addMissingBonusesProperty(pmcProfile: IPmcData): void;
|
||||
protected addMissingRepeatableQuestsProperty(pmcProfile: IPmcData): void;
|
||||
|
@ -14,6 +14,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ItemEventRouter } from "../routers/ItemEventRouter";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { PlayerService } from "../services/PlayerService";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class QuestController {
|
||||
@ -27,9 +28,10 @@ export declare class QuestController {
|
||||
protected questHelper: QuestHelper;
|
||||
protected questConditionHelper: QuestConditionHelper;
|
||||
protected playerService: PlayerService;
|
||||
protected localeService: LocaleService;
|
||||
protected configServer: ConfigServer;
|
||||
protected questConfig: IQuestConfig;
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer);
|
||||
/**
|
||||
* Get all quests visible to player
|
||||
* Exclude quests with incomplete preconditions (level/loyalty)
|
||||
|
@ -84,6 +84,11 @@ declare class ItemHelper {
|
||||
*/
|
||||
generateItemsFromStackSlot(item: ITemplateItem, parentId: string): Item[];
|
||||
getItem(tpl: string): [boolean, ITemplateItem];
|
||||
/**
|
||||
* get normalized value (0-1) based on item condition
|
||||
* @param item
|
||||
* @returns number between 0 and 1
|
||||
*/
|
||||
getItemQualityModifier(item: Item): number;
|
||||
findAndReturnChildrenByItems(items: Item[], itemID: string): string[];
|
||||
/**
|
||||
|
@ -8,6 +8,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ItemEventRouter } from "../routers/ItemEventRouter";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
@ -25,6 +26,7 @@ export declare class QuestHelper {
|
||||
protected itemHelper: ItemHelper;
|
||||
protected itemEventRouter: ItemEventRouter;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected localeService: LocaleService;
|
||||
protected ragfairServerHelper: RagfairServerHelper;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
@ -32,7 +34,7 @@ export declare class QuestHelper {
|
||||
protected traderHelper: TraderHelper;
|
||||
protected configServer: ConfigServer;
|
||||
protected questConfig: IQuestConfig;
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, configServer: ConfigServer);
|
||||
static get STATUS(): Record<string, number>;
|
||||
questStatus(pmcData: IPmcData, questID: string): string;
|
||||
/**
|
||||
@ -74,7 +76,7 @@ export declare class QuestHelper {
|
||||
cleanQuestConditions(quest: IQuest): IQuest;
|
||||
failQuest(pmcData: IPmcData, body: any, sessionID: string): any;
|
||||
getQuestFromDb(questId: string, pmcData: IPmcData): IQuest;
|
||||
getQuestLocaleIdFromDb(messageId: string, localisation?: string): string;
|
||||
getQuestLocaleIdFromDb(messageId: string): string;
|
||||
applyQuestReward(pmcData: IPmcData, body: ICompleteQuestRequestData, state: string, sessionID: string): Reward[];
|
||||
/**
|
||||
* Get the intel center bonus a player has
|
||||
|
@ -10,6 +10,7 @@ import { ItemEventRouter } from "../routers/ItemEventRouter";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { RagfairOfferService } from "../services/RagfairOfferService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
@ -37,11 +38,12 @@ export declare class RagfairOfferHelper {
|
||||
protected ragfairSortHelper: RagfairSortHelper;
|
||||
protected ragfairHelper: RagfairHelper;
|
||||
protected ragfairOfferService: RagfairOfferService;
|
||||
protected localeService: LocaleService;
|
||||
protected configServer: ConfigServer;
|
||||
protected static TPL_GOODS_SOLD: string;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
protected questConfig: IQuestConfig;
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer);
|
||||
getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
|
||||
getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
|
||||
processOffers(sessionID: string): boolean;
|
||||
|
@ -1,11 +1,12 @@
|
||||
import { MemberCategory } from "../models/enums/MemberCategory";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { MemberCategory } from "../models/enums/MemberCategory";
|
||||
import { IQuestConfig } from "../models/spt/config/IQuestConfig";
|
||||
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
@ -19,13 +20,14 @@ export declare class RagfairServerHelper {
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected localeService: LocaleService;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected configServer: ConfigServer;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
protected questConfig: IQuestConfig;
|
||||
protected static TPL_GOODS_RETURNED: string;
|
||||
constructor(randomUtil: RandomUtil, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, jsonUtil: JsonUtil, configServer: ConfigServer);
|
||||
constructor(randomUtil: RandomUtil, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, jsonUtil: JsonUtil, configServer: ConfigServer);
|
||||
/**
|
||||
* Is item valid / on blacklist / quest item
|
||||
* @param itemDetails
|
||||
|
@ -1,8 +1,10 @@
|
||||
import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
export declare class RagfairSortHelper {
|
||||
protected databaseServer: DatabaseServer;
|
||||
constructor(databaseServer: DatabaseServer);
|
||||
protected localeService: LocaleService;
|
||||
constructor(databaseServer: DatabaseServer, localeService: LocaleService);
|
||||
sortOffers(offers: IRagfairOffer[], type: number, direction?: number): IRagfairOffer[];
|
||||
protected sortOffersByID(a: IRagfairOffer, b: IRagfairOffer): number;
|
||||
protected sortOffersByRating(a: IRagfairOffer, b: IRagfairOffer): number;
|
||||
|
@ -1,4 +1,6 @@
|
||||
import { FenceLevel } from "../models/eft/common/IGlobals";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { IBarterScheme, ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader";
|
||||
import { ITraderConfig } from "../models/spt/config/ITraderConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
@ -34,7 +36,48 @@ export declare class TraderHelper {
|
||||
*/
|
||||
resetTrader(sessionID: string, traderID: string): void;
|
||||
changeTraderDisplay(traderID: string, status: boolean, sessionID: string): void;
|
||||
/**
|
||||
* Get a list of items and their prices from player inventory that can be sold to a trader
|
||||
* @param traderID trader id being traded with
|
||||
* @param sessionID session id
|
||||
* @returns IBarterScheme[][]
|
||||
*/
|
||||
getPurchasesData(traderID: string, sessionID: string): Record<string, IBarterScheme[][]>;
|
||||
/**
|
||||
* Should item be skipped when selling to trader according to its sell categories and other checks
|
||||
* @param pmcData
|
||||
* @param item
|
||||
* @param sellCategory
|
||||
* @returns true if should NOT be sold to trader
|
||||
*/
|
||||
protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[]): boolean;
|
||||
/**
|
||||
* Can this weapon be sold to a trader with its current durabiltiy level
|
||||
* @param traderID
|
||||
* @param item
|
||||
* @returns boolean
|
||||
*/
|
||||
protected isWeaponAndBelowTraderBuyDurability(traderID: string, item: Item): boolean;
|
||||
/**
|
||||
* Get the price of an item and all of its attached children
|
||||
* Take into account bonuses/adjsutments e.g. discounts
|
||||
* @param pmcData profile data
|
||||
* @param item item to calculate price of
|
||||
* @param buyPriceCoefficient
|
||||
* @param fenceInfo fence data
|
||||
* @param traderBase trader details
|
||||
* @param currencyTpl Currency to get price as
|
||||
* @returns price of item + children
|
||||
*/
|
||||
protected getAdjustedItemPrice(pmcData: IPmcData, item: Item, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderBase: ITraderBase, currencyTpl: string): number;
|
||||
/**
|
||||
* Get the raw price of item+child items from handbook without any modification
|
||||
* @param pmcData profile data
|
||||
* @param item item to calculate price of
|
||||
* @returns price as number
|
||||
*/
|
||||
protected getRawItemPrice(pmcData: IPmcData, item: Item): number;
|
||||
protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderID: string): number;
|
||||
/**
|
||||
* Calculate traders level based on exp amount and increment level if over threshold
|
||||
* @param traderID trader to process
|
||||
|
11
TypeScript/10ScopesAndTypes/types/loaders/AfterDbModLoader.d.ts
vendored
Normal file
11
TypeScript/10ScopesAndTypes/types/loaders/AfterDbModLoader.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
import { DependencyContainer } from "tsyringe";
|
||||
import { OnLoad } from "../di/OnLoad";
|
||||
import { InitialModLoader } from "./InitialModLoader";
|
||||
export declare class AfterDbModLoader implements OnLoad {
|
||||
protected initialModLoader: InitialModLoader;
|
||||
constructor(initialModLoader: InitialModLoader);
|
||||
onLoad(): void;
|
||||
getRoute(): string;
|
||||
getModPath(mod: string): string;
|
||||
protected executeMods(container: DependencyContainer): void;
|
||||
}
|
@ -8,6 +8,7 @@ export declare enum ConfigTypes {
|
||||
IN_RAID = "aki-inraid",
|
||||
INSURANCE = "aki-insurance",
|
||||
INVENTORY = "aki-inventory",
|
||||
LOCALE = "aki-locale",
|
||||
LOCATION = "aki-location",
|
||||
MATCH = "aki-match",
|
||||
QUEST = "aki-quest",
|
||||
|
4
TypeScript/10ScopesAndTypes/types/models/external/IAfterDBLoadMod.d.ts
vendored
Normal file
4
TypeScript/10ScopesAndTypes/types/models/external/IAfterDBLoadMod.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import { DependencyContainer } from "./tsyringe";
|
||||
export interface IAfterDBLoadMod {
|
||||
loadAfterDbInit(container: DependencyContainer): void;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
import { DependencyContainer } from "./tsyringe";
|
||||
export interface IMod {
|
||||
load: (container: DependencyContainer) => void;
|
||||
delayedLoad: (container: DependencyContainer) => void;
|
||||
load(container: DependencyContainer): void;
|
||||
delayedLoad(container: DependencyContainer): void;
|
||||
}
|
||||
|
5
TypeScript/10ScopesAndTypes/types/models/spt/config/ILocaleConfig.d.ts
vendored
Normal file
5
TypeScript/10ScopesAndTypes/types/models/spt/config/ILocaleConfig.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import { IBaseConfig } from "./IBaseConfig";
|
||||
export interface ILocaleConfig extends IBaseConfig {
|
||||
kind: "aki-locale";
|
||||
desiredLocale: string;
|
||||
}
|
11
TypeScript/10ScopesAndTypes/types/models/spt/logging/LogBackgroundColor.d.ts
vendored
Normal file
11
TypeScript/10ScopesAndTypes/types/models/spt/logging/LogBackgroundColor.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
export declare enum LogBackgroundColor {
|
||||
default = "",
|
||||
black = "blackBG",
|
||||
red = "redBG",
|
||||
green = "greenBG",
|
||||
yellow = "yellowBG",
|
||||
blue = "blueBG",
|
||||
magenta = "magentaBG",
|
||||
cyan = "cyanBG",
|
||||
white = "whiteBG"
|
||||
}
|
11
TypeScript/10ScopesAndTypes/types/models/spt/logging/LogTextColor.d.ts
vendored
Normal file
11
TypeScript/10ScopesAndTypes/types/models/spt/logging/LogTextColor.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
export declare enum LogTextColor {
|
||||
black = "black",
|
||||
red = "red",
|
||||
green = "green",
|
||||
yellow = "yellow",
|
||||
blue = "blue",
|
||||
magenta = "magenta",
|
||||
cyan = "cyan",
|
||||
white = "white",
|
||||
gray = ""
|
||||
}
|
7
TypeScript/10ScopesAndTypes/types/models/spt/logging/SptLogger.d.ts
vendored
Normal file
7
TypeScript/10ScopesAndTypes/types/models/spt/logging/SptLogger.d.ts
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
export interface SptLogger {
|
||||
error: (msg: string | Record<string, unknown>) => void;
|
||||
warn: (msg: string | Record<string, unknown>) => void;
|
||||
succ?: (msg: string | Record<string, unknown>) => void;
|
||||
info: (msg: string | Record<string, unknown>) => void;
|
||||
debug: (msg: string | Record<string, unknown>) => void;
|
||||
}
|
@ -1,7 +1,10 @@
|
||||
import { Daum } from "../../eft/itemEvent/IItemEventRouterRequest";
|
||||
import { LogBackgroundColor } from "../logging/LogBackgroundColor";
|
||||
import { LogTextColor } from "../logging/LogTextColor";
|
||||
export interface ILogger {
|
||||
writeToLogFile(data: string | Daum): void;
|
||||
log(data: string | Record<string, unknown> | Error, color: string): void;
|
||||
log(data: string | Record<string, unknown> | Error, color: string, backgroundColor?: string): void;
|
||||
logWithColor(data: string | Record<string, unknown>, textColor: LogTextColor, backgroundColor?: LogBackgroundColor): void;
|
||||
error(data: string): void;
|
||||
warning(data: string): void;
|
||||
success(data: string): void;
|
||||
|
@ -29,8 +29,8 @@ export declare class FenceService {
|
||||
hasExpiredCache(refreshAssort: boolean): boolean;
|
||||
generateFenceAssortCache(pmcData: IPmcData): void;
|
||||
/**
|
||||
*
|
||||
* @param pmcData Get the fence level the passed in profile has
|
||||
* Get the fence level the passed in profile has
|
||||
* @param pmcData Player profile
|
||||
* @returns FenceLevel
|
||||
*/
|
||||
getFenceInfo(pmcData: IPmcData): FenceLevel;
|
||||
|
14
TypeScript/10ScopesAndTypes/types/services/LocaleService.d.ts
vendored
Normal file
14
TypeScript/10ScopesAndTypes/types/services/LocaleService.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
import { ILocaleConfig } from "../models/spt/config/ILocaleConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
export declare class LocaleService {
|
||||
protected logger: ILogger;
|
||||
protected configServer: ConfigServer;
|
||||
protected localeConfig: ILocaleConfig;
|
||||
constructor(logger: ILogger, configServer: ConfigServer);
|
||||
/**
|
||||
* Gets the locale key from the locale.json file
|
||||
* @returns locale e.g en/ge/cz/cn
|
||||
*/
|
||||
getDesiredLocale(): string;
|
||||
}
|
@ -5,7 +5,7 @@ import { ImageRouter } from "../routers/ImageRouter";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { CustomHandbookItemService } from "../services/CustomHandbookItemService";
|
||||
import { CustomItemService } from "../services/CustomItemService";
|
||||
import { CustomPresetService } from "../services/customPresetService";
|
||||
import { CustomPresetService } from "../services/CustomPresetService";
|
||||
import { CustomTraderAssortService } from "../services/CustomTraderAssortService";
|
||||
import { JsonUtil } from "./JsonUtil";
|
||||
import { VFS } from "./VFS";
|
||||
|
@ -1,17 +1,13 @@
|
||||
/// <reference types="node" />
|
||||
import { Daum } from "../models/eft/itemEvent/IItemEventRouterRequest";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import winston from "winston";
|
||||
import { IAsyncQueue } from "../models/spt/utils/IAsyncQueue";
|
||||
import { IUUidGenerator } from "../models/spt/utils/IUuidGenerator";
|
||||
import fs from "fs";
|
||||
interface SptLogger {
|
||||
error: (msg: string | Record<string, unknown>) => void;
|
||||
warn: (msg: string | Record<string, unknown>) => void;
|
||||
succ?: (msg: string | Record<string, unknown>) => void;
|
||||
info: (msg: string | Record<string, unknown>) => void;
|
||||
debug: (msg: string | Record<string, unknown>) => void;
|
||||
}
|
||||
import winston from "winston";
|
||||
import { Daum } from "../models/eft/itemEvent/IItemEventRouterRequest";
|
||||
import { LogBackgroundColor } from "../models/spt/logging/LogBackgroundColor";
|
||||
import { LogTextColor } from "../models/spt/logging/LogTextColor";
|
||||
import { SptLogger } from "../models/spt/logging/SptLogger";
|
||||
import { IAsyncQueue } from "../models/spt/utils/IAsyncQueue";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { IUUidGenerator } from "../models/spt/utils/IUuidGenerator";
|
||||
export declare class WinstonLogger implements ILogger {
|
||||
protected asyncQueue: IAsyncQueue;
|
||||
protected uuidGenerator: IUUidGenerator;
|
||||
@ -36,16 +32,27 @@ export declare class WinstonLogger implements ILogger {
|
||||
custom: string;
|
||||
debug: string;
|
||||
};
|
||||
bgColors: {
|
||||
default: string;
|
||||
blackBG: string;
|
||||
redBG: string;
|
||||
greenBG: string;
|
||||
yellowBG: string;
|
||||
blueBG: string;
|
||||
magentaBG: string;
|
||||
cyanBG: string;
|
||||
whiteBG: string;
|
||||
};
|
||||
};
|
||||
protected logger: winston.Logger & SptLogger;
|
||||
writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise<void>;
|
||||
protected writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise<void>;
|
||||
constructor(asyncQueue: IAsyncQueue, uuidGenerator: IUUidGenerator);
|
||||
writeToLogFile(data: string | Daum): Promise<void>;
|
||||
log(data: string | Error | Record<string, unknown>, color: string): Promise<void>;
|
||||
log(data: string | Error | Record<string, unknown>, color: string, backgroundColor?: string): Promise<void>;
|
||||
error(data: string | Record<string, unknown>): Promise<void>;
|
||||
warning(data: string | Record<string, unknown>): Promise<void>;
|
||||
success(data: string | Record<string, unknown>): Promise<void>;
|
||||
info(data: string | Record<string, unknown>): Promise<void>;
|
||||
logWithColor(data: string | Record<string, unknown>, textColor: LogTextColor, backgroundColor?: LogBackgroundColor): Promise<void>;
|
||||
debug(data: string | Record<string, unknown>, onlyShowInConsole?: boolean): Promise<void>;
|
||||
}
|
||||
export {};
|
||||
|
@ -6,19 +6,23 @@ import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
|
||||
import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
|
||||
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
|
||||
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
|
||||
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { Watermark } from "../utils/Watermark";
|
||||
export declare class GameController {
|
||||
protected logger: ILogger;
|
||||
protected watermark: Watermark;
|
||||
protected httpServerHelper: HttpServerHelper;
|
||||
protected localeService: LocaleService;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected gameHelper: GameHelper;
|
||||
protected configServer: ConfigServer;
|
||||
protected httpConfig: IHttpConfig;
|
||||
constructor(logger: ILogger, watermark: Watermark, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, gameHelper: GameHelper, configServer: ConfigServer);
|
||||
protected coreConfig: ICoreConfig;
|
||||
constructor(logger: ILogger, watermark: Watermark, httpServerHelper: HttpServerHelper, localeService: LocaleService, profileHelper: ProfileHelper, gameHelper: GameHelper, configServer: ConfigServer);
|
||||
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string): void;
|
||||
protected addMissingBonusesProperty(pmcProfile: IPmcData): void;
|
||||
protected addMissingRepeatableQuestsProperty(pmcProfile: IPmcData): void;
|
||||
|
@ -14,6 +14,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ItemEventRouter } from "../routers/ItemEventRouter";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { PlayerService } from "../services/PlayerService";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class QuestController {
|
||||
@ -27,9 +28,10 @@ export declare class QuestController {
|
||||
protected questHelper: QuestHelper;
|
||||
protected questConditionHelper: QuestConditionHelper;
|
||||
protected playerService: PlayerService;
|
||||
protected localeService: LocaleService;
|
||||
protected configServer: ConfigServer;
|
||||
protected questConfig: IQuestConfig;
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer);
|
||||
/**
|
||||
* Get all quests visible to player
|
||||
* Exclude quests with incomplete preconditions (level/loyalty)
|
||||
|
@ -84,6 +84,11 @@ declare class ItemHelper {
|
||||
*/
|
||||
generateItemsFromStackSlot(item: ITemplateItem, parentId: string): Item[];
|
||||
getItem(tpl: string): [boolean, ITemplateItem];
|
||||
/**
|
||||
* get normalized value (0-1) based on item condition
|
||||
* @param item
|
||||
* @returns number between 0 and 1
|
||||
*/
|
||||
getItemQualityModifier(item: Item): number;
|
||||
findAndReturnChildrenByItems(items: Item[], itemID: string): string[];
|
||||
/**
|
||||
|
@ -8,6 +8,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ItemEventRouter } from "../routers/ItemEventRouter";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
@ -25,6 +26,7 @@ export declare class QuestHelper {
|
||||
protected itemHelper: ItemHelper;
|
||||
protected itemEventRouter: ItemEventRouter;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected localeService: LocaleService;
|
||||
protected ragfairServerHelper: RagfairServerHelper;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
@ -32,7 +34,7 @@ export declare class QuestHelper {
|
||||
protected traderHelper: TraderHelper;
|
||||
protected configServer: ConfigServer;
|
||||
protected questConfig: IQuestConfig;
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, configServer: ConfigServer);
|
||||
static get STATUS(): Record<string, number>;
|
||||
questStatus(pmcData: IPmcData, questID: string): string;
|
||||
/**
|
||||
@ -74,7 +76,7 @@ export declare class QuestHelper {
|
||||
cleanQuestConditions(quest: IQuest): IQuest;
|
||||
failQuest(pmcData: IPmcData, body: any, sessionID: string): any;
|
||||
getQuestFromDb(questId: string, pmcData: IPmcData): IQuest;
|
||||
getQuestLocaleIdFromDb(messageId: string, localisation?: string): string;
|
||||
getQuestLocaleIdFromDb(messageId: string): string;
|
||||
applyQuestReward(pmcData: IPmcData, body: ICompleteQuestRequestData, state: string, sessionID: string): Reward[];
|
||||
/**
|
||||
* Get the intel center bonus a player has
|
||||
|
@ -10,6 +10,7 @@ import { ItemEventRouter } from "../routers/ItemEventRouter";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { RagfairOfferService } from "../services/RagfairOfferService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
@ -37,11 +38,12 @@ export declare class RagfairOfferHelper {
|
||||
protected ragfairSortHelper: RagfairSortHelper;
|
||||
protected ragfairHelper: RagfairHelper;
|
||||
protected ragfairOfferService: RagfairOfferService;
|
||||
protected localeService: LocaleService;
|
||||
protected configServer: ConfigServer;
|
||||
protected static TPL_GOODS_SOLD: string;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
protected questConfig: IQuestConfig;
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer);
|
||||
getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
|
||||
getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
|
||||
processOffers(sessionID: string): boolean;
|
||||
|
@ -1,11 +1,12 @@
|
||||
import { MemberCategory } from "../models/enums/MemberCategory";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { MemberCategory } from "../models/enums/MemberCategory";
|
||||
import { IQuestConfig } from "../models/spt/config/IQuestConfig";
|
||||
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
@ -19,13 +20,14 @@ export declare class RagfairServerHelper {
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected localeService: LocaleService;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected configServer: ConfigServer;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
protected questConfig: IQuestConfig;
|
||||
protected static TPL_GOODS_RETURNED: string;
|
||||
constructor(randomUtil: RandomUtil, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, jsonUtil: JsonUtil, configServer: ConfigServer);
|
||||
constructor(randomUtil: RandomUtil, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, jsonUtil: JsonUtil, configServer: ConfigServer);
|
||||
/**
|
||||
* Is item valid / on blacklist / quest item
|
||||
* @param itemDetails
|
||||
|
@ -1,8 +1,10 @@
|
||||
import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
export declare class RagfairSortHelper {
|
||||
protected databaseServer: DatabaseServer;
|
||||
constructor(databaseServer: DatabaseServer);
|
||||
protected localeService: LocaleService;
|
||||
constructor(databaseServer: DatabaseServer, localeService: LocaleService);
|
||||
sortOffers(offers: IRagfairOffer[], type: number, direction?: number): IRagfairOffer[];
|
||||
protected sortOffersByID(a: IRagfairOffer, b: IRagfairOffer): number;
|
||||
protected sortOffersByRating(a: IRagfairOffer, b: IRagfairOffer): number;
|
||||
|
@ -1,4 +1,6 @@
|
||||
import { FenceLevel } from "../models/eft/common/IGlobals";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { IBarterScheme, ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader";
|
||||
import { ITraderConfig } from "../models/spt/config/ITraderConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
@ -34,7 +36,48 @@ export declare class TraderHelper {
|
||||
*/
|
||||
resetTrader(sessionID: string, traderID: string): void;
|
||||
changeTraderDisplay(traderID: string, status: boolean, sessionID: string): void;
|
||||
/**
|
||||
* Get a list of items and their prices from player inventory that can be sold to a trader
|
||||
* @param traderID trader id being traded with
|
||||
* @param sessionID session id
|
||||
* @returns IBarterScheme[][]
|
||||
*/
|
||||
getPurchasesData(traderID: string, sessionID: string): Record<string, IBarterScheme[][]>;
|
||||
/**
|
||||
* Should item be skipped when selling to trader according to its sell categories and other checks
|
||||
* @param pmcData
|
||||
* @param item
|
||||
* @param sellCategory
|
||||
* @returns true if should NOT be sold to trader
|
||||
*/
|
||||
protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[]): boolean;
|
||||
/**
|
||||
* Can this weapon be sold to a trader with its current durabiltiy level
|
||||
* @param traderID
|
||||
* @param item
|
||||
* @returns boolean
|
||||
*/
|
||||
protected isWeaponAndBelowTraderBuyDurability(traderID: string, item: Item): boolean;
|
||||
/**
|
||||
* Get the price of an item and all of its attached children
|
||||
* Take into account bonuses/adjsutments e.g. discounts
|
||||
* @param pmcData profile data
|
||||
* @param item item to calculate price of
|
||||
* @param buyPriceCoefficient
|
||||
* @param fenceInfo fence data
|
||||
* @param traderBase trader details
|
||||
* @param currencyTpl Currency to get price as
|
||||
* @returns price of item + children
|
||||
*/
|
||||
protected getAdjustedItemPrice(pmcData: IPmcData, item: Item, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderBase: ITraderBase, currencyTpl: string): number;
|
||||
/**
|
||||
* Get the raw price of item+child items from handbook without any modification
|
||||
* @param pmcData profile data
|
||||
* @param item item to calculate price of
|
||||
* @returns price as number
|
||||
*/
|
||||
protected getRawItemPrice(pmcData: IPmcData, item: Item): number;
|
||||
protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderID: string): number;
|
||||
/**
|
||||
* Calculate traders level based on exp amount and increment level if over threshold
|
||||
* @param traderID trader to process
|
||||
|
11
TypeScript/11BundleLoadingSample/types/loaders/AfterDbModLoader.d.ts
vendored
Normal file
11
TypeScript/11BundleLoadingSample/types/loaders/AfterDbModLoader.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
import { DependencyContainer } from "tsyringe";
|
||||
import { OnLoad } from "../di/OnLoad";
|
||||
import { InitialModLoader } from "./InitialModLoader";
|
||||
export declare class AfterDbModLoader implements OnLoad {
|
||||
protected initialModLoader: InitialModLoader;
|
||||
constructor(initialModLoader: InitialModLoader);
|
||||
onLoad(): void;
|
||||
getRoute(): string;
|
||||
getModPath(mod: string): string;
|
||||
protected executeMods(container: DependencyContainer): void;
|
||||
}
|
@ -8,6 +8,7 @@ export declare enum ConfigTypes {
|
||||
IN_RAID = "aki-inraid",
|
||||
INSURANCE = "aki-insurance",
|
||||
INVENTORY = "aki-inventory",
|
||||
LOCALE = "aki-locale",
|
||||
LOCATION = "aki-location",
|
||||
MATCH = "aki-match",
|
||||
QUEST = "aki-quest",
|
||||
|
4
TypeScript/11BundleLoadingSample/types/models/external/IAfterDBLoadMod.d.ts
vendored
Normal file
4
TypeScript/11BundleLoadingSample/types/models/external/IAfterDBLoadMod.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import { DependencyContainer } from "./tsyringe";
|
||||
export interface IAfterDBLoadMod {
|
||||
loadAfterDbInit(container: DependencyContainer): void;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
import { DependencyContainer } from "./tsyringe";
|
||||
export interface IMod {
|
||||
load: (container: DependencyContainer) => void;
|
||||
delayedLoad: (container: DependencyContainer) => void;
|
||||
load(container: DependencyContainer): void;
|
||||
delayedLoad(container: DependencyContainer): void;
|
||||
}
|
||||
|
5
TypeScript/11BundleLoadingSample/types/models/spt/config/ILocaleConfig.d.ts
vendored
Normal file
5
TypeScript/11BundleLoadingSample/types/models/spt/config/ILocaleConfig.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import { IBaseConfig } from "./IBaseConfig";
|
||||
export interface ILocaleConfig extends IBaseConfig {
|
||||
kind: "aki-locale";
|
||||
desiredLocale: string;
|
||||
}
|
11
TypeScript/11BundleLoadingSample/types/models/spt/logging/LogBackgroundColor.d.ts
vendored
Normal file
11
TypeScript/11BundleLoadingSample/types/models/spt/logging/LogBackgroundColor.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
export declare enum LogBackgroundColor {
|
||||
default = "",
|
||||
black = "blackBG",
|
||||
red = "redBG",
|
||||
green = "greenBG",
|
||||
yellow = "yellowBG",
|
||||
blue = "blueBG",
|
||||
magenta = "magentaBG",
|
||||
cyan = "cyanBG",
|
||||
white = "whiteBG"
|
||||
}
|
11
TypeScript/11BundleLoadingSample/types/models/spt/logging/LogTextColor.d.ts
vendored
Normal file
11
TypeScript/11BundleLoadingSample/types/models/spt/logging/LogTextColor.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
export declare enum LogTextColor {
|
||||
black = "black",
|
||||
red = "red",
|
||||
green = "green",
|
||||
yellow = "yellow",
|
||||
blue = "blue",
|
||||
magenta = "magenta",
|
||||
cyan = "cyan",
|
||||
white = "white",
|
||||
gray = ""
|
||||
}
|
7
TypeScript/11BundleLoadingSample/types/models/spt/logging/SptLogger.d.ts
vendored
Normal file
7
TypeScript/11BundleLoadingSample/types/models/spt/logging/SptLogger.d.ts
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
export interface SptLogger {
|
||||
error: (msg: string | Record<string, unknown>) => void;
|
||||
warn: (msg: string | Record<string, unknown>) => void;
|
||||
succ?: (msg: string | Record<string, unknown>) => void;
|
||||
info: (msg: string | Record<string, unknown>) => void;
|
||||
debug: (msg: string | Record<string, unknown>) => void;
|
||||
}
|
@ -1,7 +1,10 @@
|
||||
import { Daum } from "../../eft/itemEvent/IItemEventRouterRequest";
|
||||
import { LogBackgroundColor } from "../logging/LogBackgroundColor";
|
||||
import { LogTextColor } from "../logging/LogTextColor";
|
||||
export interface ILogger {
|
||||
writeToLogFile(data: string | Daum): void;
|
||||
log(data: string | Record<string, unknown> | Error, color: string): void;
|
||||
log(data: string | Record<string, unknown> | Error, color: string, backgroundColor?: string): void;
|
||||
logWithColor(data: string | Record<string, unknown>, textColor: LogTextColor, backgroundColor?: LogBackgroundColor): void;
|
||||
error(data: string): void;
|
||||
warning(data: string): void;
|
||||
success(data: string): void;
|
||||
|
@ -29,8 +29,8 @@ export declare class FenceService {
|
||||
hasExpiredCache(refreshAssort: boolean): boolean;
|
||||
generateFenceAssortCache(pmcData: IPmcData): void;
|
||||
/**
|
||||
*
|
||||
* @param pmcData Get the fence level the passed in profile has
|
||||
* Get the fence level the passed in profile has
|
||||
* @param pmcData Player profile
|
||||
* @returns FenceLevel
|
||||
*/
|
||||
getFenceInfo(pmcData: IPmcData): FenceLevel;
|
||||
|
14
TypeScript/11BundleLoadingSample/types/services/LocaleService.d.ts
vendored
Normal file
14
TypeScript/11BundleLoadingSample/types/services/LocaleService.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
import { ILocaleConfig } from "../models/spt/config/ILocaleConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
export declare class LocaleService {
|
||||
protected logger: ILogger;
|
||||
protected configServer: ConfigServer;
|
||||
protected localeConfig: ILocaleConfig;
|
||||
constructor(logger: ILogger, configServer: ConfigServer);
|
||||
/**
|
||||
* Gets the locale key from the locale.json file
|
||||
* @returns locale e.g en/ge/cz/cn
|
||||
*/
|
||||
getDesiredLocale(): string;
|
||||
}
|
@ -5,7 +5,7 @@ import { ImageRouter } from "../routers/ImageRouter";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { CustomHandbookItemService } from "../services/CustomHandbookItemService";
|
||||
import { CustomItemService } from "../services/CustomItemService";
|
||||
import { CustomPresetService } from "../services/customPresetService";
|
||||
import { CustomPresetService } from "../services/CustomPresetService";
|
||||
import { CustomTraderAssortService } from "../services/CustomTraderAssortService";
|
||||
import { JsonUtil } from "./JsonUtil";
|
||||
import { VFS } from "./VFS";
|
||||
|
@ -1,17 +1,13 @@
|
||||
/// <reference types="node" />
|
||||
import { Daum } from "../models/eft/itemEvent/IItemEventRouterRequest";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import winston from "winston";
|
||||
import { IAsyncQueue } from "../models/spt/utils/IAsyncQueue";
|
||||
import { IUUidGenerator } from "../models/spt/utils/IUuidGenerator";
|
||||
import fs from "fs";
|
||||
interface SptLogger {
|
||||
error: (msg: string | Record<string, unknown>) => void;
|
||||
warn: (msg: string | Record<string, unknown>) => void;
|
||||
succ?: (msg: string | Record<string, unknown>) => void;
|
||||
info: (msg: string | Record<string, unknown>) => void;
|
||||
debug: (msg: string | Record<string, unknown>) => void;
|
||||
}
|
||||
import winston from "winston";
|
||||
import { Daum } from "../models/eft/itemEvent/IItemEventRouterRequest";
|
||||
import { LogBackgroundColor } from "../models/spt/logging/LogBackgroundColor";
|
||||
import { LogTextColor } from "../models/spt/logging/LogTextColor";
|
||||
import { SptLogger } from "../models/spt/logging/SptLogger";
|
||||
import { IAsyncQueue } from "../models/spt/utils/IAsyncQueue";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { IUUidGenerator } from "../models/spt/utils/IUuidGenerator";
|
||||
export declare class WinstonLogger implements ILogger {
|
||||
protected asyncQueue: IAsyncQueue;
|
||||
protected uuidGenerator: IUUidGenerator;
|
||||
@ -36,16 +32,27 @@ export declare class WinstonLogger implements ILogger {
|
||||
custom: string;
|
||||
debug: string;
|
||||
};
|
||||
bgColors: {
|
||||
default: string;
|
||||
blackBG: string;
|
||||
redBG: string;
|
||||
greenBG: string;
|
||||
yellowBG: string;
|
||||
blueBG: string;
|
||||
magentaBG: string;
|
||||
cyanBG: string;
|
||||
whiteBG: string;
|
||||
};
|
||||
};
|
||||
protected logger: winston.Logger & SptLogger;
|
||||
writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise<void>;
|
||||
protected writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise<void>;
|
||||
constructor(asyncQueue: IAsyncQueue, uuidGenerator: IUUidGenerator);
|
||||
writeToLogFile(data: string | Daum): Promise<void>;
|
||||
log(data: string | Error | Record<string, unknown>, color: string): Promise<void>;
|
||||
log(data: string | Error | Record<string, unknown>, color: string, backgroundColor?: string): Promise<void>;
|
||||
error(data: string | Record<string, unknown>): Promise<void>;
|
||||
warning(data: string | Record<string, unknown>): Promise<void>;
|
||||
success(data: string | Record<string, unknown>): Promise<void>;
|
||||
info(data: string | Record<string, unknown>): Promise<void>;
|
||||
logWithColor(data: string | Record<string, unknown>, textColor: LogTextColor, backgroundColor?: LogBackgroundColor): Promise<void>;
|
||||
debug(data: string | Record<string, unknown>, onlyShowInConsole?: boolean): Promise<void>;
|
||||
}
|
||||
export {};
|
||||
|
@ -6,19 +6,23 @@ import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
|
||||
import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
|
||||
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
|
||||
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
|
||||
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { Watermark } from "../utils/Watermark";
|
||||
export declare class GameController {
|
||||
protected logger: ILogger;
|
||||
protected watermark: Watermark;
|
||||
protected httpServerHelper: HttpServerHelper;
|
||||
protected localeService: LocaleService;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected gameHelper: GameHelper;
|
||||
protected configServer: ConfigServer;
|
||||
protected httpConfig: IHttpConfig;
|
||||
constructor(logger: ILogger, watermark: Watermark, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, gameHelper: GameHelper, configServer: ConfigServer);
|
||||
protected coreConfig: ICoreConfig;
|
||||
constructor(logger: ILogger, watermark: Watermark, httpServerHelper: HttpServerHelper, localeService: LocaleService, profileHelper: ProfileHelper, gameHelper: GameHelper, configServer: ConfigServer);
|
||||
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string): void;
|
||||
protected addMissingBonusesProperty(pmcProfile: IPmcData): void;
|
||||
protected addMissingRepeatableQuestsProperty(pmcProfile: IPmcData): void;
|
||||
|
@ -14,6 +14,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ItemEventRouter } from "../routers/ItemEventRouter";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { PlayerService } from "../services/PlayerService";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class QuestController {
|
||||
@ -27,9 +28,10 @@ export declare class QuestController {
|
||||
protected questHelper: QuestHelper;
|
||||
protected questConditionHelper: QuestConditionHelper;
|
||||
protected playerService: PlayerService;
|
||||
protected localeService: LocaleService;
|
||||
protected configServer: ConfigServer;
|
||||
protected questConfig: IQuestConfig;
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer);
|
||||
/**
|
||||
* Get all quests visible to player
|
||||
* Exclude quests with incomplete preconditions (level/loyalty)
|
||||
|
@ -84,6 +84,11 @@ declare class ItemHelper {
|
||||
*/
|
||||
generateItemsFromStackSlot(item: ITemplateItem, parentId: string): Item[];
|
||||
getItem(tpl: string): [boolean, ITemplateItem];
|
||||
/**
|
||||
* get normalized value (0-1) based on item condition
|
||||
* @param item
|
||||
* @returns number between 0 and 1
|
||||
*/
|
||||
getItemQualityModifier(item: Item): number;
|
||||
findAndReturnChildrenByItems(items: Item[], itemID: string): string[];
|
||||
/**
|
||||
|
@ -8,6 +8,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ItemEventRouter } from "../routers/ItemEventRouter";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
@ -25,6 +26,7 @@ export declare class QuestHelper {
|
||||
protected itemHelper: ItemHelper;
|
||||
protected itemEventRouter: ItemEventRouter;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected localeService: LocaleService;
|
||||
protected ragfairServerHelper: RagfairServerHelper;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
@ -32,7 +34,7 @@ export declare class QuestHelper {
|
||||
protected traderHelper: TraderHelper;
|
||||
protected configServer: ConfigServer;
|
||||
protected questConfig: IQuestConfig;
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, configServer: ConfigServer);
|
||||
static get STATUS(): Record<string, number>;
|
||||
questStatus(pmcData: IPmcData, questID: string): string;
|
||||
/**
|
||||
@ -74,7 +76,7 @@ export declare class QuestHelper {
|
||||
cleanQuestConditions(quest: IQuest): IQuest;
|
||||
failQuest(pmcData: IPmcData, body: any, sessionID: string): any;
|
||||
getQuestFromDb(questId: string, pmcData: IPmcData): IQuest;
|
||||
getQuestLocaleIdFromDb(messageId: string, localisation?: string): string;
|
||||
getQuestLocaleIdFromDb(messageId: string): string;
|
||||
applyQuestReward(pmcData: IPmcData, body: ICompleteQuestRequestData, state: string, sessionID: string): Reward[];
|
||||
/**
|
||||
* Get the intel center bonus a player has
|
||||
|
@ -10,6 +10,7 @@ import { ItemEventRouter } from "../routers/ItemEventRouter";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { RagfairOfferService } from "../services/RagfairOfferService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
@ -37,11 +38,12 @@ export declare class RagfairOfferHelper {
|
||||
protected ragfairSortHelper: RagfairSortHelper;
|
||||
protected ragfairHelper: RagfairHelper;
|
||||
protected ragfairOfferService: RagfairOfferService;
|
||||
protected localeService: LocaleService;
|
||||
protected configServer: ConfigServer;
|
||||
protected static TPL_GOODS_SOLD: string;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
protected questConfig: IQuestConfig;
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer);
|
||||
getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
|
||||
getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
|
||||
processOffers(sessionID: string): boolean;
|
||||
|
@ -1,11 +1,12 @@
|
||||
import { MemberCategory } from "../models/enums/MemberCategory";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { MemberCategory } from "../models/enums/MemberCategory";
|
||||
import { IQuestConfig } from "../models/spt/config/IQuestConfig";
|
||||
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
@ -19,13 +20,14 @@ export declare class RagfairServerHelper {
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected localeService: LocaleService;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected configServer: ConfigServer;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
protected questConfig: IQuestConfig;
|
||||
protected static TPL_GOODS_RETURNED: string;
|
||||
constructor(randomUtil: RandomUtil, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, jsonUtil: JsonUtil, configServer: ConfigServer);
|
||||
constructor(randomUtil: RandomUtil, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, jsonUtil: JsonUtil, configServer: ConfigServer);
|
||||
/**
|
||||
* Is item valid / on blacklist / quest item
|
||||
* @param itemDetails
|
||||
|
@ -1,8 +1,10 @@
|
||||
import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
export declare class RagfairSortHelper {
|
||||
protected databaseServer: DatabaseServer;
|
||||
constructor(databaseServer: DatabaseServer);
|
||||
protected localeService: LocaleService;
|
||||
constructor(databaseServer: DatabaseServer, localeService: LocaleService);
|
||||
sortOffers(offers: IRagfairOffer[], type: number, direction?: number): IRagfairOffer[];
|
||||
protected sortOffersByID(a: IRagfairOffer, b: IRagfairOffer): number;
|
||||
protected sortOffersByRating(a: IRagfairOffer, b: IRagfairOffer): number;
|
||||
|
@ -1,4 +1,6 @@
|
||||
import { FenceLevel } from "../models/eft/common/IGlobals";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { IBarterScheme, ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader";
|
||||
import { ITraderConfig } from "../models/spt/config/ITraderConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
@ -34,7 +36,48 @@ export declare class TraderHelper {
|
||||
*/
|
||||
resetTrader(sessionID: string, traderID: string): void;
|
||||
changeTraderDisplay(traderID: string, status: boolean, sessionID: string): void;
|
||||
/**
|
||||
* Get a list of items and their prices from player inventory that can be sold to a trader
|
||||
* @param traderID trader id being traded with
|
||||
* @param sessionID session id
|
||||
* @returns IBarterScheme[][]
|
||||
*/
|
||||
getPurchasesData(traderID: string, sessionID: string): Record<string, IBarterScheme[][]>;
|
||||
/**
|
||||
* Should item be skipped when selling to trader according to its sell categories and other checks
|
||||
* @param pmcData
|
||||
* @param item
|
||||
* @param sellCategory
|
||||
* @returns true if should NOT be sold to trader
|
||||
*/
|
||||
protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[]): boolean;
|
||||
/**
|
||||
* Can this weapon be sold to a trader with its current durabiltiy level
|
||||
* @param traderID
|
||||
* @param item
|
||||
* @returns boolean
|
||||
*/
|
||||
protected isWeaponAndBelowTraderBuyDurability(traderID: string, item: Item): boolean;
|
||||
/**
|
||||
* Get the price of an item and all of its attached children
|
||||
* Take into account bonuses/adjsutments e.g. discounts
|
||||
* @param pmcData profile data
|
||||
* @param item item to calculate price of
|
||||
* @param buyPriceCoefficient
|
||||
* @param fenceInfo fence data
|
||||
* @param traderBase trader details
|
||||
* @param currencyTpl Currency to get price as
|
||||
* @returns price of item + children
|
||||
*/
|
||||
protected getAdjustedItemPrice(pmcData: IPmcData, item: Item, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderBase: ITraderBase, currencyTpl: string): number;
|
||||
/**
|
||||
* Get the raw price of item+child items from handbook without any modification
|
||||
* @param pmcData profile data
|
||||
* @param item item to calculate price of
|
||||
* @returns price as number
|
||||
*/
|
||||
protected getRawItemPrice(pmcData: IPmcData, item: Item): number;
|
||||
protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderID: string): number;
|
||||
/**
|
||||
* Calculate traders level based on exp amount and increment level if over threshold
|
||||
* @param traderID trader to process
|
||||
|
11
TypeScript/12ClassExtensionOverride/types/loaders/AfterDbModLoader.d.ts
vendored
Normal file
11
TypeScript/12ClassExtensionOverride/types/loaders/AfterDbModLoader.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
import { DependencyContainer } from "tsyringe";
|
||||
import { OnLoad } from "../di/OnLoad";
|
||||
import { InitialModLoader } from "./InitialModLoader";
|
||||
export declare class AfterDbModLoader implements OnLoad {
|
||||
protected initialModLoader: InitialModLoader;
|
||||
constructor(initialModLoader: InitialModLoader);
|
||||
onLoad(): void;
|
||||
getRoute(): string;
|
||||
getModPath(mod: string): string;
|
||||
protected executeMods(container: DependencyContainer): void;
|
||||
}
|
@ -8,6 +8,7 @@ export declare enum ConfigTypes {
|
||||
IN_RAID = "aki-inraid",
|
||||
INSURANCE = "aki-insurance",
|
||||
INVENTORY = "aki-inventory",
|
||||
LOCALE = "aki-locale",
|
||||
LOCATION = "aki-location",
|
||||
MATCH = "aki-match",
|
||||
QUEST = "aki-quest",
|
||||
|
4
TypeScript/12ClassExtensionOverride/types/models/external/IAfterDBLoadMod.d.ts
vendored
Normal file
4
TypeScript/12ClassExtensionOverride/types/models/external/IAfterDBLoadMod.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import { DependencyContainer } from "./tsyringe";
|
||||
export interface IAfterDBLoadMod {
|
||||
loadAfterDbInit(container: DependencyContainer): void;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
import { DependencyContainer } from "./tsyringe";
|
||||
export interface IMod {
|
||||
load: (container: DependencyContainer) => void;
|
||||
delayedLoad: (container: DependencyContainer) => void;
|
||||
load(container: DependencyContainer): void;
|
||||
delayedLoad(container: DependencyContainer): void;
|
||||
}
|
||||
|
5
TypeScript/12ClassExtensionOverride/types/models/spt/config/ILocaleConfig.d.ts
vendored
Normal file
5
TypeScript/12ClassExtensionOverride/types/models/spt/config/ILocaleConfig.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import { IBaseConfig } from "./IBaseConfig";
|
||||
export interface ILocaleConfig extends IBaseConfig {
|
||||
kind: "aki-locale";
|
||||
desiredLocale: string;
|
||||
}
|
11
TypeScript/12ClassExtensionOverride/types/models/spt/logging/LogBackgroundColor.d.ts
vendored
Normal file
11
TypeScript/12ClassExtensionOverride/types/models/spt/logging/LogBackgroundColor.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
export declare enum LogBackgroundColor {
|
||||
default = "",
|
||||
black = "blackBG",
|
||||
red = "redBG",
|
||||
green = "greenBG",
|
||||
yellow = "yellowBG",
|
||||
blue = "blueBG",
|
||||
magenta = "magentaBG",
|
||||
cyan = "cyanBG",
|
||||
white = "whiteBG"
|
||||
}
|
11
TypeScript/12ClassExtensionOverride/types/models/spt/logging/LogTextColor.d.ts
vendored
Normal file
11
TypeScript/12ClassExtensionOverride/types/models/spt/logging/LogTextColor.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
export declare enum LogTextColor {
|
||||
black = "black",
|
||||
red = "red",
|
||||
green = "green",
|
||||
yellow = "yellow",
|
||||
blue = "blue",
|
||||
magenta = "magenta",
|
||||
cyan = "cyan",
|
||||
white = "white",
|
||||
gray = ""
|
||||
}
|
7
TypeScript/12ClassExtensionOverride/types/models/spt/logging/SptLogger.d.ts
vendored
Normal file
7
TypeScript/12ClassExtensionOverride/types/models/spt/logging/SptLogger.d.ts
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
export interface SptLogger {
|
||||
error: (msg: string | Record<string, unknown>) => void;
|
||||
warn: (msg: string | Record<string, unknown>) => void;
|
||||
succ?: (msg: string | Record<string, unknown>) => void;
|
||||
info: (msg: string | Record<string, unknown>) => void;
|
||||
debug: (msg: string | Record<string, unknown>) => void;
|
||||
}
|
@ -1,7 +1,10 @@
|
||||
import { Daum } from "../../eft/itemEvent/IItemEventRouterRequest";
|
||||
import { LogBackgroundColor } from "../logging/LogBackgroundColor";
|
||||
import { LogTextColor } from "../logging/LogTextColor";
|
||||
export interface ILogger {
|
||||
writeToLogFile(data: string | Daum): void;
|
||||
log(data: string | Record<string, unknown> | Error, color: string): void;
|
||||
log(data: string | Record<string, unknown> | Error, color: string, backgroundColor?: string): void;
|
||||
logWithColor(data: string | Record<string, unknown>, textColor: LogTextColor, backgroundColor?: LogBackgroundColor): void;
|
||||
error(data: string): void;
|
||||
warning(data: string): void;
|
||||
success(data: string): void;
|
||||
|
@ -29,8 +29,8 @@ export declare class FenceService {
|
||||
hasExpiredCache(refreshAssort: boolean): boolean;
|
||||
generateFenceAssortCache(pmcData: IPmcData): void;
|
||||
/**
|
||||
*
|
||||
* @param pmcData Get the fence level the passed in profile has
|
||||
* Get the fence level the passed in profile has
|
||||
* @param pmcData Player profile
|
||||
* @returns FenceLevel
|
||||
*/
|
||||
getFenceInfo(pmcData: IPmcData): FenceLevel;
|
||||
|
14
TypeScript/12ClassExtensionOverride/types/services/LocaleService.d.ts
vendored
Normal file
14
TypeScript/12ClassExtensionOverride/types/services/LocaleService.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
import { ILocaleConfig } from "../models/spt/config/ILocaleConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
export declare class LocaleService {
|
||||
protected logger: ILogger;
|
||||
protected configServer: ConfigServer;
|
||||
protected localeConfig: ILocaleConfig;
|
||||
constructor(logger: ILogger, configServer: ConfigServer);
|
||||
/**
|
||||
* Gets the locale key from the locale.json file
|
||||
* @returns locale e.g en/ge/cz/cn
|
||||
*/
|
||||
getDesiredLocale(): string;
|
||||
}
|
@ -5,7 +5,7 @@ import { ImageRouter } from "../routers/ImageRouter";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { CustomHandbookItemService } from "../services/CustomHandbookItemService";
|
||||
import { CustomItemService } from "../services/CustomItemService";
|
||||
import { CustomPresetService } from "../services/customPresetService";
|
||||
import { CustomPresetService } from "../services/CustomPresetService";
|
||||
import { CustomTraderAssortService } from "../services/CustomTraderAssortService";
|
||||
import { JsonUtil } from "./JsonUtil";
|
||||
import { VFS } from "./VFS";
|
||||
|
@ -1,17 +1,13 @@
|
||||
/// <reference types="node" />
|
||||
import { Daum } from "../models/eft/itemEvent/IItemEventRouterRequest";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import winston from "winston";
|
||||
import { IAsyncQueue } from "../models/spt/utils/IAsyncQueue";
|
||||
import { IUUidGenerator } from "../models/spt/utils/IUuidGenerator";
|
||||
import fs from "fs";
|
||||
interface SptLogger {
|
||||
error: (msg: string | Record<string, unknown>) => void;
|
||||
warn: (msg: string | Record<string, unknown>) => void;
|
||||
succ?: (msg: string | Record<string, unknown>) => void;
|
||||
info: (msg: string | Record<string, unknown>) => void;
|
||||
debug: (msg: string | Record<string, unknown>) => void;
|
||||
}
|
||||
import winston from "winston";
|
||||
import { Daum } from "../models/eft/itemEvent/IItemEventRouterRequest";
|
||||
import { LogBackgroundColor } from "../models/spt/logging/LogBackgroundColor";
|
||||
import { LogTextColor } from "../models/spt/logging/LogTextColor";
|
||||
import { SptLogger } from "../models/spt/logging/SptLogger";
|
||||
import { IAsyncQueue } from "../models/spt/utils/IAsyncQueue";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { IUUidGenerator } from "../models/spt/utils/IUuidGenerator";
|
||||
export declare class WinstonLogger implements ILogger {
|
||||
protected asyncQueue: IAsyncQueue;
|
||||
protected uuidGenerator: IUUidGenerator;
|
||||
@ -36,16 +32,27 @@ export declare class WinstonLogger implements ILogger {
|
||||
custom: string;
|
||||
debug: string;
|
||||
};
|
||||
bgColors: {
|
||||
default: string;
|
||||
blackBG: string;
|
||||
redBG: string;
|
||||
greenBG: string;
|
||||
yellowBG: string;
|
||||
blueBG: string;
|
||||
magentaBG: string;
|
||||
cyanBG: string;
|
||||
whiteBG: string;
|
||||
};
|
||||
};
|
||||
protected logger: winston.Logger & SptLogger;
|
||||
writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise<void>;
|
||||
protected writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise<void>;
|
||||
constructor(asyncQueue: IAsyncQueue, uuidGenerator: IUUidGenerator);
|
||||
writeToLogFile(data: string | Daum): Promise<void>;
|
||||
log(data: string | Error | Record<string, unknown>, color: string): Promise<void>;
|
||||
log(data: string | Error | Record<string, unknown>, color: string, backgroundColor?: string): Promise<void>;
|
||||
error(data: string | Record<string, unknown>): Promise<void>;
|
||||
warning(data: string | Record<string, unknown>): Promise<void>;
|
||||
success(data: string | Record<string, unknown>): Promise<void>;
|
||||
info(data: string | Record<string, unknown>): Promise<void>;
|
||||
logWithColor(data: string | Record<string, unknown>, textColor: LogTextColor, backgroundColor?: LogBackgroundColor): Promise<void>;
|
||||
debug(data: string | Record<string, unknown>, onlyShowInConsole?: boolean): Promise<void>;
|
||||
}
|
||||
export {};
|
||||
|
@ -6,19 +6,23 @@ import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
|
||||
import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
|
||||
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
|
||||
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
|
||||
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { Watermark } from "../utils/Watermark";
|
||||
export declare class GameController {
|
||||
protected logger: ILogger;
|
||||
protected watermark: Watermark;
|
||||
protected httpServerHelper: HttpServerHelper;
|
||||
protected localeService: LocaleService;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected gameHelper: GameHelper;
|
||||
protected configServer: ConfigServer;
|
||||
protected httpConfig: IHttpConfig;
|
||||
constructor(logger: ILogger, watermark: Watermark, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, gameHelper: GameHelper, configServer: ConfigServer);
|
||||
protected coreConfig: ICoreConfig;
|
||||
constructor(logger: ILogger, watermark: Watermark, httpServerHelper: HttpServerHelper, localeService: LocaleService, profileHelper: ProfileHelper, gameHelper: GameHelper, configServer: ConfigServer);
|
||||
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string): void;
|
||||
protected addMissingBonusesProperty(pmcProfile: IPmcData): void;
|
||||
protected addMissingRepeatableQuestsProperty(pmcProfile: IPmcData): void;
|
||||
|
@ -14,6 +14,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ItemEventRouter } from "../routers/ItemEventRouter";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { PlayerService } from "../services/PlayerService";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class QuestController {
|
||||
@ -27,9 +28,10 @@ export declare class QuestController {
|
||||
protected questHelper: QuestHelper;
|
||||
protected questConditionHelper: QuestConditionHelper;
|
||||
protected playerService: PlayerService;
|
||||
protected localeService: LocaleService;
|
||||
protected configServer: ConfigServer;
|
||||
protected questConfig: IQuestConfig;
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer);
|
||||
/**
|
||||
* Get all quests visible to player
|
||||
* Exclude quests with incomplete preconditions (level/loyalty)
|
||||
|
@ -84,6 +84,11 @@ declare class ItemHelper {
|
||||
*/
|
||||
generateItemsFromStackSlot(item: ITemplateItem, parentId: string): Item[];
|
||||
getItem(tpl: string): [boolean, ITemplateItem];
|
||||
/**
|
||||
* get normalized value (0-1) based on item condition
|
||||
* @param item
|
||||
* @returns number between 0 and 1
|
||||
*/
|
||||
getItemQualityModifier(item: Item): number;
|
||||
findAndReturnChildrenByItems(items: Item[], itemID: string): string[];
|
||||
/**
|
||||
|
@ -8,6 +8,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ItemEventRouter } from "../routers/ItemEventRouter";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
@ -25,6 +26,7 @@ export declare class QuestHelper {
|
||||
protected itemHelper: ItemHelper;
|
||||
protected itemEventRouter: ItemEventRouter;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected localeService: LocaleService;
|
||||
protected ragfairServerHelper: RagfairServerHelper;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
@ -32,7 +34,7 @@ export declare class QuestHelper {
|
||||
protected traderHelper: TraderHelper;
|
||||
protected configServer: ConfigServer;
|
||||
protected questConfig: IQuestConfig;
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, configServer: ConfigServer);
|
||||
static get STATUS(): Record<string, number>;
|
||||
questStatus(pmcData: IPmcData, questID: string): string;
|
||||
/**
|
||||
@ -74,7 +76,7 @@ export declare class QuestHelper {
|
||||
cleanQuestConditions(quest: IQuest): IQuest;
|
||||
failQuest(pmcData: IPmcData, body: any, sessionID: string): any;
|
||||
getQuestFromDb(questId: string, pmcData: IPmcData): IQuest;
|
||||
getQuestLocaleIdFromDb(messageId: string, localisation?: string): string;
|
||||
getQuestLocaleIdFromDb(messageId: string): string;
|
||||
applyQuestReward(pmcData: IPmcData, body: ICompleteQuestRequestData, state: string, sessionID: string): Reward[];
|
||||
/**
|
||||
* Get the intel center bonus a player has
|
||||
|
@ -10,6 +10,7 @@ import { ItemEventRouter } from "../routers/ItemEventRouter";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { RagfairOfferService } from "../services/RagfairOfferService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
@ -37,11 +38,12 @@ export declare class RagfairOfferHelper {
|
||||
protected ragfairSortHelper: RagfairSortHelper;
|
||||
protected ragfairHelper: RagfairHelper;
|
||||
protected ragfairOfferService: RagfairOfferService;
|
||||
protected localeService: LocaleService;
|
||||
protected configServer: ConfigServer;
|
||||
protected static TPL_GOODS_SOLD: string;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
protected questConfig: IQuestConfig;
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer);
|
||||
getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
|
||||
getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
|
||||
processOffers(sessionID: string): boolean;
|
||||
|
@ -1,11 +1,12 @@
|
||||
import { MemberCategory } from "../models/enums/MemberCategory";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { MemberCategory } from "../models/enums/MemberCategory";
|
||||
import { IQuestConfig } from "../models/spt/config/IQuestConfig";
|
||||
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
@ -19,13 +20,14 @@ export declare class RagfairServerHelper {
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected localeService: LocaleService;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected configServer: ConfigServer;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
protected questConfig: IQuestConfig;
|
||||
protected static TPL_GOODS_RETURNED: string;
|
||||
constructor(randomUtil: RandomUtil, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, jsonUtil: JsonUtil, configServer: ConfigServer);
|
||||
constructor(randomUtil: RandomUtil, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, jsonUtil: JsonUtil, configServer: ConfigServer);
|
||||
/**
|
||||
* Is item valid / on blacklist / quest item
|
||||
* @param itemDetails
|
||||
|
@ -1,8 +1,10 @@
|
||||
import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
export declare class RagfairSortHelper {
|
||||
protected databaseServer: DatabaseServer;
|
||||
constructor(databaseServer: DatabaseServer);
|
||||
protected localeService: LocaleService;
|
||||
constructor(databaseServer: DatabaseServer, localeService: LocaleService);
|
||||
sortOffers(offers: IRagfairOffer[], type: number, direction?: number): IRagfairOffer[];
|
||||
protected sortOffersByID(a: IRagfairOffer, b: IRagfairOffer): number;
|
||||
protected sortOffersByRating(a: IRagfairOffer, b: IRagfairOffer): number;
|
||||
|
@ -1,4 +1,6 @@
|
||||
import { FenceLevel } from "../models/eft/common/IGlobals";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { IBarterScheme, ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader";
|
||||
import { ITraderConfig } from "../models/spt/config/ITraderConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
@ -34,7 +36,48 @@ export declare class TraderHelper {
|
||||
*/
|
||||
resetTrader(sessionID: string, traderID: string): void;
|
||||
changeTraderDisplay(traderID: string, status: boolean, sessionID: string): void;
|
||||
/**
|
||||
* Get a list of items and their prices from player inventory that can be sold to a trader
|
||||
* @param traderID trader id being traded with
|
||||
* @param sessionID session id
|
||||
* @returns IBarterScheme[][]
|
||||
*/
|
||||
getPurchasesData(traderID: string, sessionID: string): Record<string, IBarterScheme[][]>;
|
||||
/**
|
||||
* Should item be skipped when selling to trader according to its sell categories and other checks
|
||||
* @param pmcData
|
||||
* @param item
|
||||
* @param sellCategory
|
||||
* @returns true if should NOT be sold to trader
|
||||
*/
|
||||
protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[]): boolean;
|
||||
/**
|
||||
* Can this weapon be sold to a trader with its current durabiltiy level
|
||||
* @param traderID
|
||||
* @param item
|
||||
* @returns boolean
|
||||
*/
|
||||
protected isWeaponAndBelowTraderBuyDurability(traderID: string, item: Item): boolean;
|
||||
/**
|
||||
* Get the price of an item and all of its attached children
|
||||
* Take into account bonuses/adjsutments e.g. discounts
|
||||
* @param pmcData profile data
|
||||
* @param item item to calculate price of
|
||||
* @param buyPriceCoefficient
|
||||
* @param fenceInfo fence data
|
||||
* @param traderBase trader details
|
||||
* @param currencyTpl Currency to get price as
|
||||
* @returns price of item + children
|
||||
*/
|
||||
protected getAdjustedItemPrice(pmcData: IPmcData, item: Item, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderBase: ITraderBase, currencyTpl: string): number;
|
||||
/**
|
||||
* Get the raw price of item+child items from handbook without any modification
|
||||
* @param pmcData profile data
|
||||
* @param item item to calculate price of
|
||||
* @returns price as number
|
||||
*/
|
||||
protected getRawItemPrice(pmcData: IPmcData, item: Item): number;
|
||||
protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderID: string): number;
|
||||
/**
|
||||
* Calculate traders level based on exp amount and increment level if over threshold
|
||||
* @param traderID trader to process
|
||||
|
11
TypeScript/13AddTrader/types/loaders/AfterDbModLoader.d.ts
vendored
Normal file
11
TypeScript/13AddTrader/types/loaders/AfterDbModLoader.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
import { DependencyContainer } from "tsyringe";
|
||||
import { OnLoad } from "../di/OnLoad";
|
||||
import { InitialModLoader } from "./InitialModLoader";
|
||||
export declare class AfterDbModLoader implements OnLoad {
|
||||
protected initialModLoader: InitialModLoader;
|
||||
constructor(initialModLoader: InitialModLoader);
|
||||
onLoad(): void;
|
||||
getRoute(): string;
|
||||
getModPath(mod: string): string;
|
||||
protected executeMods(container: DependencyContainer): void;
|
||||
}
|
@ -8,6 +8,7 @@ export declare enum ConfigTypes {
|
||||
IN_RAID = "aki-inraid",
|
||||
INSURANCE = "aki-insurance",
|
||||
INVENTORY = "aki-inventory",
|
||||
LOCALE = "aki-locale",
|
||||
LOCATION = "aki-location",
|
||||
MATCH = "aki-match",
|
||||
QUEST = "aki-quest",
|
||||
|
4
TypeScript/13AddTrader/types/models/external/IAfterDBLoadMod.d.ts
vendored
Normal file
4
TypeScript/13AddTrader/types/models/external/IAfterDBLoadMod.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import { DependencyContainer } from "./tsyringe";
|
||||
export interface IAfterDBLoadMod {
|
||||
loadAfterDbInit(container: DependencyContainer): void;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
import { DependencyContainer } from "./tsyringe";
|
||||
export interface IMod {
|
||||
load: (container: DependencyContainer) => void;
|
||||
delayedLoad: (container: DependencyContainer) => void;
|
||||
load(container: DependencyContainer): void;
|
||||
delayedLoad(container: DependencyContainer): void;
|
||||
}
|
||||
|
5
TypeScript/13AddTrader/types/models/spt/config/ILocaleConfig.d.ts
vendored
Normal file
5
TypeScript/13AddTrader/types/models/spt/config/ILocaleConfig.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import { IBaseConfig } from "./IBaseConfig";
|
||||
export interface ILocaleConfig extends IBaseConfig {
|
||||
kind: "aki-locale";
|
||||
desiredLocale: string;
|
||||
}
|
11
TypeScript/13AddTrader/types/models/spt/logging/LogBackgroundColor.d.ts
vendored
Normal file
11
TypeScript/13AddTrader/types/models/spt/logging/LogBackgroundColor.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
export declare enum LogBackgroundColor {
|
||||
default = "",
|
||||
black = "blackBG",
|
||||
red = "redBG",
|
||||
green = "greenBG",
|
||||
yellow = "yellowBG",
|
||||
blue = "blueBG",
|
||||
magenta = "magentaBG",
|
||||
cyan = "cyanBG",
|
||||
white = "whiteBG"
|
||||
}
|
11
TypeScript/13AddTrader/types/models/spt/logging/LogTextColor.d.ts
vendored
Normal file
11
TypeScript/13AddTrader/types/models/spt/logging/LogTextColor.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
export declare enum LogTextColor {
|
||||
black = "black",
|
||||
red = "red",
|
||||
green = "green",
|
||||
yellow = "yellow",
|
||||
blue = "blue",
|
||||
magenta = "magenta",
|
||||
cyan = "cyan",
|
||||
white = "white",
|
||||
gray = ""
|
||||
}
|
7
TypeScript/13AddTrader/types/models/spt/logging/SptLogger.d.ts
vendored
Normal file
7
TypeScript/13AddTrader/types/models/spt/logging/SptLogger.d.ts
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
export interface SptLogger {
|
||||
error: (msg: string | Record<string, unknown>) => void;
|
||||
warn: (msg: string | Record<string, unknown>) => void;
|
||||
succ?: (msg: string | Record<string, unknown>) => void;
|
||||
info: (msg: string | Record<string, unknown>) => void;
|
||||
debug: (msg: string | Record<string, unknown>) => void;
|
||||
}
|
@ -1,7 +1,10 @@
|
||||
import { Daum } from "../../eft/itemEvent/IItemEventRouterRequest";
|
||||
import { LogBackgroundColor } from "../logging/LogBackgroundColor";
|
||||
import { LogTextColor } from "../logging/LogTextColor";
|
||||
export interface ILogger {
|
||||
writeToLogFile(data: string | Daum): void;
|
||||
log(data: string | Record<string, unknown> | Error, color: string): void;
|
||||
log(data: string | Record<string, unknown> | Error, color: string, backgroundColor?: string): void;
|
||||
logWithColor(data: string | Record<string, unknown>, textColor: LogTextColor, backgroundColor?: LogBackgroundColor): void;
|
||||
error(data: string): void;
|
||||
warning(data: string): void;
|
||||
success(data: string): void;
|
||||
|
@ -29,8 +29,8 @@ export declare class FenceService {
|
||||
hasExpiredCache(refreshAssort: boolean): boolean;
|
||||
generateFenceAssortCache(pmcData: IPmcData): void;
|
||||
/**
|
||||
*
|
||||
* @param pmcData Get the fence level the passed in profile has
|
||||
* Get the fence level the passed in profile has
|
||||
* @param pmcData Player profile
|
||||
* @returns FenceLevel
|
||||
*/
|
||||
getFenceInfo(pmcData: IPmcData): FenceLevel;
|
||||
|
14
TypeScript/13AddTrader/types/services/LocaleService.d.ts
vendored
Normal file
14
TypeScript/13AddTrader/types/services/LocaleService.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
import { ILocaleConfig } from "../models/spt/config/ILocaleConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
export declare class LocaleService {
|
||||
protected logger: ILogger;
|
||||
protected configServer: ConfigServer;
|
||||
protected localeConfig: ILocaleConfig;
|
||||
constructor(logger: ILogger, configServer: ConfigServer);
|
||||
/**
|
||||
* Gets the locale key from the locale.json file
|
||||
* @returns locale e.g en/ge/cz/cn
|
||||
*/
|
||||
getDesiredLocale(): string;
|
||||
}
|
@ -5,7 +5,7 @@ import { ImageRouter } from "../routers/ImageRouter";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { CustomHandbookItemService } from "../services/CustomHandbookItemService";
|
||||
import { CustomItemService } from "../services/CustomItemService";
|
||||
import { CustomPresetService } from "../services/customPresetService";
|
||||
import { CustomPresetService } from "../services/CustomPresetService";
|
||||
import { CustomTraderAssortService } from "../services/CustomTraderAssortService";
|
||||
import { JsonUtil } from "./JsonUtil";
|
||||
import { VFS } from "./VFS";
|
||||
|
37
TypeScript/13AddTrader/types/utils/Logger.d.ts
vendored
37
TypeScript/13AddTrader/types/utils/Logger.d.ts
vendored
@ -1,17 +1,13 @@
|
||||
/// <reference types="node" />
|
||||
import { Daum } from "../models/eft/itemEvent/IItemEventRouterRequest";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import winston from "winston";
|
||||
import { IAsyncQueue } from "../models/spt/utils/IAsyncQueue";
|
||||
import { IUUidGenerator } from "../models/spt/utils/IUuidGenerator";
|
||||
import fs from "fs";
|
||||
interface SptLogger {
|
||||
error: (msg: string | Record<string, unknown>) => void;
|
||||
warn: (msg: string | Record<string, unknown>) => void;
|
||||
succ?: (msg: string | Record<string, unknown>) => void;
|
||||
info: (msg: string | Record<string, unknown>) => void;
|
||||
debug: (msg: string | Record<string, unknown>) => void;
|
||||
}
|
||||
import winston from "winston";
|
||||
import { Daum } from "../models/eft/itemEvent/IItemEventRouterRequest";
|
||||
import { LogBackgroundColor } from "../models/spt/logging/LogBackgroundColor";
|
||||
import { LogTextColor } from "../models/spt/logging/LogTextColor";
|
||||
import { SptLogger } from "../models/spt/logging/SptLogger";
|
||||
import { IAsyncQueue } from "../models/spt/utils/IAsyncQueue";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { IUUidGenerator } from "../models/spt/utils/IUuidGenerator";
|
||||
export declare class WinstonLogger implements ILogger {
|
||||
protected asyncQueue: IAsyncQueue;
|
||||
protected uuidGenerator: IUUidGenerator;
|
||||
@ -36,16 +32,27 @@ export declare class WinstonLogger implements ILogger {
|
||||
custom: string;
|
||||
debug: string;
|
||||
};
|
||||
bgColors: {
|
||||
default: string;
|
||||
blackBG: string;
|
||||
redBG: string;
|
||||
greenBG: string;
|
||||
yellowBG: string;
|
||||
blueBG: string;
|
||||
magentaBG: string;
|
||||
cyanBG: string;
|
||||
whiteBG: string;
|
||||
};
|
||||
};
|
||||
protected logger: winston.Logger & SptLogger;
|
||||
writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise<void>;
|
||||
protected writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise<void>;
|
||||
constructor(asyncQueue: IAsyncQueue, uuidGenerator: IUUidGenerator);
|
||||
writeToLogFile(data: string | Daum): Promise<void>;
|
||||
log(data: string | Error | Record<string, unknown>, color: string): Promise<void>;
|
||||
log(data: string | Error | Record<string, unknown>, color: string, backgroundColor?: string): Promise<void>;
|
||||
error(data: string | Record<string, unknown>): Promise<void>;
|
||||
warning(data: string | Record<string, unknown>): Promise<void>;
|
||||
success(data: string | Record<string, unknown>): Promise<void>;
|
||||
info(data: string | Record<string, unknown>): Promise<void>;
|
||||
logWithColor(data: string | Record<string, unknown>, textColor: LogTextColor, backgroundColor?: LogBackgroundColor): Promise<void>;
|
||||
debug(data: string | Record<string, unknown>, onlyShowInConsole?: boolean): Promise<void>;
|
||||
}
|
||||
export {};
|
||||
|
@ -13,6 +13,7 @@ class Mod implements IMod
|
||||
logger.info("I am logging info!");
|
||||
logger.warning("I am logging a warning!");
|
||||
logger.error("I am logging an error!");
|
||||
logger.logWithColor("I am logging with color!", red, yellow);
|
||||
}
|
||||
|
||||
// Code added here will be run AFTER the server has started
|
||||
|
@ -6,19 +6,23 @@ import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IPmcDataRepeatableQuest, IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
|
||||
import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
|
||||
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
|
||||
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
|
||||
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { Watermark } from "../utils/Watermark";
|
||||
export declare class GameController {
|
||||
protected logger: ILogger;
|
||||
protected watermark: Watermark;
|
||||
protected httpServerHelper: HttpServerHelper;
|
||||
protected localeService: LocaleService;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected gameHelper: GameHelper;
|
||||
protected configServer: ConfigServer;
|
||||
protected httpConfig: IHttpConfig;
|
||||
constructor(logger: ILogger, watermark: Watermark, httpServerHelper: HttpServerHelper, profileHelper: ProfileHelper, gameHelper: GameHelper, configServer: ConfigServer);
|
||||
protected coreConfig: ICoreConfig;
|
||||
constructor(logger: ILogger, watermark: Watermark, httpServerHelper: HttpServerHelper, localeService: LocaleService, profileHelper: ProfileHelper, gameHelper: GameHelper, configServer: ConfigServer);
|
||||
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string): void;
|
||||
protected addMissingBonusesProperty(pmcProfile: IPmcData): void;
|
||||
protected addMissingRepeatableQuestsProperty(pmcProfile: IPmcData): void;
|
||||
|
@ -14,6 +14,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ItemEventRouter } from "../routers/ItemEventRouter";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { PlayerService } from "../services/PlayerService";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
export declare class QuestController {
|
||||
@ -27,9 +28,10 @@ export declare class QuestController {
|
||||
protected questHelper: QuestHelper;
|
||||
protected questConditionHelper: QuestConditionHelper;
|
||||
protected playerService: PlayerService;
|
||||
protected localeService: LocaleService;
|
||||
protected configServer: ConfigServer;
|
||||
protected questConfig: IQuestConfig;
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer);
|
||||
/**
|
||||
* Get all quests visible to player
|
||||
* Exclude quests with incomplete preconditions (level/loyalty)
|
||||
|
@ -84,6 +84,11 @@ declare class ItemHelper {
|
||||
*/
|
||||
generateItemsFromStackSlot(item: ITemplateItem, parentId: string): Item[];
|
||||
getItem(tpl: string): [boolean, ITemplateItem];
|
||||
/**
|
||||
* get normalized value (0-1) based on item condition
|
||||
* @param item
|
||||
* @returns number between 0 and 1
|
||||
*/
|
||||
getItemQualityModifier(item: Item): number;
|
||||
findAndReturnChildrenByItems(items: Item[], itemID: string): string[];
|
||||
/**
|
||||
|
@ -8,6 +8,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ItemEventRouter } from "../routers/ItemEventRouter";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
@ -25,6 +26,7 @@ export declare class QuestHelper {
|
||||
protected itemHelper: ItemHelper;
|
||||
protected itemEventRouter: ItemEventRouter;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected localeService: LocaleService;
|
||||
protected ragfairServerHelper: RagfairServerHelper;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected profileHelper: ProfileHelper;
|
||||
@ -32,7 +34,7 @@ export declare class QuestHelper {
|
||||
protected traderHelper: TraderHelper;
|
||||
protected configServer: ConfigServer;
|
||||
protected questConfig: IQuestConfig;
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, traderHelper: TraderHelper, configServer: ConfigServer);
|
||||
static get STATUS(): Record<string, number>;
|
||||
questStatus(pmcData: IPmcData, questID: string): string;
|
||||
/**
|
||||
@ -74,7 +76,7 @@ export declare class QuestHelper {
|
||||
cleanQuestConditions(quest: IQuest): IQuest;
|
||||
failQuest(pmcData: IPmcData, body: any, sessionID: string): any;
|
||||
getQuestFromDb(questId: string, pmcData: IPmcData): IQuest;
|
||||
getQuestLocaleIdFromDb(messageId: string, localisation?: string): string;
|
||||
getQuestLocaleIdFromDb(messageId: string): string;
|
||||
applyQuestReward(pmcData: IPmcData, body: ICompleteQuestRequestData, state: string, sessionID: string): Reward[];
|
||||
/**
|
||||
* Get the intel center bonus a player has
|
||||
|
@ -10,6 +10,7 @@ import { ItemEventRouter } from "../routers/ItemEventRouter";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { RagfairOfferService } from "../services/RagfairOfferService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { TimeUtil } from "../utils/TimeUtil";
|
||||
@ -37,11 +38,12 @@ export declare class RagfairOfferHelper {
|
||||
protected ragfairSortHelper: RagfairSortHelper;
|
||||
protected ragfairHelper: RagfairHelper;
|
||||
protected ragfairOfferService: RagfairOfferService;
|
||||
protected localeService: LocaleService;
|
||||
protected configServer: ConfigServer;
|
||||
protected static TPL_GOODS_SOLD: string;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
protected questConfig: IQuestConfig;
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer);
|
||||
getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
|
||||
getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
|
||||
processOffers(sessionID: string): boolean;
|
||||
|
@ -1,11 +1,12 @@
|
||||
import { MemberCategory } from "../models/enums/MemberCategory";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
|
||||
import { MemberCategory } from "../models/enums/MemberCategory";
|
||||
import { IQuestConfig } from "../models/spt/config/IQuestConfig";
|
||||
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { SaveServer } from "../servers/SaveServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
import { HashUtil } from "../utils/HashUtil";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
@ -19,13 +20,14 @@ export declare class RagfairServerHelper {
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected profileHelper: ProfileHelper;
|
||||
protected itemHelper: ItemHelper;
|
||||
protected localeService: LocaleService;
|
||||
protected dialogueHelper: DialogueHelper;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected configServer: ConfigServer;
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
protected questConfig: IQuestConfig;
|
||||
protected static TPL_GOODS_RETURNED: string;
|
||||
constructor(randomUtil: RandomUtil, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, jsonUtil: JsonUtil, configServer: ConfigServer);
|
||||
constructor(randomUtil: RandomUtil, hashUtil: HashUtil, saveServer: SaveServer, databaseServer: DatabaseServer, profileHelper: ProfileHelper, itemHelper: ItemHelper, localeService: LocaleService, dialogueHelper: DialogueHelper, jsonUtil: JsonUtil, configServer: ConfigServer);
|
||||
/**
|
||||
* Is item valid / on blacklist / quest item
|
||||
* @param itemDetails
|
||||
|
@ -1,8 +1,10 @@
|
||||
import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { LocaleService } from "../services/LocaleService";
|
||||
export declare class RagfairSortHelper {
|
||||
protected databaseServer: DatabaseServer;
|
||||
constructor(databaseServer: DatabaseServer);
|
||||
protected localeService: LocaleService;
|
||||
constructor(databaseServer: DatabaseServer, localeService: LocaleService);
|
||||
sortOffers(offers: IRagfairOffer[], type: number, direction?: number): IRagfairOffer[];
|
||||
protected sortOffersByID(a: IRagfairOffer, b: IRagfairOffer): number;
|
||||
protected sortOffersByRating(a: IRagfairOffer, b: IRagfairOffer): number;
|
||||
|
@ -1,4 +1,6 @@
|
||||
import { FenceLevel } from "../models/eft/common/IGlobals";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { Item } from "../models/eft/common/tables/IItem";
|
||||
import { IBarterScheme, ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader";
|
||||
import { ITraderConfig } from "../models/spt/config/ITraderConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
@ -34,7 +36,48 @@ export declare class TraderHelper {
|
||||
*/
|
||||
resetTrader(sessionID: string, traderID: string): void;
|
||||
changeTraderDisplay(traderID: string, status: boolean, sessionID: string): void;
|
||||
/**
|
||||
* Get a list of items and their prices from player inventory that can be sold to a trader
|
||||
* @param traderID trader id being traded with
|
||||
* @param sessionID session id
|
||||
* @returns IBarterScheme[][]
|
||||
*/
|
||||
getPurchasesData(traderID: string, sessionID: string): Record<string, IBarterScheme[][]>;
|
||||
/**
|
||||
* Should item be skipped when selling to trader according to its sell categories and other checks
|
||||
* @param pmcData
|
||||
* @param item
|
||||
* @param sellCategory
|
||||
* @returns true if should NOT be sold to trader
|
||||
*/
|
||||
protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[]): boolean;
|
||||
/**
|
||||
* Can this weapon be sold to a trader with its current durabiltiy level
|
||||
* @param traderID
|
||||
* @param item
|
||||
* @returns boolean
|
||||
*/
|
||||
protected isWeaponAndBelowTraderBuyDurability(traderID: string, item: Item): boolean;
|
||||
/**
|
||||
* Get the price of an item and all of its attached children
|
||||
* Take into account bonuses/adjsutments e.g. discounts
|
||||
* @param pmcData profile data
|
||||
* @param item item to calculate price of
|
||||
* @param buyPriceCoefficient
|
||||
* @param fenceInfo fence data
|
||||
* @param traderBase trader details
|
||||
* @param currencyTpl Currency to get price as
|
||||
* @returns price of item + children
|
||||
*/
|
||||
protected getAdjustedItemPrice(pmcData: IPmcData, item: Item, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderBase: ITraderBase, currencyTpl: string): number;
|
||||
/**
|
||||
* Get the raw price of item+child items from handbook without any modification
|
||||
* @param pmcData profile data
|
||||
* @param item item to calculate price of
|
||||
* @returns price as number
|
||||
*/
|
||||
protected getRawItemPrice(pmcData: IPmcData, item: Item): number;
|
||||
protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderID: string): number;
|
||||
/**
|
||||
* Calculate traders level based on exp amount and increment level if over threshold
|
||||
* @param traderID trader to process
|
||||
|
11
TypeScript/1LogToConsole/types/loaders/AfterDbModLoader.d.ts
vendored
Normal file
11
TypeScript/1LogToConsole/types/loaders/AfterDbModLoader.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
import { DependencyContainer } from "tsyringe";
|
||||
import { OnLoad } from "../di/OnLoad";
|
||||
import { InitialModLoader } from "./InitialModLoader";
|
||||
export declare class AfterDbModLoader implements OnLoad {
|
||||
protected initialModLoader: InitialModLoader;
|
||||
constructor(initialModLoader: InitialModLoader);
|
||||
onLoad(): void;
|
||||
getRoute(): string;
|
||||
getModPath(mod: string): string;
|
||||
protected executeMods(container: DependencyContainer): void;
|
||||
}
|
@ -8,6 +8,7 @@ export declare enum ConfigTypes {
|
||||
IN_RAID = "aki-inraid",
|
||||
INSURANCE = "aki-insurance",
|
||||
INVENTORY = "aki-inventory",
|
||||
LOCALE = "aki-locale",
|
||||
LOCATION = "aki-location",
|
||||
MATCH = "aki-match",
|
||||
QUEST = "aki-quest",
|
||||
|
4
TypeScript/1LogToConsole/types/models/external/IAfterDBLoadMod.d.ts
vendored
Normal file
4
TypeScript/1LogToConsole/types/models/external/IAfterDBLoadMod.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import { DependencyContainer } from "./tsyringe";
|
||||
export interface IAfterDBLoadMod {
|
||||
loadAfterDbInit(container: DependencyContainer): void;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
import { DependencyContainer } from "./tsyringe";
|
||||
export interface IMod {
|
||||
load: (container: DependencyContainer) => void;
|
||||
delayedLoad: (container: DependencyContainer) => void;
|
||||
load(container: DependencyContainer): void;
|
||||
delayedLoad(container: DependencyContainer): void;
|
||||
}
|
||||
|
5
TypeScript/1LogToConsole/types/models/spt/config/ILocaleConfig.d.ts
vendored
Normal file
5
TypeScript/1LogToConsole/types/models/spt/config/ILocaleConfig.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import { IBaseConfig } from "./IBaseConfig";
|
||||
export interface ILocaleConfig extends IBaseConfig {
|
||||
kind: "aki-locale";
|
||||
desiredLocale: string;
|
||||
}
|
11
TypeScript/1LogToConsole/types/models/spt/logging/LogBackgroundColor.d.ts
vendored
Normal file
11
TypeScript/1LogToConsole/types/models/spt/logging/LogBackgroundColor.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
export declare enum LogBackgroundColor {
|
||||
default = "",
|
||||
black = "blackBG",
|
||||
red = "redBG",
|
||||
green = "greenBG",
|
||||
yellow = "yellowBG",
|
||||
blue = "blueBG",
|
||||
magenta = "magentaBG",
|
||||
cyan = "cyanBG",
|
||||
white = "whiteBG"
|
||||
}
|
11
TypeScript/1LogToConsole/types/models/spt/logging/LogTextColor.d.ts
vendored
Normal file
11
TypeScript/1LogToConsole/types/models/spt/logging/LogTextColor.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
export declare enum LogTextColor {
|
||||
black = "black",
|
||||
red = "red",
|
||||
green = "green",
|
||||
yellow = "yellow",
|
||||
blue = "blue",
|
||||
magenta = "magenta",
|
||||
cyan = "cyan",
|
||||
white = "white",
|
||||
gray = ""
|
||||
}
|
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