Skip to content

Commit

Permalink
Update types
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchangelWTF committed Jan 30, 2025
1 parent 890c334 commit 4adbcaa
Showing 32 changed files with 197 additions and 101 deletions.
4 changes: 2 additions & 2 deletions types/callbacks/CustomizationCallbacks.d.ts
Original file line number Diff line number Diff line change
@@ -28,11 +28,11 @@ export declare class CustomizationCallbacks {
/**
* Handle CustomizationBuy event
*/
buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse;
buyCustomisation(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse;
/** Handle client/hideout/customization/offer/list */
getHideoutCustomisation(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutCustomisation>;
/** Handle client/customization/storage */
getStorage(url: string, request: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ICustomisationStorage[]>;
/** Handle CustomizationSet */
setClothing(pmcData: IPmcData, request: ICustomizationSetRequest, sessionID: string): IItemEventRouterResponse;
setCustomisation(pmcData: IPmcData, request: ICustomizationSetRequest, sessionID: string): IItemEventRouterResponse;
}
2 changes: 1 addition & 1 deletion types/callbacks/PrestigeCallbacks.d.ts
Original file line number Diff line number Diff line change
@@ -14,5 +14,5 @@ export declare class PrestigeCallbacks {
/** Handle client/prestige/list */
getPrestige(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPrestige>;
/** Handle client/prestige/obtain */
obtainPrestige(url: string, info: IObtainPrestigeRequest[], sessionID: string): INullResponseData;
obtainPrestige(url: string, info: IObtainPrestigeRequest[], sessionID: string): Promise<INullResponseData>;
}
16 changes: 5 additions & 11 deletions types/controllers/CustomizationController.d.ts
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ import { EventOutputHolder } from "@spt/routers/EventOutputHolder";
import { SaveServer } from "@spt/servers/SaveServer";
import { DatabaseService } from "@spt/services/DatabaseService";
import { LocalisationService } from "@spt/services/LocalisationService";
import { PaymentService } from "@spt/services/PaymentService";
import type { ICloner } from "@spt/utils/cloners/ICloner";
export declare class CustomizationController {
protected logger: ILogger;
@@ -20,12 +21,13 @@ export declare class CustomizationController {
protected saveServer: SaveServer;
protected localisationService: LocalisationService;
protected profileHelper: ProfileHelper;
protected paymentService: PaymentService;
protected cloner: ICloner;
protected readonly clothingIds: {
lowerParentId: string;
upperParentId: string;
};
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper, cloner: ICloner);
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper, paymentService: PaymentService, cloner: ICloner);
/**
* Get purchasable clothing items from trader that match players side (usec/bear)
* @param traderID trader to look up clothing for
@@ -41,7 +43,7 @@ export declare class CustomizationController {
* @param sessionId Session id
* @returns IItemEventRouterResponse
*/
buyClothing(pmcData: IPmcData, buyClothingRequest: IBuyClothingRequestData, sessionId: string): IItemEventRouterResponse;
buyCustomisation(pmcData: IPmcData, buyClothingRequest: IBuyClothingRequestData, sessionId: string): IItemEventRouterResponse;
protected getTraderClothingOffer(sessionId: string, offerId: string): ISuit;
/**
* Has an outfit been purchased by a player
@@ -58,21 +60,13 @@ export declare class CustomizationController {
* @param output Client response
*/
protected payForClothingItems(sessionId: string, pmcData: IPmcData, itemsToPayForClothingWith: IPaymentItemForClothing[], output: IItemEventRouterResponse): void;
/**
* Update output object and player profile with purchase details for single piece of clothing
* @param sessionId Session id
* @param pmcData Player profile
* @param paymentItemDetails Payment details
* @param output Client response
*/
protected payForClothingItem(sessionId: string, pmcData: IPmcData, paymentItemDetails: IPaymentItemForClothing, output: IItemEventRouterResponse): void;
protected getAllTraderSuits(sessionID: string): ISuit[];
/** Handle client/hideout/customization/offer/list */
getHideoutCustomisation(sessionID: string, info: IEmptyRequestData): IHideoutCustomisation;
/** Handle client/customization/storage */
getCustomisationStorage(sessionID: string, info: IEmptyRequestData): ICustomisationStorage[];
/** Handle CustomizationSet event */
setClothing(sessionId: string, request: ICustomizationSetRequest, pmcData: IPmcData): IItemEventRouterResponse;
setCustomisation(sessionId: string, request: ICustomizationSetRequest, pmcData: IPmcData): IItemEventRouterResponse;
/**
* Applies a purchsed suit to the players doll
* @param customisation Suit to apply to profile
10 changes: 9 additions & 1 deletion types/controllers/GameController.d.ts
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ import { IHttpConfig } from "@spt/models/spt/config/IHttpConfig";
import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
import type { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer";
import { CreateProfileService } from "@spt/services/CreateProfileService";
import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService";
import { DatabaseService } from "@spt/services/DatabaseService";
import { GiftService } from "@spt/services/GiftService";
@@ -53,6 +54,7 @@ export declare class GameController {
protected profileFixerService: ProfileFixerService;
protected localisationService: LocalisationService;
protected postDbLoadService: PostDbLoadService;
protected createProfileService: CreateProfileService;
protected customLocationWaveService: CustomLocationWaveService;
protected openZoneService: OpenZoneService;
protected seasonalEventService: SeasonalEventService;
@@ -68,12 +70,13 @@ export declare class GameController {
protected ragfairConfig: IRagfairConfig;
protected hideoutConfig: IHideoutConfig;
protected botConfig: IBotConfig;
constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, inventoryHelper: InventoryHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, postDbLoadService: PostDbLoadService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner);
constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, inventoryHelper: InventoryHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, postDbLoadService: PostDbLoadService, createProfileService: CreateProfileService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, profileActivityService: ProfileActivityService, applicationContext: ApplicationContext, configServer: ConfigServer, cloner: ICloner);
load(): void;
/**
* Handle client/game/start
*/
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
protected migrate310xProfile(fullProfile: ISptProfile): void;
protected migrate39xProfile(fullProfile: ISptProfile): void;
/**
* Handle client/game/config
@@ -118,6 +121,11 @@ export declare class GameController {
* @param pmcProfile Profile to add gifts to
*/
protected sendPraporGiftsToNewProfiles(pmcProfile: IPmcData): void;
/**
* Mechanic sends players a measuring tape on profile start for some reason
* @param pmcProfile Player profile
*/
protected sendMechanicGiftsToNewProfile(pmcProfile: IPmcData): void;
/**
* Get a list of installed mods and save their details to the profile being used
* @param fullProfile Profile to add mod details to
2 changes: 1 addition & 1 deletion types/controllers/InventoryController.d.ts
Original file line number Diff line number Diff line change
@@ -183,7 +183,7 @@ export declare class InventoryController {
* @param request Response request
* @returns tplId
*/
protected getExaminedItemTpl(request: IInventoryExamineRequestData): string;
protected getExaminedItemTpl(sessionId: string, request: IInventoryExamineRequestData): string | null;
readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle ApplyInventoryChanges
2 changes: 1 addition & 1 deletion types/controllers/PrestigeController.d.ts
Original file line number Diff line number Diff line change
@@ -50,6 +50,6 @@ export declare class PrestigeController {
/**
* Handle /client/prestige/obtain
*/
obtainPrestige(sessionId: string, request: IObtainPrestigeRequest[]): void;
obtainPrestige(sessionId: string, request: IObtainPrestigeRequest[]): Promise<void>;
protected addPrestigeRewardsToProfile(sessionId: string, newProfile: ISptProfile, rewards: IReward[]): void;
}
4 changes: 2 additions & 2 deletions types/controllers/RagfairController.d.ts
Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@ export declare class RagfairController {
* @param request Request data
* @returns IRagfairOffer
*/
getOfferById(sessionId: string, request: IGetRagfairOfferByIdRequest): IRagfairOffer;
getOfferById(sessionId: string, request: IGetRagfairOfferByIdRequest): IRagfairOffer | undefined;
/**
* Get offers for the client based on type of search being performed
* @param searchRequest Client search request data
@@ -151,7 +151,7 @@ export declare class RagfairController {
*/
addPlayerOffer(pmcData: IPmcData, offerRequest: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Create a flea offer for a single item - uncludes an item with > 1 sized stack
* Create a flea offer for a single item - includes an item with > 1 sized stack
* e.g. 1 ammo stack of 30 cartridges
* @param sessionID Session id
* @param offerRequest Offer request from client
27 changes: 24 additions & 3 deletions types/generators/BotEquipmentModGenerator.d.ts
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper";
import { ProbabilityHelper } from "@spt/helpers/ProbabilityHelper";
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper";
import { MinMax } from "@spt/models/common/MinMax";
import { IPreset } from "@spt/models/eft/common/IGlobals";
import { IMods, IModsChances } from "@spt/models/eft/common/tables/IBotType";
import { IItem } from "@spt/models/eft/common/tables/IItem";
@@ -66,11 +67,31 @@ export declare class BotEquipmentModGenerator {
* Filter a bots plate pool based on its current level
* @param settings Bot equipment generation settings
* @param modSlot Armor slot being filtered
* @param existingPlateTplPool Plates tpls to choose from
* @param compatiblePlateTplPool Compatible plate tpl pool to choose from
* @param armorItem The armor items db template
* @returns Array of plate tpls to choose from
*/
protected filterPlateModsForSlotByLevel(settings: IGenerateEquipmentProperties, modSlot: string, existingPlateTplPool: string[], armorItem: ITemplateItem): IFilterPlateModsForSlotByLevelResult;
protected filterPlateModsForSlotByLevel(settings: IGenerateEquipmentProperties, modSlot: string, compatiblePlateTplPool: string[], armorItem: ITemplateItem): IFilterPlateModsForSlotByLevelResult;
/**
* Get the default plate an armor has in its db item
* @param armorItem Item to look up default plate
* @param modSlot front/back
* @returns Tpl of plate
*/
protected getDefaultPlateTpl(armorItem: ITemplateItem, modSlot: string): string | undefined;
/**
* Get the matching armor slot from the default preset matching passed in armor tpl
* @param presetItemId Id of preset
* @param modSlot front/back
* @returns Armor IItem
*/
protected getDefaultPresetArmorSlot(armorItemTpl: string, modSlot: string): IItem | undefined;
/**
* Gets the minimum and maximum plate class levels from an array of plates
* @param platePool Pool of plates to sort by armorClass to get min and max
* @returns MinMax of armorClass from plate pool
*/
protected getMinMaxArmorPlateClass(platePool: ITemplateItem[]): MinMax;
/**
* Add mods to a weapon using the provided mod pool
* @param sessionId Session id
@@ -186,7 +207,7 @@ export declare class BotEquipmentModGenerator {
*/
protected getModPoolForSlot(request: IModToSpawnRequest, weaponTemplate: ITemplateItem): string[];
protected getModPoolForDefaultSlot(request: IModToSpawnRequest, weaponTemplate: ITemplateItem): string[];
protected getMatchingModFromPreset(request: IModToSpawnRequest, weaponTemplate: ITemplateItem): IItem;
protected getMatchingModFromPreset(request: IModToSpawnRequest, weaponTemplate: ITemplateItem): IItem | undefined;
/**
* Get default preset for weapon OR get specific weapon presets for edge cases (mp5/silenced dvl)
* @param weaponTemplate Weapons db template
4 changes: 2 additions & 2 deletions types/generators/LocationLootGenerator.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ContainerHelper } from "@spt/helpers/ContainerHelper";
import { ItemHelper } from "@spt/helpers/ItemHelper";
import { PresetHelper } from "@spt/helpers/PresetHelper";
import { IContainerMinMax, IStaticAmmoDetails, IStaticContainer, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "@spt/models/eft/common/ILocation";
import { IStaticAmmoDetails, IStaticContainer, IStaticContainerData, IStaticForcedProps, IStaticLootDetails } from "@spt/models/eft/common/ILocation";
import { ILocationBase } from "@spt/models/eft/common/ILocationBase";
import { ILooseLoot, ISpawnpointTemplate, ISpawnpointsForced } from "@spt/models/eft/common/ILooseLoot";
import { IItem } from "@spt/models/eft/common/tables/IItem";
@@ -76,7 +76,7 @@ export declare class LocationLootGenerator {
* @param containersGroups Container group values
* @returns dictionary keyed by groupId
*/
protected getGroupIdToContainerMappings(staticContainerGroupData: IStaticContainer | Record<string, IContainerMinMax>, staticContainersOnMap: IStaticContainerData[]): Record<string, IContainerGroupCount>;
protected getGroupIdToContainerMappings(staticContainerGroupData: IStaticContainer, staticContainersOnMap: IStaticContainerData[]): Record<string, IContainerGroupCount>;
/**
* Choose loot to put into a static container based on weighting
* Handle forced items + seasonal item removal when not in season
4 changes: 2 additions & 2 deletions types/helpers/InventoryHelper.d.ts
Original file line number Diff line number Diff line change
@@ -269,8 +269,8 @@ export declare class InventoryHelper {
}
declare namespace InventoryHelper {
interface InventoryItemHash {
byItemId: Record<string, IItem>;
byParentId: Record<string, IItem[]>;
byItemId: Map<string, IItem>;
byParentId: Map<string, IItem[]>;
}
}
export {};
6 changes: 0 additions & 6 deletions types/helpers/ProfileHelper.d.ts
Original file line number Diff line number Diff line change
@@ -211,12 +211,6 @@ export declare class ProfileHelper {
*/
getBonusValueFromProfile(pmcProfile: IPmcData, desiredBonus: BonusType): number;
playerIsFleaBanned(pmcProfile: IPmcData): boolean;
/**
* Add an achievement to player profile + check for and add any hideout customisation unlocks to profile
* @param fullProfile Profile to add achievement to
* @param achievementId Id of achievement to add
*/
addAchievementToProfile(fullProfile: ISptProfile, achievementId: string): void;
hasAccessToRepeatableFreeRefreshSystem(pmcProfile: IPmcData): boolean;
/**
* Find a profiles "Pockets" item and replace its tpl with passed in value
4 changes: 3 additions & 1 deletion types/helpers/QuestHelper.d.ts
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ import { ItemHelper } from "@spt/helpers/ItemHelper";
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
import { QuestConditionHelper } from "@spt/helpers/QuestConditionHelper";
import { QuestRewardHelper } from "@spt/helpers/QuestRewardHelper";
import { RewardHelper } from "@spt/helpers/RewardHelper";
import { TraderHelper } from "@spt/helpers/TraderHelper";
import { IPmcData } from "@spt/models/eft/common/IPmcData";
import { Common, IQuestStatus } from "@spt/models/eft/common/tables/IBotBase";
@@ -36,6 +37,7 @@ export declare class QuestHelper {
protected localeService: LocaleService;
protected profileHelper: ProfileHelper;
protected questRewardHelper: QuestRewardHelper;
protected rewardHelper: RewardHelper;
protected localisationService: LocalisationService;
protected seasonalEventService: SeasonalEventService;
protected traderHelper: TraderHelper;
@@ -44,7 +46,7 @@ export declare class QuestHelper {
protected configServer: ConfigServer;
protected cloner: ICloner;
protected questConfig: IQuestConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseService: DatabaseService, questConditionHelper: QuestConditionHelper, eventOutputHolder: EventOutputHolder, localeService: LocaleService, profileHelper: ProfileHelper, questRewardHelper: QuestRewardHelper, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, traderHelper: TraderHelper, mailSendService: MailSendService, playerService: PlayerService, configServer: ConfigServer, cloner: ICloner);
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseService: DatabaseService, questConditionHelper: QuestConditionHelper, eventOutputHolder: EventOutputHolder, localeService: LocaleService, profileHelper: ProfileHelper, questRewardHelper: QuestRewardHelper, rewardHelper: RewardHelper, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, traderHelper: TraderHelper, mailSendService: MailSendService, playerService: PlayerService, configServer: ConfigServer, cloner: ICloner);
/**
* Get status of a quest in player profile by its id
* @param pmcData Profile to search
Loading

0 comments on commit 4adbcaa

Please sign in to comment.