From e683314354f7f2e3b346cab0b0eefc348178e92e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=99=E7=A9=8F=E9=9D=84?= <170472707+seionmoya@users.noreply.github.com> Date: Thu, 1 Aug 2024 00:31:52 +0200 Subject: [PATCH 001/119] Update types --- types/callbacks/GameCallbacks.d.ts | 9 + types/callbacks/InraidCallbacks.d.ts | 25 +-- types/callbacks/LocationCallbacks.d.ts | 9 +- types/callbacks/MatchCallbacks.d.ts | 13 +- types/callbacks/WeatherCallbacks.d.ts | 2 + types/callbacks/WishlistCallbacks.d.ts | 10 +- types/controllers/BotController.d.ts | 12 +- types/controllers/InraidController.d.ts | 156 +----------------- types/controllers/LocationController.d.ts | 66 +------- types/controllers/MatchController.d.ts | 76 ++------- types/controllers/WeatherController.d.ts | 6 +- types/controllers/WishlistController.d.ts | 10 +- .../generators/BotEquipmentModGenerator.d.ts | 23 ++- types/generators/BotGenerator.d.ts | 8 +- types/generators/BotLevelGenerator.d.ts | 14 +- types/generators/BotWeaponGenerator.d.ts | 20 ++- ...erator.d.ts => LocationLootGenerator.d.ts} | 2 +- types/generators/LootGenerator.d.ts | 7 +- types/helpers/BotGeneratorHelper.d.ts | 1 - types/helpers/HealthHelper.d.ts | 18 ++ types/helpers/InRaidHelper.d.ts | 117 +------------ types/helpers/ItemHelper.d.ts | 5 +- types/helpers/WeightedRandomHelper.d.ts | 9 - types/models/eft/common/IGlobals.d.ts | 22 +++ types/models/eft/common/ILocationBase.d.ts | 6 + types/models/eft/common/tables/IBotBase.d.ts | 8 +- .../eft/common/tables/ILocationServices.d.ts | 70 ++++++++ .../eft/inRaid/ISaveProgressRequestData.d.ts | 11 -- .../eft/inRaid/IScavSaveRequestData.d.ts | 4 + types/models/eft/launcher/IMiniProfile.d.ts | 8 +- .../eft/location/IGetAirdropLootResponse.d.ts | 6 + .../eft/match/IEndLocalRaidRequestData.d.ts | 23 +++ .../eft/match/IPutMetricsRequestData.d.ts | 53 +++++- .../eft/match/IStartLocalRaidRequestData.d.ts | 7 + .../match/IStartLocalRaidResponseData.d.ts | 12 ++ types/models/eft/profile/ISptProfile.d.ts | 4 +- .../eft/wishlist/IAddToWishlistRequest.d.ts | 4 + .../IChangeWishlistItemCategoryRequest.d.ts | 5 + .../wishlist/IRemoveFromWishlistRequest.d.ts | 4 + .../eft/wishlist/IWishlistActionData.d.ts | 4 - types/models/enums/AirdropType.d.ts | 8 +- types/models/enums/BaseClasses.d.ts | 2 +- types/models/enums/ConfigTypes.d.ts | 3 +- types/models/enums/ItemTpl.d.ts | 40 +++-- .../spt/callbacks/IInraidCallbacks.d.ts | 14 -- .../spt/callbacks/IWishlistCallbacks.d.ts | 7 - types/models/spt/config/IAirdropConfig.d.ts | 17 -- types/models/spt/config/IBTRConfig.d.ts | 13 -- types/models/spt/config/ILocationConfig.d.ts | 2 - types/models/spt/templates/ITemplates.d.ts | 3 + .../weather/IGetLocalWeatherResponseData.d.ts | 5 + .../item_events/WishlistItemEventRouter.d.ts | 2 +- types/routers/static/GameStaticRouter.d.ts | 4 +- types/servers/HttpServer.d.ts | 2 +- .../ws/SptWebSocketConnectionHandler.d.ts | 2 +- types/services/AirdropService.d.ts | 53 ++++++ types/services/BotGenerationCacheService.d.ts | 2 + types/services/DatabaseService.d.ts | 5 + types/services/InsuranceService.d.ts | 64 +------ .../LegacyLocationLifecycleService.d.ts | 105 ++++++++++++ types/services/LocationLifecycleService.d.ts | 150 +++++++++++++++++ types/services/ProfileFixerService.d.ts | 6 +- types/services/TraderServicesService.d.ts | 13 -- .../tools/ItemTplGenerator/itemOverrides.d.ts | 2 + 64 files changed, 743 insertions(+), 650 deletions(-) rename types/generators/{LocationGenerator.d.ts => LocationLootGenerator.d.ts} (99%) create mode 100644 types/models/eft/common/tables/ILocationServices.d.ts delete mode 100644 types/models/eft/inRaid/ISaveProgressRequestData.d.ts create mode 100644 types/models/eft/inRaid/IScavSaveRequestData.d.ts create mode 100644 types/models/eft/location/IGetAirdropLootResponse.d.ts create mode 100644 types/models/eft/match/IEndLocalRaidRequestData.d.ts create mode 100644 types/models/eft/match/IStartLocalRaidRequestData.d.ts create mode 100644 types/models/eft/match/IStartLocalRaidResponseData.d.ts create mode 100644 types/models/eft/wishlist/IAddToWishlistRequest.d.ts create mode 100644 types/models/eft/wishlist/IChangeWishlistItemCategoryRequest.d.ts create mode 100644 types/models/eft/wishlist/IRemoveFromWishlistRequest.d.ts delete mode 100644 types/models/eft/wishlist/IWishlistActionData.d.ts delete mode 100644 types/models/spt/callbacks/IInraidCallbacks.d.ts delete mode 100644 types/models/spt/callbacks/IWishlistCallbacks.d.ts delete mode 100644 types/models/spt/config/IBTRConfig.d.ts create mode 100644 types/models/spt/weather/IGetLocalWeatherResponseData.d.ts create mode 100644 types/services/AirdropService.d.ts create mode 100644 types/services/LegacyLocationLifecycleService.d.ts create mode 100644 types/services/LocationLifecycleService.d.ts delete mode 100644 types/services/TraderServicesService.d.ts diff --git a/types/callbacks/GameCallbacks.d.ts b/types/callbacks/GameCallbacks.d.ts index b41454f1..e34bc41d 100644 --- a/types/callbacks/GameCallbacks.d.ts +++ b/types/callbacks/GameCallbacks.d.ts @@ -76,10 +76,19 @@ export declare class GameCallbacks implements OnLoad { * @returns string */ getVersion(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle /client/report/send & /client/reports/lobby/send + * @returns INullResponseData + */ reportNickname(url: string, info: IUIDRequestData, sessionID: string): INullResponseData; /** * Handle singleplayer/settings/getRaidTime * @returns string */ getRaidTime(url: string, request: IGetRaidTimeRequest, sessionID: string): IGetRaidTimeResponse; + /** + * Handle /client/survey + * @returns INullResponseData + */ + getSurvey(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; } diff --git a/types/callbacks/InraidCallbacks.d.ts b/types/callbacks/InraidCallbacks.d.ts index dc6ede45..f85e4e7c 100644 --- a/types/callbacks/InraidCallbacks.d.ts +++ b/types/callbacks/InraidCallbacks.d.ts @@ -1,9 +1,8 @@ import { InraidController } from "@spt/controllers/InraidController"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; -import { IItemDeliveryRequestData } from "@spt/models/eft/inRaid/IItemDeliveryRequestData"; import { IRegisterPlayerRequestData } from "@spt/models/eft/inRaid/IRegisterPlayerRequestData"; -import { ISaveProgressRequestData } from "@spt/models/eft/inRaid/ISaveProgressRequestData"; +import { IScavSaveRequestData } from "@spt/models/eft/inRaid/IScavSaveRequestData"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; /** * Handle client requests @@ -28,8 +27,9 @@ export declare class InraidCallbacks { * @param sessionID Session id * @returns Null http response */ - saveProgress(url: string, info: ISaveProgressRequestData, sessionID: string): INullResponseData; + saveProgress(url: string, info: IScavSaveRequestData, sessionID: string): INullResponseData; /** + * TODO - remove * Handle singleplayer/settings/raid/endstate * @returns */ @@ -39,25 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/airdrop/config - * @returns JSON as string - */ - getAirdropConfig(): string; - /** - * Handle singleplayer/btr/config - * @returns JSON as string - */ - getBTRConfig(): string; - /** - * Handle singleplayer/traderServices/getTraderServices - */ - getTraderServices(url: string, info: IEmptyRequestData, sessionId: string): string; - /** - * Handle singleplayer/traderServices/itemDelivery - */ - itemDelivery(url: string, request: IItemDeliveryRequestData, sessionId: string): INullResponseData; getTraitorScavHostileChance(url: string, info: IEmptyRequestData, sessionId: string): string; - getSandboxMaxPatrolValue(url: string, info: IEmptyRequestData, sessionId: string): string; getBossConvertSettings(url: string, info: IEmptyRequestData, sessionId: string): string; } diff --git a/types/callbacks/LocationCallbacks.d.ts b/types/callbacks/LocationCallbacks.d.ts index 28250504..2d121b04 100644 --- a/types/callbacks/LocationCallbacks.d.ts +++ b/types/callbacks/LocationCallbacks.d.ts @@ -1,9 +1,8 @@ import { LocationController } from "@spt/controllers/LocationController"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; -import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; import { ILocationsGenerateAllResponse } from "@spt/models/eft/common/ILocationsSourceDestinationBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; -import { IGetLocationRequestData } from "@spt/models/eft/location/IGetLocationRequestData"; +import { IGetAirdropLootResponse } from "@spt/models/eft/location/IGetAirdropLootResponse"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; export declare class LocationCallbacks { protected httpResponse: HttpResponseUtil; @@ -11,8 +10,6 @@ export declare class LocationCallbacks { constructor(httpResponse: HttpResponseUtil, locationController: LocationController); /** Handle client/locations */ getLocationData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** Handle client/location/getLocalloot */ - getLocation(url: string, info: IGetLocationRequestData, sessionID: string): IGetBodyResponseData; - /** Handle client/location/getAirdropLoot */ - getAirdropLoot(url: string, info: IEmptyRequestData, sessionID: string): string; + /** Handle client/airdrop/loot */ + getAirdropLoot(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/types/callbacks/MatchCallbacks.d.ts b/types/callbacks/MatchCallbacks.d.ts index 73f7564c..096fa0a1 100644 --- a/types/callbacks/MatchCallbacks.d.ts +++ b/types/callbacks/MatchCallbacks.d.ts @@ -2,7 +2,7 @@ import { MatchController } from "@spt/controllers/MatchController"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; -import { IEndOfflineRaidRequestData } from "@spt/models/eft/match/IEndOfflineRaidRequestData"; +import { IEndLocalRaidRequestData } from "@spt/models/eft/match/IEndLocalRaidRequestData"; import { IGetRaidConfigurationRequestData } from "@spt/models/eft/match/IGetRaidConfigurationRequestData"; import { IGroupCharacter } from "@spt/models/eft/match/IGroupCharacter"; import { IMatchGroupCurrentResponse } from "@spt/models/eft/match/IMatchGroupCurrentResponse"; @@ -15,6 +15,8 @@ import { IMatchGroupTransferRequest } from "@spt/models/eft/match/IMatchGroupTra import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResponse"; import { IPutMetricsRequestData } from "@spt/models/eft/match/IPutMetricsRequestData"; import { IRequestIdRequest } from "@spt/models/eft/match/IRequestIdRequest"; +import { IStartLocalRaidRequestData } from "@spt/models/eft/match/IStartLocalRaidRequestData"; +import { IStartLocalRaidResponseData } from "@spt/models/eft/match/IStartLocalRaidResponseData"; import { IUpdatePingRequestData } from "@spt/models/eft/match/IUpdatePingRequestData"; import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; @@ -45,8 +47,7 @@ export declare class MatchCallbacks { transferGroup(url: string, info: IMatchGroupTransferRequest, sessionId: string): IGetBodyResponseData; /** Handle client/match/group/invite/cancel-all */ cancelAllGroupInvite(url: string, info: IEmptyRequestData, sessionId: string): IGetBodyResponseData; - /** @deprecated - not called on raid start/end or game start/exit */ - putMetrics(url: string, info: IPutMetricsRequestData, sessionId: string): INullResponseData; + putMetrics(url: string, request: IPutMetricsRequestData, sessionId: string): INullResponseData; serverAvailable(url: string, info: IEmptyRequestData, sessionId: string): IGetBodyResponseData; /** Handle match/group/start_game */ joinMatch(url: string, info: IMatchGroupStartGameRequest, sessionID: string): IGetBodyResponseData; @@ -63,8 +64,10 @@ export declare class MatchCallbacks { leaveGroup(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/match/group/player/remove */ removePlayerFromGroup(url: string, info: IMatchGroupPlayerRemoveRequest, sessionID: string): IGetBodyResponseData; - /** Handle client/match/offline/end */ - endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData; + /** Handle client/match/local/start */ + startLocalRaid(url: string, info: IStartLocalRaidRequestData, sessionID: string): IGetBodyResponseData; + /** Handle client/match/local/end */ + endLocalRaid(url: string, info: IEndLocalRaidRequestData, sessionID: string): INullResponseData; /** Handle client/raid/configuration */ getRaidConfiguration(url: string, info: IGetRaidConfigurationRequestData, sessionID: string): INullResponseData; /** Handle client/raid/configuration-by-profile */ diff --git a/types/callbacks/WeatherCallbacks.d.ts b/types/callbacks/WeatherCallbacks.d.ts index 5ba5aab0..8229592c 100644 --- a/types/callbacks/WeatherCallbacks.d.ts +++ b/types/callbacks/WeatherCallbacks.d.ts @@ -2,6 +2,7 @@ import { WeatherController } from "@spt/controllers/WeatherController"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { IWeatherData } from "@spt/models/eft/weather/IWeatherData"; +import { IGetLocalWeatherResponseData } from "@spt/models/spt/weather/IGetLocalWeatherResponseData"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; export declare class WeatherCallbacks { protected httpResponse: HttpResponseUtil; @@ -12,4 +13,5 @@ export declare class WeatherCallbacks { * @returns IWeatherData */ getWeather(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getLocalWeather(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/types/callbacks/WishlistCallbacks.d.ts b/types/callbacks/WishlistCallbacks.d.ts index f5b500f4..414eb91e 100644 --- a/types/callbacks/WishlistCallbacks.d.ts +++ b/types/callbacks/WishlistCallbacks.d.ts @@ -1,12 +1,16 @@ import { WishlistController } from "@spt/controllers/WishlistController"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; -import { IWishlistActionData } from "@spt/models/eft/wishlist/IWishlistActionData"; +import { IAddToWishlistRequest } from "@spt/models/eft/wishlist/IAddToWishlistRequest"; +import { IChangeWishlistItemCategoryRequest } from "@spt/models/eft/wishlist/IChangeWishlistItemCategoryRequest"; +import { IRemoveFromWishlistRequest } from "@spt/models/eft/wishlist/IRemoveFromWishlistRequest"; export declare class WishlistCallbacks { protected wishlistController: WishlistController; constructor(wishlistController: WishlistController); /** Handle AddToWishList event */ - addToWishlist(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; + addToWishlist(pmcData: IPmcData, request: IAddToWishlistRequest, sessionID: string): IItemEventRouterResponse; /** Handle RemoveFromWishList event */ - removeFromWishlist(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; + removeFromWishlist(pmcData: IPmcData, request: IRemoveFromWishlistRequest, sessionID: string): IItemEventRouterResponse; + /** Handle ChangeWishlistItemCategory */ + changeWishlistItemCategory(pmcData: IPmcData, request: IChangeWishlistItemCategoryRequest, sessionID: string): IItemEventRouterResponse; } diff --git a/types/controllers/BotController.d.ts b/types/controllers/BotController.d.ts index 475f51b8..2d81384f 100644 --- a/types/controllers/BotController.d.ts +++ b/types/controllers/BotController.d.ts @@ -75,9 +75,15 @@ export declare class BotController { * @param request Bot generation request object * @param pmcProfile Player profile * @param sessionId Session id - * @returns + * @returns IBotBase[] + */ + protected generateMultipleBotsAndCache(request: IGenerateBotsRequestData, pmcProfile: IPmcData, sessionId: string): Promise; + /** + * Get min/max level range values for a specific map + * @param location Map name e.g. factory4_day + * @returns MinMax */ - generateBotsFirstTime(request: IGenerateBotsRequestData, pmcProfile: IPmcData, sessionId: string): Promise; + protected getPmcLevelRangeForMap(location: string): MinMax; /** * Create a BotGenerationDetails for the bot generator to use * @param condition Client data defining bot type and difficulty @@ -117,7 +123,7 @@ export declare class BotController { * @param request Bot generation request object * @returns Single IBotBase object */ - returnSingleBotFromCache(sessionId: string, request: IGenerateBotsRequestData): Promise; + protected returnSingleBotFromCache(sessionId: string, request: IGenerateBotsRequestData): Promise; protected updateBotGenerationDetailsToRandomBoss(botGenerationDetails: BotGenerationDetails, possibleBossTypeWeights: Record): void; /** * Get the difficulty passed in, if its not "asonline", get selected difficulty from config diff --git a/types/controllers/InraidController.d.ts b/types/controllers/InraidController.d.ts index 9f0c4094..8f0bfc18 100644 --- a/types/controllers/InraidController.d.ts +++ b/types/controllers/InraidController.d.ts @@ -1,70 +1,26 @@ import { ApplicationContext } from "@spt/context/ApplicationContext"; -import { PlayerScavGenerator } from "@spt/generators/PlayerScavGenerator"; -import { HealthHelper } from "@spt/helpers/HealthHelper"; -import { InRaidHelper } from "@spt/helpers/InRaidHelper"; -import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; -import { QuestHelper } from "@spt/helpers/QuestHelper"; -import { TraderHelper } from "@spt/helpers/TraderHelper"; -import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; import { IRegisterPlayerRequestData } from "@spt/models/eft/inRaid/IRegisterPlayerRequestData"; -import { ISaveProgressRequestData } from "@spt/models/eft/inRaid/ISaveProgressRequestData"; -import { PlayerRaidEndState } from "@spt/models/enums/PlayerRaidEndState"; -import { IAirdropConfig } from "@spt/models/spt/config/IAirdropConfig"; -import { IBTRConfig } from "@spt/models/spt/config/IBTRConfig"; +import { IScavSaveRequestData } from "@spt/models/eft/inRaid/IScavSaveRequestData"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; -import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; -import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; -import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; -import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; -import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { SaveServer } from "@spt/servers/SaveServer"; -import { DatabaseService } from "@spt/services/DatabaseService"; -import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; -import { MailSendService } from "@spt/services/MailSendService"; -import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; -import { PmcChatResponseService } from "@spt/services/PmcChatResponseService"; -import { TraderServicesService } from "@spt/services/TraderServicesService"; -import { RandomUtil } from "@spt/utils/RandomUtil"; -import { TimeUtil } from "@spt/utils/TimeUtil"; /** * Logic for handling In Raid callbacks */ export declare class InraidController { protected logger: ILogger; protected saveServer: SaveServer; - protected timeUtil: TimeUtil; - protected databaseService: DatabaseService; - protected pmcChatResponseService: PmcChatResponseService; - protected matchBotDetailsCacheService: MatchBotDetailsCacheService; - protected questHelper: QuestHelper; - protected itemHelper: ItemHelper; protected profileHelper: ProfileHelper; - protected playerScavGenerator: PlayerScavGenerator; - protected healthHelper: HealthHelper; - protected traderHelper: TraderHelper; - protected traderServicesService: TraderServicesService; protected localisationService: LocalisationService; - protected insuranceService: InsuranceService; - protected inRaidHelper: InRaidHelper; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; - protected mailSendService: MailSendService; - protected randomUtil: RandomUtil; - protected airdropConfig: IAirdropConfig; - protected btrConfig: IBTRConfig; protected inRaidConfig: IInRaidConfig; - protected traderConfig: ITraderConfig; - protected locationConfig: ILocationConfig; - protected ragfairConfig: IRagfairConfig; - protected hideoutConfig: IHideoutConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, databaseService: DatabaseService, pmcChatResponseService: PmcChatResponseService, matchBotDetailsCacheService: MatchBotDetailsCacheService, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, traderServicesService: TraderServicesService, localisationService: LocalisationService, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer, mailSendService: MailSendService, randomUtil: RandomUtil); + constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, localisationService: LocalisationService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Save locationId to active profiles inraid object AND app context * @param sessionID Session id @@ -78,118 +34,12 @@ export declare class InraidController { * @param offraidData post-raid request data * @param sessionID Session id */ - savePostRaidProgress(offraidData: ISaveProgressRequestData, sessionID: string): void; - /** - * Handle updating player profile post-pmc raid - * @param sessionID Session id - * @param postRaidRequest Post-raid data - */ - protected savePmcProgress(sessionID: string, postRaidRequest: ISaveProgressRequestData): void; - /** - * Make changes to PMC profile after they've died in raid, - * Alter body part hp, handle insurance, delete inventory items, remove carried quest items - * @param postRaidSaveRequest Post-raid save request - * @param pmcData Pmc profile - * @param sessionID Session id - * @returns Updated profile object - */ - protected performPostRaidActionsWhenDead(postRaidSaveRequest: ISaveProgressRequestData, pmcData: IPmcData, sessionID: string): IPmcData; - /** - * Adjust player characters body part hp post-raid - * @param postRaidSaveRequest post raid data - * @param pmcData player profile - */ - protected updatePmcHealthPostRaid(postRaidSaveRequest: ISaveProgressRequestData, pmcData: IPmcData): void; - /** - * Reduce body part hp to % of max - * @param pmcData profile to edit - * @param multiplier multiplier to apply to max health - */ - protected reducePmcHealthToPercent(pmcData: IPmcData, multiplier: number): void; - /** - * Handle updating the profile post-pscav raid - * @param sessionID Session id - * @param postRaidRequest Post-raid data of raid - */ - protected savePlayerScavProgress(sessionID: string, postRaidRequest: ISaveProgressRequestData): void; - /** - * merge two dictionaries together - * Prioritise pair that has true as a value - * @param primary main dictionary - * @param secondary Secondary dictionary - */ - protected mergePmcAndScavEncyclopedias(primary: IPmcData, secondary: IPmcData): void; - /** - * Post-scav-raid any charisma increase must be propigated into PMC profile - * @param postRaidServerScavProfile Scav profile after adjustments made from raid - * @param postRaidServerPmcProfile Pmc profile after raid - * @param preRaidScavCharismaProgress charisma progress value pre-raid - */ - protected updatePmcCharismaSkillPostScavRaid(postRaidServerScavProfile: IPmcData, postRaidServerPmcProfile: IPmcData, preRaidScavCharismaProgress: number): void; - /** - * Does provided profile contain any condition counters - * @param profile Profile to check for condition counters - * @returns Profile has condition counters - */ - protected profileHasConditionCounters(profile: IPmcData): boolean; - /** - * Scav quest progress isnt transferred automatically from scav to pmc, we do this manually - * @param scavProfile Scav profile with quest progress post-raid - * @param pmcProfile Server pmc profile to copy scav quest progress into - */ - protected migrateScavQuestProgressToPmcProfile(scavProfile: IPmcData, pmcProfile: IPmcData): void; - /** - * Is the player dead after a raid - dead is anything other than "survived" / "runner" - * @param statusOnExit exit value from offraidData object - * @returns true if dead - */ - protected isPlayerDead(statusOnExit: PlayerRaidEndState): boolean; - /** - * Mark inventory items as FiR if player survived raid, otherwise remove FiR from them - * @param offraidData Save Progress Request - */ - protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData): void; - /** - * Update profile after player completes scav raid - * @param scavData Scav profile - * @param sessionID Session id - * @param offraidData Post-raid save request - * @param pmcData Pmc profile - * @param isDead Is player dead - */ - protected handlePostRaidPlayerScavProcess(scavData: IPmcData, sessionID: string, offraidData: ISaveProgressRequestData, pmcData: IPmcData, isDead: boolean): void; - /** - * Update profile with scav karma values based on in-raid actions - * @param pmcData Pmc profile - * @param offraidData Post-raid save request - * @param scavData Scav profile - */ - protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData): void; + savePostRaidProfileForScav(offraidData: IScavSaveRequestData, sessionID: string): void; /** * Get the inraid config from configs/inraid.json * @returns InRaid Config */ getInraidConfig(): IInRaidConfig; - /** - * Get airdrop config from configs/airdrop.json - * @returns Airdrop config - */ - getAirdropConfig(): IAirdropConfig; - /** - * Get BTR config from configs/btr.json - * @returns Airdrop config - */ - getBTRConfig(): IBTRConfig; - /** - * Handle singleplayer/traderServices/getTraderServices - * @returns Trader services data - */ - getTraderServices(sessionId: string, traderId: string): ITraderServiceModel[]; - /** - * Handle singleplayer/traderServices/itemDelivery - */ - itemDelivery(sessionId: string, traderId: string, items: Item[]): void; getTraitorScavHostileChance(url: string, sessionID: string): number; - getSandboxMaxPatrolValue(url: string, sessionID: string): number; getBossConvertSettings(url: string, sessionId: string): string[]; } diff --git a/types/controllers/LocationController.d.ts b/types/controllers/LocationController.d.ts index a541b9ce..64aa20fb 100644 --- a/types/controllers/LocationController.d.ts +++ b/types/controllers/LocationController.d.ts @@ -1,57 +1,19 @@ -import { ApplicationContext } from "@spt/context/ApplicationContext"; -import { LocationGenerator } from "@spt/generators/LocationGenerator"; -import { LootGenerator } from "@spt/generators/LootGenerator"; -import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; -import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; import { ILocationsGenerateAllResponse } from "@spt/models/eft/common/ILocationsSourceDestinationBase"; -import { IAirdropLootResult } from "@spt/models/eft/location/IAirdropLootResult"; -import { IGetLocationRequestData } from "@spt/models/eft/location/IGetLocationRequestData"; -import { AirdropTypeEnum } from "@spt/models/enums/AirdropType"; -import { IAirdropConfig } from "@spt/models/spt/config/IAirdropConfig"; +import { IGetAirdropLootResponse } from "@spt/models/eft/location/IGetAirdropLootResponse"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; -import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { AirdropService } from "@spt/services/AirdropService"; import { DatabaseService } from "@spt/services/DatabaseService"; -import { ItemFilterService } from "@spt/services/ItemFilterService"; -import { LocalisationService } from "@spt/services/LocalisationService"; -import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; -import { HashUtil } from "@spt/utils/HashUtil"; -import { RandomUtil } from "@spt/utils/RandomUtil"; -import { TimeUtil } from "@spt/utils/TimeUtil"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class LocationController { - protected hashUtil: HashUtil; - protected randomUtil: RandomUtil; - protected weightedRandomHelper: WeightedRandomHelper; protected logger: ILogger; - protected locationGenerator: LocationGenerator; - protected localisationService: LocalisationService; - protected raidTimeAdjustmentService: RaidTimeAdjustmentService; - protected itemFilterService: ItemFilterService; - protected lootGenerator: LootGenerator; protected databaseService: DatabaseService; - protected timeUtil: TimeUtil; + protected airdropService: AirdropService; protected configServer: ConfigServer; - protected applicationContext: ApplicationContext; protected cloner: ICloner; - protected airdropConfig: IAirdropConfig; protected locationConfig: ILocationConfig; - constructor(hashUtil: HashUtil, randomUtil: RandomUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, raidTimeAdjustmentService: RaidTimeAdjustmentService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, timeUtil: TimeUtil, configServer: ConfigServer, applicationContext: ApplicationContext, cloner: ICloner); - /** - * Handle client/location/getLocalloot - * Get a location (map) with generated loot data - * @param sessionId Player id - * @param request Map request to generate - * @returns ILocationBase - */ - get(sessionId: string, request: IGetLocationRequestData): ILocationBase; - /** - * Generate a maps base location and loot - * @param name Map name - * @returns ILocationBase - */ - protected generate(name: string): ILocationBase; + constructor(logger: ILogger, databaseService: DatabaseService, airdropService: AirdropService, configServer: ConfigServer, cloner: ICloner); /** * Handle client/locations * Get all maps base location properties without loot data @@ -59,22 +21,6 @@ export declare class LocationController { * @returns ILocationsGenerateAllResponse */ generateAll(sessionId: string): ILocationsGenerateAllResponse; - /** - * Handle client/location/getAirdropLoot - * Get loot for an airdrop container - * Generates it randomly based on config/airdrop.json values - * @returns Array of LootItem objects - */ - getAirdropLoot(): IAirdropLootResult; - /** - * Randomly pick a type of airdrop loot using weighted values from config - * @returns airdrop type value - */ - protected chooseAirdropType(): AirdropTypeEnum; - /** - * Get the configuration for a specific type of airdrop - * @param airdropType Type of airdrop to get settings for - * @returns LootRequest - */ - protected getAirdropLootConfigByType(airdropType: AirdropTypeEnum): LootRequest; + /** Handle client/airdrop/loot */ + getAirdropLoot(): IGetAirdropLootResponse; } diff --git a/types/controllers/MatchController.d.ts b/types/controllers/MatchController.d.ts index c08ebb0f..a0fefced 100644 --- a/types/controllers/MatchController.d.ts +++ b/types/controllers/MatchController.d.ts @@ -1,50 +1,33 @@ import { ApplicationContext } from "@spt/context/ApplicationContext"; -import { LootGenerator } from "@spt/generators/LootGenerator"; -import { ProfileHelper } from "@spt/helpers/ProfileHelper"; -import { TraderHelper } from "@spt/helpers/TraderHelper"; -import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { IEndOfflineRaidRequestData } from "@spt/models/eft/match/IEndOfflineRaidRequestData"; +import { IEndLocalRaidRequestData } from "@spt/models/eft/match/IEndLocalRaidRequestData"; import { IGetRaidConfigurationRequestData } from "@spt/models/eft/match/IGetRaidConfigurationRequestData"; import { IMatchGroupStartGameRequest } from "@spt/models/eft/match/IMatchGroupStartGameRequest"; import { IMatchGroupStatusRequest } from "@spt/models/eft/match/IMatchGroupStatusRequest"; import { IMatchGroupStatusResponse } from "@spt/models/eft/match/IMatchGroupStatusResponse"; import { IProfileStatusResponse } from "@spt/models/eft/match/IProfileStatusResponse"; -import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; +import { IStartLocalRaidRequestData } from "@spt/models/eft/match/IStartLocalRaidRequestData"; +import { IStartLocalRaidResponseData } from "@spt/models/eft/match/IStartLocalRaidResponseData"; import { IMatchConfig } from "@spt/models/spt/config/IMatchConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; -import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { SaveServer } from "@spt/servers/SaveServer"; -import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; -import { BotLootCacheService } from "@spt/services/BotLootCacheService"; -import { MailSendService } from "@spt/services/MailSendService"; +import { LocationLifecycleService } from "@spt/services/LocationLifecycleService"; import { MatchLocationService } from "@spt/services/MatchLocationService"; import { ProfileSnapshotService } from "@spt/services/ProfileSnapshotService"; -import { HashUtil } from "@spt/utils/HashUtil"; -import { RandomUtil } from "@spt/utils/RandomUtil"; -import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class MatchController { protected logger: ILogger; protected saveServer: SaveServer; - protected timeUtil: TimeUtil; - protected randomUtil: RandomUtil; - protected hashUtil: HashUtil; - protected profileHelper: ProfileHelper; protected matchLocationService: MatchLocationService; - protected traderHelper: TraderHelper; - protected botLootCacheService: BotLootCacheService; protected configServer: ConfigServer; protected profileSnapshotService: ProfileSnapshotService; - protected botGenerationCacheService: BotGenerationCacheService; - protected mailSendService: MailSendService; - protected lootGenerator: LootGenerator; protected applicationContext: ApplicationContext; + protected locationLifecycleService: LocationLifecycleService; + protected cloner: ICloner; protected matchConfig: IMatchConfig; - protected inRaidConfig: IInRaidConfig; - protected traderConfig: ITraderConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, saveServer: SaveServer, timeUtil: TimeUtil, randomUtil: RandomUtil, hashUtil: HashUtil, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, mailSendService: MailSendService, lootGenerator: LootGenerator, applicationContext: ApplicationContext); + constructor(logger: ILogger, saveServer: SaveServer, matchLocationService: MatchLocationService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, applicationContext: ApplicationContext, locationLifecycleService: LocationLifecycleService, cloner: ICloner); getEnabled(): boolean; /** Handle client/match/group/delete */ deleteGroup(info: any): void; @@ -57,48 +40,15 @@ export declare class MatchController { * @param request Raid config request * @param sessionID Session id */ - startOfflineRaid(request: IGetRaidConfigurationRequestData, sessionID: string): void; + configureOfflineRaid(request: IGetRaidConfigurationRequestData, sessionID: string): void; /** * Convert a difficulty value from pre-raid screen to a bot difficulty * @param botDifficulty dropdown difficulty value * @returns bot difficulty */ protected convertDifficultyDropdownIntoBotDifficulty(botDifficulty: string): string; - /** Handle client/match/offline/end */ - endOfflineRaid(info: IEndOfflineRaidRequestData, sessionId: string): void; - /** - * Did player take a COOP extract - * @param extractName Name of extract player took - * @returns True if coop extract - */ - protected extractWasViaCoop(extractName: string): boolean; - protected sendCoopTakenFenceMessage(sessionId: string): void; - /** - * Handle when a player extracts using a coop extract - add rep to fence - * @param sessionId Session/player id - * @param pmcData Profile - * @param extractName Name of extract taken - */ - protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; - /** - * Was extract by car - * @param extractName name of extract - * @returns true if car extract - */ - protected extractWasViaCar(extractName: string): boolean; - /** - * Handle when a player extracts using a car - Add rep to fence - * @param extractName name of the extract used - * @param pmcData Player profile - * @param sessionId Session id - */ - protected handleCarExtract(extractName: string, pmcData: IPmcData, sessionId: string): void; - /** - * Get the fence rep gain from using a car or coop extract - * @param pmcData Profile - * @param baseGain amount gained for the first extract - * @param extractCount Number of times extract was taken - * @returns Fence standing after taking extract - */ - protected getFenceStandingAfterExtract(pmcData: IPmcData, baseGain: number, extractCount: number): number; + /** Handle client/match/local/start */ + startLocalRaid(sessionId: string, request: IStartLocalRaidRequestData): IStartLocalRaidResponseData; + /** Handle client/match/local/end */ + endLocalRaid(sessionId: string, request: IEndLocalRaidRequestData): void; } diff --git a/types/controllers/WeatherController.d.ts b/types/controllers/WeatherController.d.ts index 7d24954c..a2ce0d8c 100644 --- a/types/controllers/WeatherController.d.ts +++ b/types/controllers/WeatherController.d.ts @@ -2,13 +2,16 @@ import { WeatherGenerator } from "@spt/generators/WeatherGenerator"; import { IWeatherData } from "@spt/models/eft/weather/IWeatherData"; import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { IGetLocalWeatherResponseData } from "@spt/models/spt/weather/IGetLocalWeatherResponseData"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { SeasonalEventService } from "@spt/services/SeasonalEventService"; export declare class WeatherController { protected weatherGenerator: WeatherGenerator; protected logger: ILogger; protected configServer: ConfigServer; + protected seasonalEventService: SeasonalEventService; protected weatherConfig: IWeatherConfig; - constructor(weatherGenerator: WeatherGenerator, logger: ILogger, configServer: ConfigServer); + constructor(weatherGenerator: WeatherGenerator, logger: ILogger, configServer: ConfigServer, seasonalEventService: SeasonalEventService); /** Handle client/weather */ generate(): IWeatherData; /** @@ -16,4 +19,5 @@ export declare class WeatherController { * @returns Date object */ getCurrentInRaidTime(): Date; + generateLocal(sesssionID: string): IGetLocalWeatherResponseData; } diff --git a/types/controllers/WishlistController.d.ts b/types/controllers/WishlistController.d.ts index ee4d970e..7559dc66 100644 --- a/types/controllers/WishlistController.d.ts +++ b/types/controllers/WishlistController.d.ts @@ -1,12 +1,16 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; -import { IWishlistActionData } from "@spt/models/eft/wishlist/IWishlistActionData"; +import { IAddToWishlistRequest } from "@spt/models/eft/wishlist/IAddToWishlistRequest"; +import { IChangeWishlistItemCategoryRequest } from "@spt/models/eft/wishlist/IChangeWishlistItemCategoryRequest"; +import { IRemoveFromWishlistRequest } from "@spt/models/eft/wishlist/IRemoveFromWishlistRequest"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; export declare class WishlistController { protected eventOutputHolder: EventOutputHolder; constructor(eventOutputHolder: EventOutputHolder); /** Handle AddToWishList */ - addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; + addToWishList(pmcData: IPmcData, request: IAddToWishlistRequest, sessionID: string): IItemEventRouterResponse; /** Handle RemoveFromWishList event */ - removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; + removeFromWishList(pmcData: IPmcData, request: IRemoveFromWishlistRequest, sessionID: string): IItemEventRouterResponse; + /** Handle changeWishlistItemCategory event */ + changeWishlistItemCategory(pmcData: IPmcData, request: IChangeWishlistItemCategoryRequest, sessionID: string): IItemEventRouterResponse; } diff --git a/types/generators/BotEquipmentModGenerator.d.ts b/types/generators/BotEquipmentModGenerator.d.ts index 3952293f..c1b54d01 100644 --- a/types/generators/BotEquipmentModGenerator.d.ts +++ b/types/generators/BotEquipmentModGenerator.d.ts @@ -17,6 +17,7 @@ import { IGenerateEquipmentProperties } from "@spt/models/spt/bots/IGenerateEqui import { IGenerateWeaponRequest } from "@spt/models/spt/bots/IGenerateWeaponRequest"; import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; +import { ExhaustableArray } from "@spt/models/spt/server/ExhaustableArray"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; @@ -130,7 +131,8 @@ export declare class BotEquipmentModGenerator { */ protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; /** - * + * Choose a weapon mod tpl for a given slot from a pool of choices + * Checks chosen tpl is compatible with all existing weapon items * @param modPool Pool of mods that can be picked from * @param parentSlot Slot the picked mod will have as a parent * @param choiceTypeEnum How should chosen tpl be treated: DEFAULT_MOD/SPAWN/SKIP @@ -138,7 +140,24 @@ export declare class BotEquipmentModGenerator { * @param modSlotName Name of slot picked mod will be placed into * @returns Chosen weapon details */ - protected pickWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, choiceTypeEnum: ModSpawn, weapon: Item[], modSlotName: string): IChooseRandomCompatibleModResult; + protected getCompatibleWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, choiceTypeEnum: ModSpawn, weapon: Item[], modSlotName: string): IChooseRandomCompatibleModResult; + /** + * + * @param modPool Pool of item Tpls to choose from + * @param modSpawnType How should the slot choice be handled - forced/normal etc + * @param weapon Weapon mods at current time + * @param modSlotName Name of mod slot being filled + * @returns IChooseRandomCompatibleModResult + */ + protected getCompatibleModFromPool(modPool: string[], modSpawnType: ModSpawn, weapon: Item[]): IChooseRandomCompatibleModResult; + protected createExhaustableArray(itemsToAddToArray: T[]): ExhaustableArray; + /** + * Get a list of mod tpls that are compatible with the current weapon + * @param initialModPool + * @param weapon + * @returns string array of compatible mod tpls with weapon + */ + protected getFilteredModPool(initialModPool: string[], weapon: Item[]): string[]; /** * Filter mod pool down based on various criteria: * Is slot flagged as randomisable diff --git a/types/generators/BotGenerator.d.ts b/types/generators/BotGenerator.d.ts index ebb8a599..04edbf67 100644 --- a/types/generators/BotGenerator.d.ts +++ b/types/generators/BotGenerator.d.ts @@ -5,7 +5,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; +import { Appearance, BodyPart, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -114,6 +114,12 @@ export declare class BotGenerator { * @returns PmcHealth object */ protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth; + /** + * Sum up body parts max hp values, return the bodypart collection with lowest value + * @param bodies Body parts to sum up + * @returns Lowest hp collection + */ + protected getLowestHpBody(bodies: BodyPart[]): BodyPart | undefined; /** * Get a bots skills with randomsied progress value between the min and max values * @param botSkills Skills that should have their progress value randomised diff --git a/types/generators/BotLevelGenerator.d.ts b/types/generators/BotLevelGenerator.d.ts index a8a88951..855b0dbd 100644 --- a/types/generators/BotLevelGenerator.d.ts +++ b/types/generators/BotLevelGenerator.d.ts @@ -22,19 +22,11 @@ export declare class BotLevelGenerator { generateBotLevel(levelDetails: MinMax, botGenerationDetails: BotGenerationDetails, bot: IBotBase): IRandomisedBotLevelResult; protected chooseBotLevel(min: number, max: number, shift: number, number: number): number; /** - * Get the highest level a bot can be relative to the players level, but no further than the max size from globals.exp_table - * @param botGenerationDetails Details to help generate a bot - * @param levelDetails - * @param maxLevel Max possible level - * @returns Highest level possible for bot - */ - protected getHighestRelativeBotLevel(botGenerationDetails: BotGenerationDetails, levelDetails: MinMax, maxLevel: number): number; - /** - * Get the lowest level a bot can be relative to the players level, but no lower than 1 + * Return the min and max bot level based on a relative delta from the PMC level * @param botGenerationDetails Details to help generate a bot * @param levelDetails * @param maxlevel Max level allowed - * @returns Lowest level possible for bot + * @returns A MinMax of the lowest and highest level to generate the bots */ - protected getLowestRelativeBotLevel(botGenerationDetails: BotGenerationDetails, levelDetails: MinMax, maxlevel: number): number; + protected getRelativeBotLevelRange(botGenerationDetails: BotGenerationDetails, levelDetails: MinMax, maxAvailableLevel: number): MinMax; } diff --git a/types/generators/BotWeaponGenerator.d.ts b/types/generators/BotWeaponGenerator.d.ts index 8e03b35e..fcaad840 100644 --- a/types/generators/BotWeaponGenerator.d.ts +++ b/types/generators/BotWeaponGenerator.d.ts @@ -62,8 +62,8 @@ export declare class BotWeaponGenerator { pickWeightedWeaponTplFromPool(equipmentSlot: string, botTemplateInventory: Inventory): string; /** * Generated a weapon based on the supplied weapon tpl - * @param weaponTpl weapon tpl to generate (use pickWeightedWeaponTplFromPool()) - * @param equipmentSlot slot to fit into, primary/secondary/holster + * @param weaponTpl Weapon tpl to generate (use pickWeightedWeaponTplFromPool()) + * @param slotName Slot to fit into, primary/secondary/holster * @param botTemplateInventory e.g. assault.json * @param weaponParentId ParentId of the weapon being generated * @param modChances Dictionary of item types and % chance weapon will have that mod @@ -71,7 +71,7 @@ export declare class BotWeaponGenerator { * @param isPmc Is weapon being generated for a pmc * @returns GenerateWeaponResult object */ - generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; + generateWeaponByTpl(sessionId: string, weaponTpl: string, slotName: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; /** * Insert a cartridge(s) into a weapon * Handles all chambers - patron_in_weapon, patron_in_weapon_000 etc @@ -140,11 +140,17 @@ export declare class BotWeaponGenerator { protected getMagazineTplFromWeaponTemplate(weaponMods: Item[], weaponTemplate: ITemplateItem, botRole: string): string; /** * Finds and return a compatible ammo tpl based on the bots ammo weightings (x.json/inventory/equipment/ammo) - * @param ammo a list of ammo tpls the weapon can use - * @param weaponTemplate the weapon we want to pick ammo for - * @returns an ammo tpl that works with the desired gun + * @param cartridgePool Dict of all cartridges keyed by type e.g. Caliber556x45NATO + * @param weaponTemplate Weapon details from db we want to pick ammo for + * @returns Ammo tpl that works with the desired gun */ - protected getWeightedCompatibleAmmo(ammo: Record>, weaponTemplate: ITemplateItem): string; + protected getWeightedCompatibleAmmo(cartridgePool: Record>, weaponTemplate: ITemplateItem): string; + /** + * Get the cartridge ids from a weapon template that work with the weapon + * @param weaponTemplate Weapon db template to get cartridges for + * @returns Array of cartridge tpls + */ + protected getCompatibleCartridgesFromWeaponTemplate(weaponTemplate: ITemplateItem): string[]; /** * Get a weapons compatible cartridge caliber * @param weaponTemplate Weapon to look up caliber of diff --git a/types/generators/LocationGenerator.d.ts b/types/generators/LocationLootGenerator.d.ts similarity index 99% rename from types/generators/LocationGenerator.d.ts rename to types/generators/LocationLootGenerator.d.ts index 9a2b0c45..afc5c489 100644 --- a/types/generators/LocationGenerator.d.ts +++ b/types/generators/LocationLootGenerator.d.ts @@ -27,7 +27,7 @@ export interface IContainerGroupCount { /** How many containers the map should spawn with this group id */ chosenCount: number; } -export declare class LocationGenerator { +export declare class LocationLootGenerator { protected logger: ILogger; protected databaseService: DatabaseService; protected objectId: ObjectId; diff --git a/types/generators/LootGenerator.d.ts b/types/generators/LootGenerator.d.ts index 953ac3de..03e77e22 100644 --- a/types/generators/LootGenerator.d.ts +++ b/types/generators/LootGenerator.d.ts @@ -6,7 +6,6 @@ import { IPreset } from "@spt/models/eft/common/IGlobals"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/config/IInventoryConfig"; -import { LootItem } from "@spt/models/spt/services/LootItem"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -37,7 +36,7 @@ export declare class LootGenerator { * @param options parameters to adjust how loot is generated * @returns An array of loot items */ - createRandomLoot(options: LootRequest): LootItem[]; + createRandomLoot(options: LootRequest): Item[]; /** * Filter armor items by their front plates protection level - top if its a helmet * @param armor Armor preset to check @@ -62,7 +61,7 @@ export declare class LootGenerator { protected findAndAddRandomItemToLoot(items: [string, ITemplateItem][], itemTypeCounts: Record, options: LootRequest, result: LootItem[]): boolean; + }>, options: LootRequest, result: Item[]): boolean; /** * Get a randomised stack count for an item between its StackMinRandom and StackMaxSize values * @param item item to get stack count of @@ -81,7 +80,7 @@ export declare class LootGenerator { protected findAndAddRandomPresetToLoot(presetPool: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; + }>, itemBlacklist: string[], result: Item[]): boolean; /** * Sealed weapon containers have a weapon + associated mods inside them + assortment of other things (food/meds) * @param containerSettings sealed weapon container settings diff --git a/types/helpers/BotGeneratorHelper.d.ts b/types/helpers/BotGeneratorHelper.d.ts index 00ae8ae7..82be170b 100644 --- a/types/helpers/BotGeneratorHelper.d.ts +++ b/types/helpers/BotGeneratorHelper.d.ts @@ -68,7 +68,6 @@ export declare class BotGeneratorHelper { * @returns Repairable object */ protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; - isWeaponModIncompatibleWithCurrentMods(itemsEquipped: Item[], tplToCheck: string, modSlot: string): IChooseRandomCompatibleModResult; /** * Can item be added to another item without conflict * @param itemsEquipped Items to check compatibilities with diff --git a/types/helpers/HealthHelper.d.ts b/types/helpers/HealthHelper.d.ts index a164285e..74059015 100644 --- a/types/helpers/HealthHelper.d.ts +++ b/types/helpers/HealthHelper.d.ts @@ -1,4 +1,5 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; +import { BodyPartsHealth, Health } from "@spt/models/eft/common/tables/IBotBase"; import { ISyncHealthRequestData } from "@spt/models/eft/health/ISyncHealthRequestData"; import { Effects, ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IHealthConfig } from "@spt/models/spt/config/IHealthConfig"; @@ -21,6 +22,23 @@ export declare class HealthHelper { * @returns updated profile */ resetVitality(sessionID: string): ISptProfile; + /** + * Update player profile vitality values with changes from client request object + * @param pmcData Player profile + * @param postRaidHealth Post raid data + * @param sessionID Session id + * @param isDead Is player dead + * @param addEffects Should effects be added to profile (default - true) + * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) + */ + updateProfileHealthPostRaid(pmcData: IPmcData, postRaidHealth: Health, sessionID: string, isDead: boolean): void; + protected storeHydrationEnergyTempInProfile(fullProfile: ISptProfile, hydration: number, energy: number, temprature: number): void; + /** + * Take body part effects from client profile and apply to server profile + * @param postRaidBodyParts Post-raid body part data + * @param profileData Player profile on server + */ + protected transferPostRaidLimbEffectsToProfile(postRaidBodyParts: BodyPartsHealth, profileData: IPmcData): void; /** * Update player profile vitality values with changes from client request object * @param pmcData Player profile diff --git a/types/helpers/InRaidHelper.d.ts b/types/helpers/InRaidHelper.d.ts index 987c9ec3..f4127f40 100644 --- a/types/helpers/InRaidHelper.d.ts +++ b/types/helpers/InRaidHelper.d.ts @@ -1,122 +1,23 @@ import { InventoryHelper } from "@spt/helpers/InventoryHelper"; -import { ItemHelper } from "@spt/helpers/ItemHelper"; -import { PaymentHelper } from "@spt/helpers/PaymentHelper"; -import { ProfileHelper } from "@spt/helpers/ProfileHelper"; -import { QuestHelper } from "@spt/helpers/QuestHelper"; -import { IPmcData, IPostRaidPmcData } from "@spt/models/eft/common/IPmcData"; -import { IQuestStatus, TraderInfo } from "@spt/models/eft/common/tables/IBotBase"; +import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { ISaveProgressRequestData } from "@spt/models/eft/inRaid/ISaveProgressRequestData"; -import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; -import { SaveServer } from "@spt/servers/SaveServer"; -import { DatabaseService } from "@spt/services/DatabaseService"; -import { LocalisationService } from "@spt/services/LocalisationService"; -import { ProfileFixerService } from "@spt/services/ProfileFixerService"; -import { RandomUtil } from "@spt/utils/RandomUtil"; -import { TimeUtil } from "@spt/utils/TimeUtil"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class InRaidHelper { protected logger: ILogger; - protected timeUtil: TimeUtil; - protected saveServer: SaveServer; - protected itemHelper: ItemHelper; - protected databaseService: DatabaseService; protected inventoryHelper: InventoryHelper; - protected profileHelper: ProfileHelper; - protected questHelper: QuestHelper; - protected paymentHelper: PaymentHelper; - protected localisationService: LocalisationService; - protected profileFixerService: ProfileFixerService; protected configServer: ConfigServer; - protected randomUtil: RandomUtil; protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; - protected inRaidConfig: IInRaidConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, itemHelper: ItemHelper, databaseService: DatabaseService, inventoryHelper: InventoryHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, profileFixerService: ProfileFixerService, configServer: ConfigServer, randomUtil: RandomUtil, cloner: ICloner); - /** - * Lookup quest item loss from lostOnDeath config - * @returns True if items should be removed from inventory - */ - shouldQuestItemsBeRemovedOnDeath(): boolean; - /** - * Check items array and add an upd object to money with a stack count of 1 - * Single stack money items have no upd object and thus no StackObjectsCount, causing issues - * @param items Items array to check - */ - addStackCountToMoneyFromRaid(items: Item[]): void; - /** - * Reset a profile to a baseline, used post-raid - * Reset points earned during session property - * Increment exp - * @param profileData Profile to update - * @param saveProgressRequest post raid save data request data - * @param sessionID Session id - * @returns Reset profile object - */ - updateProfileBaseStats(profileData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionID: string): void; + constructor(logger: ILogger, inventoryHelper: InventoryHelper, configServer: ConfigServer, cloner: ICloner); /** + * @deprecated * Reset the skill points earned in a raid to 0, ready for next raid * @param profile Profile to update */ protected resetSkillPointsEarnedDuringRaid(profile: IPmcData): void; - /** Check counters are correct in profile */ - protected validateTaskConditionCounters(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; - /** - * Update various serverPMC profile values; quests/limb hp/trader standing with values post-raic - * @param pmcData Server PMC profile - * @param saveProgressRequest Post-raid request data - * @param sessionId Session id - */ - updatePmcProfileDataPostRaid(pmcData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void; - /** - * Update scav quest values on server profile with updated values post-raid - * @param scavData Server scav profile - * @param saveProgressRequest Post-raid request data - * @param sessionId Session id - */ - updateScavProfileDataPostRaid(scavData: IPmcData, saveProgressRequest: ISaveProgressRequestData, sessionId: string): void; - /** - * Look for quests with a status different from what it began the raid with - * @param sessionId Player id - * @param pmcData Player profile - * @param preRaidQuests Quests prior to starting raid - * @param postRaidProfile Profile sent by client with post-raid quests - */ - protected processAlteredQuests(sessionId: string, pmcData: IPmcData, preRaidQuests: IQuestStatus[], postRaidProfile: IPostRaidPmcData): void; - protected handleFailRestartableQuestStatus(pmcData: IPmcData, postRaidProfile: IPostRaidPmcData, postRaidQuest: IQuestStatus): void; - /** - * Take body part effects from client profile and apply to server profile - * @param saveProgressRequest post-raid request - * @param profileData player profile on server - */ - protected transferPostRaidLimbEffectsToProfile(saveProgressRequest: ISaveProgressRequestData, profileData: IPmcData): void; - /** - * Adjust server trader settings if they differ from data sent by client - * @param tradersServerProfile Server - * @param tradersClientProfile Client - */ - protected applyTraderStandingAdjustments(tradersServerProfile: Record, tradersClientProfile: Record): void; - /** - * Transfer client achievements into profile - * @param profile Player pmc profile - * @param clientAchievements Achievements from client - */ - protected updateProfileAchievements(profile: IPmcData, clientAchievements: Record): void; - /** - * Set the SPT inraid location Profile property to 'none' - * @param sessionID Session id - */ - protected setPlayerInRaidLocationStatusToNone(sessionID: string): void; - /** - * Iterate over inventory items and remove the property that defines an item as Found in Raid - * Only removes property if item had FiR when entering raid - * @param postRaidProfile profile to update items for - * @returns Updated profile with SpawnedInSession removed - */ - removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPostRaidPmcData): IPostRaidPmcData; /** * Update a players inventory post-raid * Remove equipped items from pre-raid @@ -140,12 +41,6 @@ export declare class InRaidHelper { * @returns Array of items lost on death */ protected getInventoryItemsLostOnDeath(pmcProfile: IPmcData): Item[]; - /** - * Get items in vest/pocket/backpack inventory containers (excluding children) - * @param pmcData Player profile - * @returns Item array - */ - protected getBaseItemsInRigPocketAndBackpack(pmcData: IPmcData): Item[]; /** * Does the provided items slotId mean its kept on the player after death * @pmcData Player profile @@ -153,10 +48,4 @@ export declare class InRaidHelper { * @returns true if item is kept after death */ protected isItemKeptAfterDeath(pmcData: IPmcData, itemToCheck: Item): boolean; - /** - * Return the equipped items from a players inventory - * @param items Players inventory to search through - * @returns an array of equipped items - */ - getPlayerGear(items: Item[]): Item[]; } diff --git a/types/helpers/ItemHelper.d.ts b/types/helpers/ItemHelper.d.ts index c304ceee..481f46db 100644 --- a/types/helpers/ItemHelper.d.ts +++ b/types/helpers/ItemHelper.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt/helpers/HandbookHelper"; import { IStaticAmmoDetails } from "@spt/models/eft/common/ILocation"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { InsuredItem } from "@spt/models/eft/common/tables/IBotBase"; +import { IInsuredItem } from "@spt/models/eft/common/tables/IBotBase"; import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ItemTpl } from "@spt/models/enums/ItemTpl"; @@ -278,7 +278,7 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: InsuredItem[], fastPanel?: any): Item[]; + replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: IInsuredItem[], fastPanel?: any): Item[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items @@ -510,6 +510,7 @@ export declare class ItemHelper { * @returns True when upd object was added */ addUpdObjectToItem(item: Item, warningMessageWhenMissing?: string): boolean; + getMoneyTpls(): string[]; } declare namespace ItemHelper { interface ItemSize { diff --git a/types/helpers/WeightedRandomHelper.d.ts b/types/helpers/WeightedRandomHelper.d.ts index f3a34f32..e6e2041d 100644 --- a/types/helpers/WeightedRandomHelper.d.ts +++ b/types/helpers/WeightedRandomHelper.d.ts @@ -1,13 +1,4 @@ export declare class WeightedRandomHelper { - /** - * @deprecated USE getWeightedValue() WHERE POSSIBLE - * Gets a tplId from a weighted dictionary - * @param {tplId: weighting[]} itemArray - * @returns tplId - */ - getWeightedInventoryItem(itemArray: { - [tplId: string]: unknown; - } | ArrayLike): string; /** * Choos an item from the passed in array based on the weightings of each * @param itemArray Items and weights to use diff --git a/types/models/eft/common/IGlobals.d.ts b/types/models/eft/common/IGlobals.d.ts index bfcb920d..8c1b3cca 100644 --- a/types/models/eft/common/IGlobals.d.ts +++ b/types/models/eft/common/IGlobals.d.ts @@ -31,6 +31,7 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; + GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; @@ -47,6 +48,7 @@ export interface IConfig { UncheckOnShot: boolean; BotsEnabled: boolean; BufferZone: IBufferZone; + Airdrop: IAirdropGlobalSettings; ArmorMaterials: IArmorMaterials; ArenaEftTransferSettings: IArenaEftTransferSettings; LegsOverdamage: number; @@ -392,6 +394,18 @@ export interface IBodyParts { Feet: string; Hands: string; } +export interface IAirdropGlobalSettings { + ParachuteEndOpenHeight: number; + ParachuteStartOpenHeight: number; + PlaneAdditionalDistance: number; + PlaneAirdropDuration: number; + PlaneAirdropFlareWait: number; + PlaneAirdropSmoke: number; + PlaneMaxFlightHeight: number; + PlaneMinFlightHeight: number; + PlaneSpeed: number; + SmokeActivateHeight: number; +} export interface IArenaEftTransferSettings { ArenaEftTransferSettings: ArenaEftTransferSettings; } @@ -805,6 +819,7 @@ export interface IRagFair { balancerAveragePriceCoefficient: number; delaySinceOfferAdd: number; uniqueBuyerTimeoutInDays: number; + userRatingChangeFrequencyMultiplayer: number; ratingSumForIncrease: number; ratingIncreaseCount: number; ratingSumForDecrease: number; @@ -813,6 +828,7 @@ export interface IRagFair { maxSumForDecreaseRatingPerOneSale: number; maxSumForRarity: IMaxSumForRarity; ChangePriceCoef: number; + ItemRestrictions: IItemGlobalRestrictions[]; balancerUserItemSaleCooldownEnabled: boolean; balancerUserItemSaleCooldown: number; youSellOfferMaxStorageTimeInHour: number; @@ -820,6 +836,11 @@ export interface IRagFair { isOnlyFoundInRaidAllowed: boolean; sellInOnePiece: number; } +export interface IItemGlobalRestrictions { + MaxFlea: number; + MaxFleaStacked: number; + TemplateId: string; +} export interface IMaxActiveOfferCount { from: number; to: number; @@ -1013,6 +1034,7 @@ export interface ISquadSettings { SendRequestDelaySeconds: number; } export interface IInsurance { + ChangeForReturnItemsInOfflineRaid: number; MaxStorageTimeInHour: number; CoefOfSendingMessageTime: number; CoefOfHavingMarkOfUnknown: number; diff --git a/types/models/eft/common/ILocationBase.d.ts b/types/models/eft/common/ILocationBase.d.ts index 10f1a57d..86e03cf2 100644 --- a/types/models/eft/common/ILocationBase.d.ts +++ b/types/models/eft/common/ILocationBase.d.ts @@ -76,6 +76,7 @@ export interface ILocationBase { EscapeTimeLimitCoop: number; EscapeTimeLimitPVE: number; exit_access_time: number; + ForceOnlineRaidInPVE: boolean; exit_count: number; exit_time: number; exits: Exit[]; @@ -149,14 +150,18 @@ export interface BossSupport { export interface BotLocationModifier { AccuracySpeed: number; DistToActivate: number; + DistToActivatePvE: number; DistToPersueAxemanCoef: number; DistToSleep: number; + DistToSleepPvE: number; GainSight: number; KhorovodChance: number; MagnetPower: number; MarksmanAccuratyCoef: number; Scattering: number; VisibleDistance: number; + MaxExfiltrationTime: number; + MinExfiltrationTime: number; } export interface MinMaxBot extends MinMax { WildSpawnType: WildSpawnType | string; @@ -234,6 +239,7 @@ export interface Wave { time_min: number; sptId?: string; ChanceGroup?: number; + SpawnMode: string[]; } export declare enum WildSpawnType { ASSAULT = "assault", diff --git a/types/models/eft/common/tables/IBotBase.d.ts b/types/models/eft/common/tables/IBotBase.d.ts index be37845f..539b0ad3 100644 --- a/types/models/eft/common/tables/IBotBase.d.ts +++ b/types/models/eft/common/tables/IBotBase.d.ts @@ -20,7 +20,7 @@ export interface IBotBase { Stats: Stats; Encyclopedia: Record; TaskConditionCounters: Record; - InsuredItems: InsuredItem[]; + InsuredItems: IInsuredItem[]; Hideout: Hideout; Quests: IQuestStatus[]; TradersInfo: Record; @@ -34,7 +34,7 @@ export interface IBotBase { CarExtractCounts: Record; CoopExtractCounts: Record; SurvivorClass: SurvivorClass; - WishList: string[]; + WishList: Record; moneyTransferLimitData: IMoneyTransferLimits; /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; @@ -70,6 +70,7 @@ export interface Info { GameVersion: string; AccountType: number; MemberCategory: MemberCategory; + SelectedMemberCategory: MemberCategory; lockedMoveCommands: boolean; SavageLockTime: number; LastTimePlayedAsSavage: number; @@ -82,7 +83,6 @@ export interface Info { BannedUntil: number; IsStreamerModeAvailable: boolean; lastCompletedEvent?: LastCompleted; - SelectedMemberCategory: number; isMigratedSkills: boolean; } export interface Settings { @@ -290,7 +290,7 @@ export interface BackendCounter { qid?: string; value: number; } -export interface InsuredItem { +export interface IInsuredItem { /** Trader Id item was insured by */ tid: string; itemId: string; diff --git a/types/models/eft/common/tables/ILocationServices.d.ts b/types/models/eft/common/tables/ILocationServices.d.ts new file mode 100644 index 00000000..46eda77e --- /dev/null +++ b/types/models/eft/common/tables/ILocationServices.d.ts @@ -0,0 +1,70 @@ +import { Ixyz } from "@spt/models/eft/common/Ixyz"; +export interface ILocationServices { + TraderServerSettings: ITraderServerSettings; + BTRServerSettings: IBtrServerSettings; +} +export interface ITraderServerSettings { + TraderServices: TraderServices; +} +export interface TraderServices { + ExUsecLoyalty: ITraderService; + ZryachiyAid: ITraderService; + CultistsAid: ITraderService; + PlayerTaxi: ITraderService; + BtrItemsDelivery: ITraderService; + BtrBotCover: ITraderService; +} +export interface ITraderService { + TraderId: string; + TraderServiceType: string; + Requirements: IServiceRequirements; + ServiceItemCost: Record; + UniqueItems: string[]; +} +export interface IServiceRequirements { + CompletedQuests: ICompletedQuest[]; + Standings: Record; +} +export interface ICompletedQuest { + QuestId: string; +} +export interface IStandingRequirement { + Value: number; +} +export interface IServiceItemCostDetails { + Count: number; +} +export interface IBtrServerSettings { + ChanceSpawn: number; + SpawnPeriod: Ixyz; + MoveSpeed: number; + ReadyToDepartureTime: number; + CheckTurnDistanceTime: number; + TurnCheckSensitivity: number; + DecreaseSpeedOnTurnLimit: number; + EndSplineDecelerationDistance: number; + AccelerationSpeed: number; + DecelerationSpeed: number; + PauseDurationRange: Ixyz; + BodySwingReturnSpeed: number; + BodySwingDamping: number; + BodySwingIntensity: number; + ServerMapBTRSettings: Record; +} +export interface IServerMapBtrsettings { + MapID: string; + ChanceSpawn: number; + SpawnPeriod: Ixyz; + MoveSpeed: number; + ReadyToDepartureTime: number; + CheckTurnDistanceTime: number; + TurnCheckSensitivity: number; + DecreaseSpeedOnTurnLimit: number; + EndSplineDecelerationDistance: number; + AccelerationSpeed: number; + DecelerationSpeed: number; + PauseDurationRange: Ixyz; + BodySwingReturnSpeed: number; + BodySwingDamping: number; + BodySwingIntensity: number; +} diff --git a/types/models/eft/inRaid/ISaveProgressRequestData.d.ts b/types/models/eft/inRaid/ISaveProgressRequestData.d.ts deleted file mode 100644 index b6540887..00000000 --- a/types/models/eft/inRaid/ISaveProgressRequestData.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { IPostRaidPmcData } from "@spt/models/eft/common/IPmcData"; -import { ISyncHealthRequestData } from "@spt/models/eft/health/ISyncHealthRequestData"; -import { IInsuredItemsData } from "@spt/models/eft/inRaid/IInsuredItemsData"; -import { PlayerRaidEndState } from "@spt/models/enums/PlayerRaidEndState"; -export interface ISaveProgressRequestData { - exit: PlayerRaidEndState; - profile: IPostRaidPmcData; - isPlayerScav: boolean; - health: ISyncHealthRequestData; - insurance: IInsuredItemsData[]; -} diff --git a/types/models/eft/inRaid/IScavSaveRequestData.d.ts b/types/models/eft/inRaid/IScavSaveRequestData.d.ts new file mode 100644 index 00000000..e96a9ed9 --- /dev/null +++ b/types/models/eft/inRaid/IScavSaveRequestData.d.ts @@ -0,0 +1,4 @@ +import { IPostRaidPmcData } from "@spt/models/eft/common/IPmcData"; +export interface IScavSaveRequestData { + profile: IPostRaidPmcData; +} diff --git a/types/models/eft/launcher/IMiniProfile.d.ts b/types/models/eft/launcher/IMiniProfile.d.ts index b25a1e7d..0ea27932 100644 --- a/types/models/eft/launcher/IMiniProfile.d.ts +++ b/types/models/eft/launcher/IMiniProfile.d.ts @@ -1,3 +1,4 @@ +import { Spt } from "../profile/ISptProfile"; export interface IMiniProfile { username: string; nickname: string; @@ -7,8 +8,7 @@ export interface IMiniProfile { prevexp: number; nextlvl: number; maxlvl: number; - sptData: SPTData; -} -export interface SPTData { - version: string; + edition: string; + profileId: string; + sptData: Spt; } diff --git a/types/models/eft/location/IGetAirdropLootResponse.d.ts b/types/models/eft/location/IGetAirdropLootResponse.d.ts new file mode 100644 index 00000000..034c95f2 --- /dev/null +++ b/types/models/eft/location/IGetAirdropLootResponse.d.ts @@ -0,0 +1,6 @@ +import { Item } from "@spt/models/eft/common/tables/IItem"; +import { AirdropTypeEnum } from "@spt/models/enums/AirdropType"; +export interface IGetAirdropLootResponse { + icon: AirdropTypeEnum; + container: Item[]; +} diff --git a/types/models/eft/match/IEndLocalRaidRequestData.d.ts b/types/models/eft/match/IEndLocalRaidRequestData.d.ts new file mode 100644 index 00000000..6818f2ba --- /dev/null +++ b/types/models/eft/match/IEndLocalRaidRequestData.d.ts @@ -0,0 +1,23 @@ +import { ExitStatus } from "@spt/models/enums/ExitStatis"; +import { IPmcData } from "../common/IPmcData"; +import { Item } from "../common/tables/IItem"; +export interface IEndLocalRaidRequestData { + /** ID of server player just left */ + serverId: string; + results: IEndRaidResult; + /** Insured items left in raid by player */ + lostInsuredItems: Item[]; + /** Items sent via traders to player, keyed to service e.g. BTRTransferStash */ + transferItems: Record; +} +export interface IEndRaidResult { + profile: IPmcData; + result: string; + ExitStatus: ExitStatus; + killerId: string; + killerAid: string; + exitName: string; + inSession: boolean; + favorite: boolean; + playTime: number; +} diff --git a/types/models/eft/match/IPutMetricsRequestData.d.ts b/types/models/eft/match/IPutMetricsRequestData.d.ts index d9ed2141..ab62acf3 100644 --- a/types/models/eft/match/IPutMetricsRequestData.d.ts +++ b/types/models/eft/match/IPutMetricsRequestData.d.ts @@ -1,10 +1,57 @@ export interface IPutMetricsRequestData { sid: string; settings: any; - SharedSettings: any; - HardwareDescription: any; + SharedSettings: ISharedSettings; + HardwareDescription: IHardwareDescription; Location: string; Metrics: any; - ClientEvents: any; + ClientEvents: IClientEvents; SpikeSamples: any[]; + mode: string; +} +export interface ISharedSettings { + StatedFieldOfView: number; +} +export interface IHardwareDescription { + deviceUniqueIdentifier: string; + systemMemorySize: number; + graphicsDeviceID: number; + graphicsDeviceName: string; + graphicsDeviceType: string; + graphicsDeviceVendor: string; + graphicsDeviceVendorID: number; + graphicsDeviceVersion: string; + graphicsMemorySize: number; + graphicsMultiThreaded: boolean; + graphicsShaderLevel: number; + operatingSystem: string; + processorCount: number; + processorFrequency: number; + processorType: string; + driveType: string; + swapDriveType: string; +} +export interface IClientEvents { + MatchingCompleted: number; + MatchingCompletedReal: number; + LocationLoaded: number; + LocationLoadedReal: number; + GamePrepared: number; + GamePreparedReal: number; + GameCreated: number; + GameCreatedReal: number; + GamePooled: number; + GamePooledReal: number; + GameRunned: number; + GameRunnedReal: number; + GameSpawn: number; + GameSpawnReal: number; + PlayerSpawnEvent: number; + PlayerSpawnEventReal: number; + GameSpawned: number; + GameSpawnedReal: number; + GameStarting: number; + GameStartingReal: number; + GameStarted: number; + GameStartedReal: number; } diff --git a/types/models/eft/match/IStartLocalRaidRequestData.d.ts b/types/models/eft/match/IStartLocalRaidRequestData.d.ts new file mode 100644 index 00000000..5483297f --- /dev/null +++ b/types/models/eft/match/IStartLocalRaidRequestData.d.ts @@ -0,0 +1,7 @@ +export interface IStartLocalRaidRequestData { + serverId: string; + location: string; + timeVariant: string; + mode: string; + playerSide: string; +} diff --git a/types/models/eft/match/IStartLocalRaidResponseData.d.ts b/types/models/eft/match/IStartLocalRaidResponseData.d.ts new file mode 100644 index 00000000..62a2aa88 --- /dev/null +++ b/types/models/eft/match/IStartLocalRaidResponseData.d.ts @@ -0,0 +1,12 @@ +import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; +import { IInsuredItem } from "@spt/models/eft/common/tables/IBotBase"; +import { ILocationServices } from "@spt/models/eft/common/tables/ILocationServices"; +export interface IStartLocalRaidResponseData { + serverId: string; + serverSettings: ILocationServices; + profile: IProfileInsuredItems; + locationLoot: ILocationBase; +} +export interface IProfileInsuredItems { + insuredItems: IInsuredItem[]; +} diff --git a/types/models/eft/profile/ISptProfile.d.ts b/types/models/eft/profile/ISptProfile.d.ts index dd7aea6e..bac97889 100644 --- a/types/models/eft/profile/ISptProfile.d.ts +++ b/types/models/eft/profile/ISptProfile.d.ts @@ -166,11 +166,11 @@ export interface Spt { /** What mods has this profile loaded at any point in time */ mods?: ModDetails[]; /** What gifts has this profile received and how many */ - receivedGifts: ReceivedGift[]; + receivedGifts?: ReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; /** key: daily type */ - freeRepeatableRefreshUsedCount: Record; + freeRepeatableRefreshUsedCount?: Record; } export interface ModDetails { name: string; diff --git a/types/models/eft/wishlist/IAddToWishlistRequest.d.ts b/types/models/eft/wishlist/IAddToWishlistRequest.d.ts new file mode 100644 index 00000000..656f77bc --- /dev/null +++ b/types/models/eft/wishlist/IAddToWishlistRequest.d.ts @@ -0,0 +1,4 @@ +export interface IAddToWishlistRequest { + Action: string; + items: Record; +} diff --git a/types/models/eft/wishlist/IChangeWishlistItemCategoryRequest.d.ts b/types/models/eft/wishlist/IChangeWishlistItemCategoryRequest.d.ts new file mode 100644 index 00000000..7ce88e0d --- /dev/null +++ b/types/models/eft/wishlist/IChangeWishlistItemCategoryRequest.d.ts @@ -0,0 +1,5 @@ +export interface IChangeWishlistItemCategoryRequest { + Action: string; + item: string; + category: number; +} diff --git a/types/models/eft/wishlist/IRemoveFromWishlistRequest.d.ts b/types/models/eft/wishlist/IRemoveFromWishlistRequest.d.ts new file mode 100644 index 00000000..6a13b1f7 --- /dev/null +++ b/types/models/eft/wishlist/IRemoveFromWishlistRequest.d.ts @@ -0,0 +1,4 @@ +export interface IRemoveFromWishlistRequest { + Action: string; + items: string[]; +} diff --git a/types/models/eft/wishlist/IWishlistActionData.d.ts b/types/models/eft/wishlist/IWishlistActionData.d.ts deleted file mode 100644 index 92178648..00000000 --- a/types/models/eft/wishlist/IWishlistActionData.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface IWishlistActionData { - Action: string; - templateId: string; -} diff --git a/types/models/enums/AirdropType.d.ts b/types/models/enums/AirdropType.d.ts index a6f6e3a6..f090a30e 100644 --- a/types/models/enums/AirdropType.d.ts +++ b/types/models/enums/AirdropType.d.ts @@ -1,6 +1,6 @@ export declare enum AirdropTypeEnum { - MIXED = "mixed", - WEAPONARMOR = "weaponarmor", - FOODMEDICAL = "foodmedical", - BARTER = "barter" + COMMON = "common", + SUPPLY = "supply", + MEDICAL = "medical", + WEAPON = "weapon" } diff --git a/types/models/enums/BaseClasses.d.ts b/types/models/enums/BaseClasses.d.ts index 32ebf7c9..65fc95e6 100644 --- a/types/models/enums/BaseClasses.d.ts +++ b/types/models/enums/BaseClasses.d.ts @@ -107,6 +107,6 @@ export declare enum BaseClasses { RECEIVER = "55818a304bdc2db5418b457d", BARREL = "555ef6e44bdc2de9068b457e", CHARGING_HANDLE = "55818a6f4bdc2db9688b456b", - COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569", + COMB_MUZZLE_DEVICE = "550aa4dd4bdc2dc9348b4569 ", HIDEOUT_AREA_CONTAINER = "63da6da4784a55176c018dba" } diff --git a/types/models/enums/ConfigTypes.d.ts b/types/models/enums/ConfigTypes.d.ts index 646fd550..2c4483a9 100644 --- a/types/models/enums/ConfigTypes.d.ts +++ b/types/models/enums/ConfigTypes.d.ts @@ -24,6 +24,5 @@ export declare enum ConfigTypes { WEATHER = "spt-weather", SEASONAL_EVENT = "spt-seasonalevents", LOST_ON_DEATH = "spt-lostondeath", - GIFTS = "spt-gifts", - BTR = "spt-btr" + GIFTS = "spt-gifts" } diff --git a/types/models/enums/ItemTpl.d.ts b/types/models/enums/ItemTpl.d.ts index 8512ea87..750510ea 100644 --- a/types/models/enums/ItemTpl.d.ts +++ b/types/models/enums/ItemTpl.d.ts @@ -237,10 +237,10 @@ export declare enum ItemTpl { AMMO_23X75_SHRAP10 = "5e85a9a6eacf8c039e4e2ac1", AMMO_23X75_SHRAP25 = "5f647f31b6238e5dd066e196", AMMO_23X75_ZVEZDA = "5e85a9f4add9fe03027d9bf1", + AMMO_26X75_AC = "635267f063651329f75a4ee8", AMMO_26X75_FLARE = "62389bc9423ed1685422dc57", AMMO_26X75_GREEN = "62389aaba63f32501b1b444f", AMMO_26X75_RED = "62389ba9a63f32501b1b4451", - AMMO_26X75_SIGNAL = "635267f063651329f75a4ee8", AMMO_26X75_SIGNAL_FLARE_GREEN = "624c0570c9b794431568f5d5", AMMO_26X75_SIGNAL_FLARE_RED = "624c09cfbc2e27219346d955", AMMO_26X75_SIGNAL_FLARE_WHITE = "624c09da2cec124eb67c1046", @@ -636,6 +636,7 @@ export declare enum ItemTpl { BACKPACK_MYSTERY_RANCH_BLACKJACK_50_BACKPACK_MULTICAM = "5c0e774286f77468413cc5b2", BACKPACK_MYSTERY_RANCH_NICE_COMM_3_BVS_FRAME_SYSTEM_COYOTE = "628bc7fb408e2b2e9c0801b1", BACKPACK_MYSTERY_RANCH_SATL_BRIDGER_ASSAULT_PACK_FOLIAGE = "656e0436d44a1bb4220303a0", + BACKPACK_MYSTERY_RANCH_TERRAPLANE = "56e294cdd2720b603a8b4575", BACKPACK_OAKLEY_MECHANISM_HEAVY_DUTY_BACKPACK_BLACK = "5d5d940f86f7742797262046", BACKPACK_PILGRIM_TOURIST = "59e763f286f7742ee57895da", BACKPACK_SANITARS_BAG = "5e997f0b86f7741ac73993e2", @@ -891,18 +892,18 @@ export declare enum ItemTpl { BARTER_LEDX_SKIN_TRANSILLUMINATOR = "5c0530ee86f774697952d952", BARTER_LEGA_MEDAL = "6656560053eaaa7a23349c86", BARTER_LIGHT_BULB = "5d1b392c86f77425243e98fe", - BARTER_LOCKED_EQUIPMENT_RATE_COMMON = "66588b514de4820934746dc6", - BARTER_LOCKED_EQUIPMENT_RATE_EPIC = "6658285190486915542256c4", - BARTER_LOCKED_EQUIPMENT_RATE_RARE = "66571bf06a723f7f005a0619", - BARTER_LOCKED_SUPPLY_RATE_COMMON = "66588ba291f6e93c4c06efef", - BARTER_LOCKED_SUPPLY_RATE_EPIC = "665828c44de4820934746ce4", - BARTER_LOCKED_SUPPLY_RATE_RARE = "66572b88ac60f009f270d1dc", - BARTER_LOCKED_VALUABLES_RATE_COMMON = "66588bb047fbd536a674240e", - BARTER_LOCKED_VALUABLES_RATE_EPIC = "665828f490486915542256c6", - BARTER_LOCKED_VALUABLES_RATE_RARE = "66572bb3ac60f009f270d1df", - BARTER_LOCKED_WEAPON_RATE_COMMON = "66588b6dcb48a73e674b2649", - BARTER_LOCKED_WEAPON_RATE_EPIC = "66582889efd94e2d665b14a2", - BARTER_LOCKED_WEAPON_RATE_RARE = "66572b3f6a723f7f005a066c", + BARTER_LOCKED_EQUIPMENT_CRATE_COMMON = "66588b514de4820934746dc6", + BARTER_LOCKED_EQUIPMENT_CRATE_EPIC = "6658285190486915542256c4", + BARTER_LOCKED_EQUIPMENT_CRATE_RARE = "66571bf06a723f7f005a0619", + BARTER_LOCKED_SUPPLY_CRATE_COMMON = "66588ba291f6e93c4c06efef", + BARTER_LOCKED_SUPPLY_CRATE_EPIC = "665828c44de4820934746ce4", + BARTER_LOCKED_SUPPLY_CRATE_RARE = "66572b88ac60f009f270d1dc", + BARTER_LOCKED_VALUABLES_CRATE_COMMON = "66588bb047fbd536a674240e", + BARTER_LOCKED_VALUABLES_CRATE_EPIC = "665828f490486915542256c6", + BARTER_LOCKED_VALUABLES_CRATE_RARE = "66572bb3ac60f009f270d1df", + BARTER_LOCKED_WEAPON_CRATE_COMMON = "66588b6dcb48a73e674b2649", + BARTER_LOCKED_WEAPON_CRATE_EPIC = "66582889efd94e2d665b14a2", + BARTER_LOCKED_WEAPON_CRATE_RARE = "66572b3f6a723f7f005a066c", BARTER_LOOT_LORD_PLUSHIE = "60b0f7057897d47c5b04ab94", BARTER_LVNDMARKS_RAT_POISON = "60b0f561c4449e4cb624c1d7", BARTER_MAGNET = "590a391c86f774385a33c404", @@ -2515,8 +2516,8 @@ export declare enum ItemTpl { MAGAZINE_556X45_GEN_M3_10RND = "5aaa5e60e5b5b000140293d6", MAGAZINE_556X45_GEN_M3_20RND = "5448c1d04bdc2dff2f8b4569", MAGAZINE_556X45_GEN_M3_30RND = "5aaa5dfee5b5b000140293d3", - MAGAZINE_556X45_GEN_M3_30RND_FDE = "6241c2c2117ad530666a5108", MAGAZINE_556X45_GEN_M3_40RND = "544a378f4bdc2d30388b4567", + MAGAZINE_556X45_GEN_M3_AIRSOFT_30RND = "6241c2c2117ad530666a5108", MAGAZINE_556X45_GEN_M3_FDE_30RND = "5d1340b3d7ad1a0b52682ed7", MAGAZINE_556X45_GEN_M3_FDE_40RND = "5d1340bdd7ad1a0e8d245aab", MAGAZINE_556X45_GEN_M3_WINDOW_30RND = "55802d5f4bdc2dac148b458e", @@ -3071,6 +3072,7 @@ export declare enum ItemTpl { QUEST_ARENA_POSTER_EASY_MONEY = "664b69e8e1238e506d3630af", QUEST_ARENA_POSTER_KILLA = "664b69c5a082271bc46c4e11", QUEST_BANK_CASE = "590dde5786f77405e71908b2", + QUEST_BATTERED_DIARY = "666073159916667083033cb9", QUEST_BLOOD_SAMPLE = "5a687e7886f7740c4a5133fb", QUEST_BOTTLE_OF_LE_JEAN_WINE = "6582bd252b50c61c565828e2", QUEST_CADASTRAL_REGISTRY_RECORDS = "657acb2ac900be5902191ac9", @@ -3082,26 +3084,28 @@ export declare enum ItemTpl { QUEST_CHEMICAL_CONTAINER_3 = "5b4c81bd86f77418a75ae159", QUEST_CLOTHES_DESIGN_HANDBOOK_PART_1 = "5ae9a3f586f7740aab00e4e6", QUEST_CLOTHES_DESIGN_HANDBOOK_PART_2 = "5ae9a4fc86f7746e381e1753", - QUEST_COMPROMISING_INFORMATION_ON_REF = "664fce7a90294949fe2d81cb", + QUEST_EASY_MONEY_POSTER_PACK = "664b69f3a082271bc46c4e13", QUEST_ENCRYPTED_MESSAGE = "5d3ec50586f774183a607442", QUEST_FLASHDRIVE_CAR_SERVICE = "638cbb3ba63f1b49be6a300e", QUEST_FLASHDRIVE_TERRAGROUP_EMPLOYEE = "5eff135be0d3331e9d282b7b", QUEST_FLASHDRIVE_WATCHING_YOU = "638e9d5536b3b72c944e2fc7", QUEST_FLASHDRIVE_WET_JOB_PT_4 = "5a29357286f77409c705e025", QUEST_FLASH_DRIVE_WITH_FAKE_INFO = "5c12301c86f77419522ba7e4", - QUEST_FLYERS4 = "664b69f3a082271bc46c4e13", + QUEST_GAMING_MAGAZINE = "667a8ef464eea5fdef0db135", QUEST_GOLDEN_ZIBBO_LIGHTER = "5939a00786f7742fe8132936", QUEST_GOSHAN_CARGO_MANIFESTS = "5ae9a0dd86f7742e5f454a05", QUEST_HARD_DRIVE = "661666458c2aa9cb1602503b", QUEST_HARD_DRIVE_TERRAGROUP_SCIENTIST = "6575a6ca8778e96ded05a802", QUEST_HDD_SURVEILLANCE = "638dfc803083a019d447768e", QUEST_HDD_TOP_SECRET = "628393620d8524273e7eb028", + QUEST_HDD_UNUSED = "66760b3deb51b08bd40c2b08", QUEST_HDD_WET_JOB = "5a29276886f77435ed1b117c", QUEST_HOUSING_JOURNAL = "638e0057ab150a5f56238960", QUEST_IDEA_CARGO_MANIFESTS = "5ae9a1b886f77404c8537c62", QUEST_INFORMANT_JOURNAL = "63989ced706b793c7d60cfef", QUEST_JOURNAL = "64f07f7726cfa02c506f8ac0", QUEST_KEY_TO_THE_CLOSED_PREMISES_OF_THE_HEALTH_RESORT = "5a0448bc86f774736f14efa8", + QUEST_LEDX_SKIN_TRANSILLUMINATOR_US_VERSION = "666879d498b97e3a8f09f1ae", QUEST_LETTER_GOT_MAIL = "638cbc68a63f1b49be6a3010", QUEST_LETTER_HERMIT = "61904c9df62c89219a56e034", QUEST_LETTER_POSTMAN_PAT = "591093bb86f7747caa7bb2ee", @@ -3141,6 +3145,7 @@ export declare enum ItemTpl { QUEST_PICTURE_9 = "64e74a4baac4cd0a7264ecdd", QUEST_PUMPING_STATION_OPERATION_REPORT = "619268ad78f4fa33f173dbe5", QUEST_RADIO_TRANSMITTER_BODY = "6399f54b0a36db13c823ad21", + QUEST_REF_DIRT = "664fce7a90294949fe2d81cb", QUEST_SECRET_COMPONENT = "64f5b4f71a5f313cb144c06c", QUEST_SECURED_TAPE = "6398a4cfb5992f573c6562b3", QUEST_SECURE_FLASH_DRIVE = "59f9ddae86f77407ab46e047", @@ -3159,6 +3164,7 @@ export declare enum ItemTpl { QUEST_SURGERY_KIT_MARKED_WITH_A_BLUE_SYMBOL = "5efdafc1e70b5e33f86de058", QUEST_SYRINGE_WITH_A_CHEMICAL = "593a87af86f774122f54a951", QUEST_T90M_COMMANDER_CONTROL_PANEL = "609267a2bb3f46069c3e6c7d", + QUEST_TARKOV_CITY_SOUVENIR_KEY = "66687bc89111279d600b5062", QUEST_TOUGHBOOK_CARGO = "5a29284f86f77463ef3db363", QUEST_TOUGHBOOK_SEASIDE_VACATION = "619252352be33f26043400a7", QUEST_UAV_SAS_DISK_1 = "5a294d7c86f7740651337cf9", @@ -3343,7 +3349,7 @@ export declare enum ItemTpl { SECURE_CONTAINER_GAMMA = "5857a8bc2459772bad15db29", SECURE_CONTAINER_GAMMA_TUE = "665ee77ccf2d642e98220bca", SECURE_CONTAINER_KAPPA = "5c093ca986f7740a1867ab12", - SECURE_THETA_SECURE_CONTAINER = "664a55d84a90fc2c8a6305c9", + SECURE_CONTAINER_THETA = "664a55d84a90fc2c8a6305c9", SECURE_TOURNAMENT_SECURED_CONTAINER = "64f6f4c5911bcdfe8b03b0dc", SECURE_WAIST_POUCH = "5732ee6a24597719ae0c0281", SHOTGUN_BENELLI_M3_SUPER_90_12GA_DUALMODE = "6259b864ebedf17603599e88", diff --git a/types/models/spt/callbacks/IInraidCallbacks.d.ts b/types/models/spt/callbacks/IInraidCallbacks.d.ts deleted file mode 100644 index b2679427..00000000 --- a/types/models/spt/callbacks/IInraidCallbacks.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; -import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; -import { IRegisterPlayerRequestData } from "@spt/models/eft/inRaid/IRegisterPlayerRequestData"; -import { ISaveProgressRequestData } from "@spt/models/eft/inRaid/ISaveProgressRequestData"; -import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; -export interface IInraidCallbacks { - onLoad(sessionID: string): ISptProfile; - registerPlayer(url: string, info: IRegisterPlayerRequestData, sessionID: string): INullResponseData; - saveProgress(url: string, info: ISaveProgressRequestData, sessionID: string): INullResponseData; - getRaidEndState(): string; - getRaidMenuSettings(url: string, info: IEmptyRequestData, sessionID: string): string; - getWeaponDurability(url: string, info: any, sessionID: string): string; - getAirdropConfig(url: string, info: any, sessionID: string): string; -} diff --git a/types/models/spt/callbacks/IWishlistCallbacks.d.ts b/types/models/spt/callbacks/IWishlistCallbacks.d.ts deleted file mode 100644 index 16f056d0..00000000 --- a/types/models/spt/callbacks/IWishlistCallbacks.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; -import { IWishlistActionData } from "@spt/models/eft/wishlist/IWishlistActionData"; -export interface IWishlistCallbacks { - addToWishlist(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; - removeFromWishlist(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse; -} diff --git a/types/models/spt/config/IAirdropConfig.d.ts b/types/models/spt/config/IAirdropConfig.d.ts index d438f006..15960dd4 100644 --- a/types/models/spt/config/IAirdropConfig.d.ts +++ b/types/models/spt/config/IAirdropConfig.d.ts @@ -3,24 +3,7 @@ import { AirdropTypeEnum } from "@spt/models/enums/AirdropType"; import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IAirdropConfig extends IBaseConfig { kind: "spt-airdrop"; - airdropChancePercent: AirdropChancePercent; airdropTypeWeightings: Record; - /** Lowest point plane will fly at */ - planeMinFlyHeight: number; - /** Highest point plane will fly at */ - planeMaxFlyHeight: number; - /** Loudness of plane engine */ - planeVolume: number; - /** Speed plane flies overhead */ - planeSpeed: number; - /** Speed loot crate falls after being dropped */ - crateFallSpeed: number; - /** Container tpls to use when spawning crate - affects container size, keyed by drop type e.g. mixed/weaponArmor/foodMedical/barter */ - containerIds: Record; - /** Earliest time aircraft will spawn in raid */ - airdropMinStartTimeSeconds: number; - /** Latest time aircraft will spawn in raid */ - airdropMaxStartTimeSeconds: number; /** What rewards will the loot crate contain, keyed by drop type e.g. mixed/weaponArmor/foodMedical/barter */ loot: Record; } diff --git a/types/models/spt/config/IBTRConfig.d.ts b/types/models/spt/config/IBTRConfig.d.ts deleted file mode 100644 index 2f56f73e..00000000 --- a/types/models/spt/config/IBTRConfig.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { MinMax } from "@spt/models/common/MinMax"; -import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; -export interface IBTRConfig extends IBaseConfig { - kind: "spt-btr"; - /** How fast the BTR moves */ - moveSpeed: number; - /** How long the cover fire service lasts for */ - coverFireTime: number; - /** How long the BTR waits at every point in its path */ - pointWaitTime: MinMax; - /** How long after purchasing the taxi service before the BTR leaves */ - taxiWaitTime: number; -} diff --git a/types/models/spt/config/ILocationConfig.d.ts b/types/models/spt/config/ILocationConfig.d.ts index 1e113b28..b650ab03 100644 --- a/types/models/spt/config/ILocationConfig.d.ts +++ b/types/models/spt/config/ILocationConfig.d.ts @@ -44,8 +44,6 @@ export interface ILocationConfig extends IBaseConfig { scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; - /** Sets the max Patrol Value of the Boxzone on the map Ground Zero */ - sandboxMaxPatrolvalue: number; } export interface IEquipmentLootSettings { modSpawnChancePercent: Record; diff --git a/types/models/spt/templates/ITemplates.d.ts b/types/models/spt/templates/ITemplates.d.ts index c2ebbf9f..9f9b0d5f 100644 --- a/types/models/spt/templates/ITemplates.d.ts +++ b/types/models/spt/templates/ITemplates.d.ts @@ -1,6 +1,7 @@ import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { ILocationServices } from "@spt/models/eft/common/tables/ILocationServices"; import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; import { IQuest } from "@spt/models/eft/common/tables/IQuest"; import { IRepeatableQuestDatabase } from "@spt/models/eft/common/tables/IRepeatableQuests"; @@ -21,4 +22,6 @@ export interface ITemplates { defaultEquipmentPresets: IDefaultEquipmentPreset[]; /** Achievements */ achievements: IAchievement[]; + /** Location services data */ + locationServices: ILocationServices; } diff --git a/types/models/spt/weather/IGetLocalWeatherResponseData.d.ts b/types/models/spt/weather/IGetLocalWeatherResponseData.d.ts new file mode 100644 index 00000000..ba1782b1 --- /dev/null +++ b/types/models/spt/weather/IGetLocalWeatherResponseData.d.ts @@ -0,0 +1,5 @@ +import { IWeather } from "@spt/models/eft/weather/IWeatherData"; +export interface IGetLocalWeatherResponseData { + season: number; + weather: IWeather[]; +} diff --git a/types/routers/item_events/WishlistItemEventRouter.d.ts b/types/routers/item_events/WishlistItemEventRouter.d.ts index bc6d2571..712f484f 100644 --- a/types/routers/item_events/WishlistItemEventRouter.d.ts +++ b/types/routers/item_events/WishlistItemEventRouter.d.ts @@ -6,5 +6,5 @@ export declare class WishlistItemEventRouter extends ItemEventRouterDefinition { protected wishlistCallbacks: WishlistCallbacks; constructor(wishlistCallbacks: WishlistCallbacks); getHandledRoutes(): HandledRoute[]; - handleItemEvent(url: string, pmcData: IPmcData, body: any, sessionID: string): Promise; + handleItemEvent(url: string, pmcData: IPmcData, request: any, sessionID: string): Promise; } diff --git a/types/routers/static/GameStaticRouter.d.ts b/types/routers/static/GameStaticRouter.d.ts index bf045af0..f7287a25 100644 --- a/types/routers/static/GameStaticRouter.d.ts +++ b/types/routers/static/GameStaticRouter.d.ts @@ -1,6 +1,8 @@ import { GameCallbacks } from "@spt/callbacks/GameCallbacks"; import { StaticRouter } from "@spt/di/Router"; +import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; export declare class GameStaticRouter extends StaticRouter { + protected httpResponse: HttpResponseUtil; protected gameCallbacks: GameCallbacks; - constructor(gameCallbacks: GameCallbacks); + constructor(httpResponse: HttpResponseUtil, gameCallbacks: GameCallbacks); } diff --git a/types/servers/HttpServer.d.ts b/types/servers/HttpServer.d.ts index 0024ba38..52c59daf 100644 --- a/types/servers/HttpServer.d.ts +++ b/types/servers/HttpServer.d.ts @@ -25,7 +25,7 @@ export declare class HttpServer { * Handle server loading event */ load(): void; - protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + protected handleRequest(req: IncomingMessage, resp: ServerResponse): Promise; /** * Check against hardcoded values that determine its from a local address * @param remoteAddress Address to check diff --git a/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/types/servers/ws/SptWebSocketConnectionHandler.d.ts index 70fc96ad..c77c895d 100644 --- a/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,6 +1,6 @@ /// /// -import { IncomingMessage } from "http"; +import { IncomingMessage } from "node:http"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IWsNotificationEvent } from "@spt/models/eft/ws/IWsNotificationEvent"; import { IHttpConfig } from "@spt/models/spt/config/IHttpConfig"; diff --git a/types/services/AirdropService.d.ts b/types/services/AirdropService.d.ts new file mode 100644 index 00000000..b17defae --- /dev/null +++ b/types/services/AirdropService.d.ts @@ -0,0 +1,53 @@ +import { LootGenerator } from "@spt/generators/LootGenerator"; +import { ItemHelper } from "@spt/helpers/ItemHelper"; +import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; +import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IGetAirdropLootResponse } from "@spt/models/eft/location/IGetAirdropLootResponse"; +import { AirdropTypeEnum } from "@spt/models/enums/AirdropType"; +import { IAirdropConfig } from "@spt/models/spt/config/IAirdropConfig"; +import { LootRequest } from "@spt/models/spt/services/LootRequest"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt/servers/ConfigServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { LocalisationService } from "@spt/services/LocalisationService"; +import { HashUtil } from "@spt/utils/HashUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; +export declare class AirdropService { + protected logger: ILogger; + protected hashUtil: HashUtil; + protected itemHelper: ItemHelper; + protected weightedRandomHelper: WeightedRandomHelper; + protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; + protected lootGenerator: LootGenerator; + protected databaseService: DatabaseService; + protected configServer: ConfigServer; + protected cloner: ICloner; + protected airdropConfig: IAirdropConfig; + constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); + /** + * Handle client/location/getAirdropLoot + * Get loot for an airdrop container + * Generates it randomly based on config/airdrop.json values + * @returns Array of LootItem objects + */ + generateAirdropLoot(): IGetAirdropLootResponse; + /** + * Create a container create item based on passed in airdrop type + * @param airdropType What tpye of container: weapon/common etc + * @returns Item + */ + protected getAirdropCrateItem(airdropType: AirdropTypeEnum): Item; + /** + * Randomly pick a type of airdrop loot using weighted values from config + * @returns airdrop type value + */ + protected chooseAirdropType(): AirdropTypeEnum; + /** + * Get the configuration for a specific type of airdrop + * @param airdropType Type of airdrop to get settings for + * @returns LootRequest + */ + protected getAirdropLootConfigByType(airdropType: AirdropTypeEnum): LootRequest; +} diff --git a/types/services/BotGenerationCacheService.d.ts b/types/services/BotGenerationCacheService.d.ts index ba27266c..c85489fd 100644 --- a/types/services/BotGenerationCacheService.d.ts +++ b/types/services/BotGenerationCacheService.d.ts @@ -44,4 +44,6 @@ export declare class BotGenerationCacheService { * @returns false if empty */ cacheHasBotOfRole(key: string): boolean; + getCachedBotCount(key: string): number; + createCacheKey(role: string, difficulty: string): string; } diff --git a/types/services/DatabaseService.d.ts b/types/services/DatabaseService.d.ts index 711a0698..cbe33077 100644 --- a/types/services/DatabaseService.d.ts +++ b/types/services/DatabaseService.d.ts @@ -3,6 +3,7 @@ import { ILocation } from "@spt/models/eft/common/ILocation"; import { IAchievement } from "@spt/models/eft/common/tables/IAchievement"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; +import { ILocationServices } from "@spt/models/eft/common/tables/ILocationServices"; import { IMatch } from "@spt/models/eft/common/tables/IMatch"; import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; import { IQuest } from "@spt/models/eft/common/tables/IQuest"; @@ -110,4 +111,8 @@ export declare class DatabaseService { * @returns assets/database/traders/ */ getTrader(traderId: string): ITrader; + /** + * @returns assets/database/locationServices/ + */ + getLocationServices(): ILocationServices; } diff --git a/types/services/InsuranceService.d.ts b/types/services/InsuranceService.d.ts index f7991024..9a579c5e 100644 --- a/types/services/InsuranceService.d.ts +++ b/types/services/InsuranceService.d.ts @@ -1,21 +1,14 @@ -import { DialogueHelper } from "@spt/helpers/DialogueHelper"; -import { HandbookHelper } from "@spt/helpers/HandbookHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; -import { SecureContainerHelper } from "@spt/helpers/SecureContainerHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ITraderBase } from "@spt/models/eft/common/tables/ITrader"; -import { IInsuredItemsData } from "@spt/models/eft/inRaid/IInsuredItemsData"; -import { ISaveProgressRequestData } from "@spt/models/eft/inRaid/ISaveProgressRequestData"; import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; -import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { IInsuranceEquipmentPkg } from "@spt/models/spt/services/IInsuranceEquipmentPkg"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { DatabaseService } from "@spt/services/DatabaseService"; -import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -25,43 +18,31 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class InsuranceService { protected logger: ILogger; protected databaseService: DatabaseService; - protected secureContainerHelper: SecureContainerHelper; protected randomUtil: RandomUtil; protected itemHelper: ItemHelper; protected hashUtil: HashUtil; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected traderHelper: TraderHelper; - protected dialogueHelper: DialogueHelper; - protected handbookHelper: HandbookHelper; protected localisationService: LocalisationService; - protected localeService: LocaleService; protected mailSendService: MailSendService; protected configServer: ConfigServer; protected cloner: ICloner; protected insured: Record>; protected insuranceConfig: IInsuranceConfig; - protected lostOnDeathConfig: ILostOnDeathConfig; - constructor(logger: ILogger, databaseService: DatabaseService, secureContainerHelper: SecureContainerHelper, randomUtil: RandomUtil, itemHelper: ItemHelper, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, localeService: LocaleService, mailSendService: MailSendService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer, cloner: ICloner); /** * Does player have insurance array * @param sessionId Player id * @returns True if exists */ - insuranceExists(sessionId: string): boolean; + isuranceDictionaryExists(sessionId: string): boolean; /** * Get all insured items by all traders for a profile * @param sessionId Profile id (session id) * @returns Item array */ getInsurance(sessionId: string): Record; - /** - * Get insured items by profile id + trader id - * @param sessionId Profile id (session id) - * @param traderId Trader items were insured with - * @returns Item array - */ - getInsuranceItems(sessionId: string, traderId: string): Item[]; resetInsurance(sessionId: string): void; /** * Sends stored insured items as message to player @@ -70,12 +51,6 @@ export declare class InsuranceService { * @param mapId Id of the map player died/exited that caused the insurance to be issued on */ sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void; - /** - * Check all root insured items and remove location property + set slotId to 'hideout' - * @param sessionId Session id - * @param traderId Trader id - */ - protected removeLocationProperty(sessionId: string, traderId: string): void; /** * Get a timestamp of when insurance items should be sent to player based on trader used to insure * Apply insurance return bonus if found in profile @@ -84,23 +59,6 @@ export declare class InsuranceService { * @returns Timestamp to return items to player in seconds */ protected getInsuranceReturnTimestamp(pmcData: IPmcData, trader: ITraderBase): number; - /** - * Create insurance equipment packages that should be sent to the user. The packages should contain items that have - * been lost in a raid and should be returned to the player through the insurance system. - * - * NOTE: We do not have data on items that were dropped in a raid. This means we have to pull item data from the - * profile at the start of the raid to return to the player in insurance. Because of this, the item - * positioning may differ from the position the item was in when the player died. Apart from removing all - * positioning, this is the best we can do. >:{} - * - * @param pmcData Player profile - * @param offraidData Post-raid data - * @param preRaidGear Pre-raid data - * @param sessionID Session id - * @param playerDied Did player die in raid - * @returns Array of insured items lost in raid - */ - getGearLostInRaid(pmcData: IPmcData, offraidData: ISaveProgressRequestData, preRaidGear: Item[], sessionID: string, playerDied: boolean): IInsuranceEquipmentPkg[]; /** * Take the insurance item packages within a profile session and ensure that each of the items in that package are * not orphaned from their parent ID. @@ -115,19 +73,13 @@ export declare class InsuranceService { */ storeGearLostInRaidToSendLater(sessionID: string, equipmentPkg: IInsuranceEquipmentPkg[]): void; /** - * Take preraid item and update properties to ensure its ready to be given to player in insurance return mail - * @param pmcData Player profile - * @param preRaidItemWithChildren Insured item (with children) as it was pre-raid - * @param allItemsFromClient Item data when player left raid (durability values) - * @returns Item (with children) to send to player - */ - protected getInsuredItemDetails(pmcData: IPmcData, preRaidItem: Item, insuredItemFromClient: IInsuredItemsData): Item; - /** - * Reset slotId property to "hideout" when necessary (used to be in ) - * @param pmcData Players pmcData.Inventory.equipment value - * @param itemToReturn item we will send to player as insurance return + * For the passed in items, find the trader it was insured against + * @param sessionId Session id + * @param lostInsuredItems Insured items lost in a raid + * @param pmcProfile Player profile + * @returns IInsuranceEquipmentPkg array */ - protected updateSlotIdValue(playerBaseInventoryEquipmentId: string, itemToReturn: Item): void; + mapInsuredItemsToTrader(sessionId: string, lostInsuredItems: Item[], pmcProfile: IPmcData): IInsuranceEquipmentPkg[]; /** * Add gear item to InsuredItems array in player profile * @param sessionID Session id diff --git a/types/services/LegacyLocationLifecycleService.d.ts b/types/services/LegacyLocationLifecycleService.d.ts new file mode 100644 index 00000000..b3c20df3 --- /dev/null +++ b/types/services/LegacyLocationLifecycleService.d.ts @@ -0,0 +1,105 @@ +import { ApplicationContext } from "@spt/context/ApplicationContext"; +import { LocationLootGenerator } from "@spt/generators/LocationLootGenerator"; +import { LootGenerator } from "@spt/generators/LootGenerator"; +import { PlayerScavGenerator } from "@spt/generators/PlayerScavGenerator"; +import { HealthHelper } from "@spt/helpers/HealthHelper"; +import { InRaidHelper } from "@spt/helpers/InRaidHelper"; +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; +import { IPmcData } from "@spt/models/eft/common/IPmcData"; +import { IEndOfflineRaidRequestData } from "@spt/models/eft/match/IEndOfflineRaidRequestData"; +import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; +import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IMatchConfig } from "@spt/models/spt/config/IMatchConfig"; +import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; +import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt/servers/ConfigServer"; +import { SaveServer } from "@spt/servers/SaveServer"; +import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; +import { MailSendService } from "@spt/services/MailSendService"; +import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; +import { PmcChatResponseService } from "@spt/services/PmcChatResponseService"; +import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; +import { HashUtil } from "@spt/utils/HashUtil"; +import { RandomUtil } from "@spt/utils/RandomUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; +export declare class LegacyLocationLifecycleService { + protected logger: ILogger; + protected hashUtil: HashUtil; + protected saveServer: SaveServer; + protected timeUtil: TimeUtil; + protected randomUtil: RandomUtil; + protected profileHelper: ProfileHelper; + protected databaseService: DatabaseService; + protected inRaidHelper: InRaidHelper; + protected healthHelper: HealthHelper; + protected matchBotDetailsCacheService: MatchBotDetailsCacheService; + protected pmcChatResponseService: PmcChatResponseService; + protected playerScavGenerator: PlayerScavGenerator; + protected traderHelper: TraderHelper; + protected localisationService: LocalisationService; + protected insuranceService: InsuranceService; + protected botLootCacheService: BotLootCacheService; + protected configServer: ConfigServer; + protected botGenerationCacheService: BotGenerationCacheService; + protected mailSendService: MailSendService; + protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected lootGenerator: LootGenerator; + protected applicationContext: ApplicationContext; + protected locationLootGenerator: LocationLootGenerator; + protected cloner: ICloner; + protected matchConfig: IMatchConfig; + protected inRaidConfig: IInRaidConfig; + protected traderConfig: ITraderConfig; + protected ragfairConfig: IRagfairConfig; + protected hideoutConfig: IHideoutConfig; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, timeUtil: TimeUtil, randomUtil: RandomUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, inRaidHelper: InRaidHelper, healthHelper: HealthHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, pmcChatResponseService: PmcChatResponseService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, localisationService: LocalisationService, insuranceService: InsuranceService, botLootCacheService: BotLootCacheService, configServer: ConfigServer, botGenerationCacheService: BotGenerationCacheService, mailSendService: MailSendService, raidTimeAdjustmentService: RaidTimeAdjustmentService, lootGenerator: LootGenerator, applicationContext: ApplicationContext, locationLootGenerator: LocationLootGenerator, cloner: ICloner); + /** + * Handle client/match/offline/end + * @deprecated + */ + endOfflineRaid(info: IEndOfflineRaidRequestData, sessionId: string): void; + /** + * Handle when a player extracts using a car - Add rep to fence + * @param extractName name of the extract used + * @param pmcData Player profile + * @param sessionId Session id + */ + protected handleCarExtract(extractName: string, pmcData: IPmcData, sessionId: string): void; + /** + * Get the fence rep gain from using a car or coop extract + * @param pmcData Profile + * @param baseGain amount gained for the first extract + * @param extractCount Number of times extract was taken + * @returns Fence standing after taking extract + */ + protected getFenceStandingAfterExtract(pmcData: IPmcData, baseGain: number, extractCount: number): number; + /** + * Was extract by car + * @param extractName name of extract + * @returns true if car extract + */ + protected extractWasViaCar(extractName: string): boolean; + /** + * Did player take a COOP extract + * @param extractName Name of extract player took + * @returns True if coop extract + */ + protected extractWasViaCoop(extractName: string): boolean; + /** + * Handle when a player extracts using a coop extract - add rep to fence + * @param sessionId Session/player id + * @param pmcData Profile + * @param extractName Name of extract taken + */ + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; + protected sendCoopTakenFenceMessage(sessionId: string): void; +} diff --git a/types/services/LocationLifecycleService.d.ts b/types/services/LocationLifecycleService.d.ts new file mode 100644 index 00000000..669f57bb --- /dev/null +++ b/types/services/LocationLifecycleService.d.ts @@ -0,0 +1,150 @@ +import { ApplicationContext } from "@spt/context/ApplicationContext"; +import { LocationLootGenerator } from "@spt/generators/LocationLootGenerator"; +import { LootGenerator } from "@spt/generators/LootGenerator"; +import { PlayerScavGenerator } from "@spt/generators/PlayerScavGenerator"; +import { HealthHelper } from "@spt/helpers/HealthHelper"; +import { InRaidHelper } from "@spt/helpers/InRaidHelper"; +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; +import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; +import { IPmcData } from "@spt/models/eft/common/IPmcData"; +import { Common, TraderInfo } from "@spt/models/eft/common/tables/IBotBase"; +import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IEndLocalRaidRequestData, IEndRaidResult } from "@spt/models/eft/match/IEndLocalRaidRequestData"; +import { IStartLocalRaidRequestData } from "@spt/models/eft/match/IStartLocalRaidRequestData"; +import { IStartLocalRaidResponseData } from "@spt/models/eft/match/IStartLocalRaidResponseData"; +import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; +import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; +import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt/servers/ConfigServer"; +import { SaveServer } from "@spt/servers/SaveServer"; +import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { InsuranceService } from "@spt/services/InsuranceService"; +import { LocalisationService } from "@spt/services/LocalisationService"; +import { MailSendService } from "@spt/services/MailSendService"; +import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; +import { PmcChatResponseService } from "@spt/services/PmcChatResponseService"; +import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; +import { HashUtil } from "@spt/utils/HashUtil"; +import { RandomUtil } from "@spt/utils/RandomUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; +export declare class LocationLifecycleService { + protected logger: ILogger; + protected hashUtil: HashUtil; + protected saveServer: SaveServer; + protected timeUtil: TimeUtil; + protected randomUtil: RandomUtil; + protected profileHelper: ProfileHelper; + protected databaseService: DatabaseService; + protected inRaidHelper: InRaidHelper; + protected healthHelper: HealthHelper; + protected matchBotDetailsCacheService: MatchBotDetailsCacheService; + protected pmcChatResponseService: PmcChatResponseService; + protected playerScavGenerator: PlayerScavGenerator; + protected traderHelper: TraderHelper; + protected localisationService: LocalisationService; + protected insuranceService: InsuranceService; + protected botLootCacheService: BotLootCacheService; + protected configServer: ConfigServer; + protected botGenerationCacheService: BotGenerationCacheService; + protected mailSendService: MailSendService; + protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected lootGenerator: LootGenerator; + protected applicationContext: ApplicationContext; + protected locationLootGenerator: LocationLootGenerator; + protected cloner: ICloner; + protected inRaidConfig: IInRaidConfig; + protected traderConfig: ITraderConfig; + protected ragfairConfig: IRagfairConfig; + protected hideoutConfig: IHideoutConfig; + protected locationConfig: ILocationConfig; + constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, timeUtil: TimeUtil, randomUtil: RandomUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, inRaidHelper: InRaidHelper, healthHelper: HealthHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, pmcChatResponseService: PmcChatResponseService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, localisationService: LocalisationService, insuranceService: InsuranceService, botLootCacheService: BotLootCacheService, configServer: ConfigServer, botGenerationCacheService: BotGenerationCacheService, mailSendService: MailSendService, raidTimeAdjustmentService: RaidTimeAdjustmentService, lootGenerator: LootGenerator, applicationContext: ApplicationContext, locationLootGenerator: LocationLootGenerator, cloner: ICloner); + startLocalRaid(sessionId: string, request: IStartLocalRaidRequestData): IStartLocalRaidResponseData; + /** + * Generate a maps base location and loot + * @param name Map name + * @returns ILocationBase + */ + protected generateLocationAndLoot(name: string): ILocationBase; + endLocalRaid(sessionId: string, request: IEndLocalRaidRequestData): void; + /** + * Was extract by car + * @param extractName name of extract + * @returns True if extract was by car + */ + protected extractWasViaCar(extractName: string): boolean; + /** + * Handle when a player extracts using a car - Add rep to fence + * @param extractName name of the extract used + * @param pmcData Player profile + * @param sessionId Session id + */ + protected handleCarExtract(extractName: string, pmcData: IPmcData, sessionId: string): void; + /** + * Handle when a player extracts using a coop extract - add rep to fence + * @param sessionId Session/player id + * @param pmcData Profile + * @param extractName Name of extract taken + */ + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; + /** + * Get the fence rep gain from using a car or coop extract + * @param pmcData Profile + * @param baseGain amount gained for the first extract + * @param extractCount Number of times extract was taken + * @returns Fence standing after taking extract + */ + protected getFenceStandingAfterExtract(pmcData: IPmcData, baseGain: number, extractCount: number): number; + protected sendCoopTakenFenceMessage(sessionId: string): void; + /** + * Did player take a COOP extract + * @param extractName Name of extract player took + * @returns True if coop extract + */ + protected extractTakenWasCoop(extractName: string): boolean; + protected handlePostRaidPlayerScav(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, isDead: boolean, request: IEndLocalRaidRequestData): void; + protected handlePostRaidPmc(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, postRaidProfile: IPmcData, isDead: boolean, request: IEndLocalRaidRequestData, locationName: string): void; + /** + * Adjust server trader settings if they differ from data sent by client + * @param tradersServerProfile Server + * @param tradersClientProfile Client + */ + protected applyTraderStandingAdjustments(tradersServerProfile: Record, tradersClientProfile: Record): void; + /** + * Check if player used BTR item sending service and send items to player via mail if found + * @param sessionId Session id + * @param request End raid request + */ + protected handleBTRItemTransferEvent(sessionId: string, request: IEndLocalRaidRequestData): void; + protected btrItemDelivery(sessionId: string, traderId: string, items: Item[]): void; + /** + * Return the equipped items from a players inventory + * @param items Players inventory to search through + * @returns an array of equipped items + */ + protected getEquippedGear(items: Item[]): Item[]; + /** + * Is the player dead after a raid - dead = anything other than "survived" / "runner" + * @param statusOnExit Exit value from offraidData object + * @returns true if dead + */ + protected isPlayerDead(results: IEndRaidResult): boolean; + /** + * Reset the skill points earned in a raid to 0, ready for next raid + * @param commonSkills Profile common skills to update + */ + protected resetSkillPointsEarnedDuringRaid(commonSkills: Common[]): void; + /** + * merge two dictionaries together + * Prioritise pair that has true as a value + * @param primary main dictionary + * @param secondary Secondary dictionary + */ + protected mergePmcAndScavEncyclopedias(primary: IPmcData, secondary: IPmcData): void; +} diff --git a/types/services/ProfileFixerService.d.ts b/types/services/ProfileFixerService.d.ts index 91e47808..23dc3414 100644 --- a/types/services/ProfileFixerService.d.ts +++ b/types/services/ProfileFixerService.d.ts @@ -49,6 +49,11 @@ export declare class ProfileFixerService { * @param scavProfile profile to check and fix */ checkForAndFixScavProfileIssues(scavProfile: IPmcData): void; + /** + * Check for and cap profile skills at 5100. + * @param pmcProfile profile to check and fix + */ + protected checkForSkillsOverMaxLevel(pmcProfile: IPmcData): void; protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void; protected addMissingHallOfFameContainerImprovements(pmcProfile: IPmcData): void; protected ensureGunStandLevelsMatch(pmcProfile: IPmcData): void; @@ -73,7 +78,6 @@ export declare class ProfileFixerService { */ protected removeDanglingTaskConditionCounters(pmcProfile: IPmcData): void; protected getActiveRepeatableQuests(repeatableQuests: IPmcDataRepeatableQuest[]): IRepeatableQuest[]; - protected fixNullRagfairRatings(pmcProfile: IPmcData): void; protected fixNullTraderSalesSums(pmcProfile: IPmcData): void; protected addMissingBonusesProperty(pmcProfile: IPmcData): void; /** diff --git a/types/services/TraderServicesService.d.ts b/types/services/TraderServicesService.d.ts deleted file mode 100644 index e441eb62..00000000 --- a/types/services/TraderServicesService.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { ProfileHelper } from "@spt/helpers/ProfileHelper"; -import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; -import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { DatabaseService } from "@spt/services/DatabaseService"; -import { ICloner } from "@spt/utils/cloners/ICloner"; -export declare class TraderServicesService { - protected profileHelper: ProfileHelper; - protected logger: ILogger; - protected databaseService: DatabaseService; - protected cloner: ICloner; - constructor(profileHelper: ProfileHelper, logger: ILogger, databaseService: DatabaseService, cloner: ICloner); - getTraderServices(sessionId: string, traderId: string): ITraderServiceModel[]; -} diff --git a/types/tools/ItemTplGenerator/itemOverrides.d.ts b/types/tools/ItemTplGenerator/itemOverrides.d.ts index fb2ba9a2..6ef239ad 100644 --- a/types/tools/ItemTplGenerator/itemOverrides.d.ts +++ b/types/tools/ItemTplGenerator/itemOverrides.d.ts @@ -31,6 +31,7 @@ declare const _default: { "5a29276886f77435ed1b117c": string; "628393620d8524273e7eb028": string; "638dfc803083a019d447768e": string; + "66760b3deb51b08bd40c2b08": string; "638e0057ab150a5f56238960": string; "6393262086e646067c176aa2": string; "63989ced706b793c7d60cfef": string; @@ -60,6 +61,7 @@ declare const _default: { "5d1340bdd7ad1a0e8d245aab": string; "5cbdaf89ae9215000e5b9c94": string; "5e21a3c67e40bd02257a008a": string; + "6241c2c2117ad530666a5108": string; "5914944186f774189e5e76c2": string; "5937ef2b86f77408a47244b3": string; "59387ac686f77401442ddd61": string; From 528111f82a019699e4fceeadbda65063e9c79812 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=99=E7=A9=8F=E9=9D=84?= <170472707+seionmoya@users.noreply.github.com> Date: Thu, 1 Aug 2024 00:34:17 +0200 Subject: [PATCH 002/119] Bump supported spt version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 21a376b9..680c3db0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "server", "version": "2.2.6", - "sptVersion": "~3.9", + "sptVersion": "~3.10", "main": "src/mod.js", "scripts": { "setup": "npm i", From a31609ab67a6bb3a31340abd7d3162b0e0a9867a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=99=E7=A9=8F=E9=9D=84?= <170472707+seionmoya@users.noreply.github.com> Date: Thu, 1 Aug 2024 00:37:55 +0200 Subject: [PATCH 003/119] Fix missing SelectedMemberCategory --- src/controllers/FikaDialogueController.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/controllers/FikaDialogueController.ts b/src/controllers/FikaDialogueController.ts index aa118a2f..6f222670 100644 --- a/src/controllers/FikaDialogueController.ts +++ b/src/controllers/FikaDialogueController.ts @@ -104,7 +104,8 @@ export class FikaDialogueController { Nickname: receiverProfile.characters.pmc.Info.Nickname, Side: receiverProfile.characters.pmc.Info.Side, Level: receiverProfile.characters.pmc.Info.Level, - MemberCategory: receiverProfile.characters.pmc.Info.MemberCategory + MemberCategory: receiverProfile.characters.pmc.Info.MemberCategory, + SelectedMemberCategory: senderProfile.characters.pmc.Info.SelectedMemberCategory } }, { @@ -114,7 +115,8 @@ export class FikaDialogueController { Nickname: senderProfile.characters.pmc.Info.Nickname, Side: senderProfile.characters.pmc.Info.Side, Level: senderProfile.characters.pmc.Info.Level, - MemberCategory: senderProfile.characters.pmc.Info.MemberCategory + MemberCategory: senderProfile.characters.pmc.Info.MemberCategory, + SelectedMemberCategory: senderProfile.characters.pmc.Info.SelectedMemberCategory } } ]; @@ -141,7 +143,8 @@ export class FikaDialogueController { Nickname: senderProfile.characters.pmc.Info.Nickname, Side: senderProfile.characters.pmc.Info.Side, Level: senderProfile.characters.pmc.Info.Level, - MemberCategory: senderProfile.characters.pmc.Info.MemberCategory + MemberCategory: senderProfile.characters.pmc.Info.MemberCategory, + SelectedMemberCategory: senderProfile.characters.pmc.Info.SelectedMemberCategory } }, { @@ -151,7 +154,8 @@ export class FikaDialogueController { Nickname: receiverProfile.characters.pmc.Info.Nickname, Side: receiverProfile.characters.pmc.Info.Side, Level: receiverProfile.characters.pmc.Info.Level, - MemberCategory: receiverProfile.characters.pmc.Info.MemberCategory + MemberCategory: receiverProfile.characters.pmc.Info.MemberCategory, + SelectedMemberCategory: senderProfile.characters.pmc.Info.SelectedMemberCategory } } ]; From 109b3ef58714ab31f77f52a7348f82e69d27b695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=99=E7=A9=8F=E9=9D=84?= <170472707+seionmoya@users.noreply.github.com> Date: Thu, 1 Aug 2024 01:53:17 +0200 Subject: [PATCH 004/119] Rework loot generation --- MIGRATION_NOTES.md | 5 ++ src/di/Container.ts | 6 +- src/overrides/callbacks/LocationCallbacks.ts | 41 ------------ .../services/LocationLifecycleService.ts | 67 +++++++++++++++++++ src/services/FikaMatchService.ts | 10 +-- 5 files changed, 78 insertions(+), 51 deletions(-) create mode 100644 MIGRATION_NOTES.md delete mode 100644 src/overrides/callbacks/LocationCallbacks.ts create mode 100644 src/overrides/services/LocationLifecycleService.ts diff --git a/MIGRATION_NOTES.md b/MIGRATION_NOTES.md new file mode 100644 index 00000000..e96c875e --- /dev/null +++ b/MIGRATION_NOTES.md @@ -0,0 +1,5 @@ +# Migration Notes + +`LocationLifecycleService.generateLocationAndLoot` is protected. +The code in `src/overrides/services/LocationLifecycleService.ts` and `src/services/FikaMatchService.ts` works when running on a build SPT server, but not when running +from source on debug. diff --git a/src/di/Container.ts b/src/di/Container.ts index 9e0cd88b..68a307f2 100644 --- a/src/di/Container.ts +++ b/src/di/Container.ts @@ -4,7 +4,7 @@ import { FikaConfig } from "../utils/FikaConfig"; import { Overrider } from "../overrides/Overrider"; import { DialogueCallbacksOverride } from "../overrides/callbacks/DialogueCallbacks"; -import { LocationCallbacksOverride } from "../overrides/callbacks/LocationCallbacks"; +import { LocationLifecycleServiceOverride } from "../overrides/services/LocationLifecycleService"; import { DialogueControllerOverride } from "../overrides/controllers/DialogueController"; import { ProfileControllerOverride } from "../overrides/controllers/ProfileController"; import { LocalesOverride } from "../overrides/other/Locales"; @@ -75,13 +75,13 @@ export class Container { private static registerListTypes(container: DependencyContainer): void { container.registerType("Overrides", "DialogueCallbacksOverride"); - container.registerType("Overrides", "LocationCallbacksOverride"); container.registerType("Overrides", "DialogueControllerOverride"); container.registerType("Overrides", "ProfileControllerOverride"); container.registerType("Overrides", "HttpRouterOverride"); container.registerType("Overrides", "LocalesOverride"); container.registerType("Overrides", "AchievementControllerOverride"); container.registerType("Overrides", "DatabaseServiceOverride"); + container.registerType("Overrides", "LocationLifecycleServiceOverride"); container.registerType("StaticRoutes", "FikaClientStaticRouter"); container.registerType("StaticRoutes", "FikaLocationStaticRouter"); @@ -100,7 +100,6 @@ export class Container { private static registerOverrides(container: DependencyContainer): void { container.register("DialogueCallbacksOverride", DialogueCallbacksOverride, { lifecycle: Lifecycle.Singleton }); - container.register("LocationCallbacksOverride", LocationCallbacksOverride, { lifecycle: Lifecycle.Singleton }); container.register("DialogueControllerOverride", DialogueControllerOverride, { lifecycle: Lifecycle.Singleton }); container.register("ProfileControllerOverride", ProfileControllerOverride, { lifecycle: Lifecycle.Singleton }); container.register("HttpRouterOverride", HttpRouterOverride, { lifecycle: Lifecycle.Singleton }); @@ -108,6 +107,7 @@ export class Container { container.register("Overrider", Overrider, { lifecycle: Lifecycle.Singleton }); container.register("AchievementControllerOverride", AchievementControllerOverride, { lifecycle: Lifecycle.Singleton }); container.register("DatabaseServiceOverride", DatabaseServiceOverride, { lifecycle: Lifecycle.Singleton }); + container.register("LocationLifecycleServiceOverride", LocationLifecycleServiceOverride, { lifecycle: Lifecycle.Singleton }); } private static registerServices(container: DependencyContainer): void { diff --git a/src/overrides/callbacks/LocationCallbacks.ts b/src/overrides/callbacks/LocationCallbacks.ts deleted file mode 100644 index d6fd4f43..00000000 --- a/src/overrides/callbacks/LocationCallbacks.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { DependencyContainer, inject, injectable } from "tsyringe"; - -import { LocationCallbacks } from "@spt/callbacks/LocationCallbacks"; -import { LocationController } from "@spt/controllers/LocationController"; -import { IGetLocationRequestData } from "@spt/models/eft/location/IGetLocationRequestData"; -import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; - -import { Override } from "../../di/Override"; -import { FikaMatchService } from "../../services/FikaMatchService"; - -@injectable() -export class LocationCallbacksOverride extends Override { - constructor( - @inject("LocationController") protected locationController: LocationController, - @inject("HttpResponseUtil") protected httpResponseUtil: HttpResponseUtil, - @inject("FikaMatchService") protected fikaMatchService: FikaMatchService, - ) { - super(); - } - - public execute(container: DependencyContainer): void { - container.afterResolution( - "LocationCallbacks", - (_t, result: LocationCallbacks) => { - result.getLocation = (_url: string, info: IGetLocationRequestData, sessionId: string) => { - const matchId = this.fikaMatchService.getMatchIdByProfile(sessionId); - - if (matchId === undefined) { - // player isn't in a Fika match, generate new loot - return this.httpResponseUtil.getBody(this.locationController.get(sessionId, info)); - } - - // player is in a Fika match, use match location loot - const match = this.fikaMatchService.getMatch(matchId); - return this.httpResponseUtil.getBody(match.locationData); - }; - }, - { frequency: "Always" }, - ); - } -} diff --git a/src/overrides/services/LocationLifecycleService.ts b/src/overrides/services/LocationLifecycleService.ts new file mode 100644 index 00000000..0256b612 --- /dev/null +++ b/src/overrides/services/LocationLifecycleService.ts @@ -0,0 +1,67 @@ +import { DependencyContainer, inject, injectable } from "tsyringe"; + +import { LocationController } from "@spt/controllers/LocationController"; +import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; + +import { Override } from "../../di/Override"; +import { FikaMatchService } from "../../services/FikaMatchService"; +import { LocationLifecycleService } from "@spt/services/LocationLifecycleService"; +import { IStartLocalRaidRequestData } from "@spt/models/eft/match/IStartLocalRaidRequestData"; +import { IStartLocalRaidResponseData } from "@spt/models/eft/match/IStartLocalRaidResponseData"; +import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; +import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; + +@injectable() +export class LocationLifecycleServiceOverride extends Override { + profileHelper: any; + timeUtil: any; + databaseService: any; + constructor( + @inject("LocationController") protected locationController: LocationController, + @inject("HttpResponseUtil") protected httpResponseUtil: HttpResponseUtil, + @inject("FikaMatchService") protected fikaMatchService: FikaMatchService, + @inject("LocationLifecycleService") protected locationLifecycleService: LocationLifecycleService, + @inject("BotGenerationCacheService") protected botGenerationCacheService: BotGenerationCacheService, + ) { + super(); + } + + public execute(container: DependencyContainer): void { + container.afterResolution( + "LocationLifecycleService", + (_t, result: LocationLifecycleService) => { + result.startLocalRaid = (sessionId: string, request: IStartLocalRaidRequestData): IStartLocalRaidResponseData => { + let locationLoot: ILocationBase; + const matchId = this.fikaMatchService.getMatchIdByProfile(sessionId); + + if (matchId === undefined) { + // player isn't in a Fika match, generate new loot + locationLoot = this.locationLifecycleService.generateLocationAndLoot(request.location); + } else { + // player is in a Fika match, use match location loot + const match = this.fikaMatchService.getMatch(matchId); + locationLoot = match.locationData; + } + + const playerProfile = this.profileHelper.getPmcProfile(sessionId); + + const result: IStartLocalRaidResponseData = { + serverId: `${request.location}.${request.playerSide}.${this.timeUtil.getTimestamp()}`, // TODO - does this need to be more verbose - investigate client? + serverSettings: this.databaseService.getLocationServices(), // TODO - is this per map or global? + profile: { insuredItems: playerProfile.InsuredItems }, + + // --- ONLY PART THAT IS MODIFIED + locationLoot: locationLoot, + // --- + }; + + // Clear bot cache ready for a fresh raid + this.botGenerationCacheService.clearStoredBots(); + + return result; + }; + }, + { frequency: "Always" }, + ); + } +} diff --git a/src/services/FikaMatchService.ts b/src/services/FikaMatchService.ts index 4f64cb92..e59171bd 100644 --- a/src/services/FikaMatchService.ts +++ b/src/services/FikaMatchService.ts @@ -1,6 +1,6 @@ import { inject, injectable } from "tsyringe"; -import { LocationController } from "@spt/controllers/LocationController"; +import { LocationLifecycleService } from "@spt/services/LocationLifecycleService"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { SaveServer } from "@spt/servers/SaveServer"; @@ -20,7 +20,7 @@ export class FikaMatchService { constructor( @inject("WinstonLogger") protected logger: ILogger, - @inject("LocationController") protected locationController: LocationController, + @inject("LocationLifecycleService") protected locationLifecycleService: LocationLifecycleService, @inject("SaveServer") protected saveServer: SaveServer, @inject("FikaConfig") protected fikaConfig: FikaConfig, @inject("FikaDedicatedRaidService") protected fikaDedicatedRaidService: FikaDedicatedRaidService, @@ -181,11 +181,7 @@ export class FikaMatchService { this.deleteMatch(data.serverId); } - const locationData = this.locationController.get(data.serverId, { - crc: 0 /* unused */, - locationId: data.settings.location, - variantId: 0 /* unused */, - }); + const locationData = this.locationLifecycleService.generateLocationAndLoot(data.settings.location); this.matches.set(data.serverId, { ips: null, From 44fded6b42969a3819cb43144e98d30efd4543e7 Mon Sep 17 00:00:00 2001 From: Archangel Date: Thu, 1 Aug 2024 13:58:24 +0200 Subject: [PATCH 005/119] Inject DatabaseService, ProfileHelper & TimeUtil --- src/overrides/services/LocationLifecycleService.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/overrides/services/LocationLifecycleService.ts b/src/overrides/services/LocationLifecycleService.ts index 0256b612..fc326b72 100644 --- a/src/overrides/services/LocationLifecycleService.ts +++ b/src/overrides/services/LocationLifecycleService.ts @@ -5,23 +5,26 @@ import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { Override } from "../../di/Override"; import { FikaMatchService } from "../../services/FikaMatchService"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { LocationLifecycleService } from "@spt/services/LocationLifecycleService"; import { IStartLocalRaidRequestData } from "@spt/models/eft/match/IStartLocalRaidRequestData"; import { IStartLocalRaidResponseData } from "@spt/models/eft/match/IStartLocalRaidResponseData"; import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { TimeUtil } from "@spt/utils/TimeUtil"; @injectable() export class LocationLifecycleServiceOverride extends Override { - profileHelper: any; - timeUtil: any; - databaseService: any; constructor( + @inject("DatabaseService") protected databaseService: DatabaseService, + @inject("ProfileHelper") protected profileHelper: ProfileHelper, @inject("LocationController") protected locationController: LocationController, @inject("HttpResponseUtil") protected httpResponseUtil: HttpResponseUtil, @inject("FikaMatchService") protected fikaMatchService: FikaMatchService, @inject("LocationLifecycleService") protected locationLifecycleService: LocationLifecycleService, @inject("BotGenerationCacheService") protected botGenerationCacheService: BotGenerationCacheService, + @inject("TimeUtil") protected timeUtil: TimeUtil ) { super(); } From cbfb662e639f488887ac8154dc674a0e6b7e8b03 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Wed, 21 Aug 2024 15:39:17 +0200 Subject: [PATCH 006/119] Update types --- types/callbacks/HideoutCallbacks.d.ts | 5 + types/controllers/HideoutController.d.ts | 8 ++ types/di/Serializer.d.ts | 1 - .../generators/BotEquipmentModGenerator.d.ts | 27 ++-- .../generators/RepeatableQuestGenerator.d.ts | 1 + types/helpers/InRaidHelper.d.ts | 11 +- types/helpers/ItemHelper.d.ts | 12 +- types/helpers/ProfileHelper.d.ts | 14 +++ types/models/eft/common/IGlobals.d.ts | 99 ++++++++++++++- types/models/eft/common/ILocationBase.d.ts | 31 +++++ types/models/eft/common/tables/IBotBase.d.ts | 3 +- types/models/eft/common/tables/IQuest.d.ts | 2 + .../eft/common/tables/ITemplateItem.d.ts | 17 ++- ...leOfCultistProductionStartRequestData.d.ts | 4 + types/models/enums/HideoutAreas.d.ts | 4 +- types/models/enums/HideoutEventActions.d.ts | 3 +- types/models/enums/QuestRewardType.d.ts | 3 +- types/models/enums/WildSpawnTypeNumber.d.ts | 13 +- types/models/external/HttpFramework.d.ts | 5 +- .../spt/bots/IGenerateWeaponRequest.d.ts | 2 + types/models/spt/bots/IModToSpawnRequest.d.ts | 5 +- types/routers/HttpRouter.d.ts | 1 - types/routers/ImageRouter.d.ts | 1 - .../routers/serializers/BundleSerializer.d.ts | 1 - .../routers/serializers/ImageSerializer.d.ts | 1 - .../routers/serializers/NotifySerializer.d.ts | 1 - types/servers/HttpServer.d.ts | 1 - types/servers/WebSocketServer.d.ts | 1 - types/servers/http/IHttpListener.d.ts | 1 - types/servers/http/SptHttpListener.d.ts | 2 - .../ws/IWebSocketConnectionHandler.d.ts | 1 - .../ws/SptWebSocketConnectionHandler.d.ts | 2 - types/services/InsuranceService.d.ts | 4 +- types/services/ProfileFixerService.d.ts | 116 +++--------------- types/services/RagfairTaxService.d.ts | 6 +- .../mod/httpListener/HttpListenerMod.d.ts | 1 - .../httpListener/HttpListenerModService.d.ts | 1 - types/utils/HashUtil.d.ts | 2 - types/utils/HttpFileUtil.d.ts | 1 - types/utils/ObjectId.d.ts | 1 - types/utils/VFS.d.ts | 2 - .../utils/logging/AbstractWinstonLogger.d.ts | 1 - 42 files changed, 261 insertions(+), 157 deletions(-) create mode 100644 types/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData.d.ts diff --git a/types/callbacks/HideoutCallbacks.d.ts b/types/callbacks/HideoutCallbacks.d.ts index fadab9bf..72c146b0 100644 --- a/types/callbacks/HideoutCallbacks.d.ts +++ b/types/callbacks/HideoutCallbacks.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt/di/OnUpdate"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IHandleQTEEventRequestData } from "@spt/models/eft/hideout/IHandleQTEEventRequestData"; import { IHideoutCancelProductionRequestData } from "@spt/models/eft/hideout/IHideoutCancelProductionRequestData"; +import { IHideoutCircleOfCultistProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData"; import { IHideoutContinuousProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutImproveAreaRequestData } from "@spt/models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutPutItemInRequestData } from "@spt/models/eft/hideout/IHideoutPutItemInRequestData"; @@ -75,6 +76,10 @@ export declare class HideoutCallbacks implements OnUpdate { * Handle client/game/profile/items/moving - HideoutCancelProductionCommand */ cancelProduction(pmcData: IPmcData, request: IHideoutCancelProductionRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Handle client/game/profile/items/moving - HideoutCircleOfCultistProductionStart + */ + circleOfCultistProductionStart(pmcData: IPmcData, request: IHideoutCircleOfCultistProductionStartRequestData, sessionId: string): IItemEventRouterResponse | PromiseLike; onUpdate(timeSinceLastRun: number): Promise; getRoute(): string; } diff --git a/types/controllers/HideoutController.d.ts b/types/controllers/HideoutController.d.ts index 89a428c5..332d0804 100644 --- a/types/controllers/HideoutController.d.ts +++ b/types/controllers/HideoutController.d.ts @@ -11,6 +11,7 @@ import { HideoutUpgradeCompleteRequestData } from "@spt/models/eft/hideout/Hideo import { IHandleQTEEventRequestData } from "@spt/models/eft/hideout/IHandleQTEEventRequestData"; import { IHideoutArea, Stage } from "@spt/models/eft/hideout/IHideoutArea"; import { IHideoutCancelProductionRequestData } from "@spt/models/eft/hideout/IHideoutCancelProductionRequestData"; +import { IHideoutCircleOfCultistProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData"; import { IHideoutContinuousProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutImproveAreaRequestData } from "@spt/models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; @@ -262,6 +263,13 @@ export declare class HideoutController { * @returns IItemEventRouterResponse */ cancelProduction(sessionId: string, pmcData: IPmcData, request: IHideoutCancelProductionRequestData): IItemEventRouterResponse; + /** + * Handle client/game/profile/items/moving - HideoutCircleOfCultistProductionStart + * @param sessionId Session id + * @param pmcData Profile of crafter + * @param request Request data + */ + circleOfCultistProductionStart(sessionId: string, pmcData: IPmcData, request: IHideoutCircleOfCultistProductionStartRequestData): IItemEventRouterResponse | PromiseLike; /** * Function called every x seconds as part of onUpdate event */ diff --git a/types/di/Serializer.d.ts b/types/di/Serializer.d.ts index b760b8bf..56db4774 100644 --- a/types/di/Serializer.d.ts +++ b/types/di/Serializer.d.ts @@ -1,4 +1,3 @@ -/// import { IncomingMessage, ServerResponse } from "node:http"; export declare class Serializer { serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void; diff --git a/types/generators/BotEquipmentModGenerator.d.ts b/types/generators/BotEquipmentModGenerator.d.ts index c1b54d01..59bb9b4a 100644 --- a/types/generators/BotEquipmentModGenerator.d.ts +++ b/types/generators/BotEquipmentModGenerator.d.ts @@ -77,6 +77,14 @@ export declare class BotEquipmentModGenerator { * @returns Weapon + mods array */ generateModsForWeapon(sessionId: string, request: IGenerateWeaponRequest): Item[]; + /** + * Should the provided bot have its stock chance values altered to 100% + * @param modSlot Slot to check + * @param botEquipConfig Bots equipment config/chance values + * @param modToAddTemplate Mod being added to bots weapon + * @returns True if it should + */ + protected shouldForceSubStockSlots(modSlot: string, botEquipConfig: EquipmentFilters, modToAddTemplate: ITemplateItem): boolean; /** * Is this modslot a front or rear sight * @param modSlot Slot to check @@ -140,7 +148,7 @@ export declare class BotEquipmentModGenerator { * @param modSlotName Name of slot picked mod will be placed into * @returns Chosen weapon details */ - protected getCompatibleWeaponModTplForSlotFromPool(modPool: string[], parentSlot: Slot, choiceTypeEnum: ModSpawn, weapon: Item[], modSlotName: string): IChooseRandomCompatibleModResult; + protected getCompatibleWeaponModTplForSlotFromPool(request: IModToSpawnRequest, modPool: string[], parentSlot: Slot, choiceTypeEnum: ModSpawn, weapon: Item[], modSlotName: string): IChooseRandomCompatibleModResult; /** * * @param modPool Pool of item Tpls to choose from @@ -153,26 +161,23 @@ export declare class BotEquipmentModGenerator { protected createExhaustableArray(itemsToAddToArray: T[]): ExhaustableArray; /** * Get a list of mod tpls that are compatible with the current weapon - * @param initialModPool - * @param weapon + * @param modPool + * @param tplBlacklist Tpls that are incompatible and should not be used * @returns string array of compatible mod tpls with weapon */ - protected getFilteredModPool(initialModPool: string[], weapon: Item[]): string[]; + protected getFilteredModPool(modPool: string[], tplBlacklist: Set): string[]; /** * Filter mod pool down based on various criteria: * Is slot flagged as randomisable * Is slot required * Is slot flagged as default mod only - * @param itemModPool Existing pool of mods to choose - * @param itemSpawnCategory How should slot be handled - * @param parentTemplate Mods parent + * @param request * @param weaponTemplate Mods root parent (weapon/equipment) - * @param modSlot name of mod slot to choose for - * @param botEquipBlacklist A blacklist of items not allowed to be picked - * @param isRandomisableSlot Slot is flagged as a randomisable slot * @returns Array of mod tpls */ - protected getModPoolForSlot(itemModPool: Record, itemSpawnCategory: ModSpawn, parentTemplate: ITemplateItem, weaponTemplate: ITemplateItem, modSlot: string, botEquipBlacklist: EquipmentFilterDetails, isRandomisableSlot: boolean): string[]; + protected getModPoolForSlot(request: IModToSpawnRequest, weaponTemplate: ITemplateItem): string[]; + protected getModPoolForDefaultSlot(request: IModToSpawnRequest, weaponTemplate: ITemplateItem): string[]; + protected getMatchingModFromPreset(request: IModToSpawnRequest, weaponTemplate: ITemplateItem): Item; /** * Get default preset for weapon OR get specific weapon presets for edge cases (mp5/silenced dvl) * @param weaponTemplate Weapons db template diff --git a/types/generators/RepeatableQuestGenerator.d.ts b/types/generators/RepeatableQuestGenerator.d.ts index 339f322e..866c4ecf 100644 --- a/types/generators/RepeatableQuestGenerator.d.ts +++ b/types/generators/RepeatableQuestGenerator.d.ts @@ -28,6 +28,7 @@ export declare class RepeatableQuestGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected questConfig: IQuestConfig; + protected maxRandomNumberAttempts: number; constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, objectId: ObjectId, repeatableQuestHelper: RepeatableQuestHelper, repeatableQuestRewardGenerator: RepeatableQuestRewardGenerator, configServer: ConfigServer, cloner: ICloner); /** * This method is called by /GetClientRepeatableQuests/ and creates one element of quest type format (see assets/database/templates/repeatableQuests.json). diff --git a/types/helpers/InRaidHelper.d.ts b/types/helpers/InRaidHelper.d.ts index f4127f40..f2da96cb 100644 --- a/types/helpers/InRaidHelper.d.ts +++ b/types/helpers/InRaidHelper.d.ts @@ -1,4 +1,5 @@ import { InventoryHelper } from "@spt/helpers/InventoryHelper"; +import { ItemHelper } from "@spt/helpers/ItemHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; @@ -8,10 +9,11 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class InRaidHelper { protected logger: ILogger; protected inventoryHelper: InventoryHelper; + protected itemHelper: ItemHelper; protected configServer: ConfigServer; protected cloner: ICloner; protected lostOnDeathConfig: ILostOnDeathConfig; - constructor(logger: ILogger, inventoryHelper: InventoryHelper, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); /** * @deprecated * Reset the skill points earned in a raid to 0, ready for next raid @@ -35,6 +37,13 @@ export declare class InRaidHelper { * @param sessionId Session id */ deleteInventory(pmcData: IPmcData, sessionId: string): void; + /** + * Remove FiR status from designated container + * @param sessionId Session id + * @param pmcData Player profile + * @param secureContainerSlotId Container slot id to find items for and remove FiR from + */ + removeFiRStatusFromItemsInContainer(sessionId: string, pmcData: IPmcData, secureContainerSlotId: string): void; /** * Get an array of items from a profile that will be lost on death * @param pmcProfile Profile to get items from diff --git a/types/helpers/ItemHelper.d.ts b/types/helpers/ItemHelper.d.ts index 481f46db..1f8475be 100644 --- a/types/helpers/ItemHelper.d.ts +++ b/types/helpers/ItemHelper.d.ts @@ -76,7 +76,13 @@ export declare class ItemHelper { */ generateUpdForItem(itemTemplate: ITemplateItem): Upd; /** - * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash + * Checks if a tpl is a valid item. Valid meaning that it's an item that be stored in stash + * Valid means: + * Not quest item + * 'Item' type + * Not on the invalid base types array + * Price above 0 roubles + * Not on item config blacklist * @param {string} tpl the template id / tpl * @returns boolean; true for items that may be in player possession and not quest items */ @@ -377,12 +383,12 @@ export declare class ItemHelper { addSingleStackCartridgesToAmmoBox(ammoBox: Item[], ammoBoxDetails: ITemplateItem): void; /** * Check if item is stored inside of a container - * @param item Item to check is inside of container + * @param itemToCheck Item to check is inside of container * @param desiredContainerSlotId Name of slot to check item is in e.g. SecuredContainer/Backpack * @param items Inventory with child parent items to check * @returns True when item is in container */ - itemIsInsideContainer(item: Item, desiredContainerSlotId: string, items: Item[]): boolean; + itemIsInsideContainer(itemToCheck: Item, desiredContainerSlotId: string, items: Item[]): boolean; /** * Add child items (cartridges) to a magazine * @param magazine Magazine to add child items to diff --git a/types/helpers/ProfileHelper.d.ts b/types/helpers/ProfileHelper.d.ts index cdab870b..95688af9 100644 --- a/types/helpers/ProfileHelper.d.ts +++ b/types/helpers/ProfileHelper.d.ts @@ -3,6 +3,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Common, CounterKeyValue, Stats } from "@spt/models/eft/common/tables/IBotBase"; import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; +import { BonusType } from "@spt/models/enums/BonusType"; import { SkillTypes } from "@spt/models/enums/SkillTypes"; import { IInventoryConfig } from "@spt/models/spt/config/IInventoryConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -190,6 +191,13 @@ export declare class ProfileHelper { * @param rowsToAdd How many rows to give profile */ addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; + /** + * Iterate over all bonuses and sum up all bonuses of desired type in provided profile + * @param pmcProfile Player profile + * @param desiredBonus Bonus to sum up + * @returns Summed bonus value or 0 if no bonus found + */ + getBonusValueFromProfile(pmcProfile: IPmcData, desiredBonus: BonusType): number; playerIsFleaBanned(pmcProfile: IPmcData): boolean; /** * Add an achievement to player profile @@ -198,4 +206,10 @@ export declare class ProfileHelper { */ addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void; hasAccessToRepeatableFreeRefreshSystem(pmcProfile: IPmcData): boolean; + /** + * Find a profiles "Pockets" item and replace its tpl with passed in value + * @param pmcProfile Player profile + * @param newPocketTpl New tpl to set profiles Pockets to + */ + replaceProfilePocketTpl(pmcProfile: IPmcData, newPocketTpl: string): void; } diff --git a/types/models/eft/common/IGlobals.d.ts b/types/models/eft/common/IGlobals.d.ts index 8c1b3cca..80d3fbe3 100644 --- a/types/models/eft/common/IGlobals.d.ts +++ b/types/models/eft/common/IGlobals.d.ts @@ -29,7 +29,10 @@ export interface IConfig { Mastering: IMastering[]; GlobalItemPriceModifier: number; TradingUnlimitedItems: boolean; + TransitSettings: ITransitSettings; + TripwiresSettings: ITripwiresSettings; MaxLoyaltyLevelForAll: boolean; + MountingSettings: IMountingSettings; GlobalLootChanceModifier: number; GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; @@ -51,6 +54,7 @@ export interface IConfig { Airdrop: IAirdropGlobalSettings; ArmorMaterials: IArmorMaterials; ArenaEftTransferSettings: IArenaEftTransferSettings; + KarmaCalculationSettings: IKarmaCalculationSettings; LegsOverdamage: number; HandsOverdamage: number; StomachOverdamage: number; @@ -175,6 +179,80 @@ export interface IEventWeather { Wind: number; WindDirection: number; } +export interface ITransitSettings { + BearPriceMod: number; + ClearAllPlayerEffectsOnTransit: boolean; + CoefficientDiscountCharisma: number; + DeliveryMinPrice: number; + DeliveryPrice: number; + ModDeliveryCost: number; + PercentageOfMissingEnergyRestore: number; + PercentageOfMissingHealthRestore: number; + PercentageOfMissingWaterRestore: number; + ScavPriceMod: number; + UsecPriceMod: number; + active: boolean; +} +export interface ITripwiresSettings { + CollisionCapsuleCheckCoef: number; + CollisionCapsuleRadius: number; + DefuseTimeSeconds: number; + DestroyedSeconds: number; + GroundDotProductTolerance: number; + InertSeconds: number; + InteractionSqrDistance: number; + MaxHeightDifference: number; + MaxLength: number; + MaxPreviewLength: number; + MaxTripwireToPlayerDistance: number; + MinLength: number; + MultitoolDefuseTimeSeconds: number; + ShotSqrDistance: number; +} +export interface IMountingSettings { + MovementSettings: IMountingMovementSettings; + PointDetectionSettings: IMountingPointDetectionSettings; +} +export interface IMountingMovementSettings { + ApproachTime: number; + ApproachTimeDeltaAngleModifier: number; + ExitTime: number; + MaxApproachTime: number; + MaxPitchLimitExcess: number; + MaxVerticalMountAngle: number; + MaxYawLimitExcess: number; + MinApproachTime: number; + MountingCameraSpeed: number; + MountingSwayFactorModifier: number; + PitchLimitHorizontal: Ixyz; + PitchLimitHorizontalBipod: Ixyz; + PitchLimitVertical: Ixyz; + RotationSpeedClamp: number; + SensitivityMultiplier: number; +} +export interface IMountingPointDetectionSettings { + CheckHorizontalSecondaryOffset: number; + CheckWallOffset: number; + EdgeDetectionDistance: number; + GridMaxHeight: number; + GridMinHeight: number; + HorizontalGridFromTopOffset: number; + HorizontalGridSize: number; + HorizontalGridStepsAmount: number; + MaxFramesForRaycast: number; + MaxHorizontalMountAngleDotDelta: number; + MaxProneMountAngleDotDelta: number; + MaxVerticalMountAngleDotDelta: number; + PointHorizontalMountOffset: number; + PointVerticalMountOffset: number; + RaycastDistance: number; + SecondCheckVerticalDistance: number; + SecondCheckVerticalGridOffset: number; + SecondCheckVerticalGridSize: number; + SecondCheckVerticalGridSizeStepsAmount: number; + VerticalGridSize: number; + VerticalGridStepsAmount: number; +} export interface IGraphicSettings { ExperimentalFogInCity: boolean; } @@ -231,6 +309,8 @@ export interface IMatchEnd { survivedMult: number; runnerMult: number; killedMult: number; + transit_exp_reward: number; + transit_mult: number[][]; } export interface IKill { combo: ICombo[]; @@ -406,6 +486,14 @@ export interface IAirdropGlobalSettings { PlaneSpeed: number; SmokeActivateHeight: number; } +export interface IKarmaCalculationSettings { + defaultPveKarmaValue: number; + enable: boolean; + expireDaysAfterLastRaid: number; + maxKarmaThresholdPercentile: number; + minKarmaThresholdPercentile: number; + minSurvivedRaidCount: number; +} export interface IArenaEftTransferSettings { ArenaEftTransferSettings: ArenaEftTransferSettings; } @@ -863,7 +951,10 @@ export interface IStamina { Capacity: number; SprintDrainRate: number; BaseRestorationRate: number; + BipodAimDrainRateMultiplier: number; JumpConsumption: number; + MountingHorizontalAimDrainRateMultiplier: number; + MountingVerticalAimDrainRateMultiplier: number; GrenadeHighThrow: number; GrenadeLowThrow: number; AimDrainRate: number; @@ -934,8 +1025,9 @@ export interface IAlpinist { RequirementTip: string; } export interface IRestrictionsInRaid { + MaxInLobby: number; + MaxInRaid: number; TemplateId: string; - Value: number; } export interface IFavoriteItemsSettings { WeaponStandMaxItemsCount: number; @@ -1050,6 +1142,7 @@ export interface ISkillsSettings { HideoutManagement: IHideoutManagement; Crafting: ICrafting; Metabolism: IMetabolism; + MountingErgonomicsBonusPerLevel: number; Immunity: Immunity; Endurance: IEndurance; Strength: IStrength; @@ -1075,6 +1168,7 @@ export interface ISkillsSettings { BearAksystems: any[]; BearHeavycaliber: any[]; BearRawpower: any[]; + BipodErgonomicsBonusPerLevel: number; UsecArsystems: any[]; UsecDeepweaponmodding_Settings: any[]; UsecLongrangeoptics_Settings: any[]; @@ -1134,6 +1228,7 @@ export interface IArmorCounters { export interface IHideoutManagement { SkillPointsPerAreaUpgrade: number; SkillPointsPerCraft: number; + CircleOfCultistsBonusPercent: number; ConsumptionReductionPerLevel: number; SkillBoostPercent: number; SkillPointsRate: ISkillPointsRate; @@ -1439,6 +1534,7 @@ export interface IFenceLevel { PaidExitCostModifier: number; BotFollowChance: number; ScavEquipmentSpawnChanceModifier: number; + TransitGridSize: Ixyz; PriceModifier: number; HostileBosses: boolean; HostileScavs: boolean; @@ -1457,6 +1553,7 @@ export interface IFenceLevel { ReactOnMarkOnUnknownsPVE: boolean; DeliveryGridSize: Ixyz; CanInteractWithBtr: boolean; + CircleOfCultistsBonusPercent: number; } export interface IInertia { InertiaLimits: Ixyz; diff --git a/types/models/eft/common/ILocationBase.d.ts b/types/models/eft/common/ILocationBase.d.ts index 86e03cf2..a80085a2 100644 --- a/types/models/eft/common/ILocationBase.d.ts +++ b/types/models/eft/common/ILocationBase.d.ts @@ -87,12 +87,23 @@ export interface ILocationBase { maxItemCountInLocation: MaxItemCountInLocation[]; sav_summon_seconds: number; tmp_location_field_remove_me: number; + transits: ITransit[]; users_gather_seconds: number; users_spawn_seconds_n: number; users_spawn_seconds_n2: number; users_summon_seconds: number; waves: Wave[]; } +export interface ITransit { + activateAfterSec: string; + active: boolean; + conditions: string; + description: string; + id: number; + location: string; + target: string; + time: number; +} export interface INonWaveGroupScenario { Chance: number; Enabled: boolean; @@ -136,6 +147,8 @@ export interface BossLocationSpawn { TriggerId: string; TriggerName: string; Delay?: number; + DependKarma?: boolean; + DependKarmaPVE?: boolean; ForceSpawn?: boolean; IgnoreMaxBots?: boolean; Supports?: BossSupport[]; @@ -149,6 +162,7 @@ export interface BossSupport { } export interface BotLocationModifier { AccuracySpeed: number; + AdditionalHostilitySettings: IAdditionalHostilitySettings[]; DistToActivate: number; DistToActivatePvE: number; DistToPersueAxemanCoef: number; @@ -163,6 +177,23 @@ export interface BotLocationModifier { MaxExfiltrationTime: number; MinExfiltrationTime: number; } +export interface IAdditionalHostilitySettings { + AlwaysEnemies: string[]; + AlwaysFriends: string[]; + BearEnemyChance: number; + BearPlayerBehaviour: string; + BotRole: string; + ChancedEnemies: IChancedEnemy[]; + Neutral: string[]; + SavagePlayerBehaviour: string; + UsecEnemyChance: number; + UsecPlayerBehaviour: string; + Warn: string[]; +} +export interface IChancedEnemy { + EnemyChance: number; + Role: string; +} export interface MinMaxBot extends MinMax { WildSpawnType: WildSpawnType | string; } diff --git a/types/models/eft/common/tables/IBotBase.d.ts b/types/models/eft/common/tables/IBotBase.d.ts index 539b0ad3..02e0e587 100644 --- a/types/models/eft/common/tables/IBotBase.d.ts +++ b/types/models/eft/common/tables/IBotBase.d.ts @@ -63,6 +63,7 @@ export interface Info { Side: string; SquadInviteRestriction: boolean; HasCoopExtension: boolean; + HasPveGame: boolean; Voice: string; Level: number; Experience: number; @@ -298,7 +299,7 @@ export interface IInsuredItem { export interface Hideout { Production: Record; Areas: HideoutArea[]; - Improvement: Record; + Improvements: Record; Seed: number; sptUpdateLastRunTimestamp: number; } diff --git a/types/models/eft/common/tables/IQuest.d.ts b/types/models/eft/common/tables/IQuest.d.ts index 54ff191e..25a5f637 100644 --- a/types/models/eft/common/tables/IQuest.d.ts +++ b/types/models/eft/common/tables/IQuest.d.ts @@ -61,6 +61,8 @@ export interface IQuestCondition { dispersion?: number; onlyFoundInRaid?: boolean; oneSessionOnly?: boolean; + isResetOnConditionFailed?: boolean; + isNecessary?: boolean; doNotResetIfCounterCompleted?: boolean; dogtagLevel?: number; maxDurability?: number; diff --git a/types/models/eft/common/tables/ITemplateItem.d.ts b/types/models/eft/common/tables/ITemplateItem.d.ts index c5b2da3c..0c15364e 100644 --- a/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/types/models/eft/common/tables/ITemplateItem.d.ts @@ -93,13 +93,16 @@ export interface Props { IsAnimated?: boolean; HasShoulderContact?: boolean; SightingRange?: number; + ZoomSensitivity?: number; DoubleActionAccuracyPenaltyMult?: number; - ModesCount?: any; + ModesCount?: number | number[]; DurabilityBurnModificator?: number; HeatFactor?: number; CoolFactor?: number; muzzleModType?: string; CustomAimPlane?: string; + IsAdjustableOptic?: boolean; + MinMaxFov?: Ixyz; sightModType?: string; aimingSensitivity?: number; SightModesCount?: number; @@ -226,6 +229,8 @@ export interface Props { RotationCenterNoStock?: Ixyz; ShotsGroupSettings?: IShotsGroupSettings[]; FoldedSlot?: string; + ForbidMissingVitalParts?: boolean; + ForbidNonEmptyContainers?: boolean; CompactHandling?: boolean; MinRepairDegradation?: number; MaxRepairDegradation?: number; @@ -263,6 +268,13 @@ export interface Props { RecoilStableIndexShot?: number; MinRepairKitDegradation?: number; MaxRepairKitDegradation?: number; + MountCameraSnapMultiplier?: number; + MountHorizontalRecoilMultiplier?: number; + MountReturnSpeedHandMultiplier?: number; + MountVerticalRecoilMultiplier?: number; + MountingHorizontalOutOfBreathMultiplier?: number; + MountingPosition?: Ixyz; + MountingVerticalOutOfBreathMultiplier?: Ixyz; BlocksEarpiece?: boolean; BlocksEyewear?: boolean; BlocksHeadwear?: boolean; @@ -379,6 +391,7 @@ export interface Props { ShowHitEffectOnExplode?: boolean; ExplosionType?: string; AmmoLifeTimeSec?: number; + AmmoTooltipClass?: string; Contusion?: Ixyz; ArmorDistanceDistanceDamage?: Ixyz; Blindness?: Ixyz; @@ -401,6 +414,7 @@ export interface Props { explDelay?: number; EmitTime?: number; CanBeHiddenDuringThrow?: boolean; + CanPlantOnGround?: boolean; MinTimeToContactExplode?: number; ExplosionEffectType?: string; LinkedWeapon?: string; @@ -449,6 +463,7 @@ export interface GridProps { export interface GridFilter { Filter: string[]; ExcludedFilter: string[]; + locked?: boolean; } export interface Slot { _name: string; diff --git a/types/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData.d.ts b/types/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData.d.ts new file mode 100644 index 00000000..004d0083 --- /dev/null +++ b/types/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData.d.ts @@ -0,0 +1,4 @@ +export type IHideoutCircleOfCultistProductionStartRequestData = { + Action: "HideoutCircleOfCultistProductionStart"; + timestamp: number; +}; diff --git a/types/models/enums/HideoutAreas.d.ts b/types/models/enums/HideoutAreas.d.ts index 1af487ab..6211f269 100644 --- a/types/models/enums/HideoutAreas.d.ts +++ b/types/models/enums/HideoutAreas.d.ts @@ -25,5 +25,7 @@ export declare enum HideoutAreas { EMERGENCY_WALL = 22, GYM = 23, WEAPON_STAND = 24, - WEAPON_STAND_SECONDARY = 25 + WEAPON_STAND_SECONDARY = 25, + EQUIPMENT_PRESETS_STAND = 26, + CIRCLE_OF_CULTISTS = 27 } diff --git a/types/models/enums/HideoutEventActions.d.ts b/types/models/enums/HideoutEventActions.d.ts index 556c799c..99fb979f 100644 --- a/types/models/enums/HideoutEventActions.d.ts +++ b/types/models/enums/HideoutEventActions.d.ts @@ -10,5 +10,6 @@ export declare enum HideoutEventActions { HIDEOUT_TAKE_PRODUCTION = "HideoutTakeProduction", HIDEOUT_RECORD_SHOOTING_RANGE_POINTS = "RecordShootingRangePoints", HIDEOUT_IMPROVE_AREA = "HideoutImproveArea", - HIDEOUT_CANCEL_PRODUCTION_COMMAND = "HideoutCancelProductionCommand" + HIDEOUT_CANCEL_PRODUCTION_COMMAND = "HideoutCancelProductionCommand", + HIDEOUT_CIRCLE_OF_CULTIST_PRODUCTION_START = "HideoutCircleOfCultistProductionStart" } diff --git a/types/models/enums/QuestRewardType.d.ts b/types/models/enums/QuestRewardType.d.ts index 3f010408..e09f71d3 100644 --- a/types/models/enums/QuestRewardType.d.ts +++ b/types/models/enums/QuestRewardType.d.ts @@ -9,5 +9,6 @@ export declare enum QuestRewardType { TRADER_STANDING_RESET = "TraderStandingReset", TRADER_STANDING_RESTORE = "TraderStandingRestore", STASH_ROWS = "StashRows", - ACHIEVEMENT = "Achievement" + ACHIEVEMENT = "Achievement", + POCKETS = "Pockets" } diff --git a/types/models/enums/WildSpawnTypeNumber.d.ts b/types/models/enums/WildSpawnTypeNumber.d.ts index 19d00629..dddbda59 100644 --- a/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/types/models/enums/WildSpawnTypeNumber.d.ts @@ -45,12 +45,13 @@ export declare enum WildSpawnTypeNumber { FOLLOWERKOLONTAYASSAULT = 44, FOLLOWERKOLONTAYSECURITY = 45, SHOOTERBTR = 46, - SPIRITWINTER = 47, - SPIRITSPRING = 48, - PMCBEAR = 49, - PMCUSEC = 50, - SKIER = 51, - PEACEMAKER = 52, + BOSSPARTISAN = 47, + SPIRITWINTER = 48, + SPIRITSPRING = 49, + PEACEMAKER = 50, + PMCBEAR = 51, + PMCUSEC = 52, + SKIER = 53, SPTUSEC = 100, SPTBEAR = 101 } diff --git a/types/models/external/HttpFramework.d.ts b/types/models/external/HttpFramework.d.ts index fda87328..96fb4ed8 100644 --- a/types/models/external/HttpFramework.d.ts +++ b/types/models/external/HttpFramework.d.ts @@ -1,4 +1,3 @@ -/// import { IncomingMessage, ServerResponse } from "node:http"; export type HandleFn = (_: string, req: IncomingMessage, resp: ServerResponse) => void; /** @@ -6,7 +5,9 @@ export type HandleFn = (_: string, req: IncomingMessage, resp: ServerResponse) = * @param basePath The base path * @returns The decorator that create the listener proxy */ -export declare const Listen: (basePath: string) => any>(Base: T) => T; +export declare const Listen: (basePath: string) => (Base: T) => T; /** * HTTP DELETE decorator */ diff --git a/types/models/spt/bots/IGenerateWeaponRequest.d.ts b/types/models/spt/bots/IGenerateWeaponRequest.d.ts index 4bc8adf8..6fbfecf2 100644 --- a/types/models/spt/bots/IGenerateWeaponRequest.d.ts +++ b/types/models/spt/bots/IGenerateWeaponRequest.d.ts @@ -21,6 +21,8 @@ export interface IGenerateWeaponRequest { modLimits: BotModLimits; /** Info related to the weapon being generated */ weaponStats: IWeaponStats; + /** Array of item tpls the weapon does not support */ + conflictingItemTpls: Set; } export interface IBotData { /** Role of bot weapon is generated for */ diff --git a/types/models/spt/bots/IModToSpawnRequest.d.ts b/types/models/spt/bots/IModToSpawnRequest.d.ts index 58e9a1d4..9d11109c 100644 --- a/types/models/spt/bots/IModToSpawnRequest.d.ts +++ b/types/models/spt/bots/IModToSpawnRequest.d.ts @@ -1,7 +1,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ModSpawn } from "@spt/models/enums/ModSpawn"; -import { IWeaponStats } from "@spt/models/spt/bots/IGenerateWeaponRequest"; +import { IBotData, IWeaponStats } from "@spt/models/spt/bots/IGenerateWeaponRequest"; import { EquipmentFilterDetails } from "@spt/models/spt/config/IBotConfig"; export interface IModToSpawnRequest { /** Slot mod will fit into */ @@ -24,4 +24,7 @@ export interface IModToSpawnRequest { modSpawnResult: ModSpawn; /** Weapon stats for weapon being generated */ weaponStats: IWeaponStats; + /** Array of item tpls the weapon does not support */ + conflictingItemTpls: Set; + botData: IBotData; } diff --git a/types/routers/HttpRouter.d.ts b/types/routers/HttpRouter.d.ts index 3fdb53f2..5eb9af31 100644 --- a/types/routers/HttpRouter.d.ts +++ b/types/routers/HttpRouter.d.ts @@ -1,4 +1,3 @@ -/// import { IncomingMessage } from "node:http"; import { DynamicRouter, Router, StaticRouter } from "@spt/di/Router"; export declare class HttpRouter { diff --git a/types/routers/ImageRouter.d.ts b/types/routers/ImageRouter.d.ts index eb3697f2..ca9afad0 100644 --- a/types/routers/ImageRouter.d.ts +++ b/types/routers/ImageRouter.d.ts @@ -1,4 +1,3 @@ -/// import { IncomingMessage, ServerResponse } from "node:http"; import { ImageRouteService } from "@spt/services/mod/image/ImageRouteService"; import { HttpFileUtil } from "@spt/utils/HttpFileUtil"; diff --git a/types/routers/serializers/BundleSerializer.d.ts b/types/routers/serializers/BundleSerializer.d.ts index dc71cd8b..91332ff0 100644 --- a/types/routers/serializers/BundleSerializer.d.ts +++ b/types/routers/serializers/BundleSerializer.d.ts @@ -1,4 +1,3 @@ -/// import { IncomingMessage, ServerResponse } from "node:http"; import { Serializer } from "@spt/di/Serializer"; import { BundleLoader } from "@spt/loaders/BundleLoader"; diff --git a/types/routers/serializers/ImageSerializer.d.ts b/types/routers/serializers/ImageSerializer.d.ts index 5c772437..92f06e34 100644 --- a/types/routers/serializers/ImageSerializer.d.ts +++ b/types/routers/serializers/ImageSerializer.d.ts @@ -1,4 +1,3 @@ -/// import { IncomingMessage, ServerResponse } from "node:http"; import { Serializer } from "@spt/di/Serializer"; import { ImageRouter } from "@spt/routers/ImageRouter"; diff --git a/types/routers/serializers/NotifySerializer.d.ts b/types/routers/serializers/NotifySerializer.d.ts index 8c07f81f..4e1f28d2 100644 --- a/types/routers/serializers/NotifySerializer.d.ts +++ b/types/routers/serializers/NotifySerializer.d.ts @@ -1,4 +1,3 @@ -/// import { IncomingMessage, ServerResponse } from "node:http"; import { NotifierController } from "@spt/controllers/NotifierController"; import { Serializer } from "@spt/di/Serializer"; diff --git a/types/servers/HttpServer.d.ts b/types/servers/HttpServer.d.ts index 52c59daf..e54d4a80 100644 --- a/types/servers/HttpServer.d.ts +++ b/types/servers/HttpServer.d.ts @@ -1,4 +1,3 @@ -/// import { IncomingMessage, ServerResponse } from "node:http"; import { ApplicationContext } from "@spt/context/ApplicationContext"; import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; diff --git a/types/servers/WebSocketServer.d.ts b/types/servers/WebSocketServer.d.ts index 61218247..f936d0f1 100644 --- a/types/servers/WebSocketServer.d.ts +++ b/types/servers/WebSocketServer.d.ts @@ -1,4 +1,3 @@ -/// import http, { IncomingMessage } from "node:http"; import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; import { ILogger } from "@spt/models/spt/utils/ILogger"; diff --git a/types/servers/http/IHttpListener.d.ts b/types/servers/http/IHttpListener.d.ts index ff148d64..50101489 100644 --- a/types/servers/http/IHttpListener.d.ts +++ b/types/servers/http/IHttpListener.d.ts @@ -1,4 +1,3 @@ -/// import { IncomingMessage, ServerResponse } from "node:http"; export interface IHttpListener { canHandle(sessionId: string, req: IncomingMessage): boolean; diff --git a/types/servers/http/SptHttpListener.d.ts b/types/servers/http/SptHttpListener.d.ts index ef681431..54499bf3 100644 --- a/types/servers/http/SptHttpListener.d.ts +++ b/types/servers/http/SptHttpListener.d.ts @@ -1,5 +1,3 @@ -/// -/// import { IncomingMessage, ServerResponse } from "node:http"; import { Serializer } from "@spt/di/Serializer"; import { ILogger } from "@spt/models/spt/utils/ILogger"; diff --git a/types/servers/ws/IWebSocketConnectionHandler.d.ts b/types/servers/ws/IWebSocketConnectionHandler.d.ts index 920dad49..9045dca8 100644 --- a/types/servers/ws/IWebSocketConnectionHandler.d.ts +++ b/types/servers/ws/IWebSocketConnectionHandler.d.ts @@ -1,4 +1,3 @@ -/// import { IncomingMessage } from "node:http"; import { WebSocket } from "ws"; export interface IWebSocketConnectionHandler { diff --git a/types/servers/ws/SptWebSocketConnectionHandler.d.ts b/types/servers/ws/SptWebSocketConnectionHandler.d.ts index c77c895d..cdfc42d9 100644 --- a/types/servers/ws/SptWebSocketConnectionHandler.d.ts +++ b/types/servers/ws/SptWebSocketConnectionHandler.d.ts @@ -1,5 +1,3 @@ -/// -/// import { IncomingMessage } from "node:http"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IWsNotificationEvent } from "@spt/models/eft/ws/IWsNotificationEvent"; diff --git a/types/services/InsuranceService.d.ts b/types/services/InsuranceService.d.ts index 9a579c5e..4ef88504 100644 --- a/types/services/InsuranceService.d.ts +++ b/types/services/InsuranceService.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; @@ -24,13 +25,14 @@ export declare class InsuranceService { protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected traderHelper: TraderHelper; + protected profileHelper: ProfileHelper; protected localisationService: LocalisationService; protected mailSendService: MailSendService; protected configServer: ConfigServer; protected cloner: ICloner; protected insured: Record>; protected insuranceConfig: IInsuranceConfig; - constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, profileHelper: ProfileHelper, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer, cloner: ICloner); /** * Does player have insurance array * @param sessionId Player id diff --git a/types/services/ProfileFixerService.d.ts b/types/services/ProfileFixerService.d.ts index 23dc3414..7b593c75 100644 --- a/types/services/ProfileFixerService.d.ts +++ b/types/services/ProfileFixerService.d.ts @@ -4,10 +4,9 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Bonus, HideoutSlot } from "@spt/models/eft/common/tables/IBotBase"; +import { HideoutSlot } from "@spt/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { StageBonus } from "@spt/models/eft/hideout/IHideoutArea"; import { IEquipmentBuild, IMagazineBuild, ISptProfile, IWeaponBuild } from "@spt/models/eft/profile/ISptProfile"; import { HideoutAreas } from "@spt/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; @@ -50,59 +49,33 @@ export declare class ProfileFixerService { */ checkForAndFixScavProfileIssues(scavProfile: IPmcData): void; /** - * Check for and cap profile skills at 5100. - * @param pmcProfile profile to check and fix - */ - protected checkForSkillsOverMaxLevel(pmcProfile: IPmcData): void; - protected addMissingGunStandContainerImprovements(pmcProfile: IPmcData): void; - protected addMissingHallOfFameContainerImprovements(pmcProfile: IPmcData): void; - protected ensureGunStandLevelsMatch(pmcProfile: IPmcData): void; - protected addHideoutAreaStashes(pmcProfile: IPmcData): void; - protected addMissingHideoutWallAreas(pmcProfile: IPmcData): void; - /** - * Add tag to profile to indicate when it was made - * @param fullProfile + * Attempt to fix common item issues that corrupt profiles + * @param pmcProfile Profile to check items of */ - addMissingSptVersionTagToProfile(fullProfile: ISptProfile): void; + fixProfileBreakingInventoryItemIssues(pmcProfile: IPmcData): void; /** * TODO - make this non-public - currently used by RepeatableQuestController * Remove unused condition counters * @param pmcProfile profile to remove old counters from */ removeDanglingConditionCounters(pmcProfile: IPmcData): void; - addLighthouseKeeperIfMissing(pmcProfile: IPmcData): void; - protected addUnlockedInfoObjectIfMissing(pmcProfile: IPmcData): void; /** * Repeatable quests leave behind TaskConditionCounter objects that make the profile bloat with time, remove them * @param pmcProfile Player profile to check */ protected removeDanglingTaskConditionCounters(pmcProfile: IPmcData): void; protected getActiveRepeatableQuests(repeatableQuests: IPmcDataRepeatableQuest[]): IRepeatableQuest[]; - protected fixNullTraderSalesSums(pmcProfile: IPmcData): void; - protected addMissingBonusesProperty(pmcProfile: IPmcData): void; - /** - * Adjust profile quest status and statusTimers object values - * quest.status is numeric e.g. 2 - * quest.statusTimers keys are numeric as strings e.g. "2" - * @param profile profile to update - */ - protected updateProfileQuestDataValues(profile: IPmcData): void; - protected addMissingRepeatableQuestsProperty(pmcProfile: IPmcData): void; /** - * Some profiles have hideout maxed and therefore no improvements - * @param pmcProfile Profile to add improvement data to - */ - protected addMissingWallImprovements(pmcProfile: IPmcData): void; - /** - * A new property was added to slot items "locationIndex", if this is missing, the hideout slot item must be removed - * @param pmcProfile Profile to find and remove slots from + * After removing mods that add quests, the quest panel will break without removing these + * @param pmcProfile Profile to remove dead quests from */ - protected removeResourcesFromSlotsInHideoutWithoutLocationIndexValue(pmcProfile: IPmcData): void; + protected removeOrphanedQuests(pmcProfile: IPmcData): void; /** - * Hideout slots need to be in a specific order, locationIndex in ascending order - * @param pmcProfile profile to edit + * If the profile has elite Hideout Managment skill, add the additional slots from globals + * NOTE: This seems redundant, but we will leave it here just incase. + * @param pmcProfile profile to add slots to */ - protected reorderHideoutAreasWithResouceInputs(pmcProfile: IPmcData): void; + protected addHideoutEliteSlots(pmcProfile: IPmcData): void; /** * add in objects equal to the number of slots * @param areaType area to check @@ -111,16 +84,10 @@ export declare class ProfileFixerService { protected addEmptyObjectsToHideoutAreaSlots(areaType: HideoutAreas, emptyItemCount: number, pmcProfile: IPmcData): void; protected addObjectsToArray(count: number, slots: HideoutSlot[]): HideoutSlot[]; /** - * Iterate over players hideout areas and find what's build, look for missing bonuses those areas give and add them if missing - * @param pmcProfile Profile to update - */ - addMissingHideoutBonusesToProfile(pmcProfile: IPmcData): void; - /** - * @param profileBonuses bonuses from profile - * @param bonus bonus to find - * @returns matching bonus + * Check for and cap profile skills at 5100. + * @param pmcProfile profile to check and fix */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; + protected checkForSkillsOverMaxLevel(pmcProfile: IPmcData): void; /** * Checks profile inventiory for items that do not exist inside the items db * @param sessionId Session id @@ -140,59 +107,4 @@ export declare class ProfileFixerService { * @returns True if the build should be removed from the build list, false otherwise */ protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; - /** - * Attempt to fix common item issues that corrupt profiles - * @param pmcProfile Profile to check items of - */ - fixProfileBreakingInventoryItemIssues(pmcProfile: IPmcData): void; - /** - * Add `Improvements` object to hideout if missing - added in eft 13.0.21469 - * @param pmcProfile profile to update - */ - addMissingUpgradesPropertyToHideout(pmcProfile: IPmcData): void; - /** - * Iterate over associated profile template and check all hideout areas exist, add if not - * @param fullProfile Profile to update - */ - addMissingHideoutAreasToProfile(fullProfile: ISptProfile): void; - /** - * These used to be used for storing scav case rewards, rewards are now generated on pickup - * @param pmcProfile Profile to update - */ - removeLegacyScavCaseProductionCrafts(pmcProfile: IPmcData): void; - /** - * 3.7.0 moved AIDs to be numeric, old profiles need to be migrated - * We store the old AID value in new field `sessionId` - * @param fullProfile Profile to update - */ - fixIncorrectAidValue(fullProfile: ISptProfile): void; - /** - * Bsg nested `stats` into a sub object called 'eft' - * @param fullProfile Profile to check for and migrate stats data - */ - migrateStatsToNewStructure(fullProfile: ISptProfile): void; - /** - * 26126 (7th August) requires bonuses to have an ID, these were not included in the default profile presets - * @param pmcProfile Profile to add missing IDs to - */ - addMissingIdsToBonuses(pmcProfile: IPmcData): void; - /** - * 3.8.0 utilized the wrong ProductionTime for bitcoin, fix it if it's found - */ - fixBitcoinProductionTime(pmcProfile: IPmcData): void; - /** - * At some point the property name was changed,migrate data across to new name - * @param pmcProfile Profile to migrate improvements in - */ - protected migrateImprovements(pmcProfile: IPmcData): void; - /** - * After removing mods that add quests, the quest panel will break without removing these - * @param pmcProfile Profile to remove dead quests from - */ - protected removeOrphanedQuests(pmcProfile: IPmcData): void; - /** - * If someone has run a mod from pre-3.8.0, it results in an invalid `nextResupply` value - * Resolve this by setting the nextResupply to 0 if it's undefined - */ - protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/types/services/RagfairTaxService.d.ts b/types/services/RagfairTaxService.d.ts index effb9f06..ab263661 100644 --- a/types/services/RagfairTaxService.d.ts +++ b/types/services/RagfairTaxService.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; @@ -6,13 +7,16 @@ import { IStorePlayerOfferTaxAmountRequestData } from "@spt/models/eft/ragfair/I import { ILogger } from "@spt/models/spt/utils/ILogger"; import { DatabaseService } from "@spt/services/DatabaseService"; import { RagfairPriceService } from "@spt/services/RagfairPriceService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairTaxService { protected logger: ILogger; protected databaseService: DatabaseService; protected ragfairPriceService: RagfairPriceService; protected itemHelper: ItemHelper; + protected profileHelper: ProfileHelper; + protected cloner: ICloner; protected playerOfferTaxCache: Record; - constructor(logger: ILogger, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, itemHelper: ItemHelper); + constructor(logger: ILogger, databaseService: DatabaseService, ragfairPriceService: RagfairPriceService, itemHelper: ItemHelper, profileHelper: ProfileHelper, cloner: ICloner); storeClientOfferTaxValue(sessionId: string, offer: IStorePlayerOfferTaxAmountRequestData): void; clearStoredOfferTaxById(offerIdToRemove: string): void; getStoredClientOfferTaxValueById(offerIdToGet: string): IStorePlayerOfferTaxAmountRequestData; diff --git a/types/services/mod/httpListener/HttpListenerMod.d.ts b/types/services/mod/httpListener/HttpListenerMod.d.ts index 75e42eef..84c46c3c 100644 --- a/types/services/mod/httpListener/HttpListenerMod.d.ts +++ b/types/services/mod/httpListener/HttpListenerMod.d.ts @@ -1,4 +1,3 @@ -/// import { IncomingMessage, ServerResponse } from "node:http"; import { IHttpListener } from "@spt/servers/http/IHttpListener"; export declare class HttpListenerMod implements IHttpListener { diff --git a/types/services/mod/httpListener/HttpListenerModService.d.ts b/types/services/mod/httpListener/HttpListenerModService.d.ts index 23abfbed..ba73afe3 100644 --- a/types/services/mod/httpListener/HttpListenerModService.d.ts +++ b/types/services/mod/httpListener/HttpListenerModService.d.ts @@ -1,4 +1,3 @@ -/// import { IncomingMessage, ServerResponse } from "node:http"; import { DependencyContainer } from "tsyringe"; export declare class HttpListenerModService { diff --git a/types/utils/HashUtil.d.ts b/types/utils/HashUtil.d.ts index 427c1860..195dcdb4 100644 --- a/types/utils/HashUtil.d.ts +++ b/types/utils/HashUtil.d.ts @@ -1,5 +1,3 @@ -/// -/// import crypto from "node:crypto"; import fs from "node:fs"; import { TimeUtil } from "@spt/utils/TimeUtil"; diff --git a/types/utils/HttpFileUtil.d.ts b/types/utils/HttpFileUtil.d.ts index cc0d9ef4..57f21c85 100644 --- a/types/utils/HttpFileUtil.d.ts +++ b/types/utils/HttpFileUtil.d.ts @@ -1,4 +1,3 @@ -/// import { ServerResponse } from "node:http"; import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; export declare class HttpFileUtil { diff --git a/types/utils/ObjectId.d.ts b/types/utils/ObjectId.d.ts index 91f64d33..4f873447 100644 --- a/types/utils/ObjectId.d.ts +++ b/types/utils/ObjectId.d.ts @@ -1,4 +1,3 @@ -/// import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class ObjectId { protected timeUtil: TimeUtil; diff --git a/types/utils/VFS.d.ts b/types/utils/VFS.d.ts index 6287a2fa..9c4fcc2e 100644 --- a/types/utils/VFS.d.ts +++ b/types/utils/VFS.d.ts @@ -1,5 +1,3 @@ -/// -/// import "reflect-metadata"; import fs from "node:fs"; import { IAsyncQueue } from "@spt/models/spt/utils/IAsyncQueue"; diff --git a/types/utils/logging/AbstractWinstonLogger.d.ts b/types/utils/logging/AbstractWinstonLogger.d.ts index ef544348..b850284a 100644 --- a/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/types/utils/logging/AbstractWinstonLogger.d.ts @@ -1,4 +1,3 @@ -/// import fs from "node:fs"; import { Daum } from "@spt/models/eft/itemEvent/IItemEventRouterRequest"; import { LogBackgroundColor } from "@spt/models/spt/logging/LogBackgroundColor"; From 597ccf083174c0a49dadd127d96b94f632c902ed Mon Sep 17 00:00:00 2001 From: nexus4880 <38168516+nexus4880@users.noreply.github.com> Date: Mon, 8 Jul 2024 06:17:05 -0700 Subject: [PATCH 007/119] Feature: Fix duplicate insurance Co-authored-by: nexus4880 <38168516+nexus4880@users.noreply.github.com> Co-authored-by: Lacyway <20912169+Lacyway@users.noreply.github.com> --- src/controllers/FikaRaidController.ts | 2 +- src/di/Container.ts | 5 + src/overrides/controllers/MatchController.ts | 33 ++++ src/services/FikaInsuranceService.ts | 155 +++++++++++++++++++ src/services/FikaMatchService.ts | 12 +- 5 files changed, 205 insertions(+), 2 deletions(-) create mode 100644 src/overrides/controllers/MatchController.ts create mode 100644 src/services/FikaInsuranceService.ts diff --git a/src/controllers/FikaRaidController.ts b/src/controllers/FikaRaidController.ts index 7256e7b1..7e5f7883 100644 --- a/src/controllers/FikaRaidController.ts +++ b/src/controllers/FikaRaidController.ts @@ -34,7 +34,7 @@ export class FikaRaidController { @inject("FikaDedicatedRaidWebSocket") protected fikaDedicatedRaidWebSocket: FikaDedicatedRaidWebSocket, @inject("ProfileHelper") protected profileHelper: ProfileHelper, @inject("WinstonLogger") protected logger: ILogger, - @inject("InraidController") protected inraidController: InraidController, + @inject("InraidController") protected inraidController: InraidController ) { // empty } diff --git a/src/di/Container.ts b/src/di/Container.ts index bc355297..b53f609a 100644 --- a/src/di/Container.ts +++ b/src/di/Container.ts @@ -11,11 +11,13 @@ import { ProfileControllerOverride } from "../overrides/controllers/ProfileContr // import { LocalesOverride } from "../overrides/other/Locales"; import { HttpRouterOverride } from "../overrides/routers/HttpRouter"; import { DatabaseServiceOverride } from "../overrides/services/FikaDatabaseService"; +import { MatchControllerOverride } from "../overrides/controllers/MatchController"; import { FikaMatchService } from "../services/FikaMatchService"; import { FikaFriendRequestsCacheService } from "../services/cache/FikaFriendRequestsCacheService"; import { FikaPlayerRelationsCacheService } from "../services/cache/FikaPlayerRelationsCacheService"; import { FikaDedicatedRaidService } from "../services/dedicated/FikaDedicatedRaidService"; +import { FikaInsuranceService } from "../services/FikaInsuranceService"; import { FikaClientModHashesHelper } from "../helpers/FikaClientModHashesHelper"; import { FikaFriendRequestsHelper } from "../helpers/FikaFriendRequestsHelper"; @@ -81,6 +83,7 @@ export class Container { container.registerType("Overrides", "AchievementControllerOverride"); container.registerType("Overrides", "DatabaseServiceOverride"); container.registerType("Overrides", "LocationLifecycleServiceOverride"); + container.registerType("Overrides", "MatchControllerOverride"); container.registerType("StaticRoutes", "FikaClientStaticRouter"); container.registerType("StaticRoutes", "FikaLocationStaticRouter"); @@ -107,6 +110,7 @@ export class Container { container.register("AchievementControllerOverride", AchievementControllerOverride, { lifecycle: Lifecycle.Singleton }); container.register("DatabaseServiceOverride", DatabaseServiceOverride, { lifecycle: Lifecycle.Singleton }); container.register("LocationLifecycleServiceOverride", LocationLifecycleServiceOverride, { lifecycle: Lifecycle.Singleton }); + container.register("MatchControllerOverride", MatchControllerOverride, { lifecycle: Lifecycle.Singleton }); } private static registerServices(container: DependencyContainer): void { @@ -115,6 +119,7 @@ export class Container { container.register("FikaPlayerRelationsCacheService", FikaPlayerRelationsCacheService, { lifecycle: Lifecycle.Singleton }); container.register("FikaDedicatedRaidService", FikaDedicatedRaidService, { lifecycle: Lifecycle.Singleton }); container.register("FikaDedicatedProfileService", FikaDedicatedProfileService, { lifecycle: Lifecycle.Singleton }); + container.register("FikaInsuranceService", FikaInsuranceService, { lifecycle: Lifecycle.Singleton }); } private static registerHelpers(container: DependencyContainer): void { diff --git a/src/overrides/controllers/MatchController.ts b/src/overrides/controllers/MatchController.ts new file mode 100644 index 00000000..8d165c9c --- /dev/null +++ b/src/overrides/controllers/MatchController.ts @@ -0,0 +1,33 @@ +import { DependencyContainer, inject, injectable } from "tsyringe"; +import { MatchController } from "@spt/controllers/MatchController"; +import { Override } from "../../di/Override"; +import { FikaInsuranceService } from "../../services/FikaInsuranceService"; +import { FikaMatchService } from "../../services/FikaMatchService"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { IEndLocalRaidRequestData } from "@spt/models/eft/match/IEndLocalRaidRequestData"; + +@injectable() +export class MatchControllerOverride extends Override { + constructor( + @inject("FikaInsuranceService") protected fikaInsuranceService: FikaInsuranceService, + @inject("FikaMatchService") protected fikaMatchService: FikaMatchService, + @inject("WinstonLogger") protected logger: ILogger, + ) { + super(); + } + + public execute(container: DependencyContainer): void { + container.afterResolution( + "MatchController", + (_t, result: MatchController) => { + result.endLocalRaid = (sessionId: string, request: IEndLocalRaidRequestData) => { + const match = this.fikaInsuranceService.getMatchId(sessionId); + if (match) { + this.fikaInsuranceService.onEndLocalRaidRequest(sessionId, match, request); + } + }; + }, + { frequency: "Always" }, + ); + } +} diff --git a/src/services/FikaInsuranceService.ts b/src/services/FikaInsuranceService.ts new file mode 100644 index 00000000..856f7c4d --- /dev/null +++ b/src/services/FikaInsuranceService.ts @@ -0,0 +1,155 @@ +import { MatchController } from "@spt/controllers/MatchController"; +import { ItemHelper } from "@spt/helpers/ItemHelper"; +import { IEndLocalRaidRequestData } from "@spt/models/eft/match/IEndLocalRaidRequestData"; +import { BaseClasses } from "@spt/models/enums/BaseClasses"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { SaveServer } from "@spt/servers/SaveServer"; +import { InsuranceService } from "@spt/services/InsuranceService"; +import { inject, injectable } from "tsyringe"; + +export interface IFikaInsurancePlayer { + sessionID: string, + lostItems: string[], + foundItems: string[], + inventory: string[] +} + +@injectable() +export class FikaInsuranceService { + private matchInsuranceInfo: Record; + + constructor( + @inject("SaveServer") protected saveServer: SaveServer, + @inject("InsuranceService") protected insuranceService: InsuranceService, + @inject("ItemHelper") protected itemHelper : ItemHelper, + @inject("MatchController") protected matchController: MatchController, + @inject("WinstonLogger") protected logger: ILogger, + ) { + this.matchInsuranceInfo = {}; + } + + public getMatchId(sessionID: string) : string { + for (const matchId in this.matchInsuranceInfo) { + const match = this.matchInsuranceInfo[matchId]; + + if (match.find(player => player.sessionID == sessionID)) { + return matchId; + } + } + } + + public addPlayerToMatchId(matchId: string, sessionID: string) : void { + if (!(matchId in this.matchInsuranceInfo)) { + this.matchInsuranceInfo[matchId] = []; + } + + let Data = {} as IFikaInsurancePlayer; + Data.sessionID = sessionID; + Data.foundItems = []; + + this.matchInsuranceInfo[matchId].push(Data); + } + + public onEndLocalRaidRequest(sessionID: string, matchId: string, endLocalRaidRequest: IEndLocalRaidRequestData) : void { + if (!(matchId in this.matchInsuranceInfo)) { + return; + } + + const match = this.matchInsuranceInfo[matchId]; + + for (const player of match) { + if(player.sessionID != sessionID) { + continue; + } + + // Map both the lost items and the current inventory + player.lostItems = endLocalRaidRequest.lostInsuredItems.map(i => i._id); + player.inventory = endLocalRaidRequest.results.profile.Inventory.items.map(i => i._id); + } + + MatchController.prototype.endLocalRaid.call(this.matchController, sessionID, endLocalRaidRequest); + } + + public onMatchEnd(matchId: string) : void { + if (!(matchId in this.matchInsuranceInfo)) { + return; + } + + const match = this.matchInsuranceInfo[matchId]; + + match.forEach((player) => { + match.forEach((nextPlayer) => { + // Don't need to check the player we have in the base loop + if (player.sessionID == nextPlayer.sessionID) { + return; + } + + // Find overlap between players other than the initial player we're looping over, if it contains the lost item id of the initial player we add it to foundItems + const overlap = nextPlayer.inventory.filter(i => player.lostItems.includes(i)); + + // Add said overlap to player's found items + player.foundItems = player.foundItems.concat(overlap); + }); + + if (player.foundItems.length > 0) { + this.logger.debug(`${player.sessionID} will lose ${player.foundItems.length}/${player.lostItems.length} items in insurance`); + this.removeItemsFromInsurance(player.sessionID, player.foundItems); + } + }); + + delete this.matchInsuranceInfo[matchId]; + } + + private removeItemsFromInsurance(sessionID: string, ids: string[]) : void { + const profile = this.saveServer.getProfile(sessionID); + + for (let insuranceIndex = 0; insuranceIndex < profile.insurance.length; insuranceIndex++) { + let insurance = profile.insurance[insuranceIndex]; + + for (const idToRemove of ids) { + const insuredItemIndex = insurance.items.findIndex(i => i._id == idToRemove); + + if (insuredItemIndex != -1) { + const item = insurance.items[insuredItemIndex]; + this.logger.info(`Found ${item._id} which will be removed`); + + // Remove soft inserts out of armors + if (this.itemHelper.isOfBaseclass(item._tpl, BaseClasses.ARMOR)) { + this.logger.info(`[Fika Insurance] ${item._id} is a armor`); + + // Copy the original array, when we splice into the original array while looping over it we will skip certain items. + let insuranceItems = Array.from(insurance.items); + + insuranceItems.forEach((innerItem) => { + this.logger.info(`[Fika Insurance] Inner item: ${innerItem._id}`); + + if(innerItem.parentId == item._id && this.itemHelper.isOfBaseclass(innerItem._tpl, BaseClasses.BUILT_IN_INSERTS)) { + // There's mods that allow you to take soft inserts out and those will most likely have insurance set, dont need to remove those here. + if(!ids.includes(innerItem._id)) { + this.logger.info(`[Fika Insurance] Removing soft insert ${innerItem._id} of armor ${item._id}`); + + const innerItemIndex = insurance.items.findIndex(i => i._id == innerItem._id); + + insurance.items.splice(innerItemIndex, 1); + } + } + }); + } + + // Remove the original item + insurance.items.splice(insuredItemIndex, 1); + } + } + + if (insurance.items.length == 0) { + this.logger.debug("No more insured items left, deleting this entry"); + profile.insurance.splice(insuranceIndex, 1); + insuranceIndex--; + } + else { + // Update existing insured item list + profile.insurance[insuranceIndex] = insurance; + } + } + } +} diff --git a/src/services/FikaMatchService.ts b/src/services/FikaMatchService.ts index eadaacd9..5951a78c 100644 --- a/src/services/FikaMatchService.ts +++ b/src/services/FikaMatchService.ts @@ -6,12 +6,14 @@ import { SaveServer } from "@spt/servers/SaveServer"; import { FikaMatchEndSessionMessage } from "../models/enums/FikaMatchEndSessionMessages"; import { FikaMatchStatus } from "../models/enums/FikaMatchStatus"; +import { FikaSide } from "../models/enums/FikaSide"; import { IFikaMatch } from "../models/fika/IFikaMatch"; import { IFikaPlayer } from "../models/fika/IFikaPlayer"; import { IFikaRaidCreateRequestData } from "../models/fika/routes/raid/create/IFikaRaidCreateRequestData"; import { FikaConfig } from "../utils/FikaConfig"; import { FikaDedicatedRaidService } from "./dedicated/FikaDedicatedRaidService"; +import { FikaInsuranceService } from "./FikaInsuranceService"; @injectable() export class FikaMatchService { @@ -24,6 +26,7 @@ export class FikaMatchService { @inject("SaveServer") protected saveServer: SaveServer, @inject("FikaConfig") protected fikaConfig: FikaConfig, @inject("FikaDedicatedRaidService") protected fikaDedicatedRaidService: FikaDedicatedRaidService, + @inject("FikaInsuranceService") protected fikaInsuranceService: FikaInsuranceService, ) { this.matches = new Map(); this.timeoutIntervals = new Map(); @@ -236,6 +239,7 @@ export class FikaMatchService { delete this.fikaDedicatedRaidService.requestedSessions[matchId]; } + this.fikaInsuranceService.onMatchEnd(matchId); this.deleteMatch(matchId); } @@ -298,7 +302,13 @@ export class FikaMatchService { return; } - this.matches.get(matchId).players.set(playerId, data); + const match = this.matches.get(matchId); + match.players.set(playerId, data); + + if (match.side.toString() == "Pmc") + { + this.fikaInsuranceService.addPlayerToMatchId(matchId, playerId); + } } /** From cc7b92a43982e514ca38e7ab57337b2f77a9dbeb Mon Sep 17 00:00:00 2001 From: Archangel Date: Thu, 29 Aug 2024 18:24:44 +0200 Subject: [PATCH 008/119] Update search to also nuke helmet inserts --- src/services/FikaInsuranceService.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/services/FikaInsuranceService.ts b/src/services/FikaInsuranceService.ts index 856f7c4d..1207576c 100644 --- a/src/services/FikaInsuranceService.ts +++ b/src/services/FikaInsuranceService.ts @@ -111,22 +111,22 @@ export class FikaInsuranceService { if (insuredItemIndex != -1) { const item = insurance.items[insuredItemIndex]; - this.logger.info(`Found ${item._id} which will be removed`); + this.logger.debug(`[Fika Insurance] Found ${item._id} which will be removed`); // Remove soft inserts out of armors - if (this.itemHelper.isOfBaseclass(item._tpl, BaseClasses.ARMOR)) { - this.logger.info(`[Fika Insurance] ${item._id} is a armor`); + if (this.itemHelper.isOfBaseclass(item._tpl, BaseClasses.ARMOR) || this.itemHelper.isOfBaseclass(item._tpl, BaseClasses.HEADWEAR)) { + this.logger.debug(`[Fika Insurance] ${item._id} is an armor or helmet`); // Copy the original array, when we splice into the original array while looping over it we will skip certain items. let insuranceItems = Array.from(insurance.items); insuranceItems.forEach((innerItem) => { - this.logger.info(`[Fika Insurance] Inner item: ${innerItem._id}`); + this.logger.debug(`[Fika Insurance] Inner item: ${innerItem._id}`); if(innerItem.parentId == item._id && this.itemHelper.isOfBaseclass(innerItem._tpl, BaseClasses.BUILT_IN_INSERTS)) { // There's mods that allow you to take soft inserts out and those will most likely have insurance set, dont need to remove those here. if(!ids.includes(innerItem._id)) { - this.logger.info(`[Fika Insurance] Removing soft insert ${innerItem._id} of armor ${item._id}`); + this.logger.debug(`[Fika Insurance] Removing soft insert ${innerItem._id} of item ${item._id}`); const innerItemIndex = insurance.items.findIndex(i => i._id == innerItem._id); From 10e44cfc0a52becafc749d386974006adb36408f Mon Sep 17 00:00:00 2001 From: Archangel Date: Thu, 29 Aug 2024 23:59:11 +0200 Subject: [PATCH 009/119] Handle raids ending without finishing --- src/services/FikaInsuranceService.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/services/FikaInsuranceService.ts b/src/services/FikaInsuranceService.ts index 1207576c..a023a9d1 100644 --- a/src/services/FikaInsuranceService.ts +++ b/src/services/FikaInsuranceService.ts @@ -9,6 +9,7 @@ import { inject, injectable } from "tsyringe"; export interface IFikaInsurancePlayer { sessionID: string, + endedRaid: boolean, lostItems: string[], foundItems: string[], inventory: string[] @@ -45,6 +46,7 @@ export class FikaInsuranceService { let Data = {} as IFikaInsurancePlayer; Data.sessionID = sessionID; + Data.endedRaid = false; Data.foundItems = []; this.matchInsuranceInfo[matchId].push(Data); @@ -65,6 +67,7 @@ export class FikaInsuranceService { // Map both the lost items and the current inventory player.lostItems = endLocalRaidRequest.lostInsuredItems.map(i => i._id); player.inventory = endLocalRaidRequest.results.profile.Inventory.items.map(i => i._id); + player.endedRaid = true; } MatchController.prototype.endLocalRaid.call(this.matchController, sessionID, endLocalRaidRequest); @@ -84,6 +87,11 @@ export class FikaInsuranceService { return; } + if (!player.endedRaid) + { + return; + } + // Find overlap between players other than the initial player we're looping over, if it contains the lost item id of the initial player we add it to foundItems const overlap = nextPlayer.inventory.filter(i => player.lostItems.includes(i)); From cf40b4fe9621e5e2b76551fc437311833517d7de Mon Sep 17 00:00:00 2001 From: Archangel Date: Fri, 30 Aug 2024 00:02:14 +0200 Subject: [PATCH 010/119] Return if player & nextPlayer have not finished the raid --- src/services/FikaInsuranceService.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/services/FikaInsuranceService.ts b/src/services/FikaInsuranceService.ts index a023a9d1..de1abaa0 100644 --- a/src/services/FikaInsuranceService.ts +++ b/src/services/FikaInsuranceService.ts @@ -81,14 +81,17 @@ export class FikaInsuranceService { const match = this.matchInsuranceInfo[matchId]; match.forEach((player) => { + if (!player.endedRaid) { + return; + } + match.forEach((nextPlayer) => { // Don't need to check the player we have in the base loop if (player.sessionID == nextPlayer.sessionID) { return; } - if (!player.endedRaid) - { + if (!nextPlayer.endedRaid) { return; } From 21834198af7fa2776a1c7d6e37cfef8fc28caec1 Mon Sep 17 00:00:00 2001 From: Archangel Date: Fri, 30 Aug 2024 00:13:26 +0200 Subject: [PATCH 011/119] Update comment --- src/services/FikaInsuranceService.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/services/FikaInsuranceService.ts b/src/services/FikaInsuranceService.ts index de1abaa0..d9be6d64 100644 --- a/src/services/FikaInsuranceService.ts +++ b/src/services/FikaInsuranceService.ts @@ -81,6 +81,7 @@ export class FikaInsuranceService { const match = this.matchInsuranceInfo[matchId]; match.forEach((player) => { + // This player either crashed or the raid ended prematurely, eitherway we skip him. if (!player.endedRaid) { return; } @@ -91,6 +92,7 @@ export class FikaInsuranceService { return; } + // This player either crashed or the raid ended prematurely, eitherway we skip him. if (!nextPlayer.endedRaid) { return; } From 4a9d007c44aff8e4eb3ed2d2289ae9a5a9ba6546 Mon Sep 17 00:00:00 2001 From: Archangel Date: Fri, 30 Aug 2024 00:37:15 +0200 Subject: [PATCH 012/119] Remove unused insuranceService --- src/services/FikaInsuranceService.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/services/FikaInsuranceService.ts b/src/services/FikaInsuranceService.ts index d9be6d64..5e574c1b 100644 --- a/src/services/FikaInsuranceService.ts +++ b/src/services/FikaInsuranceService.ts @@ -4,7 +4,6 @@ import { IEndLocalRaidRequestData } from "@spt/models/eft/match/IEndLocalRaidReq import { BaseClasses } from "@spt/models/enums/BaseClasses"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { SaveServer } from "@spt/servers/SaveServer"; -import { InsuranceService } from "@spt/services/InsuranceService"; import { inject, injectable } from "tsyringe"; export interface IFikaInsurancePlayer { @@ -21,7 +20,6 @@ export class FikaInsuranceService { constructor( @inject("SaveServer") protected saveServer: SaveServer, - @inject("InsuranceService") protected insuranceService: InsuranceService, @inject("ItemHelper") protected itemHelper : ItemHelper, @inject("MatchController") protected matchController: MatchController, @inject("WinstonLogger") protected logger: ILogger, From 39d3b00c93790da8a75a34e46f27cfe1fa07f22e Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Sat, 31 Aug 2024 10:30:36 +0200 Subject: [PATCH 013/119] Remove friends that cannot be found --- src/controllers/FikaDialogueController.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/controllers/FikaDialogueController.ts b/src/controllers/FikaDialogueController.ts index c9f9caa2..60365efd 100644 --- a/src/controllers/FikaDialogueController.ts +++ b/src/controllers/FikaDialogueController.ts @@ -54,6 +54,11 @@ export class FikaDialogueController { for (const friendId of friendsIds) { const profile = this.profileHelper.getPmcProfile(friendId); + if (!profile) { + this.fikaPlayerRelationsHelper.removeFriend(sessionID, friendId); + continue; + } + botsAndFriends.push({ _id: profile._id, aid: profile.aid, From 24567e5cf5e9d7095512c4b275b6467f25f07572 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Sat, 31 Aug 2024 10:30:53 +0200 Subject: [PATCH 014/119] Bump version --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 81f152f0..982b43f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "server", - "version": "2.2.8", + "version": "2.3.0", "sptVersion": "~3.10", "main": "src/mod.js", "scripts": { @@ -21,4 +21,4 @@ }, "author": "Fika", "license": "CC-BY-NC-SA-4.0" -} +} \ No newline at end of file From b04c4f7410a067cee79baffc84433fb32419b3d5 Mon Sep 17 00:00:00 2001 From: Archangel Date: Sat, 31 Aug 2024 16:05:15 +0200 Subject: [PATCH 015/119] If matchId isn't found, immediately return back to SPT endLocalRaid --- src/services/FikaInsuranceService.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/services/FikaInsuranceService.ts b/src/services/FikaInsuranceService.ts index 5e574c1b..63b71ccc 100644 --- a/src/services/FikaInsuranceService.ts +++ b/src/services/FikaInsuranceService.ts @@ -52,6 +52,9 @@ export class FikaInsuranceService { public onEndLocalRaidRequest(sessionID: string, matchId: string, endLocalRaidRequest: IEndLocalRaidRequestData) : void { if (!(matchId in this.matchInsuranceInfo)) { + this.logger.error("[Fika Insurance] onEndLocalRaidRequest: matchId not found!") + + MatchController.prototype.endLocalRaid.call(this.matchController, sessionID, endLocalRaidRequest); return; } From bc3d36743be51c7e4342cc390a8a85325983c557 Mon Sep 17 00:00:00 2001 From: Archangel Date: Sat, 31 Aug 2024 16:09:49 +0200 Subject: [PATCH 016/119] Handle checking for match in onEndLocalRaidRequest --- src/overrides/controllers/MatchController.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/overrides/controllers/MatchController.ts b/src/overrides/controllers/MatchController.ts index 8d165c9c..3f685c80 100644 --- a/src/overrides/controllers/MatchController.ts +++ b/src/overrides/controllers/MatchController.ts @@ -21,10 +21,7 @@ export class MatchControllerOverride extends Override { "MatchController", (_t, result: MatchController) => { result.endLocalRaid = (sessionId: string, request: IEndLocalRaidRequestData) => { - const match = this.fikaInsuranceService.getMatchId(sessionId); - if (match) { - this.fikaInsuranceService.onEndLocalRaidRequest(sessionId, match, request); - } + this.fikaInsuranceService.onEndLocalRaidRequest(sessionId, this.fikaInsuranceService.getMatchId(sessionId), request); }; }, { frequency: "Always" }, From c7b7dfa6306b805b7bc744f090412d223316c357 Mon Sep 17 00:00:00 2001 From: Archangel Date: Sat, 31 Aug 2024 16:18:43 +0200 Subject: [PATCH 017/119] Update comment --- src/services/FikaInsuranceService.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/services/FikaInsuranceService.ts b/src/services/FikaInsuranceService.ts index 63b71ccc..6bc87ce0 100644 --- a/src/services/FikaInsuranceService.ts +++ b/src/services/FikaInsuranceService.ts @@ -54,6 +54,7 @@ export class FikaInsuranceService { if (!(matchId in this.matchInsuranceInfo)) { this.logger.error("[Fika Insurance] onEndLocalRaidRequest: matchId not found!") + // Pass back to SPT so thaat the player can save. MatchController.prototype.endLocalRaid.call(this.matchController, sessionID, endLocalRaidRequest); return; } @@ -71,6 +72,7 @@ export class FikaInsuranceService { player.endedRaid = true; } + // Pass back to SPT so thaat the player can save. MatchController.prototype.endLocalRaid.call(this.matchController, sessionID, endLocalRaidRequest); } From 5491d77809722797d7a9fe14b9d88f30e2da86a2 Mon Sep 17 00:00:00 2001 From: Archangel Date: Sat, 31 Aug 2024 16:41:01 +0200 Subject: [PATCH 018/119] typo --- src/services/FikaInsuranceService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/FikaInsuranceService.ts b/src/services/FikaInsuranceService.ts index 6bc87ce0..0f779abe 100644 --- a/src/services/FikaInsuranceService.ts +++ b/src/services/FikaInsuranceService.ts @@ -54,7 +54,7 @@ export class FikaInsuranceService { if (!(matchId in this.matchInsuranceInfo)) { this.logger.error("[Fika Insurance] onEndLocalRaidRequest: matchId not found!") - // Pass back to SPT so thaat the player can save. + // Pass back to SPT so that the player can save. MatchController.prototype.endLocalRaid.call(this.matchController, sessionID, endLocalRaidRequest); return; } @@ -72,7 +72,7 @@ export class FikaInsuranceService { player.endedRaid = true; } - // Pass back to SPT so thaat the player can save. + // Pass back to SPT so that the player can save. MatchController.prototype.endLocalRaid.call(this.matchController, sessionID, endLocalRaidRequest); } From 14d19f8bfbf2e521897f1c5de325212921d9181a Mon Sep 17 00:00:00 2001 From: Archangel Date: Tue, 3 Sep 2024 15:22:36 +0200 Subject: [PATCH 019/119] Allow scavs to also be processed through the InsuranceService so that error goes away --- src/services/FikaMatchService.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/services/FikaMatchService.ts b/src/services/FikaMatchService.ts index 5951a78c..e610243a 100644 --- a/src/services/FikaMatchService.ts +++ b/src/services/FikaMatchService.ts @@ -305,10 +305,7 @@ export class FikaMatchService { const match = this.matches.get(matchId); match.players.set(playerId, data); - if (match.side.toString() == "Pmc") - { - this.fikaInsuranceService.addPlayerToMatchId(matchId, playerId); - } + this.fikaInsuranceService.addPlayerToMatchId(matchId, playerId); } /** From 49f338aa8bb939ff6b777e7c2c87f2df92d4df15 Mon Sep 17 00:00:00 2001 From: Archangel Date: Thu, 5 Sep 2024 16:04:59 +0200 Subject: [PATCH 020/119] Store sent items for 7 days instead of 2 --- src/controllers/FikaSendItemController.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/controllers/FikaSendItemController.ts b/src/controllers/FikaSendItemController.ts index 451ad1a8..5d28f0bf 100644 --- a/src/controllers/FikaSendItemController.ts +++ b/src/controllers/FikaSendItemController.ts @@ -77,7 +77,8 @@ export class FikaSendItemController { this.mailSendService.sendSystemMessageToPlayer( body.target, `You have received a gift from ${senderProfile?.characters?.pmc?.Info?.Nickname ?? "unknown"}`, - itemsToSend + itemsToSend, + 604800 ); this.inventoryHelper.removeItem(senderProfile.characters.pmc, body.id, sessionID, output); From ce745a806bfda8594a550f95ff25bd8ef74ce5fb Mon Sep 17 00:00:00 2001 From: Archangel Date: Wed, 11 Sep 2024 16:27:14 +0200 Subject: [PATCH 021/119] Remove editions in LauncherController instead of FikaDatabaseService --- src/di/Container.ts | 6 +- .../controllers/LauncherController.ts | 60 +++++++++++++++++++ src/overrides/services/FikaDatabaseService.ts | 50 ---------------- 3 files changed, 63 insertions(+), 53 deletions(-) create mode 100644 src/overrides/controllers/LauncherController.ts delete mode 100644 src/overrides/services/FikaDatabaseService.ts diff --git a/src/di/Container.ts b/src/di/Container.ts index b53f609a..f0f1e30b 100644 --- a/src/di/Container.ts +++ b/src/di/Container.ts @@ -10,7 +10,7 @@ import { DialogueControllerOverride } from "../overrides/controllers/DialogueCon import { ProfileControllerOverride } from "../overrides/controllers/ProfileController"; // import { LocalesOverride } from "../overrides/other/Locales"; import { HttpRouterOverride } from "../overrides/routers/HttpRouter"; -import { DatabaseServiceOverride } from "../overrides/services/FikaDatabaseService"; +import { LauncherControllerOverride } from "../overrides/controllers/LauncherController"; import { MatchControllerOverride } from "../overrides/controllers/MatchController"; import { FikaMatchService } from "../services/FikaMatchService"; @@ -81,7 +81,7 @@ export class Container { container.registerType("Overrides", "HttpRouterOverride"); // container.registerType("Overrides", "LocalesOverride"); container.registerType("Overrides", "AchievementControllerOverride"); - container.registerType("Overrides", "DatabaseServiceOverride"); + container.registerType("Overrides", "LauncherControllerOverride"); container.registerType("Overrides", "LocationLifecycleServiceOverride"); container.registerType("Overrides", "MatchControllerOverride"); @@ -108,7 +108,7 @@ export class Container { // container.register("LocalesOverride", LocalesOverride, { lifecycle: Lifecycle.Singleton }); container.register("Overrider", Overrider, { lifecycle: Lifecycle.Singleton }); container.register("AchievementControllerOverride", AchievementControllerOverride, { lifecycle: Lifecycle.Singleton }); - container.register("DatabaseServiceOverride", DatabaseServiceOverride, { lifecycle: Lifecycle.Singleton }); + container.register("LauncherControllerOverride", LauncherControllerOverride, { lifecycle: Lifecycle.Singleton }); container.register("LocationLifecycleServiceOverride", LocationLifecycleServiceOverride, { lifecycle: Lifecycle.Singleton }); container.register("MatchControllerOverride", MatchControllerOverride, { lifecycle: Lifecycle.Singleton }); } diff --git a/src/overrides/controllers/LauncherController.ts b/src/overrides/controllers/LauncherController.ts new file mode 100644 index 00000000..4202975a --- /dev/null +++ b/src/overrides/controllers/LauncherController.ts @@ -0,0 +1,60 @@ +import { DependencyContainer, inject, injectable } from "tsyringe"; + +import { LauncherController } from "@spt/controllers/LauncherController"; +import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { ConfigServer } from "@spt/servers/ConfigServer"; +import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; +import { IConnectResponse } from "@spt/models/eft/profile/IConnectResponse"; + +import { FikaConfig } from "../../utils/FikaConfig"; +import { Override } from "../../di/Override"; +import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; + +@injectable() +export class LauncherControllerOverride extends Override { + protected coreConfig: ICoreConfig; + + constructor( + @inject("LauncherController") protected launcherController: LauncherController, + @inject("HttpServerHelper") protected httpServerHelper: HttpServerHelper, + @inject("DatabaseService") protected databaseService: DatabaseService, + @inject("ConfigServer") protected configServer: ConfigServer, + @inject("FikaConfig") protected fikaConfig: FikaConfig, + @inject("WinstonLogger") protected logger: ILogger + ) { + super(); + + this.coreConfig = this.configServer.getConfig(ConfigTypes.CORE); + } + + public execute(container: DependencyContainer): void { + container.afterResolution( + "LauncherController", + (_t, result: LauncherController) => { + result.connect = (): IConnectResponse => { + let editions = this.databaseService.getProfiles(); + + if (!this.fikaConfig.getConfig().server.showDevProfile) { + delete editions["SPT Developer"] + } + + if (!this.fikaConfig.getConfig().server.showNonStandardProfile) { + for (const id of ["Tournament", "SPT Easy start", "SPT Zero to hero"]) { + delete editions[id] + } + } + + return { + backendUrl: this.httpServerHelper.getBackendUrl(), + name: this.coreConfig.serverName, + editions: Object.keys(editions), + profileDescriptions: this.launcherController.getProfileDescriptions() + }; + }; + }, + { frequency: "Always" }, + ); + } +} diff --git a/src/overrides/services/FikaDatabaseService.ts b/src/overrides/services/FikaDatabaseService.ts deleted file mode 100644 index 1b63deae..00000000 --- a/src/overrides/services/FikaDatabaseService.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { DependencyContainer, inject, injectable } from "tsyringe"; -import { Override } from "../../di/Override"; - -import { FikaConfig } from "../../utils/FikaConfig"; - -import { DatabaseService } from "@spt/services/DatabaseService"; -import { LocalisationService } from "@spt/services/LocalisationService"; -import { IProfileTemplates } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { DatabaseServer } from "@spt/servers/DatabaseServer"; - -@injectable() -export class DatabaseServiceOverride extends Override { - constructor( - @inject("DatabaseServer") protected databaseServer: DatabaseServer, - @inject("LocalisationService") protected localisationService: LocalisationService, - @inject("FikaConfig") protected fikaConfig: FikaConfig - ) { - super(); - } - - public execute(container: DependencyContainer): void { - container.afterResolution( - "DatabaseService", - (_t, result: DatabaseService) => { - result.getProfiles = (): IProfileTemplates => { - const config = this.fikaConfig.getConfig().server; - - if (!this.databaseServer.getTables().templates!.profiles) { - throw new Error(this.localisationService.getText("database-data_at_path_missing", "assets/database/templates/profiles.json")); - } - - let templates = this.databaseServer.getTables().templates!.profiles!; - - if (!config.showDevProfile) { - delete templates["SPT Developer"] - } - - if (!config.showNonStandardProfile) { - for (const id of ["Tournament", "SPT Easy start", "SPT Zero to hero"]) { - delete templates[id] - } - } - - return templates; - }; - }, - { frequency: "Always" }, - ); - } -} From f788b8ca37735ef10c2cf65d9c1de4cfd5d70c05 Mon Sep 17 00:00:00 2001 From: Archangel Date: Wed, 11 Sep 2024 16:51:01 +0200 Subject: [PATCH 022/119] Remove unused logger --- src/overrides/controllers/LauncherController.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/overrides/controllers/LauncherController.ts b/src/overrides/controllers/LauncherController.ts index 4202975a..3ce24d6c 100644 --- a/src/overrides/controllers/LauncherController.ts +++ b/src/overrides/controllers/LauncherController.ts @@ -10,7 +10,6 @@ import { IConnectResponse } from "@spt/models/eft/profile/IConnectResponse"; import { FikaConfig } from "../../utils/FikaConfig"; import { Override } from "../../di/Override"; import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; -import { ILogger } from "@spt/models/spt/utils/ILogger"; @injectable() export class LauncherControllerOverride extends Override { @@ -22,7 +21,6 @@ export class LauncherControllerOverride extends Override { @inject("DatabaseService") protected databaseService: DatabaseService, @inject("ConfigServer") protected configServer: ConfigServer, @inject("FikaConfig") protected fikaConfig: FikaConfig, - @inject("WinstonLogger") protected logger: ILogger ) { super(); From 8900ebafc47108376abbfe37f35122a074763cac Mon Sep 17 00:00:00 2001 From: Archangel Date: Fri, 20 Sep 2024 11:36:44 +0200 Subject: [PATCH 023/119] Allow FikaServerTools to support Linux --- src/utils/FikaServerTools.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/utils/FikaServerTools.ts b/src/utils/FikaServerTools.ts index e6b04450..3e72ae89 100644 --- a/src/utils/FikaServerTools.ts +++ b/src/utils/FikaServerTools.ts @@ -8,6 +8,7 @@ import { IHttpConfig } from "@spt/models/spt/config/IHttpConfig"; import { ChildProcessWithoutNullStreams, spawn } from "child_process"; import path from "node:path"; import fs from 'fs'; +import os from 'os'; @injectable() export class FikaServerTools { @@ -23,7 +24,16 @@ export class FikaServerTools { @inject("FikaConfig") protected fikaConfig: FikaConfig, @inject("ConfigServer") protected configServer: ConfigServer, ) { - this.exePath = path.join(path.join(__dirname, "../../"), "FikaServerTools.exe"); + switch(os.platform()) { + case 'linux': { + this.exePath = path.join(path.join(__dirname, "../../"), "FikaServerTools"); + break; + } + default: { + this.exePath = path.join(path.join(__dirname, "../../"), "FikaServerTools.exe"); + break; + } + } this.natPunchServerConfig = fikaConfig.getConfig().natPunchServer; this.httpConfig = this.configServer.getConfig(ConfigTypes.HTTP); } From 3064d8109ebf610cd828d8a9f22b3cb5f3d1da96 Mon Sep 17 00:00:00 2001 From: Archangel Date: Fri, 20 Sep 2024 13:17:26 +0200 Subject: [PATCH 024/119] Pass correct data to favoriteItems --- src/overrides/controllers/ProfileController.ts | 17 ++++++++++++++++- .../eft/profile/IGetOtherProfileResponse.d.ts | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/overrides/controllers/ProfileController.ts b/src/overrides/controllers/ProfileController.ts index 24b7a458..614c7f56 100644 --- a/src/overrides/controllers/ProfileController.ts +++ b/src/overrides/controllers/ProfileController.ts @@ -10,6 +10,8 @@ import { ISearchFriendResponse } from "@spt/models/eft/profile/ISearchFriendResp import { Override } from "../../di/Override"; import { FikaConfig } from "../../utils/FikaConfig"; +import { Item } from "@spt/models/eft/common/tables/IItem"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; @injectable() export class ProfileControllerOverride extends Override { @@ -79,6 +81,19 @@ export class ProfileControllerOverride extends Override { const playerPmc = player.characters.pmc; const playerScav = player.characters.scav; + const favoriteItems: Item[] = []; + + playerPmc.Inventory.favoriteItems.forEach(item => { + let favoriteItem = playerPmc.Inventory.items.find(i => i._id === item); + + if(favoriteItem === undefined) + { + return; + } + + favoriteItems.push(favoriteItem); + }); + return { id: playerPmc._id, aid: playerPmc.aid, @@ -104,7 +119,7 @@ export class ProfileControllerOverride extends Override { Items: playerPmc.Inventory.items, }, achievements: playerPmc.Achievements, - favoriteItems: playerPmc.Inventory.favoriteItems ?? [], + favoriteItems: favoriteItems, pmcStats: { eft: { totalInGameTime: playerPmc.Stats.Eft.TotalInGameTime, diff --git a/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 7df4ebac..f9a82f11 100644 --- a/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -8,7 +8,7 @@ export interface IGetOtherProfileResponse { skills: Skills; equipment: IOtherProfileEquipment; achievements: Record; - favoriteItems: string[]; + favoriteItems: Item[]; pmcStats: IOtherProfileStats; scavStats: IOtherProfileStats; } From 806b1f88beef0c16ce8740d6f87c852026c2abbb Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:57:25 +0200 Subject: [PATCH 025/119] Add customization of time --- src/controllers/FikaRaidController.ts | 6 ++++-- .../routes/raid/getsettings/IFikaRaidSettingsResponse.ts | 7 ++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/controllers/FikaRaidController.ts b/src/controllers/FikaRaidController.ts index 7e5f7883..b9672c10 100644 --- a/src/controllers/FikaRaidController.ts +++ b/src/controllers/FikaRaidController.ts @@ -62,7 +62,7 @@ export class FikaRaidController { expectedNumberOfPlayers: match.expectedNumberOfPlayers, gameVersion: match.gameVersion, fikaVersion: match.fikaVersion, - raidCode: match.raidCode, + raidCode: match.raidCode }; } @@ -110,6 +110,8 @@ export class FikaRaidController { return { metabolismDisabled: match.raidConfig.metabolismDisabled, playersSpawnPlace: match.raidConfig.playersSpawnPlace, + hourOfDay: match.raidConfig.timeAndWeatherSettings.hourOfDay, + timeFlowType: match.raidConfig.timeAndWeatherSettings.timeFlowType }; } @@ -187,7 +189,7 @@ export class FikaRaidController { public handleRaidStatusDedicated(sessionId: string, info: IStatusDedicatedRequest): IStatusDedicatedResponse { // Temp fix because the enum gets deserialized as a string instead of an integer - switch(info.status.toString()) { + switch (info.status.toString()) { case "READY": info.status = DedicatedStatus.READY; break; diff --git a/src/models/fika/routes/raid/getsettings/IFikaRaidSettingsResponse.ts b/src/models/fika/routes/raid/getsettings/IFikaRaidSettingsResponse.ts index 4ca66ec8..dd533032 100644 --- a/src/models/fika/routes/raid/getsettings/IFikaRaidSettingsResponse.ts +++ b/src/models/fika/routes/raid/getsettings/IFikaRaidSettingsResponse.ts @@ -1,4 +1,9 @@ +import { PlayersSpawnPlace } from "@spt/models/enums/PlayersSpawnPlace"; +import { TimeFlowType } from "@spt/models/enums/RaidSettings/TimeAndWeather/TimeFlowType"; + export interface IFikaRaidSettingsResponse { metabolismDisabled: boolean; - playersSpawnPlace: string; + playersSpawnPlace: PlayersSpawnPlace; + hourOfDay: number; + timeFlowType: TimeFlowType } From e69c48842eab4453b59dd8b74bd58b88d470902c Mon Sep 17 00:00:00 2001 From: Archangel Date: Fri, 20 Sep 2024 16:54:07 +0200 Subject: [PATCH 026/119] Update types --- types/callbacks/BotCallbacks.d.ts | 4 +- types/callbacks/DataCallbacks.d.ts | 11 +- types/callbacks/HideoutCallbacks.d.ts | 7 +- types/callbacks/InraidCallbacks.d.ts | 6 - types/callbacks/TraderCallbacks.d.ts | 7 +- types/controllers/BotController.d.ts | 4 +- .../controllers/CustomizationController.d.ts | 10 +- types/controllers/GameController.d.ts | 1 + types/controllers/HideoutController.d.ts | 32 ++- types/controllers/InsuranceController.d.ts | 8 + types/controllers/TraderController.d.ts | 7 +- types/generators/BotGenerator.d.ts | 19 +- types/generators/BotLootGenerator.d.ts | 8 + types/generators/LocationLootGenerator.d.ts | 6 - types/generators/LootGenerator.d.ts | 10 + types/helpers/BotDifficultyHelper.d.ts | 26 +- types/helpers/HandbookHelper.d.ts | 4 +- types/helpers/HideoutHelper.d.ts | 5 +- types/helpers/InRaidHelper.d.ts | 28 +- types/helpers/InventoryHelper.d.ts | 6 +- types/helpers/ItemHelper.d.ts | 22 +- types/helpers/PresetHelper.d.ts | 6 +- types/helpers/ProfileHelper.d.ts | 7 +- types/helpers/QuestHelper.d.ts | 4 +- types/helpers/TraderHelper.d.ts | 8 +- types/models/eft/common/ILocationBase.d.ts | 1 + types/models/eft/common/tables/IBotBase.d.ts | 19 +- .../eft/common/tables/IHandbookBase.d.ts | 8 +- .../eft/common/tables/IProfileTemplate.d.ts | 4 +- types/models/eft/common/tables/ITrader.d.ts | 18 +- .../IBuyClothingRequestData.d.ts | 4 +- types/models/eft/hideout/IHideoutArea.d.ts | 6 +- ...leOfCultistProductionStartRequestData.d.ts | 4 +- .../IHideoutDeleteProductionRequestData.d.ts | 5 + .../eft/hideout/IHideoutProduction.d.ts | 26 +- .../eft/itemEvent/IItemEventRouterBase.d.ts | 4 +- types/models/eft/match/IRaidSettings.d.ts | 7 +- types/models/enums/HideoutEventActions.d.ts | 3 +- types/models/enums/ItemTpl.d.ts | 265 +++++++++++++++--- types/models/enums/Weapons.d.ts | 12 + types/models/spt/config/IHideoutConfig.d.ts | 25 ++ types/models/spt/config/IInRaidConfig.d.ts | 3 +- types/models/spt/config/IInsuranceConfig.d.ts | 1 + types/models/spt/config/IInventoryConfig.d.ts | 2 +- types/models/spt/config/IPmcConfig.d.ts | 22 +- types/models/spt/config/IQuestConfig.d.ts | 1 + types/models/spt/config/ITraderConfig.d.ts | 6 + types/models/spt/hideout/IHideout.d.ts | 4 +- types/services/BotNameService.d.ts | 45 +++ types/services/CircleOfCultistService.d.ts | 132 +++++++++ types/services/InsuranceService.d.ts | 7 + types/services/LocationLifecycleService.d.ts | 39 ++- types/services/ProfileFixerService.d.ts | 15 +- types/services/RagfairOfferService.d.ts | 4 +- types/services/RagfairPriceService.d.ts | 4 +- .../tools/ItemTplGenerator/itemOverrides.d.ts | 1 + 56 files changed, 775 insertions(+), 178 deletions(-) create mode 100644 types/models/eft/hideout/IHideoutDeleteProductionRequestData.d.ts create mode 100644 types/services/BotNameService.d.ts create mode 100644 types/services/CircleOfCultistService.d.ts diff --git a/types/callbacks/BotCallbacks.d.ts b/types/callbacks/BotCallbacks.d.ts index 7d22dcfe..abc1483a 100644 --- a/types/callbacks/BotCallbacks.d.ts +++ b/types/callbacks/BotCallbacks.d.ts @@ -1,3 +1,4 @@ +import { ApplicationContext } from "@spt/context/ApplicationContext"; import { BotController } from "@spt/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; @@ -8,7 +9,8 @@ import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; export declare class BotCallbacks { protected botController: BotController; protected httpResponse: HttpResponseUtil; - constructor(botController: BotController, httpResponse: HttpResponseUtil); + protected applicationContext: ApplicationContext; + constructor(botController: BotController, httpResponse: HttpResponseUtil, applicationContext: ApplicationContext); /** * Handle singleplayer/settings/bot/limit * Is called by client to define each bot roles wave limit diff --git a/types/callbacks/DataCallbacks.d.ts b/types/callbacks/DataCallbacks.d.ts index 41f1d0ca..d92be661 100644 --- a/types/callbacks/DataCallbacks.d.ts +++ b/types/callbacks/DataCallbacks.d.ts @@ -1,5 +1,5 @@ import { HideoutController } from "@spt/controllers/HideoutController"; -import { RagfairController } from "@spt/controllers/RagfairController"; +import { TraderController } from "@spt/controllers/TraderController"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGlobals } from "@spt/models/eft/common/IGlobals"; @@ -7,7 +7,7 @@ import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomization import { IHandbookBase } from "@spt/models/eft/common/tables/IHandbookBase"; import { IGetItemPricesResponse } from "@spt/models/eft/game/IGetItemPricesResponse"; import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutProductionData } from "@spt/models/eft/hideout/IHideoutProduction"; import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; @@ -23,9 +23,9 @@ export declare class DataCallbacks { protected timeUtil: TimeUtil; protected traderHelper: TraderHelper; protected databaseService: DatabaseService; - protected ragfairController: RagfairController; + protected traderController: TraderController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, traderController: TraderController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase @@ -62,7 +62,7 @@ export declare class DataCallbacks { */ getHideoutSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getHideoutAreas(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - gethideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getHideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getHideoutScavcase(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/languages @@ -83,7 +83,6 @@ export declare class DataCallbacks { /** * Handle client/items/prices/ * Called when viewing a traders assorts - * TODO - fully implement this */ getItemPrices(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/types/callbacks/HideoutCallbacks.d.ts b/types/callbacks/HideoutCallbacks.d.ts index 72c146b0..d63bcd60 100644 --- a/types/callbacks/HideoutCallbacks.d.ts +++ b/types/callbacks/HideoutCallbacks.d.ts @@ -5,6 +5,7 @@ import { IHandleQTEEventRequestData } from "@spt/models/eft/hideout/IHandleQTEEv import { IHideoutCancelProductionRequestData } from "@spt/models/eft/hideout/IHideoutCancelProductionRequestData"; import { IHideoutCircleOfCultistProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData"; import { IHideoutContinuousProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; +import { IHideoutDeleteProductionRequestData } from "@spt/models/eft/hideout/IHideoutDeleteProductionRequestData"; import { IHideoutImproveAreaRequestData } from "@spt/models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutPutItemInRequestData } from "@spt/models/eft/hideout/IHideoutPutItemInRequestData"; import { IHideoutScavCaseStartRequestData } from "@spt/models/eft/hideout/IHideoutScavCaseStartRequestData"; @@ -79,7 +80,11 @@ export declare class HideoutCallbacks implements OnUpdate { /** * Handle client/game/profile/items/moving - HideoutCircleOfCultistProductionStart */ - circleOfCultistProductionStart(pmcData: IPmcData, request: IHideoutCircleOfCultistProductionStartRequestData, sessionId: string): IItemEventRouterResponse | PromiseLike; + circleOfCultistProductionStart(pmcData: IPmcData, request: IHideoutCircleOfCultistProductionStartRequestData, sessionId: string): IItemEventRouterResponse; + /** + * Handle client/game/profile/items/moving - HideoutDeleteProductionCommand + */ + hideoutDeleteProductionCommand(pmcData: IPmcData, request: IHideoutDeleteProductionRequestData, sessionId: string): IItemEventRouterResponse; onUpdate(timeSinceLastRun: number): Promise; getRoute(): string; } diff --git a/types/callbacks/InraidCallbacks.d.ts b/types/callbacks/InraidCallbacks.d.ts index f85e4e7c..675403fe 100644 --- a/types/callbacks/InraidCallbacks.d.ts +++ b/types/callbacks/InraidCallbacks.d.ts @@ -28,12 +28,6 @@ export declare class InraidCallbacks { * @returns Null http response */ saveProgress(url: string, info: IScavSaveRequestData, sessionID: string): INullResponseData; - /** - * TODO - remove - * Handle singleplayer/settings/raid/endstate - * @returns - */ - getRaidEndState(): string; /** * Handle singleplayer/settings/raid/menu * @returns JSON as string diff --git a/types/callbacks/TraderCallbacks.d.ts b/types/callbacks/TraderCallbacks.d.ts index c081a9b1..5177d99e 100644 --- a/types/callbacks/TraderCallbacks.d.ts +++ b/types/callbacks/TraderCallbacks.d.ts @@ -4,12 +4,15 @@ import { OnUpdate } from "@spt/di/OnUpdate"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrader"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; +import { ModdedTraders } from "@spt/models/spt/config/ITraderConfig"; +import { ConfigServer } from "@spt/servers/ConfigServer"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; export declare class TraderCallbacks implements OnLoad, OnUpdate { protected httpResponse: HttpResponseUtil; protected traderController: TraderController; + protected configServer: ConfigServer; constructor(httpResponse: HttpResponseUtil, // TODO: delay required - traderController: TraderController); + traderController: TraderController, configServer: ConfigServer); onLoad(): Promise; onUpdate(): Promise; getRoute(): string; @@ -19,4 +22,6 @@ export declare class TraderCallbacks implements OnLoad, OnUpdate { getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/trading/api/getTraderAssort */ getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + /** Handle /singleplayer/moddedTraders */ + getModdedTraderData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/types/controllers/BotController.d.ts b/types/controllers/BotController.d.ts index 2d81384f..80c0baa7 100644 --- a/types/controllers/BotController.d.ts +++ b/types/controllers/BotController.d.ts @@ -10,6 +10,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; +import { IGetRaidConfigurationRequestData } from "@spt/models/eft/match/IGetRaidConfigurationRequestData"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -58,10 +59,11 @@ export declare class BotController { * Adjust PMC settings to ensure they engage the correct bot types * @param type what bot the server is requesting settings for * @param diffLevel difficulty level server requested settings for + * @param raidConfig OPTIONAL - applicationContext Data stored at start of raid * @param ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty; + getBotDifficulty(type: string, diffLevel: string, raidConfig?: IGetRaidConfigurationRequestData, ignoreRaidSettings?: boolean): Difficulty; getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache diff --git a/types/controllers/CustomizationController.d.ts b/types/controllers/CustomizationController.d.ts index 028341a7..8aef9e96 100644 --- a/types/controllers/CustomizationController.d.ts +++ b/types/controllers/CustomizationController.d.ts @@ -1,7 +1,7 @@ import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { ISuit } from "@spt/models/eft/common/tables/ITrader"; -import { ClothingItem, IBuyClothingRequestData } from "@spt/models/eft/customization/IBuyClothingRequestData"; +import { IBuyClothingRequestData, IPaymentItemForClothing } from "@spt/models/eft/customization/IBuyClothingRequestData"; import { IWearClothingRequestData } from "@spt/models/eft/customization/IWearClothingRequestData"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -54,17 +54,17 @@ export declare class CustomizationController { * Update output object and player profile with purchase details * @param sessionId Session id * @param pmcData Player profile - * @param clothingItems Clothing purchased + * @param itemsToPayForClothingWith Clothing purchased * @param output Client response */ - protected payForClothingItems(sessionId: string, pmcData: IPmcData, clothingItems: ClothingItem[], output: IItemEventRouterResponse): void; + 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 clothingItem Clothing item purchased + * @param paymentItemDetails Payment details * @param output Client response */ - protected payForClothingItem(sessionId: string, pmcData: IPmcData, clothingItem: ClothingItem, output: IItemEventRouterResponse): void; + protected payForClothingItem(sessionId: string, pmcData: IPmcData, paymentItemDetails: IPaymentItemForClothing, output: IItemEventRouterResponse): void; protected getAllTraderSuits(sessionID: string): ISuit[]; } diff --git a/types/controllers/GameController.d.ts b/types/controllers/GameController.d.ts index e219c04d..f59415c3 100644 --- a/types/controllers/GameController.d.ts +++ b/types/controllers/GameController.d.ts @@ -74,6 +74,7 @@ export declare class GameController { * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected migrate39xProfile(fullProfile: ISptProfile): void; protected adjustHideoutCraftTimes(overrideSeconds: number): void; /** * Adjust all hideout craft times to be no higher than the override diff --git a/types/controllers/HideoutController.d.ts b/types/controllers/HideoutController.d.ts index 332d0804..df0ec92d 100644 --- a/types/controllers/HideoutController.d.ts +++ b/types/controllers/HideoutController.d.ts @@ -13,6 +13,7 @@ import { IHideoutArea, Stage } from "@spt/models/eft/hideout/IHideoutArea"; import { IHideoutCancelProductionRequestData } from "@spt/models/eft/hideout/IHideoutCancelProductionRequestData"; import { IHideoutCircleOfCultistProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData"; import { IHideoutContinuousProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; +import { IHideoutDeleteProductionRequestData } from "@spt/models/eft/hideout/IHideoutDeleteProductionRequestData"; import { IHideoutImproveAreaRequestData } from "@spt/models/eft/hideout/IHideoutImproveAreaRequestData"; import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; import { IHideoutPutItemInRequestData } from "@spt/models/eft/hideout/IHideoutPutItemInRequestData"; @@ -31,6 +32,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { CircleOfCultistService } from "@spt/services/CircleOfCultistService"; import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -62,11 +64,12 @@ export declare class HideoutController { protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected fenceService: FenceService; + protected circleOfCultistService: CircleOfCultistService; protected cloner: ICloner; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseService: DatabaseService, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, profileActivityService: ProfileActivityService, configServer: ConfigServer, fenceService: FenceService, circleOfCultistService: CircleOfCultistService, cloner: ICloner); /** * Handle HideoutUpgrade event * Start a hideout area upgrade @@ -99,13 +102,22 @@ export declare class HideoutController { * @param hideoutStage Stage hideout area is being upgraded to */ protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileParentHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; + /** + * Add stand1/stand2/stand3 inventory items to profile, depending on passed in hideout stage + * @param sessionId Session id + * @param equipmentPresetStage Current EQUIPMENT_PRESETS_STAND stage data + * @param pmcData Player profile + * @param equipmentPresetHideoutArea + * @param output Response to send back to client + */ + protected addMissingPresetStandItemsToProfile(sessionId: string, equipmentPresetStage: Stage, pmcData: IPmcData, equipmentPresetHideoutArea: IHideoutArea, output: IItemEventRouterResponse): void; /** * Add an inventory item to profile from a hideout area stage data * @param pmcData Profile to update - * @param dbHideoutData Hideout area from db being upgraded + * @param dbHideoutArea Hideout area from db being upgraded * @param hideoutStage Stage area upgraded to */ - protected addUpdateInventoryItemToProfile(pmcData: IPmcData, dbHideoutData: IHideoutArea, hideoutStage: Stage): void; + protected addUpdateInventoryItemToProfile(sessionId: string, pmcData: IPmcData, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; /** * @param output Object to send to client * @param sessionID Session/player id @@ -113,7 +125,7 @@ export declare class HideoutController { * @param hideoutDbData Hideout area that caused addition of stash * @param hideoutStage Hideout area upgraded to this */ - protected addContainerUpgradeToClientOutput(output: IItemEventRouterResponse, sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage): void; + protected addContainerUpgradeToClientOutput(sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage, output: IItemEventRouterResponse): void; /** * Handle HideoutPutItemsInAreaSlots * Create item in hideout slot item array, remove item from player inventory @@ -269,9 +281,17 @@ export declare class HideoutController { * @param pmcData Profile of crafter * @param request Request data */ - circleOfCultistProductionStart(sessionId: string, pmcData: IPmcData, request: IHideoutCircleOfCultistProductionStartRequestData): IItemEventRouterResponse | PromiseLike; + circleOfCultistProductionStart(sessionId: string, pmcData: IPmcData, request: IHideoutCircleOfCultistProductionStartRequestData): IItemEventRouterResponse; + /** + * Handle HideoutDeleteProductionCommand event + * @param sessionId Session id + * @param pmcData Player profile + * @param request Client request data + * @returns IItemEventRouterResponse + */ + hideoutDeleteProductionCommand(sessionId: string, pmcData: IPmcData, request: IHideoutDeleteProductionRequestData): IItemEventRouterResponse; /** - * Function called every x seconds as part of onUpdate event + * Function called every `hideoutConfig.runIntervalSeconds` seconds as part of onUpdate event */ update(): void; } diff --git a/types/controllers/InsuranceController.d.ts b/types/controllers/InsuranceController.d.ts index 543e915c..4c96b96a 100644 --- a/types/controllers/InsuranceController.d.ts +++ b/types/controllers/InsuranceController.d.ts @@ -195,6 +195,14 @@ export declare class InsuranceController { * @returns IItemEventRouterResponse object to send to client */ insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Insure softinserts of Armor that has softinsert slots + * Allows armors to come back after being lost correctly + * @param item Armor item to be insured + * @param pmcData Player profile + * @param body Insurance request data + */ + insureSoftInserts(item: Item, pmcData: IPmcData, body: IInsureRequestData): void; /** * Handle client/insurance/items/list/cost * Calculate insurance cost diff --git a/types/controllers/TraderController.d.ts b/types/controllers/TraderController.d.ts index 3592fc66..bdc9b512 100644 --- a/types/controllers/TraderController.d.ts +++ b/types/controllers/TraderController.d.ts @@ -3,11 +3,13 @@ import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { TraderAssortHelper } from "@spt/helpers/TraderAssortHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrader"; +import { IGetItemPricesResponse } from "@spt/models/eft/game/IGetItemPricesResponse"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; +import { RagfairPriceService } from "@spt/services/RagfairPriceService"; import { TraderAssortService } from "@spt/services/TraderAssortService"; import { TraderPurchasePersisterService } from "@spt/services/TraderPurchasePersisterService"; import { TimeUtil } from "@spt/utils/TimeUtil"; @@ -20,13 +22,14 @@ export declare class TraderController { protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; protected traderAssortService: TraderAssortService; + protected ragfairPriceService: RagfairPriceService; protected traderPurchasePersisterService: TraderPurchasePersisterService; protected fenceService: FenceService; protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected configServer: ConfigServer; protected cloner: ICloner; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, ragfairPriceService: RagfairPriceService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, configServer: ConfigServer, cloner: ICloner); /** * Runs when onLoad event is fired * Iterate over traders, ensure a pristine copy of their assorts is stored in traderAssortService @@ -58,4 +61,6 @@ export declare class TraderController { getTrader(sessionID: string, traderID: string): ITraderBase; /** Handle client/trading/api/getTraderAssort */ getAssort(sessionId: string, traderId: string): ITraderAssort; + /** Handle client/items/prices/TRADERID */ + getItemPrices(sessionId: string, traderId: string): IGetItemPricesResponse; } diff --git a/types/generators/BotGenerator.d.ts b/types/generators/BotGenerator.d.ts index 04edbf67..932da15b 100644 --- a/types/generators/BotGenerator.d.ts +++ b/types/generators/BotGenerator.d.ts @@ -1,6 +1,5 @@ import { BotInventoryGenerator } from "@spt/generators/BotInventoryGenerator"; import { BotLevelGenerator } from "@spt/generators/BotLevelGenerator"; -import { BotDifficultyHelper } from "@spt/helpers/BotDifficultyHelper"; import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; @@ -12,9 +11,9 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; +import { BotNameService } from "@spt/services/BotNameService"; import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; -import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { HashUtil } from "@spt/utils/HashUtil"; import { RandomUtil } from "@spt/utils/RandomUtil"; @@ -32,15 +31,14 @@ export declare class BotGenerator { protected botEquipmentFilterService: BotEquipmentFilterService; protected weightedRandomHelper: WeightedRandomHelper; protected botHelper: BotHelper; - protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; - protected localisationService: LocalisationService; protected itemFilterService: ItemFilterService; + protected botNameService: BotNameService; protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, botNameService: BotNameService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -91,17 +89,6 @@ export declare class BotGenerator { * @param botGenerationDetails Generation details */ protected setBotAppearance(bot: IBotBase, appearance: Appearance, botGenerationDetails: BotGenerationDetails): void; - /** - * Create a bot nickname - * @param botJsonTemplate x.json from database - * @param botGenerationDetails - * @param botRole role of bot e.g. assault - * @param sessionId OPTIONAL: profile session id - * @returns Nickname for bot - */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; - protected shouldSimulatePlayerScavName(botRole: string, isPlayerScav: boolean): boolean; - protected addPlayerScavNameSimulationSuffix(nickname: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/types/generators/BotLootGenerator.d.ts b/types/generators/BotLootGenerator.d.ts index c0583c6c..4fa956b2 100644 --- a/types/generators/BotLootGenerator.d.ts +++ b/types/generators/BotLootGenerator.d.ts @@ -51,6 +51,14 @@ export declare class BotLootGenerator { * @param botLevel Level of bot */ generateLoot(sessionId: string, botJsonTemplate: IBotType, isPmc: boolean, botRole: string, botInventory: PmcInventory, botLevel: number): void; + /** + * Gets the rouble cost total for loot in a bots backpack by the bots levl + * Will return 0 for non PMCs + * @param botLevel Bots level + * @param isPmc Is the bot a PMC + * @returns number + */ + protected getBackpackRoubleTotalByLevel(botLevel: number, isPmc: boolean): number; /** * Get an array of the containers a bot has on them (pockets/backpack/vest) * @param botInventory Bot to check diff --git a/types/generators/LocationLootGenerator.d.ts b/types/generators/LocationLootGenerator.d.ts index afc5c489..8f02bf09 100644 --- a/types/generators/LocationLootGenerator.d.ts +++ b/types/generators/LocationLootGenerator.d.ts @@ -133,12 +133,6 @@ export declare class LocationLootGenerator { * @returns IContainerItem */ protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint, staticAmmoDist: Record): IContainerItem; - /** - * Replace the _id value for base item + all children items parentid value - * @param itemWithChildren Item with mods to update - * @param newId new id to add on chidren of base item - */ - protected reparentItemAndChildren(itemWithChildren: Item[], newId?: string): void; /** * Find an item in array by its _tpl, handle differently if chosenTpl is a weapon * @param items Items array to search diff --git a/types/generators/LootGenerator.d.ts b/types/generators/LootGenerator.d.ts index 03e77e22..71b924a0 100644 --- a/types/generators/LootGenerator.d.ts +++ b/types/generators/LootGenerator.d.ts @@ -37,6 +37,10 @@ export declare class LootGenerator { * @returns An array of loot items */ createRandomLoot(options: LootRequest): Item[]; + protected getItemRewardPool(itemTplBlacklist: string[], itemTypeWhitelist: string[], useRewardItemBlacklist: boolean, allowBossItems: boolean): { + itemPool: [string, ITemplateItem][]; + blacklist: Set; + }; /** * Filter armor items by their front plates protection level - top if its a helmet * @param armor Armor preset to check @@ -108,5 +112,11 @@ export declare class LootGenerator { * @returns Array of item with children arrays */ getRandomLootContainerLoot(rewardContainerDetails: RewardDetails): Item[][]; + /** + * Pick a reward item based on the reward details data + * @param rewardContainerDetails + * @returns Single tpl + */ + protected pickRewardItem(rewardContainerDetails: RewardDetails): string; } export {}; diff --git a/types/helpers/BotDifficultyHelper.d.ts b/types/helpers/BotDifficultyHelper.d.ts index 2348bd33..34ca3e06 100644 --- a/types/helpers/BotDifficultyHelper.d.ts +++ b/types/helpers/BotDifficultyHelper.d.ts @@ -1,5 +1,6 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; +import { IBots } from "@spt/models/spt/bots/IBots"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -17,35 +18,14 @@ export declare class BotDifficultyHelper { protected cloner: ICloner; protected pmcConfig: IPmcConfig; constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer, cloner: ICloner); - /** - * Get a difficulty object modified to handle fighting other PMCs - * @param pmcType 'bear or 'usec' - * @param difficulty easy / normal / hard / impossible - * @param usecType pmcUSEC - * @param bearType pmcBEAR - * @returns Difficulty object - */ - getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; - /** - * Add bot types to ENEMY_BOT_TYPES array - * @param difficultySettings Bot settings to alter - * @param typesToAdd Bot types to add to enemy list - * @param typeBeingEdited Bot type to ignore and not add to enemy list - */ - protected addBotToEnemyList(difficultySettings: Difficulty, typesToAdd: string[], typeBeingEdited?: string): void; - /** - * Configure difficulty settings to be hostile to USEC and BEAR - * Look up value in bot.json/chanceSameSideIsHostilePercent - * @param difficultySettings pmc difficulty settings - */ - protected setDifficultyToHostileToBearAndUsec(difficultySettings: Difficulty): void; /** * Get difficulty settings for desired bot type, if not found use assault bot types * @param type bot type to retrieve difficulty of * @param difficulty difficulty to get settings for (easy/normal etc) + * @param botDb bots from database * @returns Difficulty object */ - getBotDifficultySettings(type: string, difficulty: string): Difficulty; + getBotDifficultySettings(type: string, difficulty: string, botDb: IBots): Difficulty; /** * Get difficulty settings for a PMC * @param type "usec" / "bear" diff --git a/types/helpers/HandbookHelper.d.ts b/types/helpers/HandbookHelper.d.ts index 0ed965ec..4690e2f6 100644 --- a/types/helpers/HandbookHelper.d.ts +++ b/types/helpers/HandbookHelper.d.ts @@ -1,4 +1,4 @@ -import { Category } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IHandbookCategory } from "@spt/models/eft/common/tables/IHandbookBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -66,6 +66,6 @@ export declare class HandbookHelper { * @returns currency count in desired type */ fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number; - getCategoryById(handbookId: string): Category; + getCategoryById(handbookId: string): IHandbookCategory; } export {}; diff --git a/types/helpers/HideoutHelper.d.ts b/types/helpers/HideoutHelper.d.ts index df0376b5..eeb691dc 100644 --- a/types/helpers/HideoutHelper.d.ts +++ b/types/helpers/HideoutHelper.d.ts @@ -37,6 +37,7 @@ export declare class HideoutHelper { protected configServer: ConfigServer; protected cloner: ICloner; static bitcoinFarm: string; + static cultistCircleCraftId: string; static bitcoinProductionId: string; static waterCollector: string; static maxSkillPoint: number; @@ -54,7 +55,7 @@ export declare class HideoutHelper { * This convenience function initializes new Production Object * with all the constants. */ - initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean): Production; + initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean, isCultistCircle?: boolean): Production; /** * Is the provided object a Production type * @param productive @@ -116,6 +117,8 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter?: boolean; }): void; + protected updateCultistCircleCraftProgress(pmcData: IPmcData, prodId: string): void; + protected flagCultistCircleCraftAsComplete(production: Productive): void; /** * Check if a productions progress value matches its corresponding recipes production time value * @param pmcData Player profile diff --git a/types/helpers/InRaidHelper.d.ts b/types/helpers/InRaidHelper.d.ts index f2da96cb..85b9c7ed 100644 --- a/types/helpers/InRaidHelper.d.ts +++ b/types/helpers/InRaidHelper.d.ts @@ -1,19 +1,29 @@ +import { QuestController } from "@spt/controllers/QuestController"; import { InventoryHelper } from "@spt/helpers/InventoryHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { ICloner } from "@spt/utils/cloners/ICloner"; +import { ProfileHelper } from "./ProfileHelper"; +import { QuestHelper } from "./QuestHelper"; export declare class InRaidHelper { protected logger: ILogger; protected inventoryHelper: InventoryHelper; protected itemHelper: ItemHelper; protected configServer: ConfigServer; protected cloner: ICloner; + protected databaseService: DatabaseService; + protected questController: QuestController; + protected profileHelper: ProfileHelper; + protected questHelper: QuestHelper; protected lostOnDeathConfig: ILostOnDeathConfig; - constructor(logger: ILogger, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner); + protected inRaidConfig: IInRaidConfig; + constructor(logger: ILogger, inventoryHelper: InventoryHelper, itemHelper: ItemHelper, configServer: ConfigServer, cloner: ICloner, databaseService: DatabaseService, questController: QuestController, profileHelper: ProfileHelper, questHelper: QuestHelper); /** * @deprecated * Reset the skill points earned in a raid to 0, ready for next raid @@ -29,7 +39,14 @@ export declare class InRaidHelper { * @param serverProfile Profile to update * @param postRaidProfile Profile returned by client after a raid */ - setInventory(sessionID: string, serverProfile: IPmcData, postRaidProfile: IPmcData): void; + setInventory(sessionID: string, serverProfile: IPmcData, postRaidProfile: IPmcData, isSurvived: boolean): void; + /** + * Iterate over inventory items and remove the property that defines an item as Found in Raid + * Only removes property if item had FiR when entering raid + * @param postRaidProfile profile to update items for + * @returns Updated profile with SpawnedInSession removed + */ + removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData; /** * Clear PMC inventory of all items except those that are exempt * Used post-raid to remove items after death @@ -44,6 +61,13 @@ export declare class InRaidHelper { * @param secureContainerSlotId Container slot id to find items for and remove FiR from */ removeFiRStatusFromItemsInContainer(sessionId: string, pmcData: IPmcData, secureContainerSlotId: string): void; + /** + * Deletes quest conditions from pickup tasks given a list of quest items being carried by a PMC. + * @param carriedQuestItems Items carried by PMC at death, usually gotten from "CarriedQuestItems" + * @param sessionId Current sessionId + * @param pmcProfile Pre-raid profile that is being handled with raid information + */ + removePickupQuestConditions(carriedQuestItems: string[], sessionId: string, pmcProfile: IPmcData): void; /** * Get an array of items from a profile that will be lost on death * @param pmcProfile Profile to get items from diff --git a/types/helpers/InventoryHelper.d.ts b/types/helpers/InventoryHelper.d.ts index 92bb49c6..f9e2c685 100644 --- a/types/helpers/InventoryHelper.d.ts +++ b/types/helpers/InventoryHelper.d.ts @@ -7,7 +7,7 @@ import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { TraderAssortHelper } from "@spt/helpers/TraderAssortHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; -import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; +import { Item, Location, Upd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; @@ -162,13 +162,15 @@ export declare class InventoryHelper { */ protected getBlankContainerMap(containerH: number, containerY: number): number[][]; /** + * Get a 2d mapping of a container with what grid slots are filled * @param containerH Horizontal size of container * @param containerV Vertical size of container - * @param itemList + * @param itemList Players inventory items * @param containerId Id of the container * @returns Two-dimensional representation of container */ getContainerMap(containerH: number, containerV: number, itemList: Item[], containerId: string): number[][]; + protected isVertical(itemLocation: Location): boolean; protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash; /** * Return the inventory that needs to be modified (scav/pmc etc) diff --git a/types/helpers/ItemHelper.d.ts b/types/helpers/ItemHelper.d.ts index 1f8475be..0cd5e5e0 100644 --- a/types/helpers/ItemHelper.d.ts +++ b/types/helpers/ItemHelper.d.ts @@ -274,6 +274,13 @@ export declare class ItemHelper { * @returns Array of Item objects */ findBarterItems(by: "tpl" | "id", itemsToSearch: Item[], desiredBarterItemIds: string | string[]): Item[]; + /** + * Replace the _id value for base item + all children that are children of it + * REPARENTS ROOT ITEM ID, NOTHING ELSE + * @param itemWithChildren Item with mods to update + * @param newId new id to add on chidren of base item + */ + replaceRootItemID(itemWithChildren: Item[], newId?: string): void; /** * Regenerate all GUIDs with new IDs, for the exception of special item types (e.g. quest, sorting table, etc.) This * function will not mutate the original items array, but will return a new array with new GUIDs. @@ -405,9 +412,9 @@ export declare class ItemHelper { * @param magazineWithChildCartridges Magazine to add child items to * @param magTemplate Db template of magazine * @param cartridgeTpl Cartridge to add to magazine - * @param minSizePercent % the magazine must be filled to + * @param minSizeMultiplier % the magazine must be filled to */ - fillMagazineWithCartridge(magazineWithChildCartridges: Item[], magTemplate: ITemplateItem, cartridgeTpl: string, minSizePercent?: number): void; + fillMagazineWithCartridge(magazineWithChildCartridges: Item[], magTemplate: ITemplateItem, cartridgeTpl: string, minSizeMultiplier?: number): void; /** * Choose a random bullet type from the list of possible a magazine has * @param magTemplate Magazine template from Db @@ -516,7 +523,18 @@ export declare class ItemHelper { * @returns True when upd object was added */ addUpdObjectToItem(item: Item, warningMessageWhenMissing?: string): boolean; + /** + * Return all tpls from Money enum + * @returns string tpls + */ getMoneyTpls(): string[]; + /** + * Get a randomsied stack size for the passed in ammo + * @param ammoItemTemplate Ammo to get stack size for + * @param maxLimit default: Limit to 60 to prevent crazy values when players use stack increase mods + * @returns number + */ + getRandomisedAmmoStackSize(ammoItemTemplate: ITemplateItem, maxLimit?: number): number; } declare namespace ItemHelper { interface ItemSize { diff --git a/types/helpers/PresetHelper.d.ts b/types/helpers/PresetHelper.d.ts index f16d6ce1..62fda36d 100644 --- a/types/helpers/PresetHelper.d.ts +++ b/types/helpers/PresetHelper.d.ts @@ -40,9 +40,9 @@ export declare class PresetHelper { getAllPresets(): IPreset[]; getPresets(templateId: string): IPreset[]; /** - * Get the default preset for passed in item id - * @param templateId Item id to get preset for - * @returns Null if no default preset, otherwise IPreset + * Get a cloned default preset for passed in item tpl + * @param templateId Item tpl to get preset for + * @returns undefined if no default preset, otherwise IPreset */ getDefaultPreset(templateId: string): IPreset | undefined; getBaseItemTpl(presetId: string): string; diff --git a/types/helpers/ProfileHelper.d.ts b/types/helpers/ProfileHelper.d.ts index 95688af9..32c099b4 100644 --- a/types/helpers/ProfileHelper.d.ts +++ b/types/helpers/ProfileHelper.d.ts @@ -59,7 +59,12 @@ export declare class ProfileHelper { * @param scavProfile post-raid scav profile * @returns Updated profile array */ - protected postRaidXpWorkaroundFix(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, output: IPmcData[]): IPmcData[]; + protected postRaidXpWorkaroundFix(sessionId: string, clonedPmc: IPmcData, clonedScav: IPmcData, output: IPmcData[]): IPmcData[]; + /** + * Sanitize any information from the profile that the client does not expect to receive + * @param clonedProfile A clone of the full player profile + */ + protected sanitizeProfileForClient(clonedProfile: ISptProfile): void; /** * Check if a nickname is used by another profile loaded by the server * @param nicknameRequest nickname request object diff --git a/types/helpers/QuestHelper.d.ts b/types/helpers/QuestHelper.d.ts index 2d5730da..734dba6a 100644 --- a/types/helpers/QuestHelper.d.ts +++ b/types/helpers/QuestHelper.d.ts @@ -152,7 +152,7 @@ export declare class QuestHelper { /** * Adjust quest money rewards by passed in multiplier * @param quest Quest to multiple money rewards - * @param bonusPercent Value to adjust money rewards by + * @param bonusPercent Pecent to adjust money rewards by * @param questStatus Status of quest to apply money boost to rewards of * @returns Updated quest */ @@ -259,7 +259,7 @@ export declare class QuestHelper { * @param pmcData player profile * @returns bonus as a percent */ - protected getQuestMoneyRewardBonus(pmcData: IPmcData): number; + protected getQuestMoneyRewardBonusMultiplier(pmcData: IPmcData): number; /** * Find quest with 'findItem' condition that needs the item tpl be handed in * @param itemTpl item tpl to look for diff --git a/types/helpers/TraderHelper.d.ts b/types/helpers/TraderHelper.d.ts index 52c0d9b8..12eabe92 100644 --- a/types/helpers/TraderHelper.d.ts +++ b/types/helpers/TraderHelper.d.ts @@ -3,8 +3,8 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Item } from "@spt/models/eft/common/tables/IItem"; -import { ProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; -import { ITraderAssort, ITraderBase, LoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; +import { IProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; +import { ITraderAssort, ITraderBase, ITraderLoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { Traders } from "@spt/models/enums/Traders"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; @@ -66,7 +66,7 @@ export declare class TraderHelper { * @param rawProfileTemplate Raw profile from profiles.json to look up standing from * @returns Standing value */ - protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number; + protected getStartingStanding(traderId: string, rawProfileTemplate: IProfileTraderTemplate): number; /** * Add an array of suit ids to a profiles suit array, no duplicates * @param fullProfile Profile to add to @@ -118,7 +118,7 @@ export declare class TraderHelper { * @returns Time in seconds */ getTraderUpdateSeconds(traderId: string): number | undefined; - getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; + getLoyaltyLevel(traderID: string, pmcData: IPmcData): ITraderLoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile * @param sessionID Session id diff --git a/types/models/eft/common/ILocationBase.d.ts b/types/models/eft/common/ILocationBase.d.ts index a80085a2..817664cc 100644 --- a/types/models/eft/common/ILocationBase.d.ts +++ b/types/models/eft/common/ILocationBase.d.ts @@ -186,6 +186,7 @@ export interface IAdditionalHostilitySettings { ChancedEnemies: IChancedEnemy[]; Neutral: string[]; SavagePlayerBehaviour: string; + SavageEnemyChance?: number; UsecEnemyChance: number; UsecPlayerBehaviour: string; Warn: string[]; diff --git a/types/models/eft/common/tables/IBotBase.d.ts b/types/models/eft/common/tables/IBotBase.d.ts index 02e0e587..865df315 100644 --- a/types/models/eft/common/tables/IBotBase.d.ts +++ b/types/models/eft/common/tables/IBotBase.d.ts @@ -12,6 +12,7 @@ export interface IBotBase { /** SPT property - use to store player id - TODO - move to AID ( account id as guid of choice) */ sessionId: string; savage?: string; + karmaValue: number; Info: Info; Customization: Customization; Health: Health; @@ -134,6 +135,7 @@ export interface BodyPartHealth { Effects?: Record; } export interface BodyPartEffectProperties { + ExtraData?: any; Time: number; } export interface CurrentMax { @@ -150,7 +152,7 @@ export interface Inventory { /** Key is hideout area enum numeric as string e.g. "24", value is area _id */ hideoutAreaStashes: Record; fastPanel: Record; - favoriteItems: string[]; + favoriteItems: Item[]; } export interface IBaseJsonSkills { Common: Record; @@ -300,9 +302,17 @@ export interface Hideout { Production: Record; Areas: HideoutArea[]; Improvements: Record; + HideoutCounters: IHideoutCounters; Seed: number; + MannequinPoses: string[]; sptUpdateLastRunTimestamp: number; } +export interface IHideoutCounters { + fuelCounter: number; + airFilterCounter: number; + waterFilterCounter: number; + craftingTimeCounter: number; +} export interface IHideoutImprovement { completed: boolean; improveCompleteTimestamp: number; @@ -313,11 +323,11 @@ export interface Productive { Progress?: number; /** Is craft in some state of being worked on by client (crafting/ready to pick up) */ inProgress?: boolean; - StartTimestamp?: number; + StartTimestamp?: string; SkipTime?: number; /** Seconds needed to fully craft */ ProductionTime?: number; - GivenItemsInStart?: string[]; + GivenItemsInStart?: Item[]; Interrupted?: boolean; Code?: string; Decoded?: boolean; @@ -333,6 +343,7 @@ export interface Productive { sptIsContinuous?: boolean; /** Stores a list of tools used in this craft and whether they're FiR, to give back once the craft is done */ sptRequiredTools?: Item[]; + sptIsCultistCircle?: boolean; } export interface Production extends Productive { RecipeId: string; @@ -392,7 +403,7 @@ export interface IQuestStatus { availableAfter?: number; } export interface TraderInfo { - loyaltyLevel: number; + loyaltyLevel?: number; salesSum: number; standing: number; nextResupply: number; diff --git a/types/models/eft/common/tables/IHandbookBase.d.ts b/types/models/eft/common/tables/IHandbookBase.d.ts index 7d7db07a..697b782c 100644 --- a/types/models/eft/common/tables/IHandbookBase.d.ts +++ b/types/models/eft/common/tables/IHandbookBase.d.ts @@ -1,15 +1,15 @@ export interface IHandbookBase { - Categories: Category[]; - Items: HandbookItem[]; + Categories: IHandbookCategory[]; + Items: IHandbookItem[]; } -export interface Category { +export interface IHandbookCategory { Id: string; ParentId?: string; Icon: string; Color: string; Order: string; } -export interface HandbookItem { +export interface IHandbookItem { Id: string; ParentId: string; Price: number; diff --git a/types/models/eft/common/tables/IProfileTemplate.d.ts b/types/models/eft/common/tables/IProfileTemplate.d.ts index 6ba92217..a1c9c111 100644 --- a/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -21,9 +21,9 @@ export interface ITemplateSide { suits: string[]; dialogues: Record; userbuilds: IUserBuilds; - trader: ProfileTraderTemplate; + trader: IProfileTraderTemplate; } -export interface ProfileTraderTemplate { +export interface IProfileTraderTemplate { initialLoyaltyLevel: Record; initialStanding: Record; setQuestsAvailableForStart?: boolean; diff --git a/types/models/eft/common/tables/ITrader.d.ts b/types/models/eft/common/tables/ITrader.d.ts index 40cf0047..9347fee0 100644 --- a/types/models/eft/common/tables/ITrader.d.ts +++ b/types/models/eft/common/tables/ITrader.d.ts @@ -23,16 +23,20 @@ export interface ITraderBase { discount: number; discount_end: number; gridHeight: number; - insurance: Insurance; + sell_modifier_for_prohibited_items?: number; + insurance: ITraderInsurance; items_buy: IItemBuyData; items_buy_prohibited: IItemBuyData; + isCanTransferItems?: boolean; + transferableItems?: IItemBuyData; + prohibitedTransferableItems?: IItemBuyData; location: string; - loyaltyLevels: LoyaltyLevel[]; + loyaltyLevels: ITraderLoyaltyLevel[]; medic: boolean; name: string; nextResupply: number; nickname: string; - repair: Repair; + repair: ITraderRepair; sell_category: string[]; surname: string; unlockedByDefault: boolean; @@ -41,7 +45,7 @@ export interface IItemBuyData { category: string[]; id_list: string[]; } -export interface Insurance { +export interface ITraderInsurance { availability: boolean; excluded_category: string[]; max_return_hour: number; @@ -49,7 +53,7 @@ export interface Insurance { min_payment: number; min_return_hour: number; } -export interface LoyaltyLevel { +export interface ITraderLoyaltyLevel { buy_price_coef: number; exchange_price_coef: number; heal_price_coef: number; @@ -59,13 +63,13 @@ export interface LoyaltyLevel { minStanding: number; repair_price_coef: number; } -export interface Repair { +export interface ITraderRepair { availability: boolean; currency: string; currency_coefficient: number; excluded_category: string[]; /** Doesn't exist in client object */ - excluded_id_list: any[]; + excluded_id_list: string[]; quality: number; } export interface ITraderAssort { diff --git a/types/models/eft/customization/IBuyClothingRequestData.d.ts b/types/models/eft/customization/IBuyClothingRequestData.d.ts index d19b70d1..3fea5126 100644 --- a/types/models/eft/customization/IBuyClothingRequestData.d.ts +++ b/types/models/eft/customization/IBuyClothingRequestData.d.ts @@ -1,9 +1,9 @@ export interface IBuyClothingRequestData { Action: "CustomizationBuy"; offer: string; - items: ClothingItem[]; + items: IPaymentItemForClothing[]; } -export interface ClothingItem { +export interface IPaymentItemForClothing { del: boolean; id: string; count: number; diff --git a/types/models/eft/hideout/IHideoutArea.d.ts b/types/models/eft/hideout/IHideoutArea.d.ts index ca0eb07f..0159c1d5 100644 --- a/types/models/eft/hideout/IHideoutArea.d.ts +++ b/types/models/eft/hideout/IHideoutArea.d.ts @@ -1,3 +1,4 @@ +import { IRequirementBase } from "@spt/models/eft/hideout/IHideoutProduction"; import { BonusSkillType } from "@spt/models/enums/BonusSkillType"; import { BonusType } from "@spt/models/enums/BonusType"; export interface IHideoutArea { @@ -50,13 +51,12 @@ export interface IStageImprovementRequirement { templateId: string; type: string; } -export interface IStageRequirement { +export interface IStageRequirement extends IRequirementBase { areaType?: number; requiredLevel?: number; - type: string; templateId?: string; count?: number; - isEncoded: false; + isEncoded?: false; isFunctional?: boolean; traderId?: string; loyaltyLevel?: number; diff --git a/types/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData.d.ts b/types/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData.d.ts index 004d0083..6f7c9b72 100644 --- a/types/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData.d.ts +++ b/types/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData.d.ts @@ -1,4 +1,4 @@ -export type IHideoutCircleOfCultistProductionStartRequestData = { +export interface IHideoutCircleOfCultistProductionStartRequestData { Action: "HideoutCircleOfCultistProductionStart"; timestamp: number; -}; +} diff --git a/types/models/eft/hideout/IHideoutDeleteProductionRequestData.d.ts b/types/models/eft/hideout/IHideoutDeleteProductionRequestData.d.ts new file mode 100644 index 00000000..97714ded --- /dev/null +++ b/types/models/eft/hideout/IHideoutDeleteProductionRequestData.d.ts @@ -0,0 +1,5 @@ +export interface IHideoutDeleteProductionRequestData { + Action: "HideoutDeleteProductionCommand"; + recipeId: string; + timestamp: number; +} diff --git a/types/models/eft/hideout/IHideoutProduction.d.ts b/types/models/eft/hideout/IHideoutProduction.d.ts index 7373a4fd..a773daa7 100644 --- a/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/types/models/eft/hideout/IHideoutProduction.d.ts @@ -1,3 +1,9 @@ +import { MinMax } from "@spt/models/common/MinMax"; +export interface IHideoutProductionData { + recipes: IHideoutProduction[]; + scavRecipes: IScavRecipe[]; + cultistRecipes: ICultistRecipe[]; +} export interface IHideoutProduction { _id: string; areaType: number; @@ -12,14 +18,30 @@ export interface IHideoutProduction { count: number; productionLimitCount: number; } -export interface Requirement { +export interface Requirement extends IRequirementBase { templateId?: string; count?: number; isEncoded?: boolean; isFunctional?: boolean; - type: string; areaType?: number; requiredLevel?: number; resource?: number; questId?: string; } +export interface IRequirementBase { + type: string; +} +export type IScavRecipe = { + _id: string; + requirements: Requirement[]; + productionTime: number; + endProducts: IEndProducts; +}; +export interface IEndProducts { + Common: MinMax; + Rare: MinMax; + Superrare: MinMax; +} +export type ICultistRecipe = { + _id: string; +}; diff --git a/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index 0c480141..9abe2b51 100644 --- a/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -35,8 +35,8 @@ export interface ProfileChange { questsStatus: IQuestStatus[]; } export interface IHideoutStashItem { - Id: string; - Tpl: string; + id: string; + tpl: string; } export interface IWeaponBuildChange { id: string; diff --git a/types/models/eft/match/IRaidSettings.d.ts b/types/models/eft/match/IRaidSettings.d.ts index 78a0c19a..2e4587bb 100644 --- a/types/models/eft/match/IRaidSettings.d.ts +++ b/types/models/eft/match/IRaidSettings.d.ts @@ -10,15 +10,18 @@ import { TimeFlowType } from "@spt/models/enums/RaidSettings/TimeAndWeather/Time import { WindSpeed } from "@spt/models/enums/RaidSettings/TimeAndWeather/WindSpeed"; import { SideType } from "@spt/models/enums/SideType"; export interface IRaidSettings { + keyId: string; location: string; + isLocationTransition: boolean; timeVariant: DateTime; - raidMode: RaidMode; metabolismDisabled: boolean; - playersSpawnPlace: PlayersSpawnPlace; timeAndWeatherSettings: TimeAndWeatherSettings; botSettings: BotSettings; wavesSettings: WavesSettings; side: SideType; + raidMode: RaidMode; + playersSpawnPlace: PlayersSpawnPlace; + CanShowGroupPreview: boolean; } export interface TimeAndWeatherSettings { isRandomTime: boolean; diff --git a/types/models/enums/HideoutEventActions.d.ts b/types/models/enums/HideoutEventActions.d.ts index 99fb979f..a495db9d 100644 --- a/types/models/enums/HideoutEventActions.d.ts +++ b/types/models/enums/HideoutEventActions.d.ts @@ -11,5 +11,6 @@ export declare enum HideoutEventActions { HIDEOUT_RECORD_SHOOTING_RANGE_POINTS = "RecordShootingRangePoints", HIDEOUT_IMPROVE_AREA = "HideoutImproveArea", HIDEOUT_CANCEL_PRODUCTION_COMMAND = "HideoutCancelProductionCommand", - HIDEOUT_CIRCLE_OF_CULTIST_PRODUCTION_START = "HideoutCircleOfCultistProductionStart" + HIDEOUT_CIRCLE_OF_CULTIST_PRODUCTION_START = "HideoutCircleOfCultistProductionStart", + HIDEOUT_DELETE_PRODUCTION_COMMAND = "HideoutDeleteProductionCommand" } diff --git a/types/models/enums/ItemTpl.d.ts b/types/models/enums/ItemTpl.d.ts index 750510ea..4dd29099 100644 --- a/types/models/enums/ItemTpl.d.ts +++ b/types/models/enums/ItemTpl.d.ts @@ -204,6 +204,10 @@ export declare enum ItemTpl { AMMOBOX_9X39_SPP_8RND = "5c12619186f7743f871c8a32", AMMO_127X108_B32 = "5cde8864d7f00c0010373be1", AMMO_127X108_BZT44M = "5d2f2ab648f03550091993ca", + AMMO_127X33_COPPER = "66a0d1e0ed648d72fe064d06", + AMMO_127X33_FMJ = "668fe62ac62660a5d8071446", + AMMO_127X33_HAWK_JSP = "66a0d1f88486c69fce00fdf6", + AMMO_127X33_JHP = "66a0d1c87d0d369e270bb9de", AMMO_127X55_PS12 = "5cadf6ddae9215051e1c23b2", AMMO_127X55_PS12A = "5cadf6e5ae921500113bb973", AMMO_127X55_PS12B = "5cadf6eeae921500134b2799", @@ -510,6 +514,7 @@ export declare enum ItemTpl { ASSAULTCARBINE_KBP_VSK94_9X39_RIFLE = "645e0c6b3b381ede770e1cc9", ASSAULTCARBINE_MOLOT_ARMS_SIMONOV_OPSKS_762X39_CARBINE = "587e02ff24597743df3deaeb", ASSAULTCARBINE_MOLOT_ARMS_VPO101_VEPRHUNTER_762X51_CARBINE = "5c501a4d2e221602b412b540", + ASSAULTCARBINE_SR3M_9X39_COMPACT_ASSAULT_RIFLE = "651450ce0e00edc794068371", ASSAULTCARBINE_TOKAREV_AVT40_762X54R_AUTOMATIC_RIFLE = "6410733d5dd49d77bd07847e", ASSAULTCARBINE_TOKAREV_SVT40_762X54R_RIFLE = "643ea5b23db6f9f57107d9fd", ASSAULTCARBINE_TOZ_SIMONOV_SKS_762X39_CARBINE = "574d967124597745970e7c94", @@ -615,6 +620,7 @@ export declare enum ItemTpl { BACKPACK_6SH118_RAID_BACKPACK_DIGITAL_FLORA = "5df8a4d786f77412672a1e3b", BACKPACK_ANA_TACTICAL_BETA_2_BATTLE_BACKPACK_OLIVE_DRAB = "5b44c6ae86f7742d1627baea", BACKPACK_CAMELBAK_TRIZIP_ASSAULT_BACKPACK_FOLIAGE = "545cdae64bdc2d39198b4568", + BACKPACK_CAMELBAK_TRIZIP_ASSAULT_BACKPACK_MULTICAM = "66b5f22b78bbc0200425f904", BACKPACK_DIRECT_ACTION_DRAGON_EGG_MARK_II_BACKPACK_BLACK = "656f198fb27298d6fd005466", BACKPACK_DUFFLE_BAG = "56e33634d2720bd8058b456b", BACKPACK_EBERLESTOCK_F4_TERMINATOR_LOAD_BEARING_BACKPACK_TIGER_STRIPE = "5f5e46b96bdad616ad46d613", @@ -638,6 +644,7 @@ export declare enum ItemTpl { BACKPACK_MYSTERY_RANCH_SATL_BRIDGER_ASSAULT_PACK_FOLIAGE = "656e0436d44a1bb4220303a0", BACKPACK_MYSTERY_RANCH_TERRAPLANE = "56e294cdd2720b603a8b4575", BACKPACK_OAKLEY_MECHANISM_HEAVY_DUTY_BACKPACK_BLACK = "5d5d940f86f7742797262046", + BACKPACK_PARTIZANS_BAG = "66a9f98f3bd5a41b162030f4", BACKPACK_PILGRIM_TOURIST = "59e763f286f7742ee57895da", BACKPACK_SANITARS_BAG = "5e997f0b86f7741ac73993e2", BACKPACK_SANTAS_BAG = "61b9e1aaef9a1b5d6a79899a", @@ -647,6 +654,7 @@ export declare enum ItemTpl { BACKPACK_TASMANIAN_TIGER_TROOPER_35_BACKPACK_KHAKI = "639346cc1c8f182ad90c8972", BACKPACK_TEHINKOM_RKPT25_PATROL_BACKPACK_DIGITAL_FLORA = "656ddcf0f02d7bcea90bf395", BACKPACK_TRANSFORMER_BAG = "56e33680d2720be2748b4576", + BACKPACK_VERTX_READY_PACK_BACKPACK_RED = "66b5f247af44ca0014063c02", BACKPACK_VKBO_ARMY_BAG = "5ab8ee7786f7742d8f33f0b9", BACKPACK_WARTECH_BERKUT_BB102_BACKPACK_ATACS_FG = "5ca20d5986f774331e7c9602", BARREL_9A91_9X39 = "645122f6d4928d46d30be3ff", @@ -661,6 +669,11 @@ export declare enum ItemTpl { BARREL_AR15_HANSON_CARBINE_556X45_137_INCH = "63d3ce0446bd475bcb50f55f", BARREL_AR15_HANSON_CARBINE_556X45_16_INCH = "63d3d44a2a49307baf09386d", BARREL_BENELLI_M3_SUPER_90_12GA_500MM = "6259c2c1d714855d182bad85", + BARREL_DESERT_EAGLE_L5_357_127MM = "669fa4c61bd4416eaa09b3ca", + BARREL_DESERT_EAGLE_L5_50_AE_127MM = "669fa4ba1bd4416eaa09b3c6", + BARREL_DESERT_EAGLE_L6_50_AE_152MM = "669fa47da0bab4e8510d9526", + BARREL_DESERT_EAGLE_L6_50_AE_152MM_BARREL_WTS = "669fa48fa0bab4e8510d952a", + BARREL_DESERT_EAGLE_MK_XIX_50_AE_152MM = "668fe5f62a0f85eea407cc18", BARREL_DVL10_762X51_500MM = "5888945a2459774bf43ba385", BARREL_DVL10_M2_762X51_660MM = "5888956924597752983e182d", BARREL_FN_FIVESEVEN_57X28 = "5d3eb5b6a4b9361eab311902", @@ -707,6 +720,10 @@ export declare enum ItemTpl { BARREL_M1911A1_45_ACP_THREADED = "5f3e77f59103d430b93f94c1", BARREL_M1A_762X51_16_INCH = "5aaf9d53e5b5b00015042a52", BARREL_M1A_762X51_22_INCH = "5addbac75acfc400194dbc56", + BARREL_M60E3_762X51_584MM = "6601279cc752a02bbe05e692", + BARREL_M60E4_762X51_458MM = "660126f7c752a02bbe05e688", + BARREL_M60E4_762X51_475MM_HEAVY = "66012788c752a02bbe05e68e", + BARREL_M60E6_762X51_458MM = "66225d88a1c7e3b81600c76f", BARREL_M700_762X51_20_INCH_STAINLESS_STEEL_THREADED = "5d2703038abbc3105103d94c", BARREL_M700_762X51_20_INCH_THREADED = "5bfebc320db8340019668d79", BARREL_M700_762X51_26_INCH = "5bfebc250db834001a6694e1", @@ -791,7 +808,15 @@ export declare enum ItemTpl { BARREL_TT_762X25_116MM = "571a26d524597720680fbe8a", BARREL_TT_762X25_116MM_GILDED = "5b3baf8f5acfc40dc5296692", BARREL_TT_762X25_121MM_HOMESPUN_THREADED = "571a279b24597720b4066566", - BARREL_VPO215_GORNOSTAY_366TKM_23_INCH = "5de65547883dde217541644b", + BARREL_UZI_238MM_THREADED_3LUG = "6698c89bfbc8142e60024b0e", + BARREL_UZI_9X19_259MM = "6698c8ab29e062525d0ad8ab", + BARREL_UZI_9X19_409MM = "6698c8b7710a4525fe0e9e55", + BARREL_UZI_PRO_9X19_114MM = "66866fe776d1a87cd80fd388", + BARREL_UZI_PRO_9X19_170MM = "6686700a2b934a68630a7fe6", + BARREL_UZI_PRO_9X19_210MM = "66867023c3d473265104f384", + BARREL_UZI_PRO_9X19_240MM = "668670432b934a68630a7fe8", + BARREL_UZI_PRO_9X19_PIKE_ARMS_114MM_THREADED = "668031705014e211b4078046", + BARREL_VPO215_GORNOSTAY_366TKM_600MM = "5de65547883dde217541644b", BARREL_VSK94_9X39 = "645123013d52156624001fd1", BARTER_42_SIGNATURE_BLEND_ENGLISH_TEA = "5bc9be8fd4351e00334cae6e", BARTER_6STEN140M_MILITARY_BATTERY = "5d03794386f77420415576f5", @@ -885,6 +910,7 @@ export declare enum ItemTpl { BARTER_HAND_DRILL = "5d1b317c86f7742523398392", BARTER_HORSE_FIGURINE = "573478bc24597738002c6175", BARTER_HUNTING_MATCHES = "5e2af2bc86f7746d3f3c33fc", + BARTER_INSEQ_GAS_PIPE_WRENCH = "66b37f114410565a8f6789e2", BARTER_INSULATING_TAPE = "5734795124597738002c6176", BARTER_IRIDIUM_MILITARY_THERMAL_VISION_MODULE = "5d0377ce86f774186372f689", BARTER_KEKTAPE_DUCT_TAPE = "5e2af29386f7746d4159f077", @@ -955,7 +981,7 @@ export declare enum ItemTpl { BARTER_PRINTER_PAPER = "577e1c9d2459773cd707c525", BARTER_PROPANE_TANK_5L = "59fafb5d86f774067a6f2084", BARTER_RADIATOR_HELIX = "5d1c774f86f7746d6620f8db", - BARTER_RAM = "57347baf24597738002c6178", + BARTER_RAM_STICK = "57347baf24597738002c6178", BARTER_RATCHET_WRENCH = "60391afc25aff57af81f7085", BARTER_RAVEN_FIGURINE = "5e54f62086f774219b0f1937", BARTER_RECHARGEABLE_BATTERY = "590a358486f77429692b2790", @@ -980,6 +1006,7 @@ export declare enum ItemTpl { BARTER_STRIKE_CIGARETTES = "5734770f24597738025ee254", BARTER_SURVL_SURVIVOR_LIGHTER = "5e2af37686f774755a234b65", BARTER_TAGILLA_FIGURINE = "66572cbdad599021091c611a", + BARTER_TAMATTHI_KUNAI_KNIFE_REPLICA = "66b37ea4c5d72b0277488439", BARTER_TETRIZ_PORTABLE_GAME_CONSOLE = "5c12620d86f7743f8b198b72", BARTER_TOILET_PAPER = "5c13cef886f774072e618e82", BARTER_TOOLSET = "590c2e1186f77425357b6124", @@ -994,6 +1021,7 @@ export declare enum ItemTpl { BARTER_USEC_OPERATIVE_FIGURINE = "655c663a6689c676ce57af85", BARTER_UZRGM_GRENADE_FUZE = "5e2af51086f7746d3f3c3402", BARTER_VERITAS_GUITAR_PICK = "5f745ee30acaeb0d490d8c5b", + BARTER_VIIBIIN_SNEAKER = "66b37eb4acff495a29492407", BARTER_VIRTEX_PROGRAMMABLE_PROCESSOR = "5c05308086f7746b2101e90b", BARTER_VPX_FLASH_STORAGE_MODULE = "5c05300686f7746dce784e5d", BARTER_WATER_FILTER = "5d1b385e86f774252167b98a", @@ -1006,8 +1034,11 @@ export declare enum ItemTpl { BARTER_WRENCH = "590c311186f77424d1667482", BARTER_XENOMORPH_SEALING_FOAM = "590c346786f77423e50ed342", BARTER_ZIBBO_LIGHTER = "56742c2e4bdc2d95058b456d", + BIPOD_ALL_TEST = "665745c8a3c672c7b00bb355", + BIPOD_BT10_V8_ATLAS = "6644920d49817dc7d505ca71", BIPOD_HARRIS_HBR = "5888961624597754281f93f3", BIPOD_HK_G36 = "622b397c9a3d4327e41843b6", + BIPOD_M60 = "66012d9a3dff5074ed002e33", BIPOD_PK = "6464d870bb2c580352070cc4", BIPOD_RPD = "6513f037e06849f06c0957d7", BIPOD_SV98 = "56ea8222d2720b69698b4567", @@ -1059,8 +1090,8 @@ export declare enum ItemTpl { BUILTININSERTS_6B516_LEVEL2_SOFT_ARMOR_COLLAR = "65764c39526e320fbe035777", BUILTININSERTS_6B516_LEVEL3_SOFT_ARMOR_FRONT = "65764a4cd8537eb26a0355ee", BUILTININSERTS_6B516_LEVEL3_SOFT_ARMOR_GROIN = "65764c6b526e320fbe03577b", - BUILTININSERTS_ADEPT_NEOSTEEL_LEVEL3_HELMET_ARMOR_NAPE = "657f9ef6c6679fefb3051e1f", - BUILTININSERTS_ADEPT_NEOSTEEL_LEVEL3_HELMET_ARMOR_TOP = "657f9eb7e9433140ad0baf86", + BUILTININSERTS_ADEPT_NEOSTEEL_LEVEL4_HELMET_ARMOR_NAPE = "657f9ef6c6679fefb3051e1f", + BUILTININSERTS_ADEPT_NEOSTEEL_LEVEL4_HELMET_ARMOR_TOP = "657f9eb7e9433140ad0baf86", BUILTININSERTS_ALTIN_LEVEL5_HELMET_ARMOR_EARS = "657bc107aab96fccee08be9f", BUILTININSERTS_ALTIN_LEVEL5_HELMET_ARMOR_NAPE = "657bc0d8a1c61ee0c303632f", BUILTININSERTS_ALTIN_LEVEL5_HELMET_ARMOR_TOP = "657bc06daab96fccee08be9b", @@ -1086,6 +1117,8 @@ export declare enum ItemTpl { BUILTININSERTS_BAGARII_LEVEL3_SOFT_ARMOR_FRONT = "657322988c1cc6dcd9098b2d", BUILTININSERTS_BAGARII_LEVEL3_SOFT_ARMOR_LEFT_SIDE = "657322acd9d89ff7ac0d961b", BUILTININSERTS_BAGARII_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = "657322b7d9d89ff7ac0d961f", + BUILTININSERTS_BALLISTICARMORCO_BASTION_LEVEL4_HELMET_ARMOR_NAPE = "66b61ce0c5d72b027748867e", + BUILTININSERTS_BALLISTICARMORCO_BASTION_LEVEL4_HELMET_ARMOR_TOP = "66b61cfae98be930d701c029", BUILTININSERTS_BANSHEE_LEVEL2_SOFT_ARMOR_BACK = "6573102b292ecadbfa09b38d", BUILTININSERTS_BANSHEE_LEVEL2_SOFT_ARMOR_FRONT = "6573101e292ecadbfa09b389", BUILTININSERTS_BANSHEE_LEVEL2_SOFT_ARMOR_LEFT_SIDE = "65731038292ecadbfa09b391", @@ -1265,11 +1298,16 @@ export declare enum ItemTpl { BUILTININSERTS_REDUT_T_LEVEL3_SOFT_ARMOR_LEFT_SIDE = "6575d9c40546f8b1de093dee", BUILTININSERTS_REDUT_T_LEVEL3_SOFT_ARMOR_RIGHT_ARM = "6575da159e27f4a85e081131", BUILTININSERTS_REDUT_T_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = "6575d9cf0546f8b1de093df2", - BUILTININSERTS_RONIN_LEVEL3_HELMET_ARMOR_EARS = "65711b706d197c216005b31c", - BUILTININSERTS_RONIN_LEVEL3_HELMET_ARMOR_EYES = "65711b9b65daf6aa960c9b1b", - BUILTININSERTS_RONIN_LEVEL3_HELMET_ARMOR_JAW = "65711bc79eb8c145180dbba1", - BUILTININSERTS_RONIN_LEVEL3_HELMET_ARMOR_NAPE = "65711b489eb8c145180dbb9d", - BUILTININSERTS_RONIN_LEVEL3_HELMET_ARMOR_TOP = "65711b07a330b8c9060f7b01", + BUILTININSERTS_RONIN_LEVEL3_HELMET_ARMOR_EARS = "66bdc2c90b603c26902b2018", + BUILTININSERTS_RONIN_LEVEL3_HELMET_ARMOR_EYES = "66bdc2d051aa8c345646d03f", + BUILTININSERTS_RONIN_LEVEL3_HELMET_ARMOR_JAW = "66bdc2d9408f1e66eb4fd957", + BUILTININSERTS_RONIN_LEVEL3_HELMET_ARMOR_NAPE = "66bdc2e25f17154509115d1e", + BUILTININSERTS_RONIN_LEVEL3_HELMET_ARMOR_TOP = "66bdc2ea8cbd597c9c2f9360", + BUILTININSERTS_RONIN_LEVEL4_HELMET_ARMOR_EARS = "65711b706d197c216005b31c", + BUILTININSERTS_RONIN_LEVEL4_HELMET_ARMOR_EYES = "65711b9b65daf6aa960c9b1b", + BUILTININSERTS_RONIN_LEVEL4_HELMET_ARMOR_JAW = "65711bc79eb8c145180dbba1", + BUILTININSERTS_RONIN_LEVEL4_HELMET_ARMOR_NAPE = "65711b489eb8c145180dbb9d", + BUILTININSERTS_RONIN_LEVEL4_HELMET_ARMOR_TOP = "65711b07a330b8c9060f7b01", BUILTININSERTS_RYS_T_LEVEL5_HELMET_ARMOR_EARS = "657bc2e7b30eca976305118d", BUILTININSERTS_RYS_T_LEVEL5_HELMET_ARMOR_NAPE = "657bc2c5a1c61ee0c3036333", BUILTININSERTS_RYS_T_LEVEL5_HELMET_ARMOR_TOP = "657bc285aab96fccee08bea3", @@ -1284,6 +1322,15 @@ export declare enum ItemTpl { BUILTININSERTS_SSH68_LEVEL3_HELMET_ARMOR_EARS = "657119fea330b8c9060f7afc", BUILTININSERTS_SSH68_LEVEL3_HELMET_ARMOR_NAPE = "657119d49eb8c145180dbb95", BUILTININSERTS_SSH68_LEVEL3_HELMET_ARMOR_TOP = "6571199565daf6aa960c9b10", + BUILTININSERTS_STICHPROFI_PCV2_LEVEL2_SOFT_ARMOR_BACK = "66b884eaacff495a29492849", + BUILTININSERTS_STICHPROFI_PCV2_LEVEL2_SOFT_ARMOR_FRONT = "66b884f4c5d72b02774886eb", + BUILTININSERTS_STICHPROFI_PCV2_LEVEL2_SOFT_ARMOR_GROIN_FRONT = "66b884fd7994640992013b37", + BUILTININSERTS_STICHPROFI_PCV2_LEVEL2_SOFT_ARMOR_LEFT_SIDE = "66b8851678bbc0200425fa03", + BUILTININSERTS_STICHPROFI_PCV2_LEVEL2_SOFT_ARMOR_RIGHT_SIDE = "66b88521a7f72d197e70be3b", + BUILTININSERTS_STICH_DEFENSE_M2_LEVEL3_SOFT_ARMOR_BACK = "66b8b20c5891c84aab75cb96", + BUILTININSERTS_STICH_DEFENSE_M2_LEVEL3_SOFT_ARMOR_FRONT = "66b8b217c5d72b02774887b4", + BUILTININSERTS_STICH_DEFENSE_M2_LEVEL3_SOFT_ARMOR_LEFT_SIDE = "66b8b223a7f72d197e70bed3", + BUILTININSERTS_STICH_DEFENSE_M2_LEVEL3_SOFT_ARMOR_RIGHT_SIDE = "66b8b22b78bbc0200425fb20", BUILTININSERTS_STRANDHOGG_LEVEL2_SOFT_ARMOR_BACK = "6572eb1b04ee6483ef039882", BUILTININSERTS_STRANDHOGG_LEVEL2_SOFT_ARMOR_FRONT = "6572eb0e55beba16bc04079f", BUILTININSERTS_STRANDHOGG_LEVEL2_SOFT_ARMOR_GROIN_FRONT = "6572eb865b5eac12f10a03ee", @@ -1381,6 +1428,7 @@ export declare enum ItemTpl { COLLIMATOR_FN_P90_RING_SIGHT_REFLEX_SIGHT = "5cebec38d7f00c00110a652a", COLLIMATOR_HENSOLDT_RV_RED_DOT_SIGHT = "622efbcb99f4ea1a4d6c9a15", COLLIMATOR_HOLOSUN_HS401G5_REFLEX_SIGHT = "5b30b0dc5acfc400153b7124", + COLLIMATOR_KOMZ_RUSAK_REFLEX_SIGHT = "65f05b9d39dab9e9ec049cfd", COLLIMATOR_LEAPERS_UTG_REFLEX_SIGHT = "6165ac8c290d254f5e6b2f6c", COLLIMATOR_MILKOR_M2A1_GRENADE_LAUNCHER_REFLEX_SIGHT = "6284bd5f95250a29bc628a30", COLLIMATOR_NPZ_PK1_OBZOR_DOVETAIL_REFLEX_SIGHT = "618a5d5852ecee1505530b2a", @@ -1422,6 +1470,7 @@ export declare enum ItemTpl { CONTAINER_MR_HOLODILNICK_THERMAL_BAG = "5c093db286f7740a1b2617e3", CONTAINER_SICC = "5d235bb686f77443f4331278", CONTAINER_SIMPLE_WALLET = "5783c43d2459774bbe137486", + CONTAINER_STREAMER_ITEM_CASE = "66bc98a01a47be227a5e956e", CONTAINER_THICC_ITEM_CASE = "5c0a840b86f7742ffa4f2482", CONTAINER_THICC_WEAPON_CASE = "5b6d9ce188a4501afc1b2b25", CONTAINER_WEAPON_CASE = "59fb023c86f7746d0d4b423c", @@ -1430,7 +1479,7 @@ export declare enum ItemTpl { DRINK_AQUAMARI_WATER_BOTTLE_WITH_FILTER = "5c0fa877d174af02a012e1cf", DRINK_BOTTLE_OF_DAN_JACKIEL_WHISKEY = "5d403f9186f7743cac3f229b", DRINK_BOTTLE_OF_FIERCE_HATCHLING_MOONSHINE = "5d1b376e86f774252519444e", - DRINK_BOTTLE_OF_NORVINSKIY_YADRENIY_PREMIUM_KVASS_06L = "5e8f3423fd7471236e6e3b64", + DRINK_BOTTLE_OF_NORVINSKY_YADRENIY_PREMIUM_KVASS_06L = "5e8f3423fd7471236e6e3b64", DRINK_BOTTLE_OF_PEVKO_LIGHT_BEER = "62a09f32621468534a797acb", DRINK_BOTTLE_OF_TARKOVSKAYA_VODKA = "5d40407c86f774318526545a", DRINK_BOTTLE_OF_TARKOVSKAYA_VODKA_BAD = "614451b71e5874611e2c7ae5", @@ -1528,6 +1577,7 @@ export declare enum ItemTpl { FLASHHIDER_AR10_CMMG_SV_BRAKE_762X51_MUZZLE_BRAKE = "6065c6e7132d4d12c81fd8e1", FLASHHIDER_AR10_DANIEL_DEFENSE_WAVE_762X51_MUZZLE_BRAKE = "5d1f819086f7744b355c219b", FLASHHIDER_AR10_DEAD_AIR_KEYMOUNT_762X51_MUZZLE_BRAKE = "628a66b41d5e41750e314f34", + FLASHHIDER_AR10_DELTATEK_DTKAR10_762X51_MUZZLE_BRAKE = "6642f63667f5cb56a00662eb", FLASHHIDER_AR10_FORTIS_RED_BRAKE_762X51_MUZZLE_BRAKE = "5d026791d7ad1a04a067ea63", FLASHHIDER_AR10_KAC_QDC_762X51_FLASH_SUPPRESSOR_KIT = "5dfa3cd1b33c0951220c079b", FLASHHIDER_AR10_KAC_QDC_762X51_MUZZLE_BRAKE_KIT = "6130c43c67085e45ef1405a1", @@ -1548,6 +1598,8 @@ export declare enum ItemTpl { FLASHHIDER_AR15_BULLETEC_ST6012_556X45_MUZZLE_BRAKE = "5cf6937cd7f00c056c53fb39", FLASHHIDER_AR15_COLT_USGI_A2_556X45_FLASH_HIDER = "544a38634bdc2d58388b4568", FLASHHIDER_AR15_DANIEL_DEFENSE_WAVE_556X45_MUZZLE_BRAKE = "5cff9e5ed7ad1a09407397d4", + FLASHHIDER_AR15_DELTATEK_DTKM16_556X45_MUZZLE_BRAKE = "664301213dd83ddae20dda18", + FLASHHIDER_AR15_DOUBLESTAR_CARLSON_TAC_COMP_556X45_COMPENSATOR = "6621455e3aceea9e2b0b01e7", FLASHHIDER_AR15_FERFRANS_CQB_556X45_MUZZLE_BRAKE = "5f6372e2865db925d54f3869", FLASHHIDER_AR15_GRIFFIN_ARMAMENT_GATELOK_HAMMER_556X45_FLASH_HIDER = "6386120cd6baa055ad1e201c", FLASHHIDER_AR15_HK_BLITZ_556X45_FLASH_HIDER = "615d8e2f1cb55961fa0fd9a4", @@ -1602,6 +1654,8 @@ export declare enum ItemTpl { FLASHHIDER_M1A_NATIONAL_MATCH_762X51_FLASH_SUPPRESSOR = "5addbb6e5acfc408fb1393fd", FLASHHIDER_M1A_SMITH_ENTERPRISE_SOCOM_16_762X51_THREADED_MUZZLE_BRAKE_GAS_BLOCK = "5ab3afb2d8ce87001660304d", FLASHHIDER_M1A_SOCOM_16_762X51_MUZZLE_BRAKECOMPENSATOR = "5aafa1c2e5b5b00015042a56", + FLASHHIDER_M60E3_762X51_FLASH_HIDER = "6601281fc752a02bbe05e696", + FLASHHIDER_M60E6_762X51_FLASH_HIDER = "66012a1d3dff5074ed002e2a", FLASHHIDER_MCX_SPEAR_CLUTCHLOK_QD_68X51_SHOULDERED_FLASH_HIDER = "6529113b5ae2ae97b80fdf39", FLASHHIDER_MOSIN_RIFLE_TACFIRE_TANKER_STYLE_762X54R_MUZZLE_BRAKE = "5bbdb83fd4351e44f824c44b", FLASHHIDER_MOSIN_RIFLE_TEXAS_PRECISION_PRODUCTS_762X54R_MUZZLE_BRAKE = "5bc5a351d4351e003477a414", @@ -1631,8 +1685,9 @@ export declare enum ItemTpl { FLASHHIDER_SV98_SRVV_MK20_762X54R_MUZZLE_BRAKECOMPENSATOR = "5c4ee3d62e2216152006f302", FLASHHIDER_SVDS_762X54R_MUZZLE_BRAKECOMPENSATOR = "5c471bfc2e221602b21d4e17", FLASHHIDER_SVT40_762X54R_MUZZLE_BRAKE = "64119d1f2c6d6f921a0929f8", - FLASHHIDER_TACCOM_CARBINE_BRAKE_MULTICALIBER_MUZZLE_BRAKE = "5cf6935bd7f00c06585fb791", + FLASHHIDER_TACCOM_CARBINE_BRAKE_9X19_MUZZLE_BRAKE = "5cf6935bd7f00c06585fb791", FLASHHIDER_TT_PMLASER_DTKTT_MUZZLE_BRAKECOMPENSATOR = "5bffd7ed0db834001d23ebf9", + FLASHHIDER_UZI_VENTED_BARREL_SHROUD = "6699370c57df3e2b4e0a0dab", FLASHHIDER_VPO136_VEPRKM_762X39_MUZZLE_BRAKECOMPENSATOR = "59e61eb386f77440d64f5daf", FLASHHIDER_VPO209_THREAD_PROTECTOR = "59e8a00d86f7742ad93b569c", FLASHHIDER_YANKEE_HILL_ANNIHILATOR_MULTICALIBER_FLASH_HIDER = "5b3a16655acfc40016387a2a", @@ -1664,6 +1719,8 @@ export declare enum ItemTpl { FOREGRIP_A3_TACTICAL_MVF001_KEYMOD_VERTICAL_FOREGRIP_BLACK = "5fc0f9b5d724d907e2077d82", FOREGRIP_AI_AXMC_PADDED_HANDGUARD_GRIP = "6281212a09427b40ab14e770", FOREGRIP_ASH12_VERTICAL = "5cda9bcfd7f00c0c0b53e900", + FOREGRIP_BCM_GUNFIGHTER_MOD_3_MLOK_FOREGRIP_BLACK = "665d5d9e338229cfd6078da1", + FOREGRIP_BCM_GUNFIGHTER_MOD_3_MLOK_FOREGRIP_FDE = "665edce564fb556f940ab32a", FOREGRIP_BCM_GUNFIGHTER_MOD_3_VERTICAL = "5c7fc87d2e221644f31c0298", FOREGRIP_DANIEL_DEFENSE_ENHANCED_MLOK_VERTICAL_FOREGRIP_BLACK = "651a8bf3a8520e48047bf708", FOREGRIP_DANIEL_DEFENSE_ENHANCED_MLOK_VERTICAL_FOREGRIP_COYOTE_BROWN = "651a8e529829226ceb67c319", @@ -1690,15 +1747,21 @@ export declare enum ItemTpl { FOREGRIP_RTM_PILLAU_TACTICAL = "5cf4fb76d7f00c065703d3ac", FOREGRIP_RTM_PILLAU_TACTICAL_FOREGRIP_SAND = "648067db042be0705c0b3009", FOREGRIP_SIG_SAUER_VERTICAL_FOREGRIP_KEYMOD_BLACK = "5fc0f9cbd6fa9c00c571bb90", + FOREGRIP_SR3M_POLYMER_FOREGRIP_BLACK = "65329ebcc0d50d0c9204ace1", + FOREGRIP_SR3M_POLYMER_FOREGRIP_PLUM = "6565c0c2ff7eb7070409084c", FOREGRIP_STARK_SE5_EXPRESS_FORWARD = "5b057b4f5acfc4771e1bd3e9", FOREGRIP_STARK_SE5_EXPRESS_FORWARD_FOREGRIP_FDE = "655df24fdf80b12750626d0a", FOREGRIP_STEYR_AUG_VERTICAL = "634e61b0767cb15c4601a877", FOREGRIP_STRIKE_INDUSTRIES_COBRA_TACTICAL = "5c791e872e2216001219c40a", FOREGRIP_STRIKE_INDUSTRIES_COBRA_TACTICAL_FOREGRIP_FDE = "655dccfdbdcc6b5df71382b6", FOREGRIP_TACTICAL_DYNAMICS_SKELETONIZED = "5f6340d3ca442212f4047eb2", + FOREGRIP_TANGODOWN_BGVQDITI_FOREGRIP_BLACK = "661e52e29c8b4dadef008577", + FOREGRIP_TANGODOWN_BGVQDITI_FOREGRIP_FDE = "661e53149c8b4dadef008579", FOREGRIP_TANGODOWN_STUBBY_BGVMK46K_FOREGRIP_BLACK = "558032614bdc2de7118b4585", FOREGRIP_TANGODOWN_STUBBY_BGVMK46K_FOREGRIP_FDE = "58c157be86f77403c74b2bb6", FOREGRIP_TANGODOWN_STUBBY_BGVMK46K_FOREGRIP_STEALTH_GREY = "58c157c886f774032749fb06", + FOREGRIP_TANGODOWN_STUBBY_BGVQDK_FOREGRIP_BLACK = "661e52415be02310ed07a07a", + FOREGRIP_TANGODOWN_STUBBY_BGVQDK_FOREGRIP_FDE = "661e52b5b099f32c28003586", FOREGRIP_VIKING_TACTICS_UVG_TACTICAL = "591af28e86f77414a27a9e1d", FOREGRIP_ZENIT_RK0_TACTICAL = "5c1bc4812e22164bef5cfde7", FOREGRIP_ZENIT_RK1_TACTICAL = "5c1bc5612e221602b5429350", @@ -1756,7 +1819,7 @@ export declare enum ItemTpl { HANDGUARD_AI_AXMC_AX_KEYSLOT_16_INCH = "6281209662cba23f6c4d7a19", HANDGUARD_AK12 = "649ec127c93611967b034957", HANDGUARD_AK545_SAG_MK3 = "628b916469015a4e1711ed8d", - HANDGUARD_AK74_PLUM_POLYMER_HANDGUARD_6P20_SB9 = "5cbda9f4ae9215000e5b9bfc", + HANDGUARD_AK74_6P20_SB9_POLYMER_HANDGUARD_PLUM = "5cbda9f4ae9215000e5b9bfc", HANDGUARD_AK74_POLYMER_HANDGUARD_6P20_SB9 = "5648b1504bdc2d9d488b4584", HANDGUARD_AK74_WOODEN_HANDGUARD_6P20_SB6 = "5648b0744bdc2d363b8b4578", HANDGUARD_AKM_WOODEN_HANDGUARD_6P1_SB61 = "59d64f2f86f77417193ef8b3", @@ -1863,6 +1926,9 @@ export declare enum ItemTpl { HANDGUARD_HK_MP5_PTR_TRIRAIL = "5d19cd96d7ad1a4a992c9f52", HANDGUARD_HK_MP5_WIDE_TROPICAL_POLYMER = "5926c36d86f77467a92a8629", HANDGUARD_KS23M_FORESTOCK = "5e848d51e4dbc5266a4ec63b", + HANDGUARD_M60E4_MOD_1 = "66012d64c752a02bbe05e69b", + HANDGUARD_M60E4_MOD_1_HANDGUARD_FDE = "661fbe066751ee51930b01f2", + HANDGUARD_M60E6 = "66012d003dff5074ed002e2c", HANDGUARD_M700_AB_ARMS_MODX_GEN_3_KEYMOD = "5cde7afdd7f00c000d36b89d", HANDGUARD_M870_FAB_DEFENSE_PR870_FORESTOCK = "5a788031c585673f2b5c1c79", HANDGUARD_M870_MAGPUL_MOE = "5a788068c5856700137e4c8f", @@ -1913,24 +1979,38 @@ export declare enum ItemTpl { HANDGUARD_SOK12_LEAPERS_UTG_PRO_MTU002_LONG_TOP_ALUMINUM = "5827272a24597748c74bdeea", HANDGUARD_SOK12_LEAPERS_UTG_PRO_MTU002_SHORT_TOP_ALUMINUM = "58272b392459774b4c7b3ccd", HANDGUARD_SOK12_POLYMER_HANDGUARD_SB71 = "576169e62459773c69055191", - HANDGUARD_SR2M_POLYMER = "62e15547db1a5c41971c1b5e", HANDGUARD_SR2M_POLYMER_HANDGUARD_BLACK = "637ba19df7ca6372bf2613d7", + HANDGUARD_SR2M_POLYMER_HANDGUARD_PLUM = "62e15547db1a5c41971c1b5e", + HANDGUARD_SR3M_POLYMER_HANDGUARD_BLACK = "65144f546ddb773afa0e35e1", + HANDGUARD_SR3M_POLYMER_HANDGUARD_PLUM = "6565c3ab977bcc2dbb01c2e7", + HANDGUARD_SR3M_RAILED_POLYMER_HANDGUARD_BLACK = "6568a6bf2c5fb7afc70bc424", HANDGUARD_SV98_CNC_GUNS_OVSV98_KEYMOD = "623c3c1f37b4b31470357737", HANDGUARD_SVDS_POLYMER = "5c471c6c2e221602b66cd9ae", HANDGUARD_SVD_CAA_XRSDRG = "5e5699df2161e06ac158df6f", HANDGUARD_SVD_MODERNIZATION_KIT = "5e56991336989c75ab4f03f6", HANDGUARD_SVD_SAG_MK1_CHASSIS = "5dfcd0e547101c39625f66f9", + HANDGUARD_UZI_HANDGUARD_WITH_FOREGRIP = "66993149558c59581e03c028", + HANDGUARD_UZI_KGRIP = "6699313af74fef4dfd0b04f6", + HANDGUARD_UZI_POLYMER = "6698c8c736ba38d29101770b", + HANDGUARD_UZI_PRO_A3_TACTICAL_MLOK = "668031bde3e7eb26e8004cd7", HANDGUARD_VPO136_VEPRKM_WOODEN = "59e6284f86f77440d569536f", HANDGUARD_VPO209_WOODEN = "59e898ee86f77427614bd225", HANDGUARD_VSK94 = "6448f2f6d4928d46d30be3f6", + HANDGUARD_VSSVAL_POLYMER_HANDGUARD_BLACK = "6565bb7eb4b12a56eb04b084", + HANDGUARD_VSSVAL_POLYMER_HANDGUARD_PLUM = "651178336cad06c37c049eb4", HANDGUARD_WASR1063_CAF_WOODEN_FOREGRIP = "5d2c829448f0353a5c7d6674", HEADPHONES_GSSH01_ACTIVE_HEADSET = "5b432b965acfc47a8774094e", HEADPHONES_MSA_SORDIN_SUPREME_PROXL_HEADSET = "5aa2ba71e5b5b000137b758f", HEADPHONES_OPSCORE_FAST_RAC_HEADSET = "5a16b9fffcdbcb0176308b34", HEADPHONES_OPSMEN_EARMOR_M32_HEADSET = "6033fa48ffd42c541047f728", - HEADPHONES_PELTOR_COMTAC_2_HEADSET_OD_GREEN = "5645bcc04bdc2d363b8b4572", - HEADPHONES_PELTOR_COMTAC_4_HYBRID_HEADSET_COYOTE_BROWN = "628e4e576d783146b124c64d", + HEADPHONES_PELTOR_COMTAC_II_HEADSET_OD_GREEN = "5645bcc04bdc2d363b8b4572", + HEADPHONES_PELTOR_COMTAC_IV_HYBRID_HEADSET_COYOTE_BROWN = "628e4e576d783146b124c64d", + HEADPHONES_PELTOR_COMTAC_VI_HEADSET_COYOTE_BROWN = "66b5f6985891c84aab75ca76", + HEADPHONES_PELTOR_COMTAC_V_HEADSET_OD_GREEN = "66b5f693acff495a294927e3", HEADPHONES_PELTOR_TACTICAL_SPORT_HEADSET = "5c165d832e2216398b5a7e36", + HEADPHONES_SAFARILAND_LIBERATOR_HP_20_HEARING_PROTECTION_HEADSET_FDE = "66b5f68de98be930d701c00e", + HEADPHONES_TW_EXFIL_PELTOR_COMTAC_VI_HEADSET_COYOTE_BROWN = "66b5f6a28ca68c6461709ed8", + HEADPHONES_TW_EXFIL_PELTOR_COMTAC_V_HEADSET_OD_GREEN = "66b5f69ea7f72d197e70bcdb", HEADPHONES_WALKERS_RAZOR_DIGITAL_HEADSET = "5e4d34ca86f774264f758330", HEADPHONES_WALKERS_XCEL_500BT_DIGITAL_HEADSET = "5f60cd6cf2bcbb675b00dac6", HEADWEAR_6B47_RATNIKBSH_HELMET_DIGITAL_FLORA_COVER = "5aa7cfc0e5b5b00015693143", @@ -1944,6 +2024,9 @@ export declare enum ItemTpl { HEADWEAR_ARMY_CAP_DESERT = "60361b0b5a45383c122086a1", HEADWEAR_ARMY_CAP_FLORA = "60361a7497633951dc245eb4", HEADWEAR_ARMY_CAP_UCP = "60361b5a9a15b10d96792291", + HEADWEAR_BALLISTIC_ARMOR_CO_BASTION_HELMET_ARMOR_BLACK = "66b5f65ca7f72d197e70bcd6", + HEADWEAR_BALLISTIC_ARMOR_CO_BASTION_HELMET_MULTICAM = "66b5f666cad6f002ab7214c2", + HEADWEAR_BALLISTIC_ARMOR_CO_BASTION_HELMET_OD_GREEN = "66b5f661af44ca0014063c05", HEADWEAR_BANDANA = "5b43271c5acfc432ff4dce65", HEADWEAR_BASEBALL_CAP = "572b7d8524597762b472f9d1", HEADWEAR_BASMACH_LEATHER_CAP = "65749ccf33fdc9c0cf06d3ca", @@ -1959,7 +2042,8 @@ export declare enum ItemTpl { HEADWEAR_BOSS_CAP = "60a7acf20c5cb24b01346648", HEADWEAR_CRYE_PRECISION_AIRFRAME_HELMET_TAN = "5c17a7ed2e2216152142459c", HEADWEAR_DED_MOROZ_HAT = "5a43943586f77416ad2f06e2", - HEADWEAR_DEVTAC_RONIN_BALLISTIC_HELMET = "5b4329f05acfc47a86086aa1", + HEADWEAR_DEVTAC_RONIN_BALLISTIC_HELMET = "66bdc28a0b603c26902b2011", + HEADWEAR_DEVTAC_RONIN_RESPIRATOR = "5b4329f05acfc47a86086aa1", HEADWEAR_DIAMOND_AGE_BASTION_HELMET_BLACK = "5ea17ca01412a1425304d1c0", HEADWEAR_DIAMOND_AGE_NEOSTEEL_HIGH_CUT_HELMET_BLACK = "65709d2d21b9f815e208ff95", HEADWEAR_DOOR_KICKER_BOONIE_HAT = "5d96141523f0ea1b7f2aacab", @@ -2016,6 +2100,10 @@ export declare enum ItemTpl { HEADWEAR_ZRYACHIYS_BALACLAVA_FOLDED = "636270263f2495c26f00b007", HEADWEAR_ZSH12M_HELMET_BLACK_COVER = "5aa7e4a4e5b5b000137b76f2", HEADWEAR_ZSH12M_HELMET_OLIVE_DRAB = "5aa7e454e5b5b0214e506fa2", + HIDEOUTAREACONTAINER_CIRCLEOFCULTISTS_STASH_1 = "66740c3739b9da6ce402ee65", + HIDEOUTAREACONTAINER_EQUIPMENTPRESETSTAND_STASH_1 = "65e5957613227bb7690ce9f6", + HIDEOUTAREACONTAINER_EQUIPMENTPRESETSTAND_STASH_2 = "65e597266017f07a3204b775", + HIDEOUTAREACONTAINER_EQUIPMENTPRESETSTAND_STASH_3 = "65e5972a13227bb7690cea07", HIDEOUTAREACONTAINER_PLACEOFFAME_STASH_1 = "63dbd45917fff4dee40fe16e", HIDEOUTAREACONTAINER_PLACEOFFAME_STASH_2 = "65424185a57eea37ed6562e9", HIDEOUTAREACONTAINER_PLACEOFFAME_STASH_3 = "6542435ea57eea37ed6562f0", @@ -2068,6 +2156,8 @@ export declare enum ItemTpl { IRONSIGHT_CHIAPPA_RHINO_REAR_SIGHT = "619f4cee4c58466fe1228435", IRONSIGHT_CHIAPPA_RHINO_RED_FIBER_OPTIC_FRONT_SIGHT = "619f52454c58466fe122843b", IRONSIGHT_CHIAPPA_RHINO_RED_FIBER_OPTIC_REAR_SIGHT = "619f4f8c4c58466fe1228439", + IRONSIGHT_DESERT_EAGLE_FRONT_SIGHT = "668fe5ec4315934ba10c6f96", + IRONSIGHT_DESERT_EAGLE_REAR_SIGHT = "668fe5e1800f0244f9036e46", IRONSIGHT_FN_FIVESEVEN_MK2_FRONT_SIGHT = "5d3eb536a4b9363b1f22f8e2", IRONSIGHT_FN_FIVESEVEN_MK2_REAR_SIGHT = "5d3eb4aba4b93650d64e497d", IRONSIGHT_FN_SCAR_FLIPUP_FRONT_SIGHT = "61816fcad92c473c770215cc", @@ -2106,6 +2196,9 @@ export declare enum ItemTpl { IRONSIGHT_M1A_SA_XS_POST_125_BLADE_FRONT_SIGHT = "5aafa49ae5b5b00015042a58", IRONSIGHT_M45A1_NOVAK_LOMOUNT_FRONT_SIGHT = "5f3e78a7fbf956000b716b8e", IRONSIGHT_M45A1_NOVAK_LOMOUNT_REAR_SIGHT = "5f3e7897ddc4f03b010e204a", + IRONSIGHT_M60E4_FRONT_SIGHT = "6601268bc752a02bbe05e686", + IRONSIGHT_M60E6_FRONT_SIGHT_RAIL = "660126a98f2b23af220b27e7", + IRONSIGHT_M60_REAR_SIGHT = "6601265f98a610c1aa0ea637", IRONSIGHT_M9A3_FRONT_SIGHT = "5cadd919ae921500126a77f3", IRONSIGHT_M9A3_REAR_SIGHT = "5cadd940ae9215051e1c2316", IRONSIGHT_M9A3_SIGHT_MOUNT_REAR_SIGHT_RAIL = "5cadd954ae921500103bb3c2", @@ -2160,6 +2253,7 @@ export declare enum ItemTpl { KEYCARD_TERRAGROUP_LABS_KEYCARD_RED = "5c1d0efb86f7744baf2e7b7b", KEYCARD_TERRAGROUP_LABS_KEYCARD_VIOLET = "5c1e495a86f7743109743dfb", KEYCARD_TERRAGROUP_LABS_KEYCARD_YELLOW = "5c1d0d6d86f7744bb2683e1f", + KEYCARD_TERRAGROUP_STORAGE_ROOM = "66acd6702b17692df20144c0", KEYCARD_WITH_A_BLUE_MARKING = "5efde6b4f5448336730dbd61", KEY_ABANDONED_FACTORY_MARKED = "63a3a93f8a56922e82001f5d", KEY_ARCHIVE_ROOM = "63a39e49cd6db0635c1975fc", @@ -2386,12 +2480,13 @@ export declare enum ItemTpl { LOOTCONTAINER_AIRDROP_SUPPLY_CRATE = "622334fa3136504a544d160c", LOOTCONTAINER_AIRDROP_WEAPON_CRATE = "6223351bb5d97a7b2c635ca7", LOOTCONTAINER_BANK_CASH_REGISTER = "64d116f41a9c6143a956127d", - LOOTCONTAINER_BANK_SAFE = "64d11702dd0cd96ab82c3280", + LOOTCONTAINER_BANK_SAFE_3X3 = "66acff0a1d8e1083b303f5af", + LOOTCONTAINER_BANK_SAFE_4X4 = "64d11702dd0cd96ab82c3280", LOOTCONTAINER_BURIED_BARREL_CACHE = "5d6d2bb386f774785b07a77a", LOOTCONTAINER_CASH_REGISTER = "578f879c24597735401e6bc6", LOOTCONTAINER_CASH_REGISTER_TAR22 = "5ad74cf586f774391278f6f0", + LOOTCONTAINER_CIVILIAN_BODY = "658420d8085fea07e674cdb6", LOOTCONTAINER_COMMON_FUND_STASH = "5d07b91b86f7745a077a9432", - LOOTCONTAINER_DEAD_CIVILIAN = "658420d8085fea07e674cdb6", LOOTCONTAINER_DEAD_SCAV = "5909e4b686f7747f5b744fa4", LOOTCONTAINER_DRAWER = "578f87b7245977356274f2cd", LOOTCONTAINER_DUFFLE_BAG = "578f87a3245977356274f2cb", @@ -2429,7 +2524,11 @@ export declare enum ItemTpl { MACHINEGUN_KALASHNIKOV_PKTM_762X54R_MODERNIZED_TANK_MACHINE_GUN = "657857faeff4c850222dff1b", MACHINEGUN_NSV_UTYOS_127X108_HEAVY_MACHINE_GUN = "5cdeb229d7f00c000e7ce174", MACHINEGUN_RPK16_545X39_LIGHT_MACHINE_GUN = "5beed0f50db834001c062b12", + MACHINEGUN_US_ORDNANCE_M60E4_762X51_LIGHT_MACHINE_GUN = "65fb023261d5829b2d090755", + MACHINEGUN_US_ORDNANCE_M60E6_762X51_LIGHT_MACHINE_GUN = "661ceb1b9311543c7104149b", + MACHINEGUN_US_ORDNANCE_M60E6_762X51_LIGHT_MACHINE_GUN_FDE = "661cec09b2c6356b4d0c7a36", MAGAZINE_127X108_100_100RND = "5cffa483d7ad1a049e54ef1c", + MAGAZINE_127X33_DE_7RND = "668fe5c5f35310705d02b696", MAGAZINE_127X55_ASH12_10RND = "5caf1041ae92157c28402e3f", MAGAZINE_127X55_ASH12_20RND = "5caf1109ae9215753c44119f", MAGAZINE_127X55_RSH12_CYL_5RND = "633ec6ee025b096d320a3b15", @@ -2543,6 +2642,7 @@ export declare enum ItemTpl { MAGAZINE_762X51_AA70_20RND = "5cf12a15d7f00c05464b293f", MAGAZINE_762X51_AICS_10RND = "5d25a6538abbc306c62e630d", MAGAZINE_762X51_AICS_5RND = "5d25a4a98abbc30b917421a4", + MAGAZINE_762X51_ASSAULT_BOX_100RND = "660ea4453786cc0af808a1be", MAGAZINE_762X51_AXMC_308_10RND = "628120f210e26c1f344e6558", MAGAZINE_762X51_DVL10_10RND = "5888988e24597752fe43a6fa", MAGAZINE_762X51_KAC_762_10RND = "5df8f535bb49d91fb446d6b0", @@ -2613,15 +2713,25 @@ export declare enum ItemTpl { MAGAZINE_9X19_SB7_10RND = "5998529a86f774647f44f421", MAGAZINE_9X19_SG919_20RND = "5c0673fb0db8340023300271", MAGAZINE_9X19_SG919_30RND = "5c0672ed0db834001b7353f3", + MAGAZINE_9X19_UZI_20RND = "66992713ae08c5c29e0c4f97", + MAGAZINE_9X19_UZI_25RND = "6699271b9950f5f4cd060299", + MAGAZINE_9X19_UZI_32RND = "669927203c4fda6471005cbe", + MAGAZINE_9X19_UZI_40RND = "66992725ae08c5c29e0c4f9a", + MAGAZINE_9X19_UZI_50RND = "6699272a3c4fda6471005cc1", + MAGAZINE_9X19_UZI_PRO_20RND = "668031ffe3e7eb26e8004cdd", + MAGAZINE_9X19_UZI_PRO_25RND = "66866f4ec3d473265104f381", + MAGAZINE_9X19_UZI_PRO_32RND = "66866f622a2296a8d9099639", MAGAZINE_9X19_X5_MP5_50RND = "5a351711c4a282000b1521a4", MAGAZINE_9X21_SR1MP_18RND = "59f99a7d86f7745b134aa97b", MAGAZINE_9X21_SR2M_20RND = "633a98eab8b0506e48497c1a", MAGAZINE_9X21_SR2M_30RND = "62e153bcdb1a5c41971c1b5b", MAGAZINE_9X33R_CR_CYL_6RND = "619f54a1d25cbd424731fb99", + MAGAZINE_9X33R_DE_9RND = "669fa435803b94fb5d0e3a76", MAGAZINE_9X39_6L24_10RND = "57838f0b2459774a256959b2", MAGAZINE_9X39_6L25_20RND = "57838f9f2459774a150289a0", MAGAZINE_9X39_9A91_20RND = "6450ec2e7da7133e5a09ca96", MAGAZINE_9X39_SR3M130_30RND = "5a9e81fba2750c00164f6b11", + MAGAZINE_9X39_VSSVAL_30RND = "65118f531b90b4fc77015083", MAP_CUSTOMS_PLAN = "5798a2832459774b53341029", MAP_FACTORY_PLAN = "574eb85c245977648157eec3", MAP_INTERCHANGE_PLAN = "5be4038986f774527d3fae60", @@ -2749,11 +2859,13 @@ export declare enum ItemTpl { MOUNT_M1A_SOCOM_16_UPPER_PART = "5ab24ef9e5b5b00fe93c9209", MOUNT_M700_30MM_INTEGRAL_RING_SCOPE = "5bfebc5e0db834001a6694e5", MOUNT_M700_AB_ARMS_MODX_RAIL = "5cde7b43d7f00c000d36b93e", + MOUNT_M700_BADGER_ORDNANCE_SCOPE_RAIL = "65f064eec4da400cbb0dc1fe", MOUNT_M700_EXTENDED_MULTISLOT_WEAVER_RAIL_BASE = "5bfebc530db834001d23eb65", MOUNT_M700_MAGPUL_PRO_700_CHASSIS_INLINE = "5cdeaca5d7f00c00b61c4b70", MOUNT_M870_LEAPERS_UTG_PRO_MTU028SG_RAIL = "5a7893c1c585673f2b5c374d", MOUNT_M870_MESA_TACTICAL_MAGAZINE_CLAMP = "5a789261c5856700186c65d3", MOUNT_M870_XS_SHOTRAIL_RAIL_WITH_GHOST_RING_REAR_SIGHT = "5a78948ec5856700177b1124", + MOUNT_MAGPUL_MLOK_093_INCH_RAIL = "669a6a4a525be1d2d004b8eb", MOUNT_MAGPUL_MLOK_25_INCH_RAIL = "5b7be47f5acfc400170e2dd2", MOUNT_MAGPUL_MLOK_41_INCH_RAIL = "5b7be4895acfc400170e2dd5", MOUNT_MAGPUL_MLOK_CANTILEVER = "6269220d70b6c02e665f2635", @@ -2806,6 +2918,8 @@ export declare enum ItemTpl { MOUNT_RFB_HANDGUARD_RAIL = "5f2aa493cd375f14e15eea72", MOUNT_RFB_SCOPE_RAIL = "5f2aa49f9b44de6b1b4e68d4", MOUNT_RPK16_HANDGUARD_RAIL = "5beecbb80db834001d2c465e", + MOUNT_RS_REGULATE_AK303M_FULL_LENGTH_LOWER_DOVETAIL = "65f1b1176dbd6c5ba2082eed", + MOUNT_RS_REGULATE_AKR_TOP = "65f1b2a5c14a07890801fc70", MOUNT_SAG_AK_DOVETAIL_SIDE = "63d114019e35b334d82302f7", MOUNT_SAG_BIT_LOW_PROFILE_DOVETAIL_SIDE = "638db77630c4240f9e06f8b6", MOUNT_SIG_ALPHA4_30MM_RING_SCOPE = "6567e751a715f85433025998", @@ -2841,6 +2955,10 @@ export declare enum ItemTpl { MOUNT_TROY_QARS_42_INCH_RAIL = "5b4736b986f77405cb415c10", MOUNT_UM_TACTICAL_UM3_PISTOL_SIGHT = "5a7b4900e899ef197b331a2a", MOUNT_UNV_DLOCIRD_SIGHT = "5a1ead28fcdbcb001912fa9f", + MOUNT_UZI_HANDGUARD_RAIL = "6698c8f4710a4525fe0e9e57", + MOUNT_UZI_PRO_SMG_RAIL_ADAPTER = "668ea3f68117e4968b0cff4a", + MOUNT_UZI_STORMWERKZ_LOWER_HANDGUARD_RAIL = "66992f7d9950f5f4cd0602a8", + MOUNT_UZI_STORMWERKZ_SCOPE = "6698c90829e062525d0ad8ad", MOUNT_VLTOR_CASV_2_INCH_RAIL = "5b7be4575acfc400161d0832", MOUNT_VLTOR_CASV_4_INCH_RAIL = "5b7be4645acfc400170e2dcc", MOUNT_VLTOR_CASV_5_INCH_RAIL = "5b7be46e5acfc400170e2dcf", @@ -2856,6 +2974,7 @@ export declare enum ItemTpl { MOUNT_ZENIT_B13V_KLASSIKA_DOVETAIL_RAIL_PLATFORM = "5c90c3622e221601da359851", MOUNT_ZENIT_B13_KLASSIKA_DOVETAIL_RAIL_PLATFORM = "5c61a40d2e2216001403158d", MOUNT_ZENIT_KR2_OLD_GEN = "646f6322f43d0c5d62063715", + MULTITOOLS_LEATHERMAN_MULTITOOL = "544fb5454bdc2df8738b456a", MUZZLECOMBO_9A91_HANDGUARD_RETAINER = "64527a263d52156624001fd7", MUZZLECOMBO_AI_AXMC_THREAD_PROTECTION_CAP = "628120621d5df4475f46a335", MUZZLECOMBO_AKM_762X39_KIBA_ARMS_308_MUZZLE_DEVICE_ADAPTER = "615d8e9867085e45ef1409c6", @@ -2901,10 +3020,15 @@ export declare enum ItemTpl { MUZZLECOMBO_STEYR_AUG_RAT_WORX_556X45_MUZZLE_DEVICE_ADAPTER = "630f27f04f3f6281050b94d7", MUZZLECOMBO_SVDS_ROTOR_43_THREAD_ADAPTER = "5e01e9e273d8eb11426f5bc3", MUZZLECOMBO_TROMIX_MONSTER_CLAW_12GA_MUZZLE_BRAKE = "59fb137a86f7740adb646af1", - MUZZLECOMBO_VPO215_GORNOSTAY_THREAD_PROTECTION_CAP = "5de6556a205ddc616a6bc4f7", + MUZZLECOMBO_UZI_9X19_3LUG_BARREL_RETAINING_NUT = "6698c9ba29e062525d0ad8b1", + MUZZLECOMBO_UZI_9X19_3LUG_BARREL_THREAD_PROTECTOR = "6698c9c636ba38d291017711", + MUZZLECOMBO_UZI_9X19_BARREL_RETAINING_NUT = "6698c9aa36ba38d29101770f", + MUZZLECOMBO_UZI_PRO_9X19_BARREL_RETAINING_NUT = "668670e3fb75ee4a5e02eb16", + MUZZLECOMBO_UZI_PRO_9X19_MASADA_THREAD_PROTECTOR = "668670f52a2296a8d909963c", + MUZZLECOMBO_VPO215_GORNOSTAY_THREAD_PROTECTOR = "5de6556a205ddc616a6bc4f7", NIGHTVISION_ANPVS14_NIGHT_VISION_MONOCULAR = "57235b6f24597759bf5a30f1", NIGHTVISION_ARMASIGHT_N15_NIGHT_VISION_GOGGLES = "5c066e3a0db834001b7353f0", - NIGHTVISION_GPNVG18_NIGHT_VISION_GOGGLES = "5c0558060db834001b735271", + NIGHTVISION_L3HARRIS_GPNVG18_NIGHT_VISION_GOGGLES = "5c0558060db834001b735271", NIGHTVISION_PNV10T_NIGHT_VISION_GOGGLES = "5c0696830db834001d23f5da", OPTICSCOPE_BELOMO_PSO1M21_4X24_SCOPE = "576fd4ec2459777f0b518431", OPTICSCOPE_BELOMO_PSO1M2_4X24_SCOPE = "5c82343a2e221644f31c0611", @@ -2924,7 +3048,7 @@ export declare enum ItemTpl { OPTICSCOPE_PAG17_SCOPE = "5d53f4b7a4b936793d58c780", OPTICSCOPE_PU_35X_RIFLESCOPE = "5b3f7c1c5acfc40dc5296b1d", OPTICSCOPE_SCHMIDT_BENDER_PM_II_18X24_30MM_RIFLESCOPE = "617151c1d92c473c770214ab", - OPTICSCOPE_SCHMIDT_BENDER_PM_II_312X50_34MM_RIFLESCOPE = "61714eec290d254f5e6b2ffc", + OPTICSCOPE_SCHMIDT_BENDER_PM_II_320X50_34MM_RIFLESCOPE = "61714eec290d254f5e6b2ffc", OPTICSCOPE_SCHMIDT_BENDER_PM_II_525X56_34MM_RIFLESCOPE = "62850c28da09541f43158cca", OPTICSCOPE_SIG_TANGO6T_16X24_30MM_RIFLESCOPE = "6567e7681265c8a131069b0f", OPTICSCOPE_VOMZ_PILAD_4X32_254MM_RIFLESCOPE = "5dff772da3651922b360bf91", @@ -2977,11 +3101,14 @@ export declare enum ItemTpl { PISTOLGRIP_AR15_STARK_AR_RIFLE_GRIP_FDE = "59db3b0886f77429d72fb895", PISTOLGRIP_AR15_TACTICAL_DYNAMICS_HEXGRIP_PISTOL_GRIP = "615d8faecabb9b7ad90f4d5d", PISTOLGRIP_AR15_TACTICAL_DYNAMICS_SKELETONIZED_PISTOL_GRIP = "5b07db875acfc40dc528a5f6", - PISTOLGRIP_AS_VAL_PISTOL_GRIP = "57c44fa82459772d2d75e415", + PISTOLGRIP_AS_VAL_PISTOL_GRIP_BLACK = "6565b91666492762f5029c0b", + PISTOLGRIP_AS_VAL_PISTOL_GRIP_PLUM = "57c44fa82459772d2d75e415", PISTOLGRIP_AS_VAL_ROTOR_43_PISTOL_GRIP_BUFFER_TUBE = "5a69a2ed8dc32e000d46d1f1", PISTOLGRIP_BENELLI_M3_TELESCOPIC_STOCK_PISTOL_GRIP = "6259c3d8012d6678ec38eeb8", PISTOLGRIP_CHIAPPA_RHINO_PLASTIC_PISTOL_GRIP = "619f4ab2d25cbd424731fb95", PISTOLGRIP_CHIAPPA_RHINO_WOODEN_PISTOL_GRIP = "619f4bffd25cbd424731fb97", + PISTOLGRIP_DESERT_EAGLE_HOGUE_RUBBER_GRIP = "668fe5d42a0f85eea407cc16", + PISTOLGRIP_DESERT_EAGLE_HOGUE_RUBBER_GRIP_WITH_FINGER_GROOVES = "66a0da76b6f47fcfeb025e96", PISTOLGRIP_GLOCK_PACHMAYR_TACTICAL_GRIP_GLOVE = "5a7b4960e899ef197b331a2d", PISTOLGRIP_HOGUE_OVERMOLDED_RUBBER_GRIP_BLACK = "57c55efc2459772d2c6271e7", PISTOLGRIP_HOGUE_OVERMOLDED_RUBBER_GRIP_FDE = "57af48872459771f0b2ebf11", @@ -2994,6 +3121,12 @@ export declare enum ItemTpl { PISTOLGRIP_M1911_KIBA_ARMS_GENEBURN_CUSTOM_SIDE_GRIPS = "626a9cb151cb5849f6002890", PISTOLGRIP_M1911_PACHMAYR_AMERICAN_LEGEND_GRIP_423 = "5ef366938cef260c0642acad", PISTOLGRIP_M45A1_MILTAC_GVT_G10_SIDE_GRIPS = "5f3e778efcd9b651187d7201", + PISTOLGRIP_M60E4_PISTOL_GRIP = "660125bf1d087a96c60a54db", + PISTOLGRIP_M60E4_TRIGGER_GROUP = "6601257f1347bc1a5f0f4db6", + PISTOLGRIP_M60E6_PISTOL_GRIP = "66152060a031cbb5570e3466", + PISTOLGRIP_M60E6_PISTOL_GRIP_FDE = "6615211ca031cbb5570e346d", + PISTOLGRIP_M60E6_TRIGGER_GROUP = "6615208aa031cbb5570e346a", + PISTOLGRIP_M60E6_TRIGGER_GROUP_FDE = "66152153a031cbb5570e346f", PISTOLGRIP_M700_MAGPUL_PRO_700_PISTOL_GRIP = "5cdeac5cd7f00c000f261694", PISTOLGRIP_M870_FAB_DEFENSE_AGR870_PISTOL_GRIP = "5bfe86a20db834001d23e8f7", PISTOLGRIP_M9A3_POLYMER_SIDE_GRIPS = "5cadc431ae921500113bb8d5", @@ -3015,9 +3148,10 @@ export declare enum ItemTpl { PISTOLGRIP_PB_BAKELITE_SIDE_GRIPS = "56e05a6ed2720bd0748b4567", PISTOLGRIP_PK_PISTOL_GRIP = "646371779f5f0ea59a04c204", PISTOLGRIP_PK_PISTOL_GRIP_BLACK = "64cbad529f7cf7f75c077fd5", - PISTOLGRIP_PM_BAKELITE_SIDE_GRIPS = "6374a7e7417239a7bf00f042", + PISTOLGRIP_PM_BAKELITE_GRIP = "6374a7e7417239a7bf00f042", PISTOLGRIP_PM_FAB_DEFENSE_PMG_PISTOL_GRIP = "637784c5f7b3f4ac1a0d1a9a", PISTOLGRIP_PM_FAB_DEFENSE_PMG_PISTOL_GRIP_OLIVE_DRAB = "648afce7ec6bb25b2608defb", + PISTOLGRIP_PM_PMLASER_GRIP_WITH_LASER_SIGHT = "661f8995c341ea101e0d33e8", PISTOLGRIP_PM_TACTIC_KIT_PISTOL_GRIP = "637b6d610aef6cfc5e02dd14", PISTOLGRIP_PP1901_VITYAZ_PISTOL_GRIP = "5998517986f7746017232f7e", PISTOLGRIP_PP91_KEDR_POLYMER_PISTOL_GRIP = "57d152ec245977144076ccdf", @@ -3028,8 +3162,8 @@ export declare enum ItemTpl { PISTOLGRIP_SA58_SAWSTYLE_PISTOL_GRIP_BLACK = "5b099b965acfc400186331e6", PISTOLGRIP_SKSVZ58_FAB_DEFENSE_AG58_PISTOL_GRIP = "5d023784d7ad1a049d4aa7f2", PISTOLGRIP_SKS_TAPCO_INTRAFUSE_SAWSTYLE_PISTOL_GRIP = "5afd7e445acfc4001637e35a", - PISTOLGRIP_SR2M_PISTOL_GRIP = "637b9c37b7e3bc41b21ce71a", PISTOLGRIP_SR2M_PISTOL_GRIP_BLACK = "637ba29bf7ca6372bf2613db", + PISTOLGRIP_SR2M_PISTOL_GRIP_PLUM = "637b9c37b7e3bc41b21ce71a", PISTOLGRIP_SVDS_LYNX_ARMS_AKSERIES_PISTOL_GRIP_ADAPTER = "6516b129609aaf354b34b3a8", PISTOLGRIP_SVDS_PISTOL_GRIP = "5c471be12e221602b66cd9ac", PISTOLGRIP_TOZ106_002_PISTOL_GRIP = "5a38eecdc4a282329a73b512", @@ -3038,6 +3172,7 @@ export declare enum ItemTpl { PISTOLGRIP_TT_PMLASER_TT206_SIDE_GRIPS_WITH_LASER_SIGHT = "5bffcf7a0db83400232fea79", PISTOLGRIP_TT_RAZOR_ARMS_RUBBER_GRIP = "5c079ec50db834001966a706", PISTOLGRIP_TT_SIDE_GRIPS = "571a282c2459771fb2755a69", + PISTOLGRIP_UZI_PISTOL_GRIP_COVER = "669946c157df3e2b4e0a0dc5", PISTOL_20X1MM_TOY_GUN = "66015072e9f84d5680039678", PISTOL_APB_9X18PM_SILENCED_MACHINE = "5abccb7dd8ce87001773e277", PISTOL_BERETTA_M9A3_9X19 = "5cadc190ae921500103bb3b6", @@ -3050,6 +3185,11 @@ export declare enum ItemTpl { PISTOL_GLOCK_19X_9X19 = "63088377b5cd696784087147", PISTOL_HK_USP_45_ACP = "6193a720f8ee7e52e42109ed", PISTOL_LEBEDEV_PL15_9X19 = "602a9740da11d6478d5a06dc", + PISTOL_MAGNUM_RESEARCH_DESERT_EAGLE_L5_357 = "669fa409933e898cce0c2166", + PISTOL_MAGNUM_RESEARCH_DESERT_EAGLE_L5_50_AE = "669fa3f88abd2662d80eee77", + PISTOL_MAGNUM_RESEARCH_DESERT_EAGLE_L6_50_AE = "669fa39b48fc9f8db6035a0c", + PISTOL_MAGNUM_RESEARCH_DESERT_EAGLE_L6_50_AE_PISTOL_WTS = "669fa3d876116c89840b1217", + PISTOL_MAGNUM_RESEARCH_DESERT_EAGLE_MK_XIX_50_AE = "668fe5a998b5ad715703ddd6", PISTOL_MAKAROV_PM_9X18PM = "5448bd6b4bdc2dfc2f8b4569", PISTOL_MAKAROV_PM_T_9X18PM = "579204f224597773d619e051", PISTOL_PB_9X18PM_SILENCED = "56e0598dd2720bb5668b45a6", @@ -3059,6 +3199,7 @@ export declare enum ItemTpl { PISTOL_TT33_762X25_TT = "571a12c42459771f627b58a0", PISTOL_TT33_762X25_TT_PISTOL_GOLDEN = "5b3b713c5acfc4330140bd8d", PISTOL_YARYGIN_MP443_GRACH_9X19 = "576a581d2459771e7b1bc4f1", + PLANTINGKITS_TRIPWIRE_INSTALLATION_KIT = "666b11055a706400b717cfa5", POCKETS_1X3 = "60c7272c204bc17802313365", POCKETS_1X4 = "557ffd194bdc2d28148b457f", POCKETS_1X4_SPECIAL = "627a4e6b255f7527fb05a0f6", @@ -3074,14 +3215,18 @@ export declare enum ItemTpl { QUEST_BANK_CASE = "590dde5786f77405e71908b2", QUEST_BATTERED_DIARY = "666073159916667083033cb9", QUEST_BLOOD_SAMPLE = "5a687e7886f7740c4a5133fb", + QUEST_BLOOD_SAMPLE_NF2024 = "66a0f0926fee20fa70036da6", QUEST_BOTTLE_OF_LE_JEAN_WINE = "6582bd252b50c61c565828e2", QUEST_CADASTRAL_REGISTRY_RECORDS = "657acb2ac900be5902191ac9", QUEST_CARBON_CASE = "5910922b86f7747d96753483", + QUEST_CASE_WITH_PRECISION_TOOLS = "66b22630a6b4e5ec7c02cdb7", QUEST_CHEFS_DIARY = "64f69b4267e11a7c6206e010", QUEST_CHEMCONT_SAMPLES = "63927b29c115f907b14700b9", + QUEST_CHEMICAL_CONTAINER = "66a0e523e749756c920d02d0", QUEST_CHEMICAL_CONTAINER_1 = "5b43237186f7742f3a4ab252", QUEST_CHEMICAL_CONTAINER_2 = "5b4c81a086f77417d26be63f", QUEST_CHEMICAL_CONTAINER_3 = "5b4c81bd86f77418a75ae159", + QUEST_CHEMICAL_SAMPLE = "669fac549b0ce3feae01a137", QUEST_CLOTHES_DESIGN_HANDBOOK_PART_1 = "5ae9a3f586f7740aab00e4e6", QUEST_CLOTHES_DESIGN_HANDBOOK_PART_2 = "5ae9a4fc86f7746e381e1753", QUEST_EASY_MONEY_POSTER_PACK = "664b69f3a082271bc46c4e13", @@ -3105,6 +3250,7 @@ export declare enum ItemTpl { QUEST_INFORMANT_JOURNAL = "63989ced706b793c7d60cfef", QUEST_JOURNAL = "64f07f7726cfa02c506f8ac0", QUEST_KEY_TO_THE_CLOSED_PREMISES_OF_THE_HEALTH_RESORT = "5a0448bc86f774736f14efa8", + QUEST_LAB_JOURNAL = "66c0b39ca1f68fcc1d0c0cc3", QUEST_LEDX_SKIN_TRANSILLUMINATOR_US_VERSION = "666879d498b97e3a8f09f1ae", QUEST_LETTER_GOT_MAIL = "638cbc68a63f1b49be6a3010", QUEST_LETTER_HERMIT = "61904c9df62c89219a56e034", @@ -3143,6 +3289,7 @@ export declare enum ItemTpl { QUEST_PICTURE_7 = "64e74a3d4d49d23b2c39d319", QUEST_PICTURE_8 = "64e74a44c2b4f829615ec334", QUEST_PICTURE_9 = "64e74a4baac4cd0a7264ecdd", + QUEST_PILOT_LOGBOOK = "66c0b90c8398582e4b0c2e27", QUEST_PUMPING_STATION_OPERATION_REPORT = "619268ad78f4fa33f173dbe5", QUEST_RADIO_TRANSMITTER_BODY = "6399f54b0a36db13c823ad21", QUEST_REF_DIRT = "664fce7a90294949fe2d81cb", @@ -3240,12 +3387,24 @@ export declare enum ItemTpl { RANDOMLOOTCONTAINER_EVENT_CONTAINER_AIRDROP_48 = "6489cca131a2135f0d7d0fdd", RANDOMLOOTCONTAINER_EVENT_CONTAINER_AIRDROP_49 = "6489d812cf0cd80b7e749071", RANDOMLOOTCONTAINER_EVENT_CONTAINER_AIRDROP_50 = "6489d89debac5a4a1b73caf7", + RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_COMMON = "6694f4101ae1778e310f4f8e", + RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_COMMON_PLUS_1 = "66a3896972c8e72507028806", + RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_COMMON_PLUS_2 = "66a3896de45f71bf1009e45a", + RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_EPIC = "6694f423909d2322a8073151", + RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_EPIC_PLUS_1 = "66a389c0705adefa710cdeaa", + RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_EPIC_PLUS_2 = "66a389c60982fc7e4c091c51", + RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_RARE = "6694f418c74d8a180f0f78c0", + RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_RARE_PLUS_1 = "66a3898c1df2a447cc0d3c35", + RANDOMLOOTCONTAINER_ITEM_CONTAINER_EVENT_TWITCH_SUMMER_DROPS_2024_RARE_PLUS_2 = "66a3898f0982fc7e4c091c4d", RANDOMLOOTCONTAINER_NEW_YEAR_GIFT_BIG = "63a897c6b1ff6e29734fcc95", RANDOMLOOTCONTAINER_NEW_YEAR_GIFT_MEDIUM = "63a898a328e385334e0640a5", RANDOMLOOTCONTAINER_NEW_YEAR_GIFT_SMALL = "63a8970d7108f713591149f5", RANDOMLOOTCONTAINER_PUMPKIN_RAND_LOOT_CONTAINER = "634959225289190e5e773b3b", RANDOMLOOTCONTAINER_RANDOM_LOOT_CONTAINER = "62f10b79e7ee985f386b2f47", RANDOMLOOTCONTAINER_RANDOM_LOOT_QUEST_CONTAINER = "633ffb5d419dbf4bea7004c6", + RANDOMLOOTCONTAINER_RAND_LOOT_CONTAINER_TWITCH_EVENT = "66aa3a180d6ecb50a21a4e1a", + RANDOMLOOTCONTAINER_RAND_LOOT_CONTAINER_TWITCH_EVENT_PLUS_1 = "66aa3a31efb1b8119f0196c7", + RANDOMLOOTCONTAINER_RAND_LOOT_CONTAINER_TWITCH_EVENT_PLUS_2 = "66aa3a3800b2c42adb07d13e", RANGEFINDER_VORTEX_RANGER_1500 = "61605e13ffa6e502ac5e7eef", RECEIVER_AI_AXMC_338_LM_CHASSIS = "6281204f308cb521f87a8f9b", RECEIVER_AI_AXMC_UPPER = "62811fbf09427b40ab14e767", @@ -3266,6 +3425,11 @@ export declare enum ItemTpl { RECEIVER_AR15_NOVESKE_GEN3_556X45_UPPER = "5c07a8770db8340023300450", RECEIVER_AR15_VLTOR_MUR1S_556X45_UPPER = "59bfe68886f7746004266202", RECEIVER_AS_VAL_DUST_COVER = "57c44f4f2459772d2c627113", + RECEIVER_DESERT_EAGLE_L5_357_PISTOL_SLIDE = "669fa5127a09bc295603b499", + RECEIVER_DESERT_EAGLE_L5_50_AE_PISTOL_SLIDE = "669fa5019aa2a422600442f6", + RECEIVER_DESERT_EAGLE_L6_PISTOL_SLIDE = "669fa4d97a09bc295603b496", + RECEIVER_DESERT_EAGLE_L6_PISTOL_SLIDE_WTS = "669fa5271bd4416eaa09b3ce", + RECEIVER_DESERT_EAGLE_MK_XIX_PISTOL_SLIDE = "668fe60b56984d93550462c6", RECEIVER_FAL_STANDARD_DUST_COVER = "5b7d6c105acfc40015109a5f", RECEIVER_FN_FIVESEVEN_MK2_PISTOL_SLIDE = "5d3eb44aa4b93650d64e4979", RECEIVER_FN_P90_57X28_UPPER = "5cc70102e4a949035e43ba74", @@ -3333,6 +3497,7 @@ export declare enum ItemTpl { RECEIVER_SVDS_DUST_COVER = "5c471bd12e221602b4129c3a", RECEIVER_SVT_DUST_COVER = "64119cdbdcf48d656f0aa272", RECEIVER_TX15_556X45_LIGHTWEIGHT_UPPER = "5d4405aaa4b9361e6a4e6bd3", + RECEIVER_UZI_PRO_DUST_COVER = "6680326874b8f2050c0b9178", RECEIVER_VPO101_VEPRHUNTER_DUST_COVER = "5c503d0a2e221602b542b7ef", RECEIVER_VSS_DUST_COVER = "578395402459774a256959b5", REPAIRKITS_BODY_ARMOR_REPAIR_KIT = "591094e086f7747caa7bb2ef", @@ -3424,6 +3589,7 @@ export declare enum ItemTpl { SILENCER_SKS_HEXAGON_762X39_SOUND_SUPPRESSOR = "593d490386f7745ee97a1555", SILENCER_SR1MP_9X21_SOUND_SUPPRESSOR = "5a27b6bec4a282000e496f78", SILENCER_SR2M_9X21_SOUND_SUPPRESSOR_SV1381 = "62e2a7138e1ac9380579c122", + SILENCER_SR3M_9X39_SOUND_SUPPRESSOR = "65144ff50e00edc79406836f", SILENCER_STEYR_AUG_ASE_UTRA_S_SERIES_SL7I_556X45_SOUND_SUPPRESSOR = "634eba08f69c710e0108d386", SILENCER_STEYR_AUG_RELFEX_T4AUG_RANGER_556X45_SOUND_SUPPRESSOR = "630f2982cdb9e392db0cbcc7", SILENCER_SUREFIRE_SOCOM556MINI_MONSTER_556X45_SOUND_SUPPRESSOR = "55d6190f4bdc2d87028b4567", @@ -3432,6 +3598,7 @@ export declare enum ItemTpl { SILENCER_SV98_762X54R_SOUND_SUPPRESSOR = "5c4eecc32e221602b412b440", SILENCER_THUNDER_BEAST_ARMS_ULTRA_5_SOUND_SUPPRESSOR = "5d44064fa4b9361e4f6eb8b5", SILENCER_TT_762X25_MAKESHIFT_SOUND_SUPPRESSOR = "571a28e524597720b4066567", + SILENCER_UZI_9X19_SOUND_SUPPRESSOR = "66993733f74fef4dfd0b04ff", SILENCER_VPO101_VEPRHUNTER_ROTOR_43_762X51_MUZZLE_BRAKECOMPENSATOR = "5f63407e1b231926f2329f15", SILENCER_VSS_9X39_INTEGRAL_BARRELSUPPRESSOR = "57838c962459774a1651ec63", SMG_BT_MP9N_9X19_SUBMACHINE_GUN = "5de7bd7bfd6b4e6e2276dc25", @@ -3442,6 +3609,9 @@ export declare enum ItemTpl { SMG_HK_MP7A1_46X30_SUBMACHINE_GUN = "5ba26383d4351e00334c93d9", SMG_HK_MP7A2_46X30_SUBMACHINE_GUN = "5bd70322209c4d00d7167b8f", SMG_HK_UMP_45_ACP_SUBMACHINE_GUN = "5fc3e272f8b6a877a729eac5", + SMG_IWI_UZI_9X19_SUBMACHINE_GUN = "66992b349950f5f4cd06029f", + SMG_IWI_UZI_PRO_PISTOL_9X19_SUBMACHINE_GUN = "6680304edadb7aa61d00cef0", + SMG_IWI_UZI_PRO_SMG_9X19_SUBMACHINE_GUN = "668e71a8dadf42204c032ce1", SMG_PP1901_VITYAZ_9X19_SUBMACHINE_GUN = "59984ab886f7743e98271174", SMG_PP9101_KEDRB_9X18PM_SUBMACHINE_GUN = "57f3c6bd24597738e730fa2f", SMG_PP91_KEDR_9X18PM_SUBMACHINE_GUN = "57d14d2524597714373db789", @@ -3470,7 +3640,6 @@ export declare enum ItemTpl { SPECIALSCOPE_SIG_SAUER_ECHO1_12X30MM_30HZ_THERMAL_REFLEX_SCOPE = "6478641c19d732620e045e17", SPECIALSCOPE_TORREY_PINES_LOGIC_T12W_30HZ_THERMAL_REFLEX_SIGHT = "609bab8b455afd752b2e6138", SPECIALSCOPE_TRIJICON_REAPIR_THERMAL_SCOPE = "5a1eaa87fcdbcb001865f75e", - SPECITEM_LEATHERMAN_MULTITOOL = "544fb5454bdc2df8738b456a", SPECITEM_MS2000_MARKER = "5991b51486f77447b112d44f", SPECITEM_RADIO_REPEATER = "63a0b2eabea67a6d93009e52", SPECITEM_SIGNAL_JAMMER = "5ac78a9b86f7741cca0bbd8d", @@ -3514,7 +3683,7 @@ export declare enum ItemTpl { STOCK_AK74MAK100_ZENIT_PT_LOCK = "5ac78eaf5acfc4001926317a", STOCK_AK74M_CAA_AKTS_AK74_BUFFER_TUBE = "5cf50fc5d7f00c056c53f83c", STOCK_AK74M_POLYMER_STOCK_6P34_SB15 = "5ac50c185acfc400163398d4", - STOCK_AK74_PLUM_POLYMER_STOCK_6P20_SB7 = "5cbdb1b0ae9215000d50e105", + STOCK_AK74_6P20_SB7_POLYMER_STOCK_PLUM = "5cbdb1b0ae9215000d50e105", STOCK_AK74_POLYMER_STOCK_6P20_SB7 = "5649b0fc4bdc2d17108b4588", STOCK_AK74_WOODEN_STOCK_6P20_SB5 = "5649b1c04bdc2d16268b457c", STOCK_AKMAK74_CAA_AKTS_BUFFER_TUBE = "5cf518cfd7f00c065b422214", @@ -3535,6 +3704,7 @@ export declare enum ItemTpl { STOCK_AK_100SERIES_METAL_SKELETONIZED = "6386300124a1dc425c00577a", STOCK_AK_CUSTOM_ARMS_STEF_74_SKELETON_STOCK_EXTENSION = "6494094948796d891603e59f", STOCK_AK_GP25_ACCESSORY_KIT_RECOIL_PAD = "5a0c59791526d8dba737bba7", + STOCK_AK_SKELETONIZED_STOCK_CUSTOMIZED = "66ac9d9740e27931602042d4", STOCK_AK_ZENIT_PT1_KLASSIKA = "5b222d405acfc400153af4fe", STOCK_AK_ZENIT_PT3_KLASSIKA = "59ecc3dd86f7746dc827481c", STOCK_APB_DETACHABLE_WIRE = "5a17fb9dfcdbcbcae6687291", @@ -3630,6 +3800,9 @@ export declare enum ItemTpl { STOCK_M14_TROY_SASS_CHASSIS = "5ab372a310e891001717f0d8", STOCK_M1A_PROMAG_ARCHANGEL_CHASSIS = "5addbf175acfc408fb13965b", STOCK_M1A_SOCOM_16 = "5aaf8e43e5b5b00015693246", + STOCK_M60E4_BUTT = "660126161347bc1a5f0f4dba", + STOCK_M60E6_BUTT = "6615202b96461aa8360271eb", + STOCK_M60E6_BUTTSTOCK_FDE = "661520fb6f8e1a96340afaa6", STOCK_M700_AB_ARMS_MODX_BUFFER_TUBE_SIDE_FOLDER_ADAPTER = "5cde77a9d7f00c000f261009", STOCK_M700_AB_ARMS_MODX_GEN_3_CHASSIS = "5cde739cd7f00c0010373bd3", STOCK_M700_AI_AT_AICS_POLYMER_CHASSIS = "5d25d0ac8abbc3054f3e61f7", @@ -3642,11 +3815,9 @@ export declare enum ItemTpl { STOCK_M870_SHOCKWAVE_RAPTOR_GRIP = "5a788169c5856700142fdd9e", STOCK_M870_SPS_POLYMER = "5a7880d0c5856700142fdd9d", STOCK_MAGPUL_MOE_CARBINE_RUBBER_BUTTPAD = "58d2912286f7744e27117493", - STOCK_MCXMPX_FOLDING_STOCK_ADAPTER_BUFFER_TUBE_COYOTE_TAN = "6529366450dc782999054ba0", - STOCK_MCXMPX_STOCK_LOCKING_HINGE_ASSEMBLY = "6529348224cbe3c74a05e5c4", STOCK_MESA_TACTICAL_CROSSHAIR_HYDRAULIC_BUFFER_TUBE = "5ef1ba28c64c5d0dfc0571a5", STOCK_MOSIN_RIFLE_AIM_SPORTS_RECOIL_PAD = "5bbde409d4351e003562b036", - STOCK_MOSIN_RIFLE_ATI_MONTE_CARLO_CHASSIS = "5bbdb870d4351e00367fb67d", + STOCK_MOSIN_RIFLE_ATI_MONTE_CARLO = "5bbdb870d4351e00367fb67d", STOCK_MOSIN_RIFLE_CARBINE = "5bfd384c0db834001a6691d3", STOCK_MOSIN_RIFLE_INFANTRY = "5bfd35380db83400232fe5cc", STOCK_MOSIN_RIFLE_PROMAG_ARCHANGEL_OPFOR_PRS_CHASSIS = "5bae13bad4351e00320204af", @@ -3670,11 +3841,13 @@ export declare enum ItemTpl { STOCK_MP431C_BUTTPAD = "611a31ce5b7ffe001b4649d1", STOCK_MP9 = "5de910da8b6c4240ba2651b5", STOCK_MPXMCX_COLLAPSINGTELESCOPING = "5894a13e86f7742405482982", - STOCK_MPXMCX_LIGHTWEIGHT = "5fbcc437d724d907e2077d5c", - STOCK_MPXMCX_MAXIM_DEFENSE_CQB_TELESCOPING = "5c5db6ee2e221600113fba54", + STOCK_MPXMCX_FOLDING_KNUCKLE_STOCK_ADAPTER = "58ac1bf086f77420ed183f9f", + STOCK_MPXMCX_MAXIM_DEFENSE_CQB = "5c5db6ee2e221600113fba54", STOCK_MPXMCX_PMM_ULSS_FOLDABLE = "5c5db6f82e2216003a0fe914", - STOCK_MPXMCX_RETRACTABLE_STOCK_ADAPTER = "58ac1bf086f77420ed183f9f", - STOCK_MPXMCX_TELESCOPING = "5fbcc429900b1d5091531dd7", + STOCK_MPXMCX_STOCK_ADAPTER_LOW_PROFILE_TUBE_COYOTE_TAN = "6529366450dc782999054ba0", + STOCK_MPXMCX_STOCK_LOCKING_HINGE_ASSEMBLY = "6529348224cbe3c74a05e5c4", + STOCK_MPXMCX_TELESCOPINGFOLDING = "5fbcc429900b1d5091531dd7", + STOCK_MPXMCX_THIN_SIDEFOLDING = "5fbcc437d724d907e2077d5c", STOCK_MTS25512_WOODEN = "612781056f3d944a17348d60", STOCK_MTS_2001 = "5adf23995acfc400185c2aeb", STOCK_OPSKS_WOODEN = "587e0531245977466077a0f7", @@ -3693,7 +3866,7 @@ export declare enum ItemTpl { STOCK_SA58_FOLDING = "5b7d63cf5acfc4001876c8df", STOCK_SA58_HUMPBACK_POLYMER = "5b7d645e5acfc400170e2f90", STOCK_SA58_SPR = "5b7d63de5acfc400170e2f8d", - STOCK_SKS_ATI_MONTE_CARLO_CHASSIS = "653ecef836fae5a82f02b869", + STOCK_SKS_ATI_MONTE_CARLO = "653ecef836fae5a82f02b869", STOCK_SKS_FAB_DEFENSE_UAS_BUTT = "653ed132896b99b40a0292e6", STOCK_SKS_FAB_DEFENSE_UAS_CHASSIS = "5d0236dad7ad1a0940739d29", STOCK_SKS_TAPCO_INTRAFUSE_BUFFER_TUBE = "5afd7e095acfc40017541f61", @@ -3709,19 +3882,30 @@ export declare enum ItemTpl { STOCK_TOZ106 = "5a38ef1fc4a282000b1521f6", STOCK_TOZ106_CUSTOM_CUT_MOSIN = "5c99f3592e221644fc633070", STOCK_TOZ106_FAB_DEFENSE_GPCP_CHEEK_REST = "626a8ae89e664a2e2a75f409", + STOCK_UZI_PRO_A3_TACTICAL_MODULAR_FOLDING_BRACE = "6686717ffb75ee4a5e02eb19", + STOCK_UZI_PRO_A3_TACTICAL_REAR_STOCK_ADAPTER = "668672b8c99550c6fd0f0b29", + STOCK_UZI_PRO_BACKPLATE = "66881008f23233ee9a0742e7", + STOCK_UZI_PRO_CSM_STOCK_ADAPTER = "669cf78806768ff39504fc1c", + STOCK_UZI_PRO_SBR_BUTT = "66867310f3734a938b077f79", + STOCK_UZI_PRO_STABILIZING_BRACE = "668032ba74b8f2050c0b917d", + STOCK_UZI_STORMWERKZ_STOCK_ADAPTER = "66992f4db9f31ddda10dd1c8", + STOCK_UZI_TYPE_3_BUTT = "6698c9ed36ba38d291017713", + STOCK_UZI_TYPE_5_BUTT = "6699249f3c4fda6471005cba", + STOCK_UZI_TYPE_6_BUTT = "669924a69950f5f4cd060295", + STOCK_UZI_TYPE_7_BUTT = "6698c9e07356874dfe0a0b88", STOCK_VPO101_VEPRHUNTER = "5c503af12e221602b177ca02", STOCK_VPO101_VEPRHUNTER_SVDSTYLE = "5f63405df5750b524b45f114", STOCK_VPO136_VEPRKM_WOODEN = "59e6227d86f77440d64f5dc2", STOCK_VPO209_WOODEN = "59e89d0986f77427600d226e", - STOCK_VPO215_GORNOSTAY = "5de655be4a9f347bc92edb88", + STOCK_VPO215_GORNOSTAY_WOODEN = "5de655be4a9f347bc92edb88", STOCK_VSK94 = "6452519e3d52156624001fd5", STOCK_VSS_WOODEN = "578395e82459774a0e553c7b", - TACTICALCOMBO_ANPEQ15_TACTICAL_DEVICE = "544909bb4bdc2d6f028b4577", - TACTICALCOMBO_ANPEQ2_TACTICAL_DEVICE = "5d10b49bd7ad1a1a560708b0", TACTICALCOMBO_GLOCK_GTL_21_TACTICAL_FLASHLIGHT_WITH_LASER = "5a800961159bd4315e3a1657", TACTICALCOMBO_HOLOSUN_LS321_TACTICAL_DEVICE = "57fd23e32459772d0805bcf1", + TACTICALCOMBO_INSIGHT_ANPEQ2_TACTICAL_DEVICE = "5d10b49bd7ad1a1a560708b0", TACTICALCOMBO_INSIGHT_WMX200_TACTICAL_FLASHLIGHT = "626becf9582c3e319310b837", - TACTICALCOMBO_LA5BPEQ_TACTICAL_DEVICE = "5c06595c0db834001a66af6c", + TACTICALCOMBO_L3HARRIS_ANPEQ15_TACTICAL_DEVICE = "544909bb4bdc2d6f028b4577", + TACTICALCOMBO_L3HARRIS_LA5BPEQ_TACTICAL_DEVICE = "5c06595c0db834001a66af6c", TACTICALCOMBO_MAWLC1_TACTICAL_DEVICE = "644a3df63b0b6f03e101e065", TACTICALCOMBO_NCSTAR_TACTICAL_BLUE_LASER_LAMMODULE = "5cc9c20cd7f00c001336c65d", TACTICALCOMBO_OLIGHT_BALDR_PRO_TACTICAL_FLASHLIGHT_WITH_LASER = "6272370ee4013c5d7e31f418", @@ -3780,6 +3964,9 @@ export declare enum ItemTpl { VEST_SS_PRECISION_PLATEFRAME_PLATE_CARRIER_GOONS_EDITION = "628b9784bcf6e2659e09b8a2", VEST_STICH_PROFI_CHEST_RIG_MK2_ASSAULT_ATACS_FG = "60a621c49c197e4e8c4455e6", VEST_STICH_PROFI_CHEST_RIG_MK2_RECON_ATACS_FG = "60a6220e953894617404b00a", + VEST_STICH_PROFI_PLATE_CARRIER_V2_BLACK = "66b6296d7994640992013b17", + VEST_STICH_PROFI_STICH_DEFENSE_MOD2_PLATE_CARRIER_MULTICAM = "66b6295178bbc0200425f995", + VEST_TASMANIAN_TIGER_PLATE_CARRIER_MKIII_COYOTE_BROWN = "66b6295a8ca68c6461709efa", VEST_TASMANIAN_TIGER_SK_PLATE_CARRIER_MULTICAM_BLACK = "628cd624459354321c4b7fa2", VEST_TYPE_56_CHICOM_CHEST_HARNESS = "64be7110bf597ba84a0a41ea", VEST_UMKA_M33SET1_HUNTER_VEST_OLIVE_DRAB = "6034cf5fffd42c541047f72e", @@ -3792,8 +3979,8 @@ export declare enum ItemTpl { VEST_ZULU_NYLON_GEAR_M4_REDUCED_SIGNATURE_CHEST_RIG_RANGER_GREEN = "64be7095047e826eae02b0c1", VISORS_6B34_ANTIFRAGMENTATION_GLASSES = "5b432be65acfc433000ed01f", VISORS_ANTIFRAGMENTATION_GLASSES = "59e770b986f7742cbd762754", - VISORS_CROSSBOW_TACTICAL_GLASSES = "5d5fca1ea4b93635fd598c07", VISORS_DUNDUKK_SPORT_SUNGLASSES = "5aa2b986e5b5b00014028f4c", + VISORS_ESS_CROSSBOW_TACTICAL_GLASSES = "5d5fca1ea4b93635fd598c07", VISORS_GAS_WELDER_SAFETY_GOGGLES = "61c18d83b00456371a66814b", VISORS_JOHNB_LIQUID_DNB_GLASSES = "62a09e410b9d3c46de5b6e78", VISORS_NPP_KLASS_CONDOR_GLASSES = "603409c80ca681766b6a0fb2", diff --git a/types/models/enums/Weapons.d.ts b/types/models/enums/Weapons.d.ts index 178bc68a..d0eaf91d 100644 --- a/types/models/enums/Weapons.d.ts +++ b/types/models/enums/Weapons.d.ts @@ -6,6 +6,7 @@ export declare enum Weapons { ASSAULTCARBINE_762X54R_SVT_40 = "643ea5b23db6f9f57107d9fd", ASSAULTCARBINE_9X39_9A_91 = "644674a13d52156624001fbc", ASSAULTCARBINE_9X39_AS_VAL = "57c44b372459772d2b39b8ce", + ASSAULTCARBINE_9X39_SR_3M = "651450ce0e00edc794068371", ASSAULTCARBINE_9X39_VSK_94 = "645e0c6b3b381ede770e1cc9", ASSAULTRIFLE_127X55_ASH_12 = "5cadfbf7ae92152ac412eeef", ASSAULTRIFLE_366TKM_VPO_209 = "59e6687d86f77411d949b251", @@ -61,6 +62,9 @@ export declare enum Weapons { MACHINEGUN_545X39_RPK_16 = "5beed0f50db834001c062b12", MACHINEGUN_762X39_RPD = "6513ef33e06849f06c0957ca", MACHINEGUN_762X39_RPDN = "65268d8ecb944ff1e90ea385", + MACHINEGUN_762X51_M60E6 = "661ceb1b9311543c7104149b", + MACHINEGUN_762X51_M60E6_FDE = "661cec09b2c6356b4d0c7a36", + MACHINEGUN_762X51_MK_43_MOD_1 = "65fb023261d5829b2d090755", MACHINEGUN_762X54R_PKM = "64637076203536ad5600c990", MACHINEGUN_762X54R_PKP = "64ca3d3954fc657e230529cc", MACHINEGUN_762X54R_PKTM = "657857faeff4c850222dff1b", @@ -72,6 +76,10 @@ export declare enum Weapons { MARKSMANRIFLE_762X54R_SVDS = "5c46fbd72e2216398b5a8c9c", MARKSMANRIFLE_86X70_MK_18_MJLNIR = "5fc22d7c187fea44d52eda44", MARKSMANRIFLE_9X39_VSS_VINTOREZ = "57838ad32459774a17445cd2", + PISTOL_127X33_DESERT_EAGLE_L5 = "669fa3f88abd2662d80eee77", + PISTOL_127X33_DESERT_EAGLE_L6 = "669fa39b48fc9f8db6035a0c", + PISTOL_127X33_DESERT_EAGLE_L6_WTS = "669fa3d876116c89840b1217", + PISTOL_127X33_DESERT_EAGLE_MK_XIX = "668fe5a998b5ad715703ddd6", PISTOL_20X1MM_BLICKY = "66015072e9f84d5680039678", PISTOL_45ACP_M1911A1 = "5e81c3cbac2bb513793cdc75", PISTOL_45ACP_M45A1 = "5f36a0e5fbf956000b716b65", @@ -93,6 +101,7 @@ export declare enum Weapons { PISTOL_9X19_P226R = "56d59856d2720bd8418b456a", PISTOL_9X19_PL_15 = "602a9740da11d6478d5a06dc", PISTOL_9X21_SR_1MP = "59f98b4986f7746f546d2cef", + PISTOL_9X33R_DESERT_EAGLE_L5 = "669fa409933e898cce0c2166", REVOLVER_127X55_RSH_12 = "633ec7c2a6918cb895019c6c", REVOLVER_12G_MTS_255_12 = "60db29ce99594040e04c4a27", REVOLVER_40X46_MSGL = "6275303a9f372d6ea97f9ec7", @@ -128,6 +137,9 @@ export declare enum Weapons { SMG_9X19_PP_19_01 = "59984ab886f7743e98271174", SMG_9X19_SAIGA_9 = "59f9cabd86f7743a10721f46", SMG_9X19_STM_9 = "60339954d62c9b14ed777c06", + SMG_9X19_UZI = "66992b349950f5f4cd06029f", + SMG_9X19_UZI_PRO_PISTOL = "6680304edadb7aa61d00cef0", + SMG_9X19_UZI_PRO_SMG = "668e71a8dadf42204c032ce1", SMG_9X19_VECTOR_9X19 = "5fc3f2d5900b1d5091531e57", SMG_9X21_SR_2M = "62e14904c2699c0ec93adc47", SNIPERRIFLE_366TKM_VPO_215_GORNOSTAY = "5de652c31b7e3716273428be", diff --git a/types/models/spt/config/IHideoutConfig.d.ts b/types/models/spt/config/IHideoutConfig.d.ts index c1967c0e..ec0c181b 100644 --- a/types/models/spt/config/IHideoutConfig.d.ts +++ b/types/models/spt/config/IHideoutConfig.d.ts @@ -1,3 +1,4 @@ +import { MinMax } from "@spt/models/common/MinMax"; import { IBaseConfig, IRunIntervalValues } from "@spt/models/spt/config/IBaseConfig"; export interface IHideoutConfig extends IBaseConfig { kind: "spt-hideout"; @@ -11,4 +12,28 @@ export interface IHideoutConfig extends IBaseConfig { overrideBuildTimeSeconds: number; /** Only process a profiles hideout crafts when it has been active in the last x minutes */ updateProfileHideoutWhenActiveWithinMinutes: number; + cultistCircle: ICultistCircleSettings; +} +export interface ICultistCircleSettings { + maxRewardItemCount: number; + maxAttemptsToPickRewardsWithinBudget: number; + rewardPriceMultiplerMinMax: MinMax; + craftTimeThreshholds: CraftTimeThreshhold[]; + /** -1 means no override */ + craftTimeOverride: number; + /** Specific reward pool when player sacrificed one specific item */ + directRewards: Record; + directRewardStackSize: Record; + /** Item tpls to exclude from the reward pool */ + rewardItemBlacklist: string[]; + /** Item tpls to include in the reward pool */ + additionalRewardItemPool: string[]; + currencyRewards: Record; +} +export interface CraftTimeThreshhold extends MinMax { + craftTimeSeconds: number; +} +export interface DirectRewardSettings { + rewardTpls: string[]; + craftTimeSeconds: number; } diff --git a/types/models/spt/config/IInRaidConfig.d.ts b/types/models/spt/config/IInRaidConfig.d.ts index 7d6befdf..d5fe8f67 100644 --- a/types/models/spt/config/IInRaidConfig.d.ts +++ b/types/models/spt/config/IInRaidConfig.d.ts @@ -1,7 +1,6 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInRaidConfig extends IBaseConfig { kind: "spt-inraid"; - MIAOnRaidEnd: boolean; /** Overrides to apply to the pre-raid settings screen */ raidMenuSettings: RaidMenuSettings; /** What effects should be saved post-raid */ @@ -20,6 +19,8 @@ export interface IInRaidConfig extends IBaseConfig { pmcKillProbabilityForScavGain: number; /** On death should items in your secure keep their Find in raid status regardless of how you finished the raid */ keepFiRSecureContainerOnDeath: boolean; + /** If enabled always keep found in raid status on items */ + alwaysKeepFoundInRaidonRaidEnd: boolean; /** Percentage chance a player scav hot is hostile to the player when scavving */ playerScavHostileChancePercent: number; } diff --git a/types/models/spt/config/IInsuranceConfig.d.ts b/types/models/spt/config/IInsuranceConfig.d.ts index 2bbd7b30..6c90fe09 100644 --- a/types/models/spt/config/IInsuranceConfig.d.ts +++ b/types/models/spt/config/IInsuranceConfig.d.ts @@ -13,4 +13,5 @@ export interface IInsuranceConfig extends IBaseConfig { runIntervalSeconds: number; minAttachmentRoublePriceToBeTaken: number; chanceNoAttachmentsTakenPercent: number; + simulateItemsBeingTaken: boolean; } diff --git a/types/models/spt/config/IInventoryConfig.d.ts b/types/models/spt/config/IInventoryConfig.d.ts index b4893932..3a2de2a8 100644 --- a/types/models/spt/config/IInventoryConfig.d.ts +++ b/types/models/spt/config/IInventoryConfig.d.ts @@ -15,7 +15,7 @@ export interface RewardDetails { rewardCount: number; foundInRaid: boolean; rewardTplPool?: Record; - rewardTypePool?: Record; + rewardTypePool?: string[]; } export interface ISealedAirdropContainerSettings { weaponRewardWeight: Record; diff --git a/types/models/spt/config/IPmcConfig.d.ts b/types/models/spt/config/IPmcConfig.d.ts index 00fabb35..c6e55331 100644 --- a/types/models/spt/config/IPmcConfig.d.ts +++ b/types/models/spt/config/IPmcConfig.d.ts @@ -1,4 +1,5 @@ import { MinMax } from "@spt/models/common/MinMax"; +import { IChancedEnemy } from "@spt/models/eft/common/ILocationBase"; import { MemberCategory } from "@spt/models/enums/MemberCategory"; import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IPmcConfig extends IBaseConfig { @@ -29,27 +30,37 @@ export interface IPmcConfig extends IBaseConfig { usecType: string; /** WildSpawnType enum value BEAR PMCs use */ bearType: string; - chanceSameSideIsHostilePercent: number; /** What 'brain' does a PMC use, keyed by map and side (USEC/BEAR) key: map location, value: type for usec/bear */ pmcType: Record>>; - maxBackpackLootTotalRub: number; + maxBackpackLootTotalRub: MinMaxLootValue[]; maxPocketLootTotalRub: number; maxVestLootTotalRub: number; /** Percentage chance a bot from a wave is converted into a PMC, key = bot wildspawn tpye (assault/exusec), value: min+max chance to be converted */ convertIntoPmcChance: Record; - /** WildSpawnType bots PMCs should see as hostile */ - enemyTypes: string[]; /** How many levels above player level can a PMC be */ botRelativeLevelDeltaMax: number; /** How many levels below player level can a PMC be */ botRelativeLevelDeltaMin: number; /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; + hostilitySettings: Record; allPMCsHavePlayerNameWithRandomPrefixChance: number; locationSpecificPmcLevelOverride: Record; /** Should secure container loot from usec.json/bear.json be added to pmc bots secure */ addSecureContainerLootFromBotConfig: boolean; } +export interface IHostilitySettings { + /** Bot roles that are 100% an enemy */ + additionalEnemyTypes?: string[]; + /** Objects that determine the % chance another bot type is an enemy */ + chancedEnemies?: IChancedEnemy[]; + bearEnemyChance?: number; + usecEnemyChance?: number; + savageEnemyChance?: number; + /** Bot roles that are 100% an friendly */ + additionalFriendlyTypes?: string[]; + savagePlayerBehaviour?: string; +} export interface PmcTypes { usec: string; bear: string; @@ -58,3 +69,6 @@ export interface SlotLootSettings { whitelist: string[]; blacklist: string[]; } +export interface MinMaxLootValue extends MinMax { + value: number; +} diff --git a/types/models/spt/config/IQuestConfig.d.ts b/types/models/spt/config/IQuestConfig.d.ts index a4257cfc..e37ce7c1 100644 --- a/types/models/spt/config/IQuestConfig.d.ts +++ b/types/models/spt/config/IQuestConfig.d.ts @@ -49,6 +49,7 @@ export interface IRepeatableQuestConfig { rewardAmmoStackMinSize: number; freeChangesAvailable: number; freeChanges: number; + keepDailyQuestTypeOnReplacement: boolean; } export interface IRewardScaling { levels: number[]; diff --git a/types/models/spt/config/ITraderConfig.d.ts b/types/models/spt/config/ITraderConfig.d.ts index d60b496a..43882027 100644 --- a/types/models/spt/config/ITraderConfig.d.ts +++ b/types/models/spt/config/ITraderConfig.d.ts @@ -10,6 +10,7 @@ export interface ITraderConfig extends IBaseConfig { updateTimeDefault: number; traderPriceMultipler: number; fence: FenceConfig; + moddedTraders: ModdedTraders; } export interface UpdateTime { traderId: string; @@ -63,3 +64,8 @@ export interface DiscountOptions { weaponPresetMinMax: MinMax; equipmentPresetMinMax: MinMax; } +/** Custom trader data needed client side for things such as the clothing service */ +export interface ModdedTraders { + /** Trader Ids to enable the clothing service for */ + clothingService: string[]; +} diff --git a/types/models/spt/hideout/IHideout.d.ts b/types/models/spt/hideout/IHideout.d.ts index 57fed470..e93f7487 100644 --- a/types/models/spt/hideout/IHideout.d.ts +++ b/types/models/spt/hideout/IHideout.d.ts @@ -1,11 +1,11 @@ import { IHideoutArea } from "@spt/models/eft/hideout/IHideoutArea"; -import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutProductionData } from "@spt/models/eft/hideout/IHideoutProduction"; import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IHideoutSettingsBase } from "@spt/models/eft/hideout/IHideoutSettingsBase"; import { IQteData } from "@spt/models/eft/hideout/IQteData"; export interface IHideout { areas: IHideoutArea[]; - production: IHideoutProduction[]; + production: IHideoutProductionData; scavcase: IHideoutScavCase[]; settings: IHideoutSettingsBase; qte: IQteData[]; diff --git a/types/services/BotNameService.d.ts b/types/services/BotNameService.d.ts new file mode 100644 index 00000000..e5b0f221 --- /dev/null +++ b/types/services/BotNameService.d.ts @@ -0,0 +1,45 @@ +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; +import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; +import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; +import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt/servers/ConfigServer"; +import { RandomUtil } from "@spt/utils/RandomUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; +import { DatabaseService } from "./DatabaseService"; +import { LocalisationService } from "./LocalisationService"; +export declare class BotNameService { + protected logger: ILogger; + protected randomUtil: RandomUtil; + protected profileHelper: ProfileHelper; + protected databaseService: DatabaseService; + protected localisationService: LocalisationService; + protected configServer: ConfigServer; + protected cloner: ICloner; + protected botConfig: IBotConfig; + protected pmcConfig: IPmcConfig; + protected usedNameCache: Set; + constructor(logger: ILogger, randomUtil: RandomUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + /** + * Clear out any entries in Name Set + */ + clearNameCache(): void; + /** + * Create a unique bot nickname + * @param firstNames FIRST names to choose from + * @param lastNames OPTIONAL: Names to choose from + * @param botGenerationDetails + * @param botRole role of bot e.g. assault + * @param uniqueRoles Lowercase roles to always make unique + * @param sessionId OPTIONAL: profile session id + * @returns Nickname for bot + */ + generateUniqueBotNickname(firstNames: string[], lastNames: string[], botGenerationDetails: BotGenerationDetails, botRole: string, uniqueRoles?: string[], sessionId?: string): string; + /** + * Should this bot have a name like "name (Pmc Name)" + * @param botRole Role bot has + * @returns True if name should be simulated pscav + */ + protected shouldSimulatePlayerScavName(botRole: string): boolean; + protected addPlayerScavNameSimulationSuffix(nickname: string): string; +} diff --git a/types/services/CircleOfCultistService.d.ts b/types/services/CircleOfCultistService.d.ts new file mode 100644 index 00000000..a6e4dc72 --- /dev/null +++ b/types/services/CircleOfCultistService.d.ts @@ -0,0 +1,132 @@ +import { HideoutHelper } from "@spt/helpers/HideoutHelper"; +import { InventoryHelper } from "@spt/helpers/InventoryHelper"; +import { ItemHelper } from "@spt/helpers/ItemHelper"; +import { PresetHelper } from "@spt/helpers/PresetHelper"; +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; +import { IPmcData } from "@spt/models/eft/common/IPmcData"; +import { HideoutArea } from "@spt/models/eft/common/tables/IBotBase"; +import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IStageRequirement } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutCircleOfCultistProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData"; +import { IHideoutProduction, IHideoutProductionData, IRequirementBase, Requirement } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; +import { DirectRewardSettings, IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; +import { ConfigServer } from "@spt/servers/ConfigServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; +import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { HashUtil } from "@spt/utils/HashUtil"; +import { RandomUtil } from "@spt/utils/RandomUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; +import { ICloner } from "@spt/utils/cloners/ICloner"; +export declare class CircleOfCultistService { + protected logger: ILogger; + protected timeUtil: TimeUtil; + protected cloner: ICloner; + protected eventOutputHolder: EventOutputHolder; + protected randomUtil: RandomUtil; + protected hashUtil: HashUtil; + protected itemHelper: ItemHelper; + protected presetHelper: PresetHelper; + protected profileHelper: ProfileHelper; + protected inventoryHelper: InventoryHelper; + protected hideoutHelper: HideoutHelper; + protected databaseService: DatabaseService; + protected itemFilterService: ItemFilterService; + protected seasonalEventService: SeasonalEventService; + protected configServer: ConfigServer; + protected static circleOfCultistSlotId: string; + protected hideoutConfig: IHideoutConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, cloner: ICloner, eventOutputHolder: EventOutputHolder, randomUtil: RandomUtil, hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, inventoryHelper: InventoryHelper, hideoutHelper: HideoutHelper, databaseService: DatabaseService, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + /** + * Start a sacrifice event + * Generate rewards + * Delete sacrificed items + * @param sessionId Session id + * @param pmcData Player profile doing sacrifice + * @param request Client request + * @returns IItemEventRouterResponse + */ + startSacrifice(sessionId: string, pmcData: IPmcData, request: IHideoutCircleOfCultistProductionStartRequestData): IItemEventRouterResponse; + /** + * Register production inside player profile + * @param sessionId Session id + * @param pmcData Player profile + * @param recipeId Recipe id + * @param sacrificedItems Items player sacrificed + * @param rewardAmountRoubles Rouble amount to reward player in items with + * @param directRewardSettings OPTIONAL: If craft is giving direct rewards + */ + protected registerCircleOfCultistProduction(sessionId: string, pmcData: IPmcData, recipeId: string, sacrificedItems: Item[], rewardAmountRoubles: number, directRewardSettings?: DirectRewardSettings): void; + /** + * Get the circle craft time as seconds, value is based on reward item value + * OR rewards are direct, then use custom craft time defined in oarameter object + * @param rewardAmountRoubles Value of rewards in roubles + * @param directRewardSettings OPTIONAL: If craft is giving direct rewards + * @returns craft time seconds + */ + protected getCircleCraftTimeSeconds(rewardAmountRoubles: number, directRewardSettings?: DirectRewardSettings): number; + /** + * Get the items player sacrificed in circle + * @param pmcData Player profile + * @returns Array of its from player inventory + */ + protected getSacrificedItems(pmcData: IPmcData): Item[]; + /** + * Given a pool of items + rouble budget, pick items until the budget is reached + * @param rewardItemTplPool Items that can be picekd + * @param rewardBudget Rouble budget to reach + * @param cultistCircleStashId Id of stash item + * @returns Array of item arrays + */ + protected getRewardsWithinBudget(rewardItemTplPool: string[], rewardBudget: number, cultistCircleStashId: string): Item[][]; + /** + * Give every item as a reward that's passed in + * @param rewardTpls Item tpls to turn into reward items + * @param cultistCircleStashId Id of stash item + * @returns Array of item arrays + */ + protected getExplicitRewards(explicitRewardSettings: DirectRewardSettings, cultistCircleStashId: string): Item[][]; + /** + * Explicit rewards have thier own stack sizes as they dont use a reward rouble pool + * @param rewardTpl Item being rewarded to get stack size of + * @returns stack size of item + */ + protected getExplicitRewardBaseTypeStackSize(rewardTpl: string): number; + /** + * Get the size of a reward items stack + * 1 for everything except ammo, ammo can be between min stack and max stack + * @param itemTpl Item chosen + * @param rewardPoolRemaining Rouble amount of pool remaining to fill + * @returns Size of stack + */ + protected getRewardStackSize(itemTpl: string, rewardPoolRemaining: number): number; + /** + * Get a pool of tpl IDs of items the player needs to complete hideout crafts/upgrade areas + * @param sessionId Session id + * @param pmcData Profile of player who will be getting the rewards + * @returns Array of tpls + */ + protected getCultistCircleRewardPool(sessionId: string, pmcData: IPmcData): string[]; + /** + * Get all active hideout areas + * @param areas Hideout areas to iterate over + * @returns Active area array + */ + protected getPlayerAccessibleHideoutAreas(areas: HideoutArea[]): HideoutArea[]; + /** + * Get all recipes the player has access to, includes base + unlocked recipes + * @param unlockedRecipes Recipes player has flagged as unlocked + * @param allRecipes All recipes + * @returns Array of recipes + */ + protected getPlayerAccessibleRecipes(unlockedRecipes: string[], allRecipes: IHideoutProductionData): IHideoutProduction[]; + /** + * Iterate over passed in hideout requirements and return the Item + * @param requirements Requirements to iterate over + * @returns Array of item requirements + */ + protected getItemRequirements(requirements: IRequirementBase[]): (IStageRequirement | Requirement)[]; +} diff --git a/types/services/InsuranceService.d.ts b/types/services/InsuranceService.d.ts index 4ef88504..4e087dc4 100644 --- a/types/services/InsuranceService.d.ts +++ b/types/services/InsuranceService.d.ts @@ -82,6 +82,13 @@ export declare class InsuranceService { * @returns IInsuranceEquipmentPkg array */ mapInsuredItemsToTrader(sessionId: string, lostInsuredItems: Item[], pmcProfile: IPmcData): IInsuranceEquipmentPkg[]; + /** + * Some items should never be returned in insurance but BSG send them in the request + * @param lostItem Item being returned in insurance + * @param inventoryItems Player inventory + * @returns True if item + */ + protected itemCannotBeLostOnDeath(lostItem: Item, inventoryItems: Item[]): boolean; /** * Add gear item to InsuredItems array in player profile * @param sessionID Session id diff --git a/types/services/LocationLifecycleService.d.ts b/types/services/LocationLifecycleService.d.ts index 669f57bb..f95597c5 100644 --- a/types/services/LocationLifecycleService.d.ts +++ b/types/services/LocationLifecycleService.d.ts @@ -8,7 +8,7 @@ import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Common, TraderInfo } from "@spt/models/eft/common/tables/IBotBase"; +import { Common, IQuestStatus, TraderInfo } from "@spt/models/eft/common/tables/IBotBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IEndLocalRaidRequestData, IEndRaidResult } from "@spt/models/eft/match/IEndLocalRaidRequestData"; import { IStartLocalRaidRequestData } from "@spt/models/eft/match/IStartLocalRaidRequestData"; @@ -16,6 +16,7 @@ import { IStartLocalRaidResponseData } from "@spt/models/eft/match/IStartLocalRa import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -23,6 +24,7 @@ import { ConfigServer } from "@spt/servers/ConfigServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { BotNameService } from "@spt/services/BotNameService"; import { DatabaseService } from "@spt/services/DatabaseService"; import { InsuranceService } from "@spt/services/InsuranceService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -55,6 +57,7 @@ export declare class LocationLifecycleService { protected botGenerationCacheService: BotGenerationCacheService; protected mailSendService: MailSendService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected botNameService: BotNameService; protected lootGenerator: LootGenerator; protected applicationContext: ApplicationContext; protected locationLootGenerator: LocationLootGenerator; @@ -64,10 +67,24 @@ export declare class LocationLifecycleService { protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, timeUtil: TimeUtil, randomUtil: RandomUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, inRaidHelper: InRaidHelper, healthHelper: HealthHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, pmcChatResponseService: PmcChatResponseService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, localisationService: LocalisationService, insuranceService: InsuranceService, botLootCacheService: BotLootCacheService, configServer: ConfigServer, botGenerationCacheService: BotGenerationCacheService, mailSendService: MailSendService, raidTimeAdjustmentService: RaidTimeAdjustmentService, lootGenerator: LootGenerator, applicationContext: ApplicationContext, locationLootGenerator: LocationLootGenerator, cloner: ICloner); + protected pmcConfig: IPmcConfig; + constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, timeUtil: TimeUtil, randomUtil: RandomUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, inRaidHelper: InRaidHelper, healthHelper: HealthHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, pmcChatResponseService: PmcChatResponseService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, localisationService: LocalisationService, insuranceService: InsuranceService, botLootCacheService: BotLootCacheService, configServer: ConfigServer, botGenerationCacheService: BotGenerationCacheService, mailSendService: MailSendService, raidTimeAdjustmentService: RaidTimeAdjustmentService, botNameService: BotNameService, lootGenerator: LootGenerator, applicationContext: ApplicationContext, locationLootGenerator: LocationLootGenerator, cloner: ICloner); + /** Handle client/match/local/start */ startLocalRaid(sessionId: string, request: IStartLocalRaidRequestData): IStartLocalRaidResponseData; /** - * Generate a maps base location and loot + * Replace map exits with scav exits when player is scavving + * @param playerSide Playders side (savage/usec/bear) + * @param location id of map being loaded + * @param locationData Maps locationbase data + */ + protected adjustExtracts(playerSide: string, location: string, locationData: ILocationBase): void; + /** + * Adjust the bot hostility values prior to entering a raid + * @param location map to adjust values of + */ + protected adjustBotHostilitySettings(location: ILocationBase): void; + /** + * Generate a maps base location (cloned) and loot * @param name Map name * @returns ILocationBase */ @@ -109,7 +126,14 @@ export declare class LocationLifecycleService { */ protected extractTakenWasCoop(extractName: string): boolean; protected handlePostRaidPlayerScav(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, isDead: boolean, request: IEndLocalRaidRequestData): void; - protected handlePostRaidPmc(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, postRaidProfile: IPmcData, isDead: boolean, request: IEndLocalRaidRequestData, locationName: string): void; + protected handlePostRaidPmc(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, postRaidProfile: IPmcData, isDead: boolean, isSurvived: boolean, request: IEndLocalRaidRequestData, locationName: string): void; + /** + * Convert post-raid quests into correct format + * Quest status comes back as a string version of the enum `Success`, not the expected value of 1 + * @param questsToProcess + * @returns IQuestStatus + */ + protected processPostRaidQuests(questsToProcess: IQuestStatus[]): IQuestStatus[]; /** * Adjust server trader settings if they differ from data sent by client * @param tradersServerProfile Server @@ -123,12 +147,19 @@ export declare class LocationLifecycleService { */ protected handleBTRItemTransferEvent(sessionId: string, request: IEndLocalRaidRequestData): void; protected btrItemDelivery(sessionId: string, traderId: string, items: Item[]): void; + protected handleInsuredItemLostEvent(sessionId: string, preRaidPmcProfile: IPmcData, request: IEndLocalRaidRequestData, locationName: string): void; /** * Return the equipped items from a players inventory * @param items Players inventory to search through * @returns an array of equipped items */ protected getEquippedGear(items: Item[]): Item[]; + /** + * Checks to see if player survives. run through will return false + * @param statusOnExit Exit value from offraidData object + * @returns true if Survived + */ + protected isPlayerSurvived(results: IEndRaidResult): boolean; /** * Is the player dead after a raid - dead = anything other than "survived" / "runner" * @param statusOnExit Exit value from offraidData object diff --git a/types/services/ProfileFixerService.d.ts b/types/services/ProfileFixerService.d.ts index 7b593c75..e1026281 100644 --- a/types/services/ProfileFixerService.d.ts +++ b/types/services/ProfileFixerService.d.ts @@ -4,9 +4,10 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { HideoutSlot } from "@spt/models/eft/common/tables/IBotBase"; +import { Bonus, HideoutSlot } from "@spt/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { StageBonus } from "@spt/models/eft/hideout/IHideoutArea"; import { IEquipmentBuild, IMagazineBuild, ISptProfile, IWeaponBuild } from "@spt/models/eft/profile/ISptProfile"; import { HideoutAreas } from "@spt/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; @@ -107,4 +108,16 @@ export declare class ProfileFixerService { * @returns True if the build should be removed from the build list, false otherwise */ protected shouldRemoveMagazineBuild(magazineBuild: IMagazineBuild, itemsDb: Record): boolean; + /** + * REQUIRED for dev profiles + * Iterate over players hideout areas and find what's build, look for missing bonuses those areas give and add them if missing + * @param pmcProfile Profile to update + */ + addMissingHideoutBonusesToProfile(pmcProfile: IPmcData): void; + /** + * @param profileBonuses bonuses from profile + * @param bonus bonus to find + * @returns matching bonus + */ + protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; } diff --git a/types/services/RagfairOfferService.d.ts b/types/services/RagfairOfferService.d.ts index 98dd1799..ef33d324 100644 --- a/types/services/RagfairOfferService.d.ts +++ b/types/services/RagfairOfferService.d.ts @@ -10,6 +10,7 @@ import { ConfigServer } from "@spt/servers/ConfigServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; +import { HashUtil } from "@spt/utils/HashUtil"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { RagfairOfferHolder } from "@spt/utils/RagfairOfferHolder"; import { TimeUtil } from "@spt/utils/TimeUtil"; @@ -17,6 +18,7 @@ import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class RagfairOfferService { protected logger: ILogger; protected timeUtil: TimeUtil; + protected hashUtil: HashUtil; protected databaseService: DatabaseService; protected saveServer: SaveServer; protected ragfairServerHelper: RagfairServerHelper; @@ -32,7 +34,7 @@ export declare class RagfairOfferService { protected expiredOffers: Record; protected ragfairConfig: IRagfairConfig; protected ragfairOfferHandler: RagfairOfferHolder; - constructor(logger: ILogger, timeUtil: TimeUtil, databaseService: DatabaseService, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, databaseService: DatabaseService, saveServer: SaveServer, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Get all offers * @returns IRagfairOffer array diff --git a/types/services/RagfairPriceService.d.ts b/types/services/RagfairPriceService.d.ts index 0a2f26e4..736ab01f 100644 --- a/types/services/RagfairPriceService.d.ts +++ b/types/services/RagfairPriceService.d.ts @@ -5,7 +5,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { MinMax } from "@spt/models/common/MinMax"; import { IPreset } from "@spt/models/eft/common/IGlobals"; -import { HandbookItem } from "@spt/models/eft/common/tables/IHandbookBase"; +import { IHandbookItem } from "@spt/models/eft/common/tables/IHandbookBase"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader"; import { IRagfairConfig, IUnreasonableModPrices } from "@spt/models/spt/config/IRagfairConfig"; @@ -114,7 +114,7 @@ export declare class RagfairPriceService implements OnLoad { * @param price Current price of item * @returns Adjusted price of item */ - protected adjustUnreasonablePrice(handbookPrices: HandbookItem[], unreasonableItemChange: IUnreasonableModPrices, itemTpl: string, price: number): number; + protected adjustUnreasonablePrice(handbookPrices: IHandbookItem[], unreasonableItemChange: IUnreasonableModPrices, itemTpl: string, price: number): number; /** * Get different min/max price multipliers for different offer types (preset/pack/default) * @param isPreset Offer is a preset diff --git a/types/tools/ItemTplGenerator/itemOverrides.d.ts b/types/tools/ItemTplGenerator/itemOverrides.d.ts index 6ef239ad..9d6089f0 100644 --- a/types/tools/ItemTplGenerator/itemOverrides.d.ts +++ b/types/tools/ItemTplGenerator/itemOverrides.d.ts @@ -55,6 +55,7 @@ declare const _default: { "6614230055afee107f05e998": string; "661421c7c1f2f548c50ee649": string; "661423200d240a5f5d0f679b": string; + "66a0f0926fee20fa70036da6": string; "5d1340b3d7ad1a0b52682ed7": string; "55802d5f4bdc2dac148b458e": string; "5d1340cad7ad1a0b0b249869": string; From 731515594ddc3ad3d9369ba9da6d4cc500b81d5a Mon Sep 17 00:00:00 2001 From: Archangel Date: Fri, 20 Sep 2024 16:56:17 +0200 Subject: [PATCH 027/119] Remove code to convert favoriteItems as this is now in SPT --- src/overrides/controllers/ProfileController.ts | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/overrides/controllers/ProfileController.ts b/src/overrides/controllers/ProfileController.ts index 614c7f56..cc91605e 100644 --- a/src/overrides/controllers/ProfileController.ts +++ b/src/overrides/controllers/ProfileController.ts @@ -81,19 +81,6 @@ export class ProfileControllerOverride extends Override { const playerPmc = player.characters.pmc; const playerScav = player.characters.scav; - const favoriteItems: Item[] = []; - - playerPmc.Inventory.favoriteItems.forEach(item => { - let favoriteItem = playerPmc.Inventory.items.find(i => i._id === item); - - if(favoriteItem === undefined) - { - return; - } - - favoriteItems.push(favoriteItem); - }); - return { id: playerPmc._id, aid: playerPmc.aid, @@ -119,7 +106,7 @@ export class ProfileControllerOverride extends Override { Items: playerPmc.Inventory.items, }, achievements: playerPmc.Achievements, - favoriteItems: favoriteItems, + favoriteItems: playerPmc.Inventory.favoriteItems ?? [], pmcStats: { eft: { totalInGameTime: playerPmc.Stats.Eft.TotalInGameTime, From e5d2ffc011a21b359498e986e597a29729bb30be Mon Sep 17 00:00:00 2001 From: Archangel Date: Fri, 20 Sep 2024 17:00:44 +0200 Subject: [PATCH 028/119] Keep check for dedicated consistent with other checks --- src/controllers/FikaAchievementController.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/FikaAchievementController.ts b/src/controllers/FikaAchievementController.ts index e0bdadc2..5ba6caad 100644 --- a/src/controllers/FikaAchievementController.ts +++ b/src/controllers/FikaAchievementController.ts @@ -21,7 +21,7 @@ export class FikaAchievementController { for (const achievement of achievements) { let percentage = 0; for (const profile of profiles) { - if (profile.info?.username?.startsWith("dedicated_")) { + if (profile.info?.password === "fika-dedicated") { continue; } From 9122d832dc033dff1c26d3d028bf256984a18758 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Fri, 20 Sep 2024 17:09:04 +0200 Subject: [PATCH 029/119] Update locales --- assets/database/locales/global/en.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/assets/database/locales/global/en.json b/assets/database/locales/global/en.json index 5d4de14d..dc450d89 100644 --- a/assets/database/locales/global/en.json +++ b/assets/database/locales/global/en.json @@ -85,5 +85,9 @@ "F_UI_WaitForPlayer": "Waiting for {0} player", "F_UI_WaitForPlayers": "Waiting for {0} players", "F_UI_ToSLong": "Welcome to Fika!\r\n\r\nFika is a co-op mod for SPT, allowing you to play with your friends. Fika is and will always be free, if you paid for it you got scammed. You are also not allowed to host public servers with monetization or donations.\r\n\r\nWait for this message to fade to accept our Terms of Service.\r\n\r\nYou can join our Discord here: https://discord.gg/project-fika", - "F_UI_ToSShort": "Welcome to Fika!\r\n\r\nFika is a co-op mod for SPT, allowing you to play with your friends. Fika is and will always be free, if you paid for it you got scammed. You are also not allowed to host public servers with monetization or donations.\r\n\r\nYou can join our Discord here: https://discord.gg/project-fika" -} + "F_UI_ToSShort": "Welcome to Fika!\r\n\r\nFika is a co-op mod for SPT, allowing you to play with your friends. Fika is and will always be free, if you paid for it you got scammed. You are also not allowed to host public servers with monetization or donations.\r\n\r\nYou can join our Discord here: https://discord.gg/project-fika", + "F_UI_RaidSettingsDescription": "In this mode, you can play online co-op with your friends without the risk of meeting others.\nAll game mechanics in the co-op mode (weather, bots, bosses, etc.) are identical to the online mechanics.\nOnly the hosts settings will take effect.", + "F_UI_CoopGameMode": "Fika Co-op Game Mode", + "F_UI_CoopRaidSettings": "Fika Co-op Raid Settings", + "F_UI_FikaAlwaysCoop": "Co-op is always enabled in Fika" +} \ No newline at end of file From 3a75c00b8106cf1a7b7f8d4eaa812eedf40c4313 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Sun, 22 Sep 2024 17:00:51 +0200 Subject: [PATCH 030/119] Update locales --- assets/database/locales/global/en.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/database/locales/global/en.json b/assets/database/locales/global/en.json index dc450d89..c3902922 100644 --- a/assets/database/locales/global/en.json +++ b/assets/database/locales/global/en.json @@ -89,5 +89,6 @@ "F_UI_RaidSettingsDescription": "In this mode, you can play online co-op with your friends without the risk of meeting others.\nAll game mechanics in the co-op mode (weather, bots, bosses, etc.) are identical to the online mechanics.\nOnly the hosts settings will take effect.", "F_UI_CoopGameMode": "Fika Co-op Game Mode", "F_UI_CoopRaidSettings": "Fika Co-op Raid Settings", - "F_UI_FikaAlwaysCoop": "Co-op is always enabled in Fika" + "F_UI_FikaAlwaysCoop": "Co-op is always enabled in Fika", + "F_UI_UpnpFailed": "UPnP mapping failed. Make sure the selected port is not already open!\nDisable UPnP if you are using a VPN." } \ No newline at end of file From be6dcaddc5e80606b98015201a7ce05002167e83 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Fri, 27 Sep 2024 07:11:03 +0200 Subject: [PATCH 031/119] Update types --- types/callbacks/BotCallbacks.d.ts | 6 +- types/callbacks/MatchCallbacks.d.ts | 1 + types/callbacks/ProfileCallbacks.d.ts | 4 +- types/controllers/BotController.d.ts | 14 +- types/controllers/GameController.d.ts | 4 +- types/controllers/HideoutController.d.ts | 10 +- types/controllers/InsuranceController.d.ts | 20 +- types/controllers/ProfileController.d.ts | 4 +- types/controllers/QuestController.d.ts | 13 +- types/controllers/RagfairController.d.ts | 8 +- types/controllers/TradeController.d.ts | 4 +- .../generators/BotEquipmentModGenerator.d.ts | 36 +-- types/generators/BotGenerator.d.ts | 14 +- types/generators/BotInventoryGenerator.d.ts | 19 +- types/generators/BotLootGenerator.d.ts | 16 +- types/generators/BotWeaponGenerator.d.ts | 34 +-- .../generators/FenceBaseAssortGenerator.d.ts | 4 +- types/generators/LocationLootGenerator.d.ts | 16 +- types/generators/LootGenerator.d.ts | 16 +- types/generators/PlayerScavGenerator.d.ts | 8 +- types/generators/RagfairAssortGenerator.d.ts | 10 +- types/generators/RagfairOfferGenerator.d.ts | 28 +-- .../generators/RepeatableQuestGenerator.d.ts | 10 +- .../RepeatableQuestRewardGenerator.d.ts | 4 +- types/generators/ScavCaseRewardGenerator.d.ts | 6 +- .../generators/weapongen/InventoryMagGen.d.ts | 10 +- types/helpers/BotDifficultyHelper.d.ts | 6 +- types/helpers/BotGeneratorHelper.d.ts | 18 +- types/helpers/BotHelper.d.ts | 15 +- types/helpers/BotWeaponGeneratorHelper.d.ts | 14 +- types/helpers/DialogueHelper.d.ts | 4 +- types/helpers/HandbookHelper.d.ts | 4 +- types/helpers/HealthHelper.d.ts | 6 +- types/helpers/HideoutHelper.d.ts | 39 ++-- types/helpers/InRaidHelper.d.ts | 6 +- types/helpers/InventoryHelper.d.ts | 49 ++-- types/helpers/ItemHelper.d.ts | 83 +++---- types/helpers/ProfileHelper.d.ts | 6 +- types/helpers/QuestHelper.d.ts | 28 ++- types/helpers/RagfairHelper.d.ts | 4 +- types/helpers/RagfairOfferHelper.d.ts | 13 +- types/helpers/RagfairSellHelper.d.ts | 4 +- types/helpers/RagfairServerHelper.d.ts | 8 +- types/helpers/RepairHelper.d.ts | 4 +- types/helpers/SecureContainerHelper.d.ts | 10 +- types/helpers/TradeHelper.d.ts | 9 +- types/helpers/TraderAssortHelper.d.ts | 6 +- types/helpers/TraderHelper.d.ts | 6 +- types/loaders/BundleLoader.d.ts | 8 +- .../eft/bot/IGenerateBotsRequestData.d.ts | 4 +- types/models/eft/common/IGlobals.d.ts | 82 ++++++- types/models/eft/common/ILocation.d.ts | 18 +- types/models/eft/common/ILocationBase.d.ts | 72 +++--- .../ILocationsSourceDestinationBase.d.ts | 4 +- types/models/eft/common/ILooseLoot.d.ts | 34 +-- types/models/eft/common/tables/IBotBase.d.ts | 209 +++++++++--------- types/models/eft/common/tables/IBotType.d.ts | 101 ++++----- .../eft/common/tables/ICustomizationItem.d.ts | 6 +- types/models/eft/common/tables/IItem.d.ts | 104 ++++----- .../eft/common/tables/ILocationServices.d.ts | 5 +- .../eft/common/tables/ILocationsBase.d.ts | 8 +- types/models/eft/common/tables/IMatch.d.ts | 4 +- types/models/eft/common/tables/IQuest.d.ts | 9 +- .../eft/common/tables/IRepeatableQuests.d.ts | 8 +- .../eft/common/tables/ITemplateItem.d.ts | 58 ++--- types/models/eft/common/tables/ITrader.d.ts | 4 +- .../models/eft/game/IGameConfigResponse.d.ts | 4 +- .../health/IHealthTreatmentRequestData.d.ts | 28 +-- .../eft/health/ISyncHealthRequestData.d.ts | 20 +- .../eft/hideout/IHideoutSettingsBase.d.ts | 1 + ...deoutSingleProductionStartRequestData.d.ts | 6 +- .../eft/inRaid/IItemDeliveryRequestData.d.ts | 4 +- .../eft/inventory/IAddItemDirectRequest.d.ts | 4 +- .../eft/inventory/IAddItemRequestData.d.ts | 4 +- .../eft/inventory/IAddItemTempObject.d.ts | 6 +- .../eft/inventory/IAddItemsDirectRequest.d.ts | 4 +- .../IInventoryBaseActionRequestData.d.ts | 10 +- .../inventory/IInventorySortRequestData.d.ts | 18 +- .../eft/itemEvent/IItemEventRouterBase.d.ts | 47 ++-- .../eft/location/IGetAirdropLootResponse.d.ts | 4 +- .../eft/match/IEndLocalRaidRequestData.d.ts | 23 +- .../IGetRaidConfigurationRequestData.d.ts | 1 - types/models/eft/match/IGroupCharacter.d.ts | 4 +- .../eft/match/IStartLocalRaidRequestData.d.ts | 8 + .../match/IStartLocalRaidResponseData.d.ts | 7 + ...IPlayerIncrementSkillLevelRequestData.d.ts | 4 +- .../IPresetBuildActionRequestData.d.ts | 4 +- .../profile/GetProfileStatusResponseData.d.ts | 6 +- .../eft/profile/IGetOtherProfileResponse.d.ts | 12 +- types/models/eft/profile/ISptProfile.d.ts | 14 +- .../eft/quests/IHandoverQuestRequestData.d.ts | 4 +- types/models/eft/ragfair/IRagfairOffer.d.ts | 8 +- .../trade/IProcessBuyTradeRequestData.d.ts | 4 +- .../trade/IProcessSellTradeRequestData.d.ts | 4 +- types/models/enums/AirdropType.d.ts | 8 +- types/models/enums/WildSpawnTypeNumber.d.ts | 3 + .../models/spt/bots/GenerateWeaponResult.d.ts | 8 +- .../bots/IGenerateEquipmentProperties.d.ts | 8 +- .../spt/bots/IGenerateWeaponRequest.d.ts | 10 +- types/models/spt/bots/IModToSpawnRequest.d.ts | 4 +- types/models/spt/config/IAirdropConfig.d.ts | 6 +- types/models/spt/config/IBotConfig.d.ts | 5 +- types/models/spt/config/IBotDurability.d.ts | 50 ++--- types/models/spt/config/ICoreConfig.d.ts | 1 + types/models/spt/config/IGiftsConfig.d.ts | 8 +- types/models/spt/config/ILocationConfig.d.ts | 16 +- types/models/spt/config/ILootConfig.d.ts | 4 +- .../models/spt/config/ILostOnDeathConfig.d.ts | 4 +- .../models/spt/config/IPlayerScavConfig.d.ts | 14 +- types/models/spt/config/IPmcConfig.d.ts | 4 +- types/models/spt/config/IQuestConfig.d.ts | 4 + types/models/spt/config/IRagfairConfig.d.ts | 7 + types/models/spt/config/IScavCaseConfig.d.ts | 18 +- .../spt/config/ISeasonalEventConfig.d.ts | 8 +- .../spt/controllers/IBotController.d.ts | 4 +- .../spt/dialog/ISendMessageDetails.d.ts | 4 +- .../spt/fence/ICreateFenceAssortsResult.d.ts | 4 +- .../models/spt/generators/IBotGenerator.d.ts | 6 +- .../spt/generators/ILocationGenerator.d.ts | 4 +- .../generators/IRagfairAssortGenerator.d.ts | 4 +- .../generators/IRagfairOfferGenerator.d.ts | 4 +- .../spt/inventory/IOwnerInventoryItems.d.ts | 6 +- .../spt/services/IInsuranceEquipmentPkg.d.ts | 4 +- types/routers/EventOutputHolder.d.ts | 9 +- types/services/AirdropService.d.ts | 4 +- types/services/BotEquipmentFilterService.d.ts | 6 +- .../services/BotEquipmentModPoolService.d.ts | 6 +- types/services/BotGenerationCacheService.d.ts | 2 +- types/services/BotWeaponModLimitService.d.ts | 4 +- types/services/CircleOfCultistService.d.ts | 14 +- types/services/CustomLocationWaveService.d.ts | 6 +- types/services/FenceService.d.ts | 38 ++-- types/services/GiftService.d.ts | 10 +- types/services/InsuranceService.d.ts | 23 +- types/services/LocationLifecycleService.d.ts | 11 +- types/services/MailSendService.d.ts | 14 +- types/services/MapMarkerService.d.ts | 8 +- types/services/PaymentService.d.ts | 8 +- types/services/PmcChatResponseService.d.ts | 10 +- types/services/ProfileFixerService.d.ts | 6 +- types/services/RagfairOfferService.d.ts | 6 +- types/services/RagfairPriceService.d.ts | 12 +- types/services/RagfairTaxService.d.ts | 6 +- types/services/RaidTimeAdjustmentService.d.ts | 4 +- types/services/RepairService.d.ts | 8 +- types/services/SeasonalEventService.d.ts | 4 +- types/utils/HashUtil.d.ts | 6 + 147 files changed, 1140 insertions(+), 977 deletions(-) diff --git a/types/callbacks/BotCallbacks.d.ts b/types/callbacks/BotCallbacks.d.ts index abc1483a..909e93ee 100644 --- a/types/callbacks/BotCallbacks.d.ts +++ b/types/callbacks/BotCallbacks.d.ts @@ -3,7 +3,7 @@ import { BotController } from "@spt/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { Difficulties } from "@spt/models/eft/common/tables/IBotType"; +import { IDifficulties } from "@spt/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -26,7 +26,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/difficulties * @returns dictionary of every bot and its diffiulty settings */ - getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData @@ -36,7 +36,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/maxCap * @returns string */ - getBotCap(url: string, info: any, sessionID: string): string; + getBotCap(url: string, info: IEmptyRequestData, sessionID: string): string; /** * Handle singleplayer/settings/bot/getBotBehaviours * @returns string diff --git a/types/callbacks/MatchCallbacks.d.ts b/types/callbacks/MatchCallbacks.d.ts index 096fa0a1..b63c920e 100644 --- a/types/callbacks/MatchCallbacks.d.ts +++ b/types/callbacks/MatchCallbacks.d.ts @@ -48,6 +48,7 @@ export declare class MatchCallbacks { /** Handle client/match/group/invite/cancel-all */ cancelAllGroupInvite(url: string, info: IEmptyRequestData, sessionId: string): IGetBodyResponseData; putMetrics(url: string, request: IPutMetricsRequestData, sessionId: string): INullResponseData; + eventDisconnect(url: string, request: IPutMetricsRequestData, sessionId: string): INullResponseData; serverAvailable(url: string, info: IEmptyRequestData, sessionId: string): IGetBodyResponseData; /** Handle match/group/start_game */ joinMatch(url: string, info: IMatchGroupStartGameRequest, sessionID: string): IGetBodyResponseData; diff --git a/types/callbacks/ProfileCallbacks.d.ts b/types/callbacks/ProfileCallbacks.d.ts index ba35f5e6..3824a8cc 100644 --- a/types/callbacks/ProfileCallbacks.d.ts +++ b/types/callbacks/ProfileCallbacks.d.ts @@ -5,7 +5,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; import { IGetMiniProfileRequestData } from "@spt/models/eft/launcher/IGetMiniProfileRequestData"; -import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; +import { IGetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { ICreateProfileResponse } from "@spt/models/eft/profile/ICreateProfileResponse"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; @@ -65,7 +65,7 @@ export declare class ProfileCallbacks { * Handle client/profile/status * Called when creating a character when choosing a character face/voice */ - getProfileStatus(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getProfileStatus(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/profile/view * Called when viewing another players profile diff --git a/types/controllers/BotController.d.ts b/types/controllers/BotController.d.ts index 80c0baa7..36477a21 100644 --- a/types/controllers/BotController.d.ts +++ b/types/controllers/BotController.d.ts @@ -5,11 +5,11 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { MinMax } from "@spt/models/common/MinMax"; -import { Condition, IGenerateBotsRequestData } from "@spt/models/eft/bot/IGenerateBotsRequestData"; +import { ICondition, IGenerateBotsRequestData } from "@spt/models/eft/bot/IGenerateBotsRequestData"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; +import { IDifficultyCategories } from "@spt/models/eft/common/tables/IBotType"; import { IGetRaidConfigurationRequestData } from "@spt/models/eft/match/IGetRaidConfigurationRequestData"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; @@ -63,7 +63,7 @@ export declare class BotController { * @param ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string, raidConfig?: IGetRaidConfigurationRequestData, ignoreRaidSettings?: boolean): Difficulty; + getBotDifficulty(type: string, diffLevel: string, raidConfig?: IGetRaidConfigurationRequestData, ignoreRaidSettings?: boolean): IDifficultyCategories; getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache @@ -80,6 +80,7 @@ export declare class BotController { * @returns IBotBase[] */ protected generateMultipleBotsAndCache(request: IGenerateBotsRequestData, pmcProfile: IPmcData, sessionId: string): Promise; + protected getMostRecentRaidSettings(): IGetRaidConfigurationRequestData; /** * Get min/max level range values for a specific map * @param location Map name e.g. factory4_day @@ -91,12 +92,12 @@ export declare class BotController { * @param condition Client data defining bot type and difficulty * @param pmcProfile Player who is generating bots * @param allPmcsHaveSameNameAsPlayer Should all PMCs have same name as player - * @param pmcLevelRangeForMap Min/max levels for PMCs to generate within + * @param raidSettings Settings chosen pre-raid by player * @param botCountToGenerate How many bots to generate * @param generateAsPmc Force bot being generated a PMC * @returns BotGenerationDetails */ - protected getBotGenerationDetailsForWave(condition: Condition, pmcProfile: IPmcData, allPmcsHaveSameNameAsPlayer: boolean, pmcLevelRangeForMap: MinMax, botCountToGenerate: number, generateAsPmc: boolean): BotGenerationDetails; + protected getBotGenerationDetailsForWave(condition: ICondition, pmcProfile: IPmcData, allPmcsHaveSameNameAsPlayer: boolean, raidSettings: IGetRaidConfigurationRequestData, botCountToGenerate: number, generateAsPmc: boolean): BotGenerationDetails; /** * Get players profile level * @param pmcProfile Profile to get level from @@ -110,7 +111,7 @@ export declare class BotController { * @param sessionId Session id * @returns A promise for the bots to be done generating */ - protected generateWithBotDetails(condition: Condition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; + protected generateWithBotDetails(condition: ICondition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; /** * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with @@ -126,6 +127,7 @@ export declare class BotController { * @returns Single IBotBase object */ protected returnSingleBotFromCache(sessionId: string, request: IGenerateBotsRequestData): Promise; + protected getPmcConversionMinMaxForLocation(requestedBotRole: string, location: string): MinMax; protected updateBotGenerationDetailsToRandomBoss(botGenerationDetails: BotGenerationDetails, possibleBossTypeWeights: Record): void; /** * Get the difficulty passed in, if its not "asonline", get selected difficulty from config diff --git a/types/controllers/GameController.d.ts b/types/controllers/GameController.d.ts index f59415c3..dbcbce2a 100644 --- a/types/controllers/GameController.d.ts +++ b/types/controllers/GameController.d.ts @@ -1,6 +1,7 @@ import { ApplicationContext } from "@spt/context/ApplicationContext"; import { HideoutHelper } from "@spt/helpers/HideoutHelper"; import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; +import { InventoryHelper } from "@spt/helpers/InventoryHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { PreSptModLoader } from "@spt/loaders/PreSptModLoader"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; @@ -45,6 +46,7 @@ export declare class GameController { protected hashUtil: HashUtil; protected preSptModLoader: PreSptModLoader; protected httpServerHelper: HttpServerHelper; + protected inventoryHelper: InventoryHelper; protected randomUtil: RandomUtil; protected hideoutHelper: HideoutHelper; protected profileHelper: ProfileHelper; @@ -68,7 +70,7 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, hashUtil: HashUtil, preSptModLoader: PreSptModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, 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, 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 diff --git a/types/controllers/HideoutController.d.ts b/types/controllers/HideoutController.d.ts index df0ec92d..f65df697 100644 --- a/types/controllers/HideoutController.d.ts +++ b/types/controllers/HideoutController.d.ts @@ -6,7 +6,7 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { HideoutArea, ITaskConditionCounter, Product } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotHideoutArea, IProduct, ITaskConditionCounter } from "@spt/models/eft/common/tables/IBotBase"; import { HideoutUpgradeCompleteRequestData } from "@spt/models/eft/hideout/HideoutUpgradeCompleteRequestData"; import { IHandleQTEEventRequestData } from "@spt/models/eft/hideout/IHandleQTEEventRequestData"; import { IHideoutArea, Stage } from "@spt/models/eft/hideout/IHideoutArea"; @@ -92,7 +92,7 @@ export declare class HideoutController { * Upgrade wall status to visible in profile if medstation/water collector are both level 1 * @param pmcData Player profile */ - protected checkAndUpgradeWall(pmcData: IPmcData): void; + protected SetWallVisibleIfPrereqsMet(pmcData: IPmcData): void; /** * @param pmcData Profile to edit * @param output Object to send back to client @@ -101,7 +101,7 @@ export declare class HideoutController { * @param dbHideoutArea Hideout area being upgraded * @param hideoutStage Stage hideout area is being upgraded to */ - protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileParentHideoutArea: HideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; + protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileParentHideoutArea: IBotHideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; /** * Add stand1/stand2/stand3 inventory items to profile, depending on passed in hideout stage * @param sessionId Session id @@ -153,7 +153,7 @@ export declare class HideoutController { * @param hideoutArea Area fuel is being removed from * @returns IItemEventRouterResponse response */ - protected removeResourceFromArea(sessionID: string, pmcData: IPmcData, removeResourceRequest: IHideoutTakeItemOutRequestData, output: IItemEventRouterResponse, hideoutArea: HideoutArea): IItemEventRouterResponse; + protected removeResourceFromArea(sessionID: string, pmcData: IPmcData, removeResourceRequest: IHideoutTakeItemOutRequestData, output: IItemEventRouterResponse, hideoutArea: IBotHideoutArea): IItemEventRouterResponse; /** * Handle HideoutToggleArea event * Toggle area on/off @@ -195,7 +195,7 @@ export declare class HideoutController { * @param rewards reward items to add to profile * @param recipeId recipe id to save into Production dict */ - protected addScavCaseRewardsToProfile(pmcData: IPmcData, rewards: Product[], recipeId: string): void; + protected addScavCaseRewardsToProfile(pmcData: IPmcData, rewards: IProduct[], recipeId: string): void; /** * Start production of continuously created item * @param pmcData Player profile diff --git a/types/controllers/InsuranceController.d.ts b/types/controllers/InsuranceController.d.ts index 4c96b96a..2f45da6a 100644 --- a/types/controllers/InsuranceController.d.ts +++ b/types/controllers/InsuranceController.d.ts @@ -4,7 +4,7 @@ import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IGetInsuranceCostRequestData } from "@spt/models/eft/insurance/IGetInsuranceCostRequestData"; import { IGetInsuranceCostResponseData } from "@spt/models/eft/insurance/IGetInsuranceCostResponseData"; import { IInsureRequestData } from "@spt/models/eft/insurance/IInsureRequestData"; @@ -109,7 +109,7 @@ export declare class InsuranceController { * @param itemsMap - A Map object for quick item look-up by item ID. * @returns A Map object containing parent item IDs to arrays of their attachment items. */ - protected populateParentAttachmentsMap(rootItemParentID: string, insured: Insurance, itemsMap: Map): Map; + protected populateParentAttachmentsMap(rootItemParentID: string, insured: Insurance, itemsMap: Map): Map; /** * Remove attachments that can not be moddable in-raid from the parentAttachmentsMap. If no moddable attachments * remain, the parent is removed from the map as well. @@ -118,7 +118,7 @@ export declare class InsuranceController { * @param itemsMap - A Map object for quick item look-up by item ID. * @returns A Map object containing parent item IDs to arrays of their attachment items which are not moddable in-raid. */ - protected removeNonModdableAttachments(parentAttachmentsMap: Map, itemsMap: Map): Map; + protected removeNonModdableAttachments(parentAttachmentsMap: Map, itemsMap: Map): Map; /** * Process "regular" insurance items. Any insured item that is not an attached, attachment is considered a "regular" * item. This method iterates over them, preforming item deletion rolls to see if they should be deleted. If so, @@ -129,7 +129,7 @@ export declare class InsuranceController { * @param parentAttachmentsMap A Map object containing parent item IDs to arrays of their attachment items. * @returns void */ - protected processRegularItems(insured: Insurance, toDelete: Set, parentAttachmentsMap: Map): void; + protected processRegularItems(insured: Insurance, toDelete: Set, parentAttachmentsMap: Map): void; /** * Process parent items and their attachments, updating the toDelete Set accordingly. * @@ -138,7 +138,7 @@ export declare class InsuranceController { * @param traderId The trader ID from the Insurance object. * @param toDelete A Set object to keep track of items marked for deletion. */ - protected processAttachments(mainParentToAttachmentsMap: Map, itemsMap: Map, traderId: string, toDelete: Set): void; + protected processAttachments(mainParentToAttachmentsMap: Map, itemsMap: Map, traderId: string, toDelete: Set): void; /** * Takes an array of attachment items that belong to the same main-parent item, sorts them in descending order by * their maximum price. For each attachment, a roll is made to determine if a deletion should be made. Once the @@ -150,9 +150,9 @@ export declare class InsuranceController { * @param toDelete The array that accumulates the IDs of the items to be deleted. * @returns void */ - protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; - protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: Item[], attachmentPrices: Record): void; - protected weightAttachmentsByPrice(attachments: Item[]): Record; + protected processAttachmentByParent(attachments: IItem[], traderId: string, toDelete: Set): void; + protected logAttachmentsBeingRemoved(attachmentIdsToRemove: string[], attachments: IItem[], attachmentPrices: Record): void; + protected weightAttachmentsByPrice(attachments: IItem[]): Record; /** * Get count of items to remove from weapon (take into account trader + price of attachment) * @param weightedAttachmentByPrice Dict of item Tpls and thier rouble price @@ -184,7 +184,7 @@ export declare class InsuranceController { * @param insuredItem Optional. The item to roll for. Only used for logging. * @returns true if the insured item should be removed from inventory, false otherwise, or undefined on error. */ - protected rollForDelete(traderId: string, insuredItem?: Item): boolean | undefined; + protected rollForDelete(traderId: string, insuredItem?: IItem): boolean | undefined; /** * Handle Insure event * Add insurance to an item @@ -202,7 +202,7 @@ export declare class InsuranceController { * @param pmcData Player profile * @param body Insurance request data */ - insureSoftInserts(item: Item, pmcData: IPmcData, body: IInsureRequestData): void; + insureSoftInserts(item: IItem, pmcData: IPmcData, body: IInsureRequestData): void; /** * Handle client/insurance/items/list/cost * Calculate insurance cost diff --git a/types/controllers/ProfileController.d.ts b/types/controllers/ProfileController.d.ts index 7e6d35c1..71fd9e6e 100644 --- a/types/controllers/ProfileController.d.ts +++ b/types/controllers/ProfileController.d.ts @@ -7,7 +7,7 @@ import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile"; -import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; +import { IGetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest"; @@ -117,7 +117,7 @@ export declare class ProfileController { /** * Handle client/profile/status */ - getProfileStatus(sessionId: string): GetProfileStatusResponseData; + getProfileStatus(sessionId: string): IGetProfileStatusResponseData; getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; /** * Handle client/profile/settings diff --git a/types/controllers/QuestController.d.ts b/types/controllers/QuestController.d.ts index 6a5b415a..270a70a9 100644 --- a/types/controllers/QuestController.d.ts +++ b/types/controllers/QuestController.d.ts @@ -6,7 +6,7 @@ import { QuestHelper } from "@spt/helpers/QuestHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IQuestStatus } from "@spt/models/eft/common/tables/IBotBase"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IQuest, IQuestCondition } from "@spt/models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -72,6 +72,13 @@ export declare class QuestController { * @returns Client response */ acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * + * @param questConditions Conditions to iterate over and possibly add to profile + * @param pmcData Profile to add to + * @param questId Quest conditions came from + */ + protected addTaskConditionCountersToProfile(questConditions: IQuestCondition[], pmcData: IPmcData, questId: string): void; /** * Handle the client accepting a repeatable quest and starting it * Send starting rewards if any to player and @@ -127,7 +134,7 @@ export declare class QuestController { * @param completedQuestId Completed quest id * @param questRewards Rewards given to player */ - protected sendSuccessDialogMessageOnQuestComplete(sessionID: string, pmcData: IPmcData, completedQuestId: string, questRewards: Item[]): void; + protected sendSuccessDialogMessageOnQuestComplete(sessionID: string, pmcData: IPmcData, completedQuestId: string, questRewards: IItem[]): void; /** * Look for newly available quests after completing a quest with a requirement to wait x minutes (time-locked) before being available and add data to profile * @param pmcData Player profile to update @@ -167,7 +174,7 @@ export declare class QuestController { * @param output Response to send to user * @returns IItemEventRouterResponse */ - protected showQuestItemHandoverMatchError(handoverQuestRequest: IHandoverQuestRequestData, itemHandedOver: Item, handoverRequirements: IQuestCondition, output: IItemEventRouterResponse): IItemEventRouterResponse; + protected showQuestItemHandoverMatchError(handoverQuestRequest: IHandoverQuestRequestData, itemHandedOver: IItem, handoverRequirements: IQuestCondition, output: IItemEventRouterResponse): IItemEventRouterResponse; /** * Increment a backend counter stored value by an amount, * Create counter if it does not exist diff --git a/types/controllers/RagfairController.d.ts b/types/controllers/RagfairController.d.ts index fbd25e0d..463ea293 100644 --- a/types/controllers/RagfairController.d.ts +++ b/types/controllers/RagfairController.d.ts @@ -10,7 +10,7 @@ import { RagfairSellHelper } from "@spt/helpers/RagfairSellHelper"; import { RagfairSortHelper } from "@spt/helpers/RagfairSortHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; @@ -199,7 +199,7 @@ export declare class RagfairController { * @param output IItemEventRouterResponse * @returns True if charging tax to player failed */ - protected chargePlayerTaxFee(sessionID: string, rootItem: Item, pmcData: IPmcData, requirementsPriceInRub: number, itemStackCount: number, offerRequest: IAddOfferRequestData, output: IItemEventRouterResponse): boolean; + protected chargePlayerTaxFee(sessionID: string, rootItem: IItem, pmcData: IPmcData, requirementsPriceInRub: number, itemStackCount: number, offerRequest: IAddOfferRequestData, output: IItemEventRouterResponse): boolean; /** * Is the item to be listed on the flea valid * @param offerRequest Client offer request @@ -220,10 +220,10 @@ export declare class RagfairController { * @returns Array of items from player inventory */ protected getItemsToListOnFleaFromInventory(pmcData: IPmcData, itemIdsFromFleaOfferRequest: string[]): { - items: Item[][] | undefined; + items: IItem[][] | undefined; errorMessage: string | undefined; }; - createPlayerOffer(sessionId: string, requirements: Requirement[], items: Item[], sellInOnePiece: boolean): IRagfairOffer; + createPlayerOffer(sessionId: string, requirements: Requirement[], items: IItem[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; getStaticPrices(): Record; /** diff --git a/types/controllers/TradeController.d.ts b/types/controllers/TradeController.d.ts index 842a97b4..517446a4 100644 --- a/types/controllers/TradeController.d.ts +++ b/types/controllers/TradeController.d.ts @@ -4,7 +4,7 @@ import { RagfairOfferHelper } from "@spt/helpers/RagfairOfferHelper"; import { TradeHelper } from "@spt/helpers/TradeHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITraderBase } from "@spt/models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; @@ -101,5 +101,5 @@ export declare class TradeController { * @param traderDetails Trader being sold to to perform buy category check against * @returns Rouble price */ - protected getPriceOfItemAndChildren(parentItemId: string, items: Item[], handbookPrices: Record, traderDetails: ITraderBase): number; + protected getPriceOfItemAndChildren(parentItemId: string, items: IItem[], handbookPrices: Record, traderDetails: ITraderBase): number; } diff --git a/types/generators/BotEquipmentModGenerator.d.ts b/types/generators/BotEquipmentModGenerator.d.ts index 59bb9b4a..04639ed3 100644 --- a/types/generators/BotEquipmentModGenerator.d.ts +++ b/types/generators/BotEquipmentModGenerator.d.ts @@ -7,9 +7,9 @@ import { ProbabilityHelper } from "@spt/helpers/ProbabilityHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPreset } from "@spt/models/eft/common/IGlobals"; -import { Mods, ModsChances } from "@spt/models/eft/common/tables/IBotType"; -import { Item } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IMods, IModsChances } from "@spt/models/eft/common/tables/IBotType"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; +import { ISlot, ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ModSpawn } from "@spt/models/enums/ModSpawn"; import { IChooseRandomCompatibleModResult } from "@spt/models/spt/bots/IChooseRandomCompatibleModResult"; import { IFilterPlateModsForSlotByLevelResult } from "@spt/models/spt/bots/IFilterPlateModsForSlotByLevelResult"; @@ -60,7 +60,7 @@ export declare class BotEquipmentModGenerator { * @param forceSpawn should this mod be forced to spawn * @returns Item + compatible mods as an array */ - generateModsForEquipment(equipment: Item[], parentId: string, parentTemplate: ITemplateItem, settings: IGenerateEquipmentProperties, shouldForceSpawn?: boolean): Item[]; + generateModsForEquipment(equipment: IItem[], parentId: string, parentTemplate: ITemplateItem, settings: IGenerateEquipmentProperties, shouldForceSpawn?: boolean): IItem[]; /** * Filter a bots plate pool based on its current level * @param settings Bot equipment generation settings @@ -76,7 +76,7 @@ export declare class BotEquipmentModGenerator { * @param request Data used to generate the weapon * @returns Weapon + mods array */ - generateModsForWeapon(sessionId: string, request: IGenerateWeaponRequest): Item[]; + generateModsForWeapon(sessionId: string, request: IGenerateWeaponRequest): IItem[]; /** * Should the provided bot have its stock chance values altered to 100% * @param modSlot Slot to check @@ -102,7 +102,7 @@ export declare class BotEquipmentModGenerator { * Set mod spawn chances to defined amount * @param modSpawnChances Chance dictionary to update */ - protected adjustSlotSpawnChances(modSpawnChances: ModsChances, modSlotsToAdjust: string[], newChancePercent: number): void; + protected adjustSlotSpawnChances(modSpawnChances: IModsChances, modSlotsToAdjust: string[], newChancePercent: number): void; /** * Does the provided modSlot allow muzzle-related items * @param modSlot Slot id to check @@ -122,7 +122,7 @@ export declare class BotEquipmentModGenerator { * @param parentTemplate item template * @returns Slot item */ - protected getModItemSlotFromDb(modSlot: string, parentTemplate: ITemplateItem): Slot; + protected getModItemSlotFromDb(modSlot: string, parentTemplate: ITemplateItem): ISlot; /** * Randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot * @param itemSlot slot the item sits in @@ -131,7 +131,7 @@ export declare class BotEquipmentModGenerator { * @param botEquipConfig Various config settings for generating this type of bot * @returns ModSpawn.SPAWN when mod should be spawned, ModSpawn.DEFAULT_MOD when default mod should spawn, ModSpawn.SKIP when mod is skipped */ - protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances, botEquipConfig: EquipmentFilters): ModSpawn; + protected shouldModBeSpawned(itemSlot: ISlot, modSlot: string, modSpawnChances: IModsChances, botEquipConfig: EquipmentFilters): ModSpawn; /** * Choose a mod to fit into the desired slot * @param request Data used to choose an appropriate mod with @@ -148,7 +148,7 @@ export declare class BotEquipmentModGenerator { * @param modSlotName Name of slot picked mod will be placed into * @returns Chosen weapon details */ - protected getCompatibleWeaponModTplForSlotFromPool(request: IModToSpawnRequest, modPool: string[], parentSlot: Slot, choiceTypeEnum: ModSpawn, weapon: Item[], modSlotName: string): IChooseRandomCompatibleModResult; + protected getCompatibleWeaponModTplForSlotFromPool(request: IModToSpawnRequest, modPool: string[], parentSlot: ISlot, choiceTypeEnum: ModSpawn, weapon: IItem[], modSlotName: string): IChooseRandomCompatibleModResult; /** * * @param modPool Pool of item Tpls to choose from @@ -157,7 +157,7 @@ export declare class BotEquipmentModGenerator { * @param modSlotName Name of mod slot being filled * @returns IChooseRandomCompatibleModResult */ - protected getCompatibleModFromPool(modPool: string[], modSpawnType: ModSpawn, weapon: Item[]): IChooseRandomCompatibleModResult; + protected getCompatibleModFromPool(modPool: string[], modSpawnType: ModSpawn, weapon: IItem[]): IChooseRandomCompatibleModResult; protected createExhaustableArray(itemsToAddToArray: T[]): ExhaustableArray; /** * Get a list of mod tpls that are compatible with the current weapon @@ -177,7 +177,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): Item; + protected getMatchingModFromPreset(request: IModToSpawnRequest, weaponTemplate: ITemplateItem): IItem; /** * Get default preset for weapon OR get specific weapon presets for edge cases (mp5/silenced dvl) * @param weaponTemplate Weapons db template @@ -191,7 +191,7 @@ export declare class BotEquipmentModGenerator { * @param modTpl Mod to check compatibility with weapon * @returns True if incompatible */ - protected weaponModComboIsIncompatible(weapon: Item[], modTpl: string): boolean; + protected weaponModComboIsIncompatible(weapon: IItem[], modTpl: string): boolean; /** * Create a mod item with provided parameters as properties + add upd property * @param modId _id @@ -202,7 +202,7 @@ export declare class BotEquipmentModGenerator { * @param botRole The bots role mod is being created for * @returns Item object */ - protected createModItem(modId: string, modTpl: string, parentId: string, modSlot: string, modTemplate: ITemplateItem, botRole: string): Item; + protected createModItem(modId: string, modTpl: string, parentId: string, modSlot: string, modTemplate: ITemplateItem, botRole: string): IItem; /** * Get a list of containers that hold ammo * e.g. mod_magazine / patron_in_weapon_000 @@ -217,7 +217,7 @@ export declare class BotEquipmentModGenerator { * @param items Items to ensure picked mod is compatible with * @returns Item tpl */ - protected getRandomModTplFromItemDb(fallbackModTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string | undefined; + protected getRandomModTplFromItemDb(fallbackModTpl: string, parentSlot: ISlot, modSlot: string, items: IItem[]): string | undefined; /** * Check if mod exists in db + is for a required slot * @param modToAdd Db template of mod to check @@ -227,7 +227,7 @@ export declare class BotEquipmentModGenerator { * @param botRole Bots wildspawntype (assault/pmcBot/exUsec etc) * @returns True if valid for slot */ - protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; + protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: ISlot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; /** * Find mod tpls of a provided type and add to modPool * @param desiredSlotName Slot to look up and add we are adding tpls for (e.g mod_scope) @@ -235,7 +235,7 @@ export declare class BotEquipmentModGenerator { * @param modPool Pool of mods we are adding to * @param botEquipBlacklist A blacklist of items that cannot be picked */ - protected addCompatibleModsForProvidedMod(desiredSlotName: string, modTemplate: ITemplateItem, modPool: Mods, botEquipBlacklist: EquipmentFilterDetails): void; + protected addCompatibleModsForProvidedMod(desiredSlotName: string, modTemplate: ITemplateItem, modPool: IMods, botEquipBlacklist: EquipmentFilterDetails): void; /** * Get the possible items that fit a slot * @param parentItemId item tpl to get compatible items for @@ -262,7 +262,7 @@ export declare class BotEquipmentModGenerator { * @param cylinderMagParentId The CylinderMagazine's UID * @param cylinderMagTemplate The CylinderMagazine's template */ - protected fillCamora(items: Item[], modPool: Mods, cylinderMagParentId: string, cylinderMagTemplate: ITemplateItem): void; + protected fillCamora(items: IItem[], modPool: IMods, cylinderMagParentId: string, cylinderMagTemplate: ITemplateItem): void; /** * Take a record of camoras and merge the compatible shells into one array * @param camorasWithShells Dictionary of camoras we want to merge into one array @@ -278,5 +278,5 @@ export declare class BotEquipmentModGenerator { * @param botWeaponSightWhitelist Whitelist of scope types by weapon base type * @returns Array of scope tpls that have been filtered to just ones allowed for that weapon type */ - protected filterSightsByWeaponType(weapon: Item, scopes: string[], botWeaponSightWhitelist: Record): string[]; + protected filterSightsByWeaponType(weapon: IItem, scopes: string[], botWeaponSightWhitelist: Record): string[]; } diff --git a/types/generators/BotGenerator.d.ts b/types/generators/BotGenerator.d.ts index 932da15b..bff2b497 100644 --- a/types/generators/BotGenerator.d.ts +++ b/types/generators/BotGenerator.d.ts @@ -3,8 +3,8 @@ import { BotLevelGenerator } from "@spt/generators/BotLevelGenerator"; import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; -import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, BodyPart, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; +import { IBaseJsonSkills, IBaseSkill, IBotBase, IInfo, IHealth as PmcHealth, ISkills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; +import { IAppearance, IBodyPart, IBotType, IHealth, IInventory } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -81,14 +81,14 @@ export declare class BotGenerator { * Remove items from item.json/lootableItemBlacklist from bots inventory * @param botInventory Bot to filter */ - protected removeBlacklistedLootFromBotTemplate(botInventory: Inventory): void; + protected removeBlacklistedLootFromBotTemplate(botInventory: IInventory): void; /** * Choose various appearance settings for a bot using weights: head/body/feet/hands * @param bot Bot to adjust * @param appearance Appearance settings to choose from * @param botGenerationDetails Generation details */ - protected setBotAppearance(bot: IBotBase, appearance: Appearance, botGenerationDetails: BotGenerationDetails): void; + protected setBotAppearance(bot: IBotBase, appearance: IAppearance, botGenerationDetails: BotGenerationDetails): void; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client @@ -100,13 +100,13 @@ export declare class BotGenerator { * @param playerScav Is a pscav bot being generated * @returns PmcHealth object */ - protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth; + protected generateHealth(healthObj: IHealth, playerScav?: boolean): PmcHealth; /** * Sum up body parts max hp values, return the bodypart collection with lowest value * @param bodies Body parts to sum up * @returns Lowest hp collection */ - protected getLowestHpBody(bodies: BodyPart[]): BodyPart | undefined; + protected getLowestHpBody(bodies: IBodyPart[]): IBodyPart | undefined; /** * Get a bots skills with randomsied progress value between the min and max values * @param botSkills Skills that should have their progress value randomised @@ -139,7 +139,7 @@ export declare class BotGenerator { * @param botInfo bot info object to update * @returns Chosen game version */ - protected setRandomisedGameVersionAndCategory(botInfo: Info): string; + protected setRandomisedGameVersionAndCategory(botInfo: IInfo): string; /** * Add a side-specific (usec/bear) dogtag item to a bots inventory * @param bot bot to add dogtag to diff --git a/types/generators/BotInventoryGenerator.d.ts b/types/generators/BotInventoryGenerator.d.ts index 1ea549cb..5c23c438 100644 --- a/types/generators/BotInventoryGenerator.d.ts +++ b/types/generators/BotInventoryGenerator.d.ts @@ -5,8 +5,8 @@ import { BotGeneratorHelper } from "@spt/helpers/BotGeneratorHelper"; import { BotHelper } from "@spt/helpers/BotHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; -import { Inventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase"; -import { Chances, Equipment, Generation, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; +import { IInventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotType, IChances, IEquipment, IGeneration, IInventory } from "@spt/models/eft/common/tables/IBotType"; import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { IGenerateEquipmentProperties } from "@spt/models/spt/bots/IGenerateEquipmentProperties"; import { EquipmentFilterDetails, IBotConfig } from "@spt/models/spt/config/IBotConfig"; @@ -59,17 +59,20 @@ export declare class BotInventoryGenerator { * @param botLevel Level of bot * @param chosenGameVersion Game version for bot, only really applies for PMCs */ - protected generateAndAddEquipmentToBot(templateInventory: Inventory, wornItemChances: Chances, botRole: string, botInventory: PmcInventory, botLevel: number, chosenGameVersion: string): void; + protected generateAndAddEquipmentToBot(templateInventory: IInventory, wornItemChances: IChances, botRole: string, botInventory: PmcInventory, botLevel: number, chosenGameVersion: string): void; /** * Remove non-armored rigs from parameter data * @param templateEquipment Equpiment to filter TacticalVest of + * @param botRole Role of bot vests are being filtered for */ - protected filterRigsToThoseWithProtection(templateEquipment: Equipment): void; + protected filterRigsToThoseWithProtection(templateEquipment: IEquipment, botRole: string): void; /** * Remove armored rigs from parameter data * @param templateEquipment Equpiment to filter TacticalVest of + * @param botRole Role of bot vests are being filtered for + * @param allowEmptyResult Should the function return all rigs when 0 unarmored are found */ - protected filterRigsToThoseWithoutProtection(templateEquipment: Equipment): void; + protected filterRigsToThoseWithoutProtection(templateEquipment: IEquipment, botRole: string, allowEmptyResult?: boolean): void; /** * Add a piece of equipment with mods to inventory from the provided pools * @param settings Values to adjust how item is chosen and added to bot @@ -94,13 +97,13 @@ export declare class BotInventoryGenerator { * @param itemGenerationLimitsMinMax Limits for items the bot can have * @param botLevel level of bot having weapon generated */ - protected generateAndAddWeaponsToBot(templateInventory: Inventory, equipmentChances: Chances, sessionId: string, botInventory: PmcInventory, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void; + protected generateAndAddWeaponsToBot(templateInventory: IInventory, equipmentChances: IChances, sessionId: string, botInventory: PmcInventory, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: IGeneration, botLevel: number): void; /** * Calculate if the bot should have weapons in Primary/Secondary/Holster slots * @param equipmentChances Chances bot has certain equipment * @returns What slots bot should have weapons generated for */ - protected getDesiredWeaponsForBot(equipmentChances: Chances): { + protected getDesiredWeaponsForBot(equipmentChances: IChances): { slot: EquipmentSlots; shouldSpawn: boolean; }[]; @@ -118,5 +121,5 @@ export declare class BotInventoryGenerator { protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: { slot: EquipmentSlots; shouldSpawn: boolean; - }, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationWeights: Generation, botLevel: number): void; + }, templateInventory: IInventory, botInventory: PmcInventory, equipmentChances: IChances, botRole: string, isPmc: boolean, itemGenerationWeights: IGeneration, botLevel: number): void; } diff --git a/types/generators/BotLootGenerator.d.ts b/types/generators/BotLootGenerator.d.ts index 4fa956b2..07f8b684 100644 --- a/types/generators/BotLootGenerator.d.ts +++ b/types/generators/BotLootGenerator.d.ts @@ -5,9 +5,9 @@ import { HandbookHelper } from "@spt/helpers/HandbookHelper"; import { InventoryHelper } from "@spt/helpers/InventoryHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; -import { Inventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase"; -import { IBotType, Inventory, ModsChances } from "@spt/models/eft/common/tables/IBotType"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IInventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotType, IInventory, IModsChances } from "@spt/models/eft/common/tables/IBotType"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { IItemSpawnLimitSettings } from "@spt/models/spt/bots/IItemSpawnLimitSettings"; @@ -91,7 +91,7 @@ export declare class BotLootGenerator { * @param isPmc Is bot being generated for a pmc */ protected addLootFromPool(pool: Record, equipmentSlots: string[], totalItemCount: number, inventoryToAddItemsTo: PmcInventory, botRole: string, itemSpawnLimits?: IItemSpawnLimitSettings, totalValueLimitRub?: number, isPmc?: boolean, containersIdFull?: Set): void; - protected createWalletLoot(walletId: string): Item[][]; + protected createWalletLoot(walletId: string): IItem[][]; /** * Some items need child items to function, add them to the itemToAddChildrenTo array * @param itemToAddTemplate Db template of item to check @@ -99,7 +99,7 @@ export declare class BotLootGenerator { * @param isPmc Is the item being generated for a pmc (affects money/ammo stack sizes) * @param botRole role bot has that owns item */ - protected addRequiredChildItemsToParent(itemToAddTemplate: ITemplateItem, itemToAddChildrenTo: Item[], isPmc: boolean, botRole: string): void; + protected addRequiredChildItemsToParent(itemToAddTemplate: ITemplateItem, itemToAddChildrenTo: IItem[], isPmc: boolean, botRole: string): void; /** * Add generated weapons to inventory as loot * @param botInventory inventory to add preset to @@ -109,7 +109,7 @@ export declare class BotLootGenerator { * @param botRole bots role .e.g. pmcBot * @param isPmc are we generating for a pmc */ - protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number, containersIdFull?: Set): void; + protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: IInventory, modChances: IModsChances, botRole: string, isPmc: boolean, botLevel: number, containersIdFull?: Set): void; /** * Hydrate item limit array to contain items that have a limit for a specific bot type * All values are set to 0 @@ -131,14 +131,14 @@ export declare class BotLootGenerator { * @param itemTemplate item details from db * @param moneyItem Money item to randomise */ - protected randomiseMoneyStackSize(botRole: string, itemTemplate: ITemplateItem, moneyItem: Item): void; + protected randomiseMoneyStackSize(botRole: string, itemTemplate: ITemplateItem, moneyItem: IItem): void; /** * Randomise the size of an ammo stack * @param isPmc Is ammo on a PMC bot * @param itemTemplate item details from db * @param ammoItem Ammo item to randomise */ - protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: Item): void; + protected randomiseAmmoStackSize(isPmc: boolean, itemTemplate: ITemplateItem, ammoItem: IItem): void; /** * Get spawn limits for a specific bot type from bot.json config * If no limit found for a non pmc bot, fall back to defaults diff --git a/types/generators/BotWeaponGenerator.d.ts b/types/generators/BotWeaponGenerator.d.ts index fcaad840..273e9814 100644 --- a/types/generators/BotWeaponGenerator.d.ts +++ b/types/generators/BotWeaponGenerator.d.ts @@ -4,9 +4,9 @@ import { BotGeneratorHelper } from "@spt/helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "@spt/helpers/BotWeaponGeneratorHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; -import { Inventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase"; -import { GenerationData, Inventory, ModsChances } from "@spt/models/eft/common/tables/IBotType"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IInventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase"; +import { IGenerationData, IInventory, IModsChances } from "@spt/models/eft/common/tables/IBotType"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { GenerateWeaponResult } from "@spt/models/spt/bots/GenerateWeaponResult"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; @@ -52,14 +52,14 @@ export declare class BotWeaponGenerator { * @param isPmc Is weapon generated for a pmc * @returns GenerateWeaponResult object */ - generateRandomWeapon(sessionId: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; + generateRandomWeapon(sessionId: string, equipmentSlot: string, botTemplateInventory: IInventory, weaponParentId: string, modChances: IModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; /** * Get a random weighted weapon from a bots pool of weapons * @param equipmentSlot Primary/secondary/holster * @param botTemplateInventory e.g. assault.json * @returns weapon tpl */ - pickWeightedWeaponTplFromPool(equipmentSlot: string, botTemplateInventory: Inventory): string; + pickWeightedWeaponTplFromPool(equipmentSlot: string, botTemplateInventory: IInventory): string; /** * Generated a weapon based on the supplied weapon tpl * @param weaponTpl Weapon tpl to generate (use pickWeightedWeaponTplFromPool()) @@ -71,7 +71,7 @@ export declare class BotWeaponGenerator { * @param isPmc Is weapon being generated for a pmc * @returns GenerateWeaponResult object */ - generateWeaponByTpl(sessionId: string, weaponTpl: string, slotName: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; + generateWeaponByTpl(sessionId: string, weaponTpl: string, slotName: string, botTemplateInventory: IInventory, weaponParentId: string, modChances: IModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; /** * Insert a cartridge(s) into a weapon * Handles all chambers - patron_in_weapon, patron_in_weapon_000 etc @@ -79,7 +79,7 @@ export declare class BotWeaponGenerator { * @param ammoTpl Cartridge to add to weapon * @param chamberSlotIds name of slots to create or add ammo to */ - protected addCartridgeToChamber(weaponWithModsArray: Item[], ammoTpl: string, chamberSlotIds: string[]): void; + protected addCartridgeToChamber(weaponWithModsArray: IItem[], ammoTpl: string, chamberSlotIds: string[]): void; /** * Create array with weapon base as only element and * add additional properties based on weapon type @@ -90,7 +90,7 @@ export declare class BotWeaponGenerator { * @param botRole for durability values * @returns Base weapon item in array */ - protected constructWeaponBaseArray(weaponTpl: string, weaponParentId: string, equipmentSlot: string, weaponItemTemplate: ITemplateItem, botRole: string): Item[]; + protected constructWeaponBaseArray(weaponTpl: string, weaponParentId: string, equipmentSlot: string, weaponItemTemplate: ITemplateItem, botRole: string): IItem[]; /** * Get the mods necessary to kit out a weapon to its preset level * @param weaponTpl weapon to find preset for @@ -98,14 +98,14 @@ export declare class BotWeaponGenerator { * @param weaponParentId Value used for the parentid * @returns array of weapon mods */ - protected getPresetWeaponMods(weaponTpl: string, equipmentSlot: string, weaponParentId: string, itemTemplate: ITemplateItem, botRole: string): Item[]; + protected getPresetWeaponMods(weaponTpl: string, equipmentSlot: string, weaponParentId: string, itemTemplate: ITemplateItem, botRole: string): IItem[]; /** * Checks if all required slots are occupied on a weapon and all it's mods * @param weaponItemArray Weapon + mods * @param botRole role of bot weapon is for * @returns true if valid */ - protected isWeaponValid(weaponItemArray: Item[], botRole: string): boolean; + protected isWeaponValid(weaponItemArray: IItem[], botRole: string): boolean; /** * Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets. * Additionally, adds extra bullets to SecuredContainer @@ -114,14 +114,14 @@ export declare class BotWeaponGenerator { * @param inventory Inventory to add magazines to * @param botRole The bot type we're getting generating extra mags for */ - addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magWeights: GenerationData, inventory: PmcInventory, botRole: string): void; + addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magWeights: IGenerationData, inventory: PmcInventory, botRole: string): void; /** * Add Grendaes for UBGL to bots vest and secure container * @param weaponMods Weapon array with mods * @param generatedWeaponResult result of weapon generation * @param inventory bot inventory to add grenades to */ - protected addUbglGrenadesToBotInventory(weaponMods: Item[], generatedWeaponResult: GenerateWeaponResult, inventory: PmcInventory): void; + protected addUbglGrenadesToBotInventory(weaponMods: IItem[], generatedWeaponResult: GenerateWeaponResult, inventory: PmcInventory): void; /** * Add ammo to the secure container * @param stackCount How many stacks of ammo to add @@ -137,7 +137,7 @@ export declare class BotWeaponGenerator { * @param botRole the bot type we are getting the magazine for * @returns magazine tpl string */ - protected getMagazineTplFromWeaponTemplate(weaponMods: Item[], weaponTemplate: ITemplateItem, botRole: string): string; + protected getMagazineTplFromWeaponTemplate(weaponMods: IItem[], weaponTemplate: ITemplateItem, botRole: string): string; /** * Finds and return a compatible ammo tpl based on the bots ammo weightings (x.json/inventory/equipment/ammo) * @param cartridgePool Dict of all cartridges keyed by type e.g. Caliber556x45NATO @@ -163,14 +163,14 @@ export declare class BotWeaponGenerator { * @param magazine Magazine item * @param cartridgeTpl Cartridge to insert into magazine */ - protected fillExistingMagazines(weaponMods: Item[], magazine: Item, cartridgeTpl: string): void; + protected fillExistingMagazines(weaponMods: IItem[], magazine: IItem, cartridgeTpl: string): void; /** * Add desired ammo tpl as item to weaponmods array, placed as child to UBGL * @param weaponMods Weapon with children * @param ubglMod UBGL item * @param ubglAmmoTpl Grenade ammo tpl */ - protected fillUbgl(weaponMods: Item[], ubglMod: Item, ubglAmmoTpl: string): void; + protected fillUbgl(weaponMods: IItem[], ubglMod: IItem, ubglAmmoTpl: string): void; /** * Add cartridge item to weapon Item array, if it already exists, update * @param weaponWithMods Weapon items array to amend @@ -179,12 +179,12 @@ export declare class BotWeaponGenerator { * @param newStackSize how many cartridges should go into the magazine * @param magazineTemplate magazines db template */ - protected addOrUpdateMagazinesChildWithAmmo(weaponWithMods: Item[], magazine: Item, chosenAmmoTpl: string, magazineTemplate: ITemplateItem): void; + protected addOrUpdateMagazinesChildWithAmmo(weaponWithMods: IItem[], magazine: IItem, chosenAmmoTpl: string, magazineTemplate: ITemplateItem): void; /** * Fill each Camora with a bullet * @param weaponMods Weapon mods to find and update camora mod(s) from * @param magazineId magazine id to find and add to * @param ammoTpl ammo template id to hydate with */ - protected fillCamorasWithAmmo(weaponMods: Item[], magazineId: string, ammoTpl: string): void; + protected fillCamorasWithAmmo(weaponMods: IItem[], magazineId: string, ammoTpl: string): void; } diff --git a/types/generators/FenceBaseAssortGenerator.d.ts b/types/generators/FenceBaseAssortGenerator.d.ts index 784022f5..b6ef72b1 100644 --- a/types/generators/FenceBaseAssortGenerator.d.ts +++ b/types/generators/FenceBaseAssortGenerator.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt/helpers/HandbookHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -47,7 +47,7 @@ export declare class FenceBaseAssortGenerator { * @param armor Armor item array to add mods into * @param itemDbDetails Armor items db template */ - protected addChildrenToArmorModSlots(armor: Item[], itemDbDetails: ITemplateItem): void; + protected addChildrenToArmorModSlots(armor: IItem[], itemDbDetails: ITemplateItem): void; /** * Check if item is valid for being added to fence assorts * @param item Item to check diff --git a/types/generators/LocationLootGenerator.d.ts b/types/generators/LocationLootGenerator.d.ts index 8f02bf09..6ef0bbce 100644 --- a/types/generators/LocationLootGenerator.d.ts +++ b/types/generators/LocationLootGenerator.d.ts @@ -3,8 +3,8 @@ 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 { ILocationBase } from "@spt/models/eft/common/ILocationBase"; -import { ILooseLoot, Spawnpoint, SpawnpointTemplate, SpawnpointsForced } from "@spt/models/eft/common/ILooseLoot"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { ILooseLoot, ISpawnpoint, ISpawnpointTemplate, ISpawnpointsForced } from "@spt/models/eft/common/ILooseLoot"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -17,7 +17,7 @@ import { ObjectId } from "@spt/utils/ObjectId"; import { ProbabilityObjectArray, RandomUtil } from "@spt/utils/RandomUtil"; import { ICloner } from "@spt/utils/cloners/ICloner"; export interface IContainerItem { - items: Item[]; + items: IItem[]; width: number; height: number; } @@ -49,7 +49,7 @@ export declare class LocationLootGenerator { * @param staticAmmoDist Static ammo distribution * @returns Array of container objects */ - generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; + generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): ISpawnpointTemplate[]; /** * Get containers with a non-100% chance to spawn OR are NOT on the container type randomistion blacklist * @param staticContainers @@ -117,14 +117,14 @@ export declare class LocationLootGenerator { * @param locationName Location to generate loot for * @returns Array of spawn points with loot in them */ - generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record, locationName: string): SpawnpointTemplate[]; + generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record, locationName: string): ISpawnpointTemplate[]; /** * Add forced spawn point loot into loot parameter array * @param lootLocationTemplates array to add forced loot spawn locations to * @param forcedSpawnPoints forced Forced loot locations that must be added * @param locationName Name of map currently having force loot created for */ - protected addForcedLoot(lootLocationTemplates: SpawnpointTemplate[], forcedSpawnPoints: SpawnpointsForced[], locationName: string): void; + protected addForcedLoot(lootLocationTemplates: ISpawnpointTemplate[], forcedSpawnPoints: ISpawnpointsForced[], locationName: string): void; /** * Create array of item (with child items) and return * @param chosenComposedKey Key we want to look up items for @@ -132,13 +132,13 @@ export declare class LocationLootGenerator { * @param staticAmmoDist ammo distributions * @returns IContainerItem */ - protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: Spawnpoint, staticAmmoDist: Record): IContainerItem; + protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: ISpawnpoint, staticAmmoDist: Record): IContainerItem; /** * Find an item in array by its _tpl, handle differently if chosenTpl is a weapon * @param items Items array to search * @param chosenTpl Tpl we want to get item with * @returns Item object */ - protected getItemInArray(items: Item[], chosenTpl: string): Item | undefined; + protected getItemInArray(items: IItem[], chosenTpl: string): IItem | undefined; protected createStaticLootItem(chosenTpl: string, staticAmmoDist: Record, parentId?: string): IContainerItem; } diff --git a/types/generators/LootGenerator.d.ts b/types/generators/LootGenerator.d.ts index 71b924a0..37124a06 100644 --- a/types/generators/LootGenerator.d.ts +++ b/types/generators/LootGenerator.d.ts @@ -3,7 +3,7 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPreset } from "@spt/models/eft/common/IGlobals"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/config/IInventoryConfig"; import { LootRequest } from "@spt/models/spt/services/LootRequest"; @@ -36,7 +36,7 @@ export declare class LootGenerator { * @param options parameters to adjust how loot is generated * @returns An array of loot items */ - createRandomLoot(options: LootRequest): Item[]; + createRandomLoot(options: LootRequest): IItem[]; protected getItemRewardPool(itemTplBlacklist: string[], itemTypeWhitelist: string[], useRewardItemBlacklist: boolean, allowBossItems: boolean): { itemPool: [string, ITemplateItem][]; blacklist: Set; @@ -65,7 +65,7 @@ export declare class LootGenerator { protected findAndAddRandomItemToLoot(items: [string, ITemplateItem][], itemTypeCounts: Record, options: LootRequest, result: Item[]): boolean; + }>, options: LootRequest, result: IItem[]): boolean; /** * Get a randomised stack count for an item between its StackMinRandom and StackMaxSize values * @param item item to get stack count of @@ -84,20 +84,20 @@ export declare class LootGenerator { protected findAndAddRandomPresetToLoot(presetPool: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: Item[]): boolean; + }>, itemBlacklist: string[], result: IItem[]): boolean; /** * Sealed weapon containers have a weapon + associated mods inside them + assortment of other things (food/meds) * @param containerSettings sealed weapon container settings * @returns Array of item with children arrays */ - getSealedWeaponCaseLoot(containerSettings: ISealedAirdropContainerSettings): Item[][]; + getSealedWeaponCaseLoot(containerSettings: ISealedAirdropContainerSettings): IItem[][]; /** * Get non-weapon mod rewards for a sealed container * @param containerSettings Sealed weapon container settings * @param weaponDetailsDb Details for the weapon to reward player * @returns Array of item with children arrays */ - protected getSealedContainerNonWeaponModRewards(containerSettings: ISealedAirdropContainerSettings, weaponDetailsDb: ITemplateItem): Item[][]; + protected getSealedContainerNonWeaponModRewards(containerSettings: ISealedAirdropContainerSettings, weaponDetailsDb: ITemplateItem): IItem[][]; /** * Iterate over the container weaponModRewardLimits settings and create an array of weapon mods to reward player * @param containerSettings Sealed weapon container settings @@ -105,13 +105,13 @@ export declare class LootGenerator { * @param chosenWeaponPreset The weapon preset given to player as reward * @returns Array of item with children arrays */ - protected getSealedContainerWeaponModRewards(containerSettings: ISealedAirdropContainerSettings, linkedItemsToWeapon: ITemplateItem[], chosenWeaponPreset: IPreset): Item[][]; + protected getSealedContainerWeaponModRewards(containerSettings: ISealedAirdropContainerSettings, linkedItemsToWeapon: ITemplateItem[], chosenWeaponPreset: IPreset): IItem[][]; /** * Handle event-related loot containers - currently just the halloween jack-o-lanterns that give food rewards * @param rewardContainerDetails * @returns Array of item with children arrays */ - getRandomLootContainerLoot(rewardContainerDetails: RewardDetails): Item[][]; + getRandomLootContainerLoot(rewardContainerDetails: RewardDetails): IItem[][]; /** * Pick a reward item based on the reward details data * @param rewardContainerDetails diff --git a/types/generators/PlayerScavGenerator.d.ts b/types/generators/PlayerScavGenerator.d.ts index e317bf68..86255294 100644 --- a/types/generators/PlayerScavGenerator.d.ts +++ b/types/generators/PlayerScavGenerator.d.ts @@ -4,7 +4,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { IBotBase, Skills, Stats } from "@spt/models/eft/common/tables/IBotBase"; +import { IBotBase, ISkills, IStats } from "@spt/models/eft/common/tables/IBotBase"; import { IBotType } from "@spt/models/eft/common/tables/IBotType"; import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -68,9 +68,9 @@ export declare class PlayerScavGenerator { * @param baseBotNode bot template to modify according to karama level settings */ protected adjustBotTemplateWithKarmaSpecificSettings(karmaSettings: KarmaLevel, baseBotNode: IBotType): void; - protected getScavSkills(scavProfile: IPmcData): Skills; - protected getDefaultScavSkills(): Skills; - protected getScavStats(scavProfile: IPmcData): Stats; + protected getScavSkills(scavProfile: IPmcData): ISkills; + protected getDefaultScavSkills(): ISkills; + protected getScavStats(scavProfile: IPmcData): IStats; protected getScavLevel(scavProfile: IPmcData): number; protected getScavExperience(scavProfile: IPmcData): number; /** diff --git a/types/generators/RagfairAssortGenerator.d.ts b/types/generators/RagfairAssortGenerator.d.ts index 4c6cf1c7..60c4c86f 100644 --- a/types/generators/RagfairAssortGenerator.d.ts +++ b/types/generators/RagfairAssortGenerator.d.ts @@ -1,7 +1,7 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IPreset } from "@spt/models/eft/common/IGlobals"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; @@ -14,7 +14,7 @@ export declare class RagfairAssortGenerator { protected databaseServer: DatabaseServer; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; - protected generatedAssortItems: Item[][]; + protected generatedAssortItems: IItem[][]; protected ragfairConfig: IRagfairConfig; protected ragfairItemInvalidBaseTypes: string[]; constructor(hashUtil: HashUtil, itemHelper: ItemHelper, presetHelper: PresetHelper, databaseServer: DatabaseServer, seasonalEventService: SeasonalEventService, configServer: ConfigServer); @@ -23,7 +23,7 @@ export declare class RagfairAssortGenerator { * Each sub array contains item + children (if any) * @returns array of arrays */ - getAssortItems(): Item[][]; + getAssortItems(): IItem[][]; /** * Check internal generatedAssortItems array has objects * @returns true if array has objects @@ -33,7 +33,7 @@ export declare class RagfairAssortGenerator { * Generate an array of arrays (item + children) the flea can sell * @returns array of arrays (item + children) */ - protected generateRagfairAssortItems(): Item[][]; + protected generateRagfairAssortItems(): IItem[][]; /** * Get presets from globals to add to flea * ragfairConfig.dynamic.showDefaultPresetsOnly decides if its all presets or just defaults @@ -46,5 +46,5 @@ export declare class RagfairAssortGenerator { * @param id id to add to item * @returns Hydrated Item object */ - protected createRagfairAssortRootItem(tplId: string, id?: string): Item; + protected createRagfairAssortRootItem(tplId: string, id?: string): IItem; } diff --git a/types/generators/RagfairOfferGenerator.d.ts b/types/generators/RagfairOfferGenerator.d.ts index ca097293..02e5cea4 100644 --- a/types/generators/RagfairOfferGenerator.d.ts +++ b/types/generators/RagfairOfferGenerator.d.ts @@ -6,7 +6,7 @@ import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader"; import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/eft/ragfair/IRagfairOffer"; @@ -62,7 +62,7 @@ export declare class RagfairOfferGenerator { * @param sellInOnePiece Flags sellInOnePiece to be true * @returns Created flea offer */ - createAndAddFleaOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer; + createAndAddFleaOffer(userID: string, time: number, items: IItem[], barterScheme: IBarterScheme[], loyalLevel: number, sellInOnePiece?: boolean): IRagfairOffer; /** * Create an offer object ready to send to ragfairOfferService.addOffer() * @param userID Owner of the offer @@ -73,7 +73,7 @@ export declare class RagfairOfferGenerator { * @param isPackOffer Is offer being created flaged as a pack * @returns IRagfairOffer */ - protected createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, isPackOffer?: boolean): IRagfairOffer; + protected createOffer(userID: string, time: number, items: IItem[], barterScheme: IBarterScheme[], loyalLevel: number, isPackOffer?: boolean): IRagfairOffer; /** * Create the user object stored inside each flea offer object * @param userID user creating the offer @@ -130,20 +130,20 @@ export declare class RagfairOfferGenerator { * Create multiple offers for items by using a unique list of items we've generated previously * @param expiredOffers optional, expired offers to regenerate */ - generateDynamicOffers(expiredOffers?: Item[][]): Promise; + generateDynamicOffers(expiredOffers?: IItem[][]): Promise; /** * @param assortItemWithChildren Item with its children to process into offers * @param isExpiredOffer is an expired offer * @param config Ragfair dynamic config */ - protected createOffersFromAssort(assortItemWithChildren: Item[], isExpiredOffer: boolean, config: Dynamic): Promise; + protected createOffersFromAssort(assortItemWithChildren: IItem[], isExpiredOffer: boolean, config: Dynamic): Promise; /** * iterate over an items chidren and look for plates above desired level and remove them * @param presetWithChildren preset to check for plates * @param plateSettings Settings * @returns True if plate removed */ - protected removeBannedPlatesFromPreset(presetWithChildren: Item[], plateSettings: IArmorPlateBlacklistSettings): boolean; + protected removeBannedPlatesFromPreset(presetWithChildren: IItem[], plateSettings: IArmorPlateBlacklistSettings): boolean; /** * Create one flea offer for a specific item * @param itemWithChildren Item to create offer for @@ -151,7 +151,7 @@ export declare class RagfairOfferGenerator { * @param itemDetails raw db item details * @returns Item array */ - protected createSingleOfferForItem(itemWithChildren: Item[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise; + protected createSingleOfferForItem(itemWithChildren: IItem[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise; /** * Generate trader offers on flea using the traders assort data * @param traderID Trader to generate offers for @@ -164,7 +164,7 @@ export declare class RagfairOfferGenerator { * @param itemWithMods Item and mods, get condition of first item (only first array item is modified) * @param itemDetails db details of first item */ - protected randomiseOfferItemUpdProperties(userID: string, itemWithMods: Item[], itemDetails: ITemplateItem): void; + protected randomiseOfferItemUpdProperties(userID: string, itemWithMods: IItem[], itemDetails: ITemplateItem): void; /** * Get the relevant condition id if item tpl matches in ragfair.json/condition * @param tpl Item to look for matching condition object @@ -177,7 +177,7 @@ export declare class RagfairOfferGenerator { * @param itemWithMods Item to adjust condition details of * @param itemDetails db item details of first item in array */ - protected randomiseItemCondition(conditionSettingsId: string, itemWithMods: Item[], itemDetails: ITemplateItem): void; + protected randomiseItemCondition(conditionSettingsId: string, itemWithMods: IItem[], itemDetails: ITemplateItem): void; /** * Adjust an items durability/maxDurability value * @param item item (weapon/armor) to Adjust @@ -185,27 +185,27 @@ export declare class RagfairOfferGenerator { * @param maxMultiplier Value to multiply max durability by * @param currentMultiplier Value to multiply current durability by */ - protected randomiseWeaponDurability(item: Item, itemDbDetails: ITemplateItem, maxMultiplier: number, currentMultiplier: number): void; + protected randomiseWeaponDurability(item: IItem, itemDbDetails: ITemplateItem, maxMultiplier: number, currentMultiplier: number): void; /** * Randomise the durabiltiy values for an armors plates and soft inserts * @param armorWithMods Armor item with its child mods * @param currentMultiplier Chosen multipler to use for current durability value * @param maxMultiplier Chosen multipler to use for max durability value */ - protected randomiseArmorDurabilityValues(armorWithMods: Item[], currentMultiplier: number, maxMultiplier: number): void; + protected randomiseArmorDurabilityValues(armorWithMods: IItem[], currentMultiplier: number, maxMultiplier: number): void; /** * Add missing conditions to an item if needed * Durabiltiy for repairable items * HpResource for medical items * @param item item to add conditions to */ - protected addMissingConditions(item: Item): void; + protected addMissingConditions(item: IItem): void; /** * Create a barter-based barter scheme, if not possible, fall back to making barter scheme currency based * @param offerItems Items for sale in offer * @returns Barter scheme */ - protected createBarterBarterScheme(offerItems: Item[]): IBarterScheme[]; + protected createBarterBarterScheme(offerItems: IItem[]): IBarterScheme[]; /** * Get an array of flea prices + item tpl, cached in generator class inside `allowedFleaPriceItemsForBarter` * @returns array with tpl/price values @@ -221,5 +221,5 @@ export declare class RagfairOfferGenerator { * @param multipler What to multiply the resulting price by * @returns Barter scheme for offer */ - protected createCurrencyBarterScheme(offerWithChildren: Item[], isPackOffer: boolean, multipler?: number): IBarterScheme[]; + protected createCurrencyBarterScheme(offerWithChildren: IItem[], isPackOffer: boolean, multipler?: number): IBarterScheme[]; } diff --git a/types/generators/RepeatableQuestGenerator.d.ts b/types/generators/RepeatableQuestGenerator.d.ts index 866c4ecf..79a10fc3 100644 --- a/types/generators/RepeatableQuestGenerator.d.ts +++ b/types/generators/RepeatableQuestGenerator.d.ts @@ -1,8 +1,8 @@ import { RepeatableQuestRewardGenerator } from "@spt/generators/RepeatableQuestRewardGenerator"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper"; -import { Exit } from "@spt/models/eft/common/ILocationBase"; -import { TraderInfo } from "@spt/models/eft/common/tables/IBotBase"; +import { IExit } from "@spt/models/eft/common/ILocationBase"; +import { ITraderInfo } from "@spt/models/eft/common/tables/IBotBase"; import { IQuestCondition, IQuestConditionCounterCondition } from "@spt/models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IBossInfo, IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; @@ -39,7 +39,7 @@ export declare class RepeatableQuestGenerator { * @param repeatableConfig Repeatable quest config * @returns IRepeatableQuest */ - generateRepeatableQuest(pmcLevel: number, pmcTraderInfo: Record, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; + generateRepeatableQuest(pmcLevel: number, pmcTraderInfo: Record, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** * Generate a randomised Elimination quest * @param pmcLevel Player's level for requested items and reward generation @@ -109,7 +109,7 @@ export declare class RepeatableQuestGenerator { * @param playerSide Scav/Pmc * @returns Array of Exit objects */ - protected getLocationExitsForSide(locationKey: string, playerSide: string): Exit[]; + protected getLocationExitsForSide(locationKey: string, playerSide: string): IExit[]; protected generatePickupQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; /** * Convert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) @@ -124,7 +124,7 @@ export declare class RepeatableQuestGenerator { * @param {string} exit The exit name to generate the condition for * @returns {object} Exit condition */ - protected generateExplorationExitCondition(exit: Exit): IQuestConditionCounterCondition; + protected generateExplorationExitCondition(exit: IExit): IQuestConditionCounterCondition; /** * Generates the base object of quest type format given as templates in assets/database/templates/repeatableQuests.json * The templates include Elimination, Completion and Extraction quest types diff --git a/types/generators/RepeatableQuestRewardGenerator.d.ts b/types/generators/RepeatableQuestRewardGenerator.d.ts index 713a394a..17f4fd4f 100644 --- a/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt/helpers/HandbookHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IQuestReward, IQuestRewards } from "@spt/models/eft/common/tables/IQuest"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig, IRewardScaling } from "@spt/models/spt/config/IQuestConfig"; @@ -133,7 +133,7 @@ export declare class RepeatableQuestRewardGenerator { * @param preset Optional array of preset items * @returns {object} Object of "Reward"-item-type */ - protected generatePresetReward(tpl: string, count: number, index: number, preset?: Item[]): IQuestReward; + protected generatePresetReward(tpl: string, count: number, index: number, preset?: IItem[]): IQuestReward; /** * Picks rewardable items from items.json * This means they must: diff --git a/types/generators/ScavCaseRewardGenerator.d.ts b/types/generators/ScavCaseRewardGenerator.d.ts index 45f2e517..194b705c 100644 --- a/types/generators/ScavCaseRewardGenerator.d.ts +++ b/types/generators/ScavCaseRewardGenerator.d.ts @@ -1,6 +1,6 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; @@ -36,7 +36,7 @@ export declare class ScavCaseRewardGenerator { * @param recipeId recipe of the scav case craft * @returns Product array */ - generate(recipeId: string): Item[][]; + generate(recipeId: string): IItem[][]; /** * Get all db items that are not blacklisted in scavcase config or global blacklist * Store in class field @@ -75,7 +75,7 @@ export declare class ScavCaseRewardGenerator { * @param rewardItems items to convert * @returns Product array */ - protected randomiseContainerItemRewards(rewardItems: ITemplateItem[], rarity: string): Item[][]; + protected randomiseContainerItemRewards(rewardItems: ITemplateItem[], rarity: string): IItem[][]; /** * @param dbItems all items from the items.json * @param itemFilters controls how the dbItems will be filtered and returned (handbook price) diff --git a/types/generators/weapongen/InventoryMagGen.d.ts b/types/generators/weapongen/InventoryMagGen.d.ts index 1db99158..7e2011dc 100644 --- a/types/generators/weapongen/InventoryMagGen.d.ts +++ b/types/generators/weapongen/InventoryMagGen.d.ts @@ -1,5 +1,5 @@ -import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; -import { GenerationData } from "@spt/models/eft/common/tables/IBotType"; +import { IInventory } from "@spt/models/eft/common/tables/IBotBase"; +import { IGenerationData } from "@spt/models/eft/common/tables/IBotType"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; export declare class InventoryMagGen { private magCounts; @@ -7,10 +7,10 @@ export declare class InventoryMagGen { private weaponTemplate; private ammoTemplate; private pmcInventory; - constructor(magCounts: GenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: Inventory); - getMagCount(): GenerationData; + constructor(magCounts: IGenerationData, magazineTemplate: ITemplateItem, weaponTemplate: ITemplateItem, ammoTemplate: ITemplateItem, pmcInventory: IInventory); + getMagCount(): IGenerationData; getMagazineTemplate(): ITemplateItem; getWeaponTemplate(): ITemplateItem; getAmmoTemplate(): ITemplateItem; - getPmcInventory(): Inventory; + getPmcInventory(): IInventory; } diff --git a/types/helpers/BotDifficultyHelper.d.ts b/types/helpers/BotDifficultyHelper.d.ts index 34ca3e06..ef30bbc0 100644 --- a/types/helpers/BotDifficultyHelper.d.ts +++ b/types/helpers/BotDifficultyHelper.d.ts @@ -1,5 +1,5 @@ import { BotHelper } from "@spt/helpers/BotHelper"; -import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; +import { IDifficultyCategories } from "@spt/models/eft/common/tables/IBotType"; import { IBots } from "@spt/models/spt/bots/IBots"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -25,14 +25,14 @@ export declare class BotDifficultyHelper { * @param botDb bots from database * @returns Difficulty object */ - getBotDifficultySettings(type: string, difficulty: string, botDb: IBots): Difficulty; + getBotDifficultySettings(type: string, difficulty: string, botDb: IBots): IDifficultyCategories; /** * Get difficulty settings for a PMC * @param type "usec" / "bear" * @param difficulty what difficulty to retrieve * @returns Difficulty object */ - protected getDifficultySettings(type: string, difficulty: string): Difficulty; + protected getDifficultySettings(type: string, difficulty: string): IDifficultyCategories; /** * Translate chosen value from pre-raid difficulty dropdown into bot difficulty value * @param dropDownDifficulty Dropdown difficulty value to convert diff --git a/types/helpers/BotGeneratorHelper.d.ts b/types/helpers/BotGeneratorHelper.d.ts index 82be170b..468d27bb 100644 --- a/types/helpers/BotGeneratorHelper.d.ts +++ b/types/helpers/BotGeneratorHelper.d.ts @@ -3,9 +3,9 @@ import { ContainerHelper } from "@spt/helpers/ContainerHelper"; import { DurabilityLimitsHelper } from "@spt/helpers/DurabilityLimitsHelper"; import { InventoryHelper } from "@spt/helpers/InventoryHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; -import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; -import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; -import { Grid, ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IInventory } from "@spt/models/eft/common/tables/IBotBase"; +import { IItem, IUpd, IUpdRepairable } from "@spt/models/eft/common/tables/IItem"; +import { IGrid, ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ItemAddedResult } from "@spt/models/enums/ItemAddedResult"; import { IChooseRandomCompatibleModResult } from "@spt/models/spt/bots/IChooseRandomCompatibleModResult"; import { EquipmentFilters, IBotConfig, IRandomisedResourceValues } from "@spt/models/spt/config/IBotConfig"; @@ -37,7 +37,7 @@ export declare class BotGeneratorHelper { * @returns Item Upd object with extra properties */ generateExtraPropertiesForItem(itemTemplate: ITemplateItem, botRole?: string): { - upd?: Upd; + upd?: IUpd; }; /** * Randomize the HpResource for bots e.g (245/400 resources) @@ -60,14 +60,14 @@ export declare class BotGeneratorHelper { * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; + protected generateWeaponRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): IUpdRepairable; /** * Create a repairable object for an armor that containers durability + max durability properties * @param itemTemplate weapon object being generated for * @param botRole type of bot being generated for * @returns Repairable object */ - protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): Repairable; + protected generateArmorRepairableProperties(itemTemplate: ITemplateItem, botRole?: string): IUpdRepairable; /** * Can item be added to another item without conflict * @param itemsEquipped Items to check compatibilities with @@ -75,7 +75,7 @@ export declare class BotGeneratorHelper { * @param equipmentSlot Slot the item will be placed into * @returns false if no incompatibilities, also has incompatibility reason */ - isItemIncompatibleWithCurrentItems(itemsEquipped: Item[], tplToCheck: string, equipmentSlot: string): IChooseRandomCompatibleModResult; + isItemIncompatibleWithCurrentItems(itemsEquipped: IItem[], tplToCheck: string, equipmentSlot: string): IChooseRandomCompatibleModResult; /** * Convert a bots role to the equipment role used in config/bot.json * @param botRole Role to convert @@ -91,12 +91,12 @@ export declare class BotGeneratorHelper { * @param inventory Inventory to add item+children into * @returns ItemAddedResult result object */ - addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set): ItemAddedResult; + addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: IItem[], inventory: IInventory, containersIdFull?: Set): ItemAddedResult; /** * Is the provided item allowed inside a container * @param slotGrid Items sub-grid we want to place item inside * @param itemTpl Item tpl being placed * @returns True if allowed */ - protected itemAllowedInContainer(slotGrid: Grid, itemTpl: string): boolean; + protected itemAllowedInContainer(slotGrid: IGrid, itemTpl: string): boolean; } diff --git a/types/helpers/BotHelper.d.ts b/types/helpers/BotHelper.d.ts index c5871ae7..1058942b 100644 --- a/types/helpers/BotHelper.d.ts +++ b/types/helpers/BotHelper.d.ts @@ -1,5 +1,5 @@ import { MinMax } from "@spt/models/common/MinMax"; -import { Difficulty, IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { IBotType, IDifficultyCategories } from "@spt/models/eft/common/tables/IBotType"; import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -33,20 +33,15 @@ export declare class BotHelper { * @param difficultySettings bot settings to alter * @param typeToAdd bot type to add to friendly list */ - addBotToFriendlyList(difficultySettings: Difficulty, typeToAdd: string): void; + addBotToFriendlyList(difficultySettings: IDifficultyCategories, typeToAdd: string): void; /** * Add a bot to the REVENGE_BOT_TYPES array * @param difficultySettings bot settings to alter * @param typesToAdd bot type to add to revenge list */ - addBotToRevengeList(difficultySettings: Difficulty, typesToAdd: string[]): void; - /** - * Choose if a bot should become a PMC by checking if bot type is allowed to become a Pmc in botConfig.convertFromChances and doing a random int check - * @param botRole the bot role to check if should be a pmc - * @returns true if should be a pmc - */ - shouldBotBePmc(botRole: string): boolean; - rollChanceToBePmc(role: string, botConvertMinMax: MinMax): boolean; + addBotToRevengeList(difficultySettings: IDifficultyCategories, typesToAdd: string[]): void; + rollChanceToBePmc(botConvertMinMax: MinMax): boolean; + protected getPmcConversionValuesForLocation(location: string): Record; /** * is the provided role a PMC, case-agnostic * @param botRole Role to check diff --git a/types/helpers/BotWeaponGeneratorHelper.d.ts b/types/helpers/BotWeaponGeneratorHelper.d.ts index 5ab4e59f..8a2d23a0 100644 --- a/types/helpers/BotWeaponGeneratorHelper.d.ts +++ b/types/helpers/BotWeaponGeneratorHelper.d.ts @@ -1,9 +1,9 @@ import { BotGeneratorHelper } from "@spt/helpers/BotGeneratorHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; -import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; -import { GenerationData } from "@spt/models/eft/common/tables/IBotType"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IInventory } from "@spt/models/eft/common/tables/IBotBase"; +import { IGenerationData } from "@spt/models/eft/common/tables/IBotType"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -27,13 +27,13 @@ export declare class BotWeaponGeneratorHelper { * @param magTemplate magazine to generate bullet count for * @returns bullet count number */ - getRandomizedBulletCount(magCounts: GenerationData, magTemplate: ITemplateItem): number; + getRandomizedBulletCount(magCounts: IGenerationData, magTemplate: ITemplateItem): number; /** * Get a randomized count of magazines * @param magCounts min and max value returned value can be between * @returns numerical value of magazine count */ - getRandomizedMagazineCount(magCounts: GenerationData): number; + getRandomizedMagazineCount(magCounts: IGenerationData): number; /** * Is this magazine cylinder related (revolvers and grenade launchers) * @param magazineParentName the name of the magazines parent @@ -47,7 +47,7 @@ export declare class BotWeaponGeneratorHelper { * @param magTemplate template object of magazine * @returns Item array */ - createMagazineWithAmmo(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[]; + createMagazineWithAmmo(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): IItem[]; /** * Add a specific number of cartridges to a bots inventory (defaults to vest and pockets) * @param ammoTpl Ammo tpl to add to vest/pockets @@ -55,7 +55,7 @@ export declare class BotWeaponGeneratorHelper { * @param inventory bot inventory to add cartridges to * @param equipmentSlotsToAddTo what equipment slots should bullets be added into */ - addAmmoIntoEquipmentSlots(ammoTpl: string, cartridgeCount: number, inventory: Inventory, equipmentSlotsToAddTo?: EquipmentSlots[]): void; + addAmmoIntoEquipmentSlots(ammoTpl: string, cartridgeCount: number, inventory: IInventory, equipmentSlotsToAddTo?: EquipmentSlots[]): void; /** * Get a weapons default magazine template id * @param weaponTemplate weapon to get default magazine for diff --git a/types/helpers/DialogueHelper.d.ts b/types/helpers/DialogueHelper.d.ts index febe696c..4f0a2cbc 100644 --- a/types/helpers/DialogueHelper.d.ts +++ b/types/helpers/DialogueHelper.d.ts @@ -1,7 +1,7 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { Dialogue, MessagePreview } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; @@ -31,7 +31,7 @@ export declare class DialogueHelper { * @param itemId Item being moved to inventory * @returns */ - getMessageItemContents(messageID: string, sessionID: string, itemId: string): Item[]; + getMessageItemContents(messageID: string, sessionID: string, itemId: string): IItem[]; /** * Get the dialogs dictionary for a profile, create if doesnt exist * @param sessionId Session/player id diff --git a/types/helpers/HandbookHelper.d.ts b/types/helpers/HandbookHelper.d.ts index 4690e2f6..d6777345 100644 --- a/types/helpers/HandbookHelper.d.ts +++ b/types/helpers/HandbookHelper.d.ts @@ -1,5 +1,5 @@ import { IHandbookCategory } from "@spt/models/eft/common/tables/IHandbookBase"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -33,7 +33,7 @@ export declare class HandbookHelper { * @returns price in roubles */ getTemplatePrice(tpl: string): number; - getTemplatePriceForItems(items: Item[]): number; + getTemplatePriceForItems(items: IItem[]): number; /** * Get all items in template with the given parent category * @param parentId diff --git a/types/helpers/HealthHelper.d.ts b/types/helpers/HealthHelper.d.ts index 74059015..73ce2b82 100644 --- a/types/helpers/HealthHelper.d.ts +++ b/types/helpers/HealthHelper.d.ts @@ -1,5 +1,5 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { BodyPartsHealth, Health } from "@spt/models/eft/common/tables/IBotBase"; +import { IBodyPartsHealth, IHealth } from "@spt/models/eft/common/tables/IBotBase"; import { ISyncHealthRequestData } from "@spt/models/eft/health/ISyncHealthRequestData"; import { Effects, ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IHealthConfig } from "@spt/models/spt/config/IHealthConfig"; @@ -31,14 +31,14 @@ export declare class HealthHelper { * @param addEffects Should effects be added to profile (default - true) * @param deleteExistingEffects Should all prior effects be removed before apply new ones (default - true) */ - updateProfileHealthPostRaid(pmcData: IPmcData, postRaidHealth: Health, sessionID: string, isDead: boolean): void; + updateProfileHealthPostRaid(pmcData: IPmcData, postRaidHealth: IHealth, sessionID: string, isDead: boolean): void; protected storeHydrationEnergyTempInProfile(fullProfile: ISptProfile, hydration: number, energy: number, temprature: number): void; /** * Take body part effects from client profile and apply to server profile * @param postRaidBodyParts Post-raid body part data * @param profileData Player profile on server */ - protected transferPostRaidLimbEffectsToProfile(postRaidBodyParts: BodyPartsHealth, profileData: IPmcData): void; + protected transferPostRaidLimbEffectsToProfile(postRaidBodyParts: IBodyPartsHealth, profileData: IPmcData): void; /** * Update player profile vitality values with changes from client request object * @param pmcData Player profile diff --git a/types/helpers/HideoutHelper.d.ts b/types/helpers/HideoutHelper.d.ts index eeb691dc..5917927b 100644 --- a/types/helpers/HideoutHelper.d.ts +++ b/types/helpers/HideoutHelper.d.ts @@ -2,9 +2,9 @@ import { InventoryHelper } from "@spt/helpers/InventoryHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { HideoutArea, IHideoutImprovement, Production, Productive } from "@spt/models/eft/common/tables/IBotBase"; -import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; -import { StageBonus } from "@spt/models/eft/hideout/IHideoutArea"; +import { IBotHideoutArea, IHideoutImprovement, IProduction, IProductive } from "@spt/models/eft/common/tables/IBotBase"; +import { IItem, IUpd } from "@spt/models/eft/common/tables/IItem"; +import { IHideoutArea, StageBonus } from "@spt/models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; import { IHideoutSingleProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutSingleProductionStartRequestData"; @@ -55,13 +55,13 @@ export declare class HideoutHelper { * This convenience function initializes new Production Object * with all the constants. */ - initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean, isCultistCircle?: boolean): Production; + initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean, isCultistCircle?: boolean): IProduction; /** * Is the provided object a Production type * @param productive * @returns */ - isProductionType(productive: Productive): productive is Production; + isProductionType(productive: IProductive): productive is IProduction; /** * Apply bonus to player profile given after completing hideout upgrades * @param pmcData Profile to add bonus to @@ -83,7 +83,7 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }; - protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; + protected doesWaterCollectorHaveFilter(waterCollector: IBotHideoutArea): boolean; /** * Iterate over productions and update their progress timers * @param pmcData Profile to check for productions and update @@ -118,7 +118,7 @@ export declare class HideoutHelper { waterCollectorHasFilter?: boolean; }): void; protected updateCultistCircleCraftProgress(pmcData: IPmcData, prodId: string): void; - protected flagCultistCircleCraftAsComplete(production: Productive): void; + protected flagCultistCircleCraftAsComplete(production: IProductive): void; /** * Check if a productions progress value matches its corresponding recipes production time value * @param pmcData Player profile @@ -150,8 +150,8 @@ export declare class HideoutHelper { * @param pmcData Player profile * @param isGeneratorOn Is the generator turned on since last update */ - protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, hideoutProperties: { + protected updateFuel(generatorArea: IBotHideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; + protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: IBotHideoutArea, hideoutProperties: { btcFarmCGs: number; isGeneratorOn: boolean; waterCollectorHasFilter: boolean; @@ -171,7 +171,7 @@ export declare class HideoutHelper { * @param isGeneratorOn is generator enabled * @param pmcData Player profile */ - protected updateWaterFilters(waterFilterArea: HideoutArea, production: Production, isGeneratorOn: boolean, pmcData: IPmcData): void; + protected updateWaterFilters(waterFilterArea: IBotHideoutArea, production: IProduction, isGeneratorOn: boolean, pmcData: IPmcData): void; /** * Get an adjusted water filter drain rate based on time elapsed since last run, * handle edge case when craft time has gone on longer than total production time @@ -201,15 +201,15 @@ export declare class HideoutHelper { * @param resourceUnitsConsumed * @returns Upd */ - protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): Upd; - protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; - protected updateBitcoinFarm(pmcData: IPmcData, btcFarmCGs: number, isGeneratorOn: boolean): Production | undefined; + protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number, isFoundInRaid: boolean): IUpd; + protected updateAirFilters(airFilterArea: IBotHideoutArea, pmcData: IPmcData, isGeneratorOn: boolean): void; + protected updateBitcoinFarm(pmcData: IPmcData, btcProduction: IProductive, btcFarmCGs: number, isGeneratorOn: boolean): void; /** * Add bitcoin object to btc production products array and set progress time * @param btcProd Bitcoin production object * @param coinCraftTimeSeconds Time to craft a bitcoin */ - protected addBtcToProduction(btcProd: Production, coinCraftTimeSeconds: number): void; + protected addBtcToProduction(btcProd: IProduction, coinCraftTimeSeconds: number): void; /** * Get number of ticks that have passed since hideout areas were last processed, reduced when generator is off * @param pmcData Player profile @@ -251,7 +251,7 @@ export declare class HideoutHelper { * @returns Seconds to reduce craft time by */ getSkillProductionTimeReduction(pmcData: IPmcData, productionTime: number, skill: SkillTypes, amountPerLevel: number): number; - isProduction(productive: Productive): productive is Production; + isProduction(productive: IProductive): productive is IProduction; /** * Gather crafted BTC from hideout area and add to inventory * Reset production start timestamp if hideout area at full coin capacity @@ -289,5 +289,12 @@ export declare class HideoutHelper { * @param activeDogtags Active dogtags in place of fame dogtag slots * @returns combat bonus */ - protected getDogtagCombatSkillBonusPercent(pmcData: IPmcData, activeDogtags: Item[]): number; + protected getDogtagCombatSkillBonusPercent(pmcData: IPmcData, activeDogtags: IItem[]): number; + /** + * The wall pollutes a profile with various temp buffs/debuffs, + * Remove them all + * @param wallAreaDb Hideout area data + * @param pmcData Player profile + */ + removeHideoutWallBuffsAndDebuffs(wallAreaDb: IHideoutArea, pmcData: IPmcData): void; } diff --git a/types/helpers/InRaidHelper.d.ts b/types/helpers/InRaidHelper.d.ts index 85b9c7ed..10b40d91 100644 --- a/types/helpers/InRaidHelper.d.ts +++ b/types/helpers/InRaidHelper.d.ts @@ -2,7 +2,7 @@ import { QuestController } from "@spt/controllers/QuestController"; import { InventoryHelper } from "@spt/helpers/InventoryHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; import { ILostOnDeathConfig } from "@spt/models/spt/config/ILostOnDeathConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -73,12 +73,12 @@ export declare class InRaidHelper { * @param pmcProfile Profile to get items from * @returns Array of items lost on death */ - protected getInventoryItemsLostOnDeath(pmcProfile: IPmcData): Item[]; + protected getInventoryItemsLostOnDeath(pmcProfile: IPmcData): IItem[]; /** * Does the provided items slotId mean its kept on the player after death * @pmcData Player profile * @itemToCheck Item to check should be kept * @returns true if item is kept after death */ - protected isItemKeptAfterDeath(pmcData: IPmcData, itemToCheck: Item): boolean; + protected isItemKeptAfterDeath(pmcData: IPmcData, itemToCheck: IItem): boolean; } diff --git a/types/helpers/InventoryHelper.d.ts b/types/helpers/InventoryHelper.d.ts index f9e2c685..e95f340d 100644 --- a/types/helpers/InventoryHelper.d.ts +++ b/types/helpers/InventoryHelper.d.ts @@ -6,8 +6,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { TraderAssortHelper } from "@spt/helpers/TraderAssortHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Inventory } from "@spt/models/eft/common/tables/IBotBase"; -import { Item, Location, Upd } from "@spt/models/eft/common/tables/IItem"; +import { IInventory } from "@spt/models/eft/common/tables/IBotBase"; +import { IItem, IItemLocation, IUpd } from "@spt/models/eft/common/tables/IItem"; import { IAddItemDirectRequest } from "@spt/models/eft/inventory/IAddItemDirectRequest"; import { IAddItemsDirectRequest } from "@spt/models/eft/inventory/IAddItemsDirectRequest"; import { IInventoryMergeRequestData } from "@spt/models/eft/inventory/IInventoryMergeRequestData"; @@ -65,33 +65,33 @@ export declare class InventoryHelper { * @param itemWithChildren An item * @param foundInRaid Item was found in raid */ - protected setFindInRaidStatusForItem(itemWithChildren: Item[], foundInRaid: boolean): void; + protected setFindInRaidStatusForItem(itemWithChildren: IItem[], foundInRaid: boolean): void; /** * Remove properties from a Upd object used by a trader/ragfair that are unnecessary to a player * @param upd Object to update */ - protected removeTraderRagfairRelatedUpdProperties(upd: Upd): void; + protected removeTraderRagfairRelatedUpdProperties(upd: IUpd): void; /** * Can all probided items be added into player inventory * @param sessionId Player id * @param itemsWithChildren array of items with children to try and fit * @returns True all items fit */ - canPlaceItemsInInventory(sessionId: string, itemsWithChildren: Item[][]): boolean; + canPlaceItemsInInventory(sessionId: string, itemsWithChildren: IItem[][]): boolean; /** * Do the provided items all fit into the grid * @param containerFS2D Container grid to fit items into * @param itemsWithChildren items to try and fit into grid * @returns True all fit */ - canPlaceItemsInContainer(containerFS2D: number[][], itemsWithChildren: Item[][]): boolean; + canPlaceItemsInContainer(containerFS2D: number[][], itemsWithChildren: IItem[][]): boolean; /** * Does an item fit into a container grid * @param containerFS2D Container grid * @param itemWithChildren item to check fits * @returns True it fits */ - canPlaceItemInContainer(containerFS2D: number[][], itemWithChildren: Item[]): boolean; + canPlaceItemInContainer(containerFS2D: number[][], itemWithChildren: IItem[]): boolean; /** * Find a free location inside a container to fit the item * @param containerFS2D Container grid to add item to @@ -99,7 +99,7 @@ export declare class InventoryHelper { * @param containerId Id of the container we're fitting item into * @param desiredSlotId slot id value to use, default is "hideout" */ - placeItemInContainer(containerFS2D: number[][], itemWithChildren: Item[], containerId: string, desiredSlotId?: string): void; + placeItemInContainer(containerFS2D: number[][], itemWithChildren: IItem[], containerId: string, desiredSlotId?: string): void; /** * Find a location to place an item into inventory and place it * @param stashFS2D 2-dimensional representation of the container slots @@ -109,7 +109,7 @@ export declare class InventoryHelper { * @param useSortingTable Should sorting table to be used if main stash has no space * @param output output to send back to client */ - protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: Item[], playerInventory: Inventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; + protected placeItemInInventory(stashFS2D: number[][], sortingTableFS2D: number[][], itemWithChildren: IItem[], playerInventory: IInventory, useSortingTable: boolean, output: IItemEventRouterResponse): void; /** * Handle Remove event * Remove item from player inventory + insured items array @@ -144,7 +144,7 @@ export declare class InventoryHelper { * @param inventoryItems * @returns [width, height] */ - getItemSize(itemTpl: string, itemID: string, inventoryItems: Item[]): number[]; + getItemSize(itemTpl: string, itemID: string, inventoryItems: IItem[]): number[]; /** * Calculates the size of an item including attachements * takes into account if item is folded @@ -169,9 +169,9 @@ export declare class InventoryHelper { * @param containerId Id of the container * @returns Two-dimensional representation of container */ - getContainerMap(containerH: number, containerV: number, itemList: Item[], containerId: string): number[][]; - protected isVertical(itemLocation: Location): boolean; - protected getInventoryItemHash(inventoryItem: Item[]): InventoryHelper.InventoryItemHash; + getContainerMap(containerH: number, containerV: number, itemList: IItem[], containerId: string): number[][]; + protected isVertical(itemLocation: IItemLocation): boolean; + protected getInventoryItemHash(inventoryItem: IItem[]): InventoryHelper.InventoryItemHash; /** * Return the inventory that needs to be modified (scav/pmc etc) * Changes made to result apply to character inventory @@ -219,7 +219,7 @@ export declare class InventoryHelper { * @param toItems Inventory of the destination * @param request Move request */ - moveItemToProfile(sourceItems: Item[], toItems: Item[], request: IInventoryMoveRequestData): void; + moveItemToProfile(sourceItems: IItem[], toItems: IItem[], request: IInventoryMoveRequestData): void; /** * Internal helper function to move item within the same profile_f. * @param pmcData profile to edit @@ -227,7 +227,7 @@ export declare class InventoryHelper { * @param moveRequest client move request * @returns True if move was successful */ - moveItemInternal(pmcData: IPmcData, inventoryItems: Item[], moveRequest: IInventoryMoveRequestData): { + moveItemInternal(pmcData: IPmcData, inventoryItems: IItem[], moveRequest: IInventoryMoveRequestData): { success: boolean; errorMessage?: string; }; @@ -236,11 +236,11 @@ export declare class InventoryHelper { * @param pmcData Player profile * @param itemBeingMoved item being moved */ - protected updateFastPanelBinding(pmcData: IPmcData, itemBeingMoved: Item): void; + protected updateFastPanelBinding(pmcData: IPmcData, itemBeingMoved: IItem): void; /** * Internal helper function to handle cartridges in inventory if any of them exist. */ - protected handleCartridges(items: Item[], request: IInventoryMoveRequestData): void; + protected handleCartridges(items: IItem[], request: IInventoryMoveRequestData): void; /** * Get details for how a random loot container should be handled, max rewards, possible reward tpls * @param itemTpl Container being opened @@ -256,12 +256,21 @@ export declare class InventoryHelper { * @param itemToCheck Item to look for * @returns True if item exists inside stash */ - isItemInStash(pmcData: IPmcData, itemToCheck: Item): boolean; + isItemInStash(pmcData: IPmcData, itemToCheck: IItem): boolean; + validateInventoryUsesMonogoIds(itemsToValidate: IItem[]): void; + /** + * Does the provided item have a root item with the provided id + * @param pmcData Profile with items + * @param item Item to check + * @param rootId Root item id to check for + * @returns True when item has rootId, false when not + */ + doesItemHaveRootId(pmcData: IPmcData, item: IItem, rootId: string): boolean; } declare namespace InventoryHelper { interface InventoryItemHash { - byItemId: Record; - byParentId: Record; + byItemId: Record; + byParentId: Record; } } export {}; diff --git a/types/helpers/ItemHelper.d.ts b/types/helpers/ItemHelper.d.ts index 0cd5e5e0..366ad9b7 100644 --- a/types/helpers/ItemHelper.d.ts +++ b/types/helpers/ItemHelper.d.ts @@ -2,7 +2,7 @@ import { HandbookHelper } from "@spt/helpers/HandbookHelper"; import { IStaticAmmoDetails } from "@spt/models/eft/common/ILocation"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IInsuredItem } from "@spt/models/eft/common/tables/IBotBase"; -import { Item, Repairable, Upd } from "@spt/models/eft/common/tables/IItem"; +import { IItem, IUpd, IUpdRepairable } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ItemTpl } from "@spt/models/enums/ItemTpl"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -42,7 +42,7 @@ export declare class ItemHelper { * @param slotId OPTIONAL - slotid of desired item * @returns True if pool contains item */ - hasItemWithTpl(itemPool: Item[], item: ItemTpl, slotId?: string): boolean; + hasItemWithTpl(itemPool: IItem[], item: ItemTpl, slotId?: string): boolean; /** * Get the first item from provided pool with the desired tpl * @param itemPool Item collection to search @@ -50,7 +50,7 @@ export declare class ItemHelper { * @param slotId OPTIONAL - slotid of desired item * @returns Item or undefined */ - getItemFromPoolByTpl(itemPool: Item[], item: ItemTpl, slotId?: string): Item | undefined; + getItemFromPoolByTpl(itemPool: IItem[], item: ItemTpl, slotId?: string): IItem | undefined; /** * This method will compare two items (with all its children) and see if the are equivalent. * This method will NOT compare IDs on the items @@ -59,7 +59,7 @@ export declare class ItemHelper { * @param compareUpdProperties Upd properties to compare between the items * @returns true if they are the same, false if they arent */ - isSameItems(item1: Item[], item2: Item[], compareUpdProperties?: Set): boolean; + isSameItems(item1: IItem[], item2: IItem[], compareUpdProperties?: Set): boolean; /** * This method will compare two items and see if the are equivalent. * This method will NOT compare IDs on the items @@ -68,13 +68,13 @@ export declare class ItemHelper { * @param compareUpdProperties Upd properties to compare between the items * @returns true if they are the same, false if they arent */ - isSameItem(item1: Item, item2: Item, compareUpdProperties?: Set): boolean; + isSameItem(item1: IItem, item2: IItem, compareUpdProperties?: Set): boolean; /** * Helper method to generate a Upd based on a template * @param itemTemplate the item template to generate a Upd for * @returns A Upd with all the default properties set */ - generateUpdForItem(itemTemplate: ITemplateItem): Upd; + generateUpdForItem(itemTemplate: ITemplateItem): IUpd; /** * Checks if a tpl is a valid item. Valid meaning that it's an item that be stored in stash * Valid means: @@ -171,7 +171,7 @@ export declare class ItemHelper { * @param item Item to update * @returns Fixed item */ - fixItemStackCount(item: Item): Item; + fixItemStackCount(item: IItem): IItem; /** * Get cloned copy of all item data from items.json * @returns array of ITemplateItem objects @@ -191,7 +191,7 @@ export declare class ItemHelper { * @param skipArmorItemsWithoutDurability Skip over armor items without durability * @returns % quality modifer between 0 and 1 */ - getItemQualityModifierForItems(items: Item[], skipArmorItemsWithoutDurability?: boolean): number; + getItemQualityModifierForItems(items: IItem[], skipArmorItemsWithoutDurability?: boolean): number; /** * get normalized value (0-1) based on item condition * Will return -1 for base armor items with 0 durability @@ -199,7 +199,7 @@ export declare class ItemHelper { * @param skipArmorItemsWithoutDurability return -1 for armor items that have maxdurability of 0 * @returns Number between 0 and 1 */ - getItemQualityModifier(item: Item, skipArmorItemsWithoutDurability?: boolean): number; + getItemQualityModifier(item: IItem, skipArmorItemsWithoutDurability?: boolean): number; /** * Get a quality value based on a repairable items (weapon/armor) current state between current and max durability * @param itemDetails Db details for item we want quality value for @@ -207,14 +207,14 @@ export declare class ItemHelper { * @param item Item quality value is for * @returns A number between 0 and 1 */ - protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: Repairable, item: Item): number; + protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: IUpdRepairable, item: IItem): number; /** * Recursive function that looks at every item from parameter and gets their childrens Ids + includes parent item in results * @param items Array of items (item + possible children) * @param baseItemId Parent items id * @returns an array of strings */ - findAndReturnChildrenByItems(items: Item[], baseItemId: string): string[]; + findAndReturnChildrenByItems(items: IItem[], baseItemId: string): string[]; /** * A variant of findAndReturnChildren where the output is list of item objects instead of their ids. * @param items Array of items (item + possible children) @@ -222,20 +222,20 @@ export declare class ItemHelper { * @param modsOnly Include only mod items, exclude items stored inside root item * @returns An array of Item objects */ - findAndReturnChildrenAsItems(items: Item[], baseItemId: string, modsOnly?: boolean): Item[]; + findAndReturnChildrenAsItems(items: IItem[], baseItemId: string, modsOnly?: boolean): IItem[]; /** * Find children of the item in a given assort (weapons parts for example, need recursive loop function) * @param itemIdToFind Template id of item to check for * @param assort Array of items to check in * @returns Array of children of requested item */ - findAndReturnChildrenByAssort(itemIdToFind: string, assort: Item[]): Item[]; + findAndReturnChildrenByAssort(itemIdToFind: string, assort: IItem[]): IItem[]; /** * Check if the passed in item has buy count restrictions * @param itemToCheck Item to check * @returns true if it has buy restrictions */ - hasBuyRestrictions(itemToCheck: Item): boolean; + hasBuyRestrictions(itemToCheck: IItem): boolean; /** * is the passed in template id a dog tag * @param tpl Template id to check @@ -247,7 +247,7 @@ export declare class ItemHelper { * @param item * @returns "slotId OR slotid,locationX,locationY" */ - getChildId(item: Item): string; + getChildId(item: IItem): string; /** * Can the passed in item be stacked * @param tpl item to check @@ -259,28 +259,28 @@ export declare class ItemHelper { * @param itemToSplit Item to split into smaller stacks * @returns Array of root item + children */ - splitStack(itemToSplit: Item): Item[]; + splitStack(itemToSplit: IItem): IItem[]; /** * Turn items like money into separate stacks that adhere to max stack size * @param itemToSplit Item to split into smaller stacks * @returns */ - splitStackIntoSeparateItems(itemToSplit: Item): Item[][]; + splitStackIntoSeparateItems(itemToSplit: IItem): IItem[][]; /** * Find Barter items from array of items * @param {string} by tpl or id - * @param {Item[]} itemsToSearch Array of items to iterate over + * @param {IItem[]} itemsToSearch Array of items to iterate over * @param {string} desiredBarterItemIds * @returns Array of Item objects */ - findBarterItems(by: "tpl" | "id", itemsToSearch: Item[], desiredBarterItemIds: string | string[]): Item[]; + findBarterItems(by: "tpl" | "id", itemsToSearch: IItem[], desiredBarterItemIds: string | string[]): IItem[]; /** * Replace the _id value for base item + all children that are children of it * REPARENTS ROOT ITEM ID, NOTHING ELSE * @param itemWithChildren Item with mods to update * @param newId new id to add on chidren of base item */ - replaceRootItemID(itemWithChildren: Item[], newId?: string): void; + replaceRootItemID(itemWithChildren: IItem[], newId?: string): void; /** * Regenerate all GUIDs with new IDs, for the exception of special item types (e.g. quest, sorting table, etc.) This * function will not mutate the original items array, but will return a new array with new GUIDs. @@ -291,13 +291,13 @@ export declare class ItemHelper { * @param fastPanel Quick slot panel * @returns Item[] */ - replaceIDs(originalItems: Item[], pmcData?: IPmcData, insuredItems?: IInsuredItem[], fastPanel?: any): Item[]; + replaceIDs(originalItems: IItem[], pmcData?: IPmcData, insuredItems?: IInsuredItem[], fastPanel?: any): IItem[]; /** * Mark the passed in array of items as found in raid. * Modifies passed in items * @param items The list of items to mark as FiR */ - setFoundInRaid(items: Item[]): void; + setFoundInRaid(items: IItem[]): void; /** * WARNING, SLOW. Recursively loop down through an items hierarchy to see if any of the ids match the supplied list, return true if any do * @param {string} tpl Items tpl to check parents of @@ -322,7 +322,7 @@ export declare class ItemHelper { * @param parent The parent of the item to be checked * @returns True if the item is actually moddable, false if it is not, and undefined if the check cannot be performed. */ - isRaidModdable(item: Item, parent: Item): boolean | undefined; + isRaidModdable(item: IItem, parent: IItem): boolean | undefined; /** * Retrieves the main parent item for a given attachment item. * @@ -339,14 +339,14 @@ export declare class ItemHelper { * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. * @returns The Item object representing the top-most parent of the given item, or `undefined` if no such parent exists. */ - getAttachmentMainParent(itemId: string, itemsMap: Map): Item | undefined; + getAttachmentMainParent(itemId: string, itemsMap: Map): IItem | undefined; /** * Determines if an item is an attachment that is currently attached to it's parent item. * * @param item The item to check. * @returns true if the item is attached attachment, otherwise false. */ - isAttachmentAttached(item: Item): boolean; + isAttachmentAttached(item: IItem): boolean; /** * Retrieves the equipment parent item for a given item. * @@ -362,14 +362,14 @@ export declare class ItemHelper { * @param itemsMap - A Map containing item IDs mapped to their corresponding Item objects for quick lookup. * @returns The Item object representing the equipment parent of the given item, or `undefined` if no such parent exists. */ - getEquipmentParent(itemId: string, itemsMap: Map): Item | undefined; + getEquipmentParent(itemId: string, itemsMap: Map): IItem | undefined; /** * Get the inventory size of an item * @param items Item with children * @param rootItemId * @returns ItemSize object (width and height) */ - getItemSize(items: Item[], rootItemId: string): ItemHelper.ItemSize; + getItemSize(items: IItem[], rootItemId: string): ItemHelper.IItemSize; /** * Get a random cartridge from an items Filter property * @param item Db item template to look up Cartridge filter values from @@ -381,13 +381,13 @@ export declare class ItemHelper { * @param ammoBox Box to add cartridges to * @param ammoBoxDetails Item template from items db */ - addCartridgesToAmmoBox(ammoBox: Item[], ammoBoxDetails: ITemplateItem): void; + addCartridgesToAmmoBox(ammoBox: IItem[], ammoBoxDetails: ITemplateItem): void; /** * Add a single stack of cartridges to the ammo box * @param ammoBox Box to add cartridges to * @param ammoBoxDetails Item template from items db */ - addSingleStackCartridgesToAmmoBox(ammoBox: Item[], ammoBoxDetails: ITemplateItem): void; + addSingleStackCartridgesToAmmoBox(ammoBox: IItem[], ammoBoxDetails: ITemplateItem): void; /** * Check if item is stored inside of a container * @param itemToCheck Item to check is inside of container @@ -395,7 +395,7 @@ export declare class ItemHelper { * @param items Inventory with child parent items to check * @returns True when item is in container */ - itemIsInsideContainer(itemToCheck: Item, desiredContainerSlotId: string, items: Item[]): boolean; + itemIsInsideContainer(itemToCheck: IItem, desiredContainerSlotId: string, items: IItem[]): boolean; /** * Add child items (cartridges) to a magazine * @param magazine Magazine to add child items to @@ -406,7 +406,7 @@ export declare class ItemHelper { * @param defaultCartridgeTpl Cartridge to use when none found * @param weapon Weapon the magazine will be used for (if passed in uses Chamber as whitelist) */ - fillMagazineWithRandomCartridge(magazine: Item[], magTemplate: ITemplateItem, staticAmmoDist: Record, caliber?: string, minSizePercent?: number, defaultCartridgeTpl?: string, weapon?: ITemplateItem): void; + fillMagazineWithRandomCartridge(magazine: IItem[], magTemplate: ITemplateItem, staticAmmoDist: Record, caliber?: string, minSizePercent?: number, defaultCartridgeTpl?: string, weapon?: ITemplateItem): void; /** * Add child items to a magazine of a specific cartridge * @param magazineWithChildCartridges Magazine to add child items to @@ -414,7 +414,7 @@ export declare class ItemHelper { * @param cartridgeTpl Cartridge to add to magazine * @param minSizeMultiplier % the magazine must be filled to */ - fillMagazineWithCartridge(magazineWithChildCartridges: Item[], magTemplate: ITemplateItem, cartridgeTpl: string, minSizeMultiplier?: number): void; + fillMagazineWithCartridge(magazineWithChildCartridges: IItem[], magTemplate: ITemplateItem, cartridgeTpl: string, minSizeMultiplier?: number): void; /** * Choose a random bullet type from the list of possible a magazine has * @param magTemplate Magazine template from Db @@ -439,13 +439,13 @@ export declare class ItemHelper { * @param foundInRaid OPTIONAL - Are cartridges found in raid (SpawnedInSession) * @returns Item */ - createCartridges(parentId: string, ammoTpl: string, stackCount: number, location: number, foundInRaid?: boolean): Item; + createCartridges(parentId: string, ammoTpl: string, stackCount: number, location: number, foundInRaid?: boolean): IItem; /** * Get the size of a stack, return 1 if no stack object count property found * @param item Item to get stack size of * @returns size of stack */ - getItemStackSize(item: Item): number; + getItemStackSize(item: IItem): number; /** * Get the name of an item from the locale file using the item tpl * @param itemTpl Tpl of item to get name of @@ -466,7 +466,7 @@ export declare class ItemHelper { * @param requiredOnly Only add required mods * @returns Item with children */ - addChildSlotItems(itemToAdd: Item[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): Item[]; + addChildSlotItems(itemToAdd: IItem[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): IItem[]; /** * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter * @param possibleTpls Tpls to randomly choose from @@ -491,14 +491,14 @@ export declare class ItemHelper { * @param itemWithChildren Primary item + children of primary item * @returns Item array with updated IDs */ - reparentItemAndChildren(rootItem: Item, itemWithChildren: Item[]): Item[]; + reparentItemAndChildren(rootItem: IItem, itemWithChildren: IItem[]): IItem[]; /** * Update a root items _id property value to be unique * @param itemWithChildren Item to update root items _id property * @param newId Optional: new id to use * @returns New root id */ - remapRootItemId(itemWithChildren: Item[], newId?: string): string; + remapRootItemId(itemWithChildren: IItem[], newId?: string): string; /** * Adopts orphaned items by resetting them as root "hideout" items. Helpful in situations where a parent has been * deleted from a group of items and there are children still referencing the missing parent. This method will @@ -508,21 +508,21 @@ export declare class ItemHelper { * @param items Array of Items that should be adjusted. * @returns Array of Items that have been adopted. */ - adoptOrphanedItems(rootId: string, items: Item[]): Item[]; + adoptOrphanedItems(rootId: string, items: IItem[]): IItem[]; /** * Populate a Map object of items for quick lookup using their ID. * * @param items An array of Items that should be added to a Map. * @returns A Map where the keys are the item IDs and the values are the corresponding Item objects. */ - generateItemsMap(items: Item[]): Map; + generateItemsMap(items: IItem[]): Map; /** * Add a blank upd object to passed in item if it does not exist already * @param item item to add upd to * @param warningMessageWhenMissing text to write to log when upd object was not found * @returns True when upd object was added */ - addUpdObjectToItem(item: Item, warningMessageWhenMissing?: string): boolean; + addUpdObjectToItem(item: IItem, warningMessageWhenMissing?: string): boolean; /** * Return all tpls from Money enum * @returns string tpls @@ -535,9 +535,10 @@ export declare class ItemHelper { * @returns number */ getRandomisedAmmoStackSize(ammoItemTemplate: ITemplateItem, maxLimit?: number): number; + getItemBaseType(tpl: string, rootOnly?: boolean): string; } declare namespace ItemHelper { - interface ItemSize { + interface IItemSize { width: number; height: number; } diff --git a/types/helpers/ProfileHelper.d.ts b/types/helpers/ProfileHelper.d.ts index 32c099b4..df468feb 100644 --- a/types/helpers/ProfileHelper.d.ts +++ b/types/helpers/ProfileHelper.d.ts @@ -1,6 +1,6 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Common, CounterKeyValue, Stats } from "@spt/models/eft/common/tables/IBotBase"; +import { Common, ICounterKeyValue, IStats } from "@spt/models/eft/common/tables/IBotBase"; import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData"; import { BonusType } from "@spt/models/enums/BonusType"; @@ -126,7 +126,7 @@ export declare class ProfileHelper { * Get baseline counter values for a fresh profile * @returns Default profile Stats object */ - getDefaultCounters(): Stats; + getDefaultCounters(): IStats; /** * is this profile flagged for data removal * @param sessionID Profile id @@ -160,7 +160,7 @@ export declare class ProfileHelper { * @param counters Counters to search for key * @param keyToIncrement Key */ - incrementStatCounter(counters: CounterKeyValue[], keyToIncrement: string): void; + incrementStatCounter(counters: ICounterKeyValue[], keyToIncrement: string): void; /** * Check if player has a skill at elite level * @param skillType Skill to check diff --git a/types/helpers/QuestHelper.d.ts b/types/helpers/QuestHelper.d.ts index 734dba6a..02fc4399 100644 --- a/types/helpers/QuestHelper.d.ts +++ b/types/helpers/QuestHelper.d.ts @@ -8,7 +8,7 @@ import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Common, IQuestStatus } from "@spt/models/eft/common/tables/IBotBase"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IQuest, IQuestCondition, IQuestReward } from "@spt/models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { IAcceptQuestRequestData } from "@spt/models/eft/quests/IAcceptQuestRequestData"; @@ -102,20 +102,20 @@ export declare class QuestHelper { * @param questReward Reward item to fix * @returns Fixed rewards */ - protected processReward(questReward: IQuestReward): Item[]; + protected processReward(questReward: IQuestReward): IItem[]; /** * Add missing mod items to a quest armor reward * @param originalRewardRootItem Original armor reward item from IQuestReward.items object * @param questReward Armor reward from quest */ - protected generateArmorRewardChildSlots(originalRewardRootItem: Item, questReward: IQuestReward): void; + protected generateArmorRewardChildSlots(originalRewardRootItem: IItem, questReward: IQuestReward): void; /** * Gets a flat list of reward items for the given quest at a specific state (e.g. Fail/Success) * @param quest quest to get rewards for * @param status Quest status that holds the items (Started, Success, Fail) * @returns array of items with the correct maxStack */ - getQuestRewardItems(quest: IQuest, status: QuestStatus): Item[]; + getQuestRewardItems(quest: IQuest, status: QuestStatus): IItem[]; /** * Look up quest in db by accepted quest id and construct a profile-ready object ready to store in profile * @param pmcData Player profile @@ -142,6 +142,22 @@ export declare class QuestHelper { * @param questId QuestId to check */ questIsForOtherSide(playerSide: string, questId: string): boolean; + /** + * Is the provided quest prevented from being viewed by the provided game version + * (Inclusive filter) + * @param gameVersion Game version to check against + * @param questId Quest id to check + * @returns True Quest should not be visible to game version + */ + protected questIsProfileBlacklisted(gameVersion: string, questId: string): boolean; + /** + * Is the provided quest able to be seen by the provided game version + * (Exclusive filter) + * @param gameVersion Game version to check against + * @param questId Quest id to check + * @returns True Quest should be visible to game version + */ + protected questIsProfileWhitelisted(gameVersion: string, questId: string): boolean; /** * Get quests that can be shown to player after failing a quest * @param failedQuestId Id of the quest failed by player @@ -173,7 +189,7 @@ export declare class QuestHelper { * @param sessionId Session id * @param item Item that was adjusted */ - protected addItemStackSizeChangeIntoEventResponse(output: IItemEventRouterResponse, sessionId: string, item: Item): void; + protected addItemStackSizeChangeIntoEventResponse(output: IItemEventRouterResponse, sessionId: string, item: IItem): void; /** * Get quests, strip all requirement conditions except level * @param quests quests to process @@ -243,7 +259,7 @@ export declare class QuestHelper { * @param questResponse Response to send back to client * @returns Array of reward objects */ - applyQuestReward(profileData: IPmcData, questId: string, state: QuestStatus, sessionId: string, questResponse: IItemEventRouterResponse): Item[]; + applyQuestReward(profileData: IPmcData, questId: string, state: QuestStatus, sessionId: string, questResponse: IItemEventRouterResponse): IItem[]; /** * WIP - Find hideout craft id and add to unlockedProductionRecipe array in player profile * also update client response recipeUnlocked array with craft id diff --git a/types/helpers/RagfairHelper.d.ts b/types/helpers/RagfairHelper.d.ts index 52ca4676..0ec76d63 100644 --- a/types/helpers/RagfairHelper.d.ts +++ b/types/helpers/RagfairHelper.d.ts @@ -2,7 +2,7 @@ import { HandbookHelper } from "@spt/helpers/HandbookHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { TraderAssortHelper } from "@spt/helpers/TraderAssortHelper"; import { UtilityHelper } from "@spt/helpers/UtilityHelper"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; @@ -36,7 +36,7 @@ export declare class RagfairHelper { * Iterate over array of identical items and merge stack count * Ragfair allows abnormally large stacks. */ - mergeStackable(items: Item[]): Item[]; + mergeStackable(items: IItem[]): IItem[]; /** * Return the symbol for a currency * e.g. 5449016a4bdc2d6f028b456f return ₽ diff --git a/types/helpers/RagfairOfferHelper.d.ts b/types/helpers/RagfairOfferHelper.d.ts index 2386316e..f5a21936 100644 --- a/types/helpers/RagfairOfferHelper.d.ts +++ b/types/helpers/RagfairOfferHelper.d.ts @@ -9,14 +9,14 @@ import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { RagfairSortHelper } from "@spt/helpers/RagfairSortHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; -import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; +import { IRagfairConfig, ITieredFlea } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -65,6 +65,7 @@ export declare class RagfairOfferHelper { * @returns Offers the player should see */ getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcData: IPmcData): IRagfairOffer[]; + protected offerIsHiddenFromPlayerTieredFlea(tieredFlea: ITieredFlea, offer: IRagfairOffer, tieredFleaLimitTypes: string[], playerLevel: number): boolean; /** * Get matching offers that require the desired item and filter out offers from non traders if player is below ragfair unlock level * @param searchRequest Search request from client @@ -125,7 +126,7 @@ export declare class RagfairOfferHelper { * @param itemsInInventoryToList items to sum up * @returns Total count */ - getTotalStackCountSize(itemsInInventoryToList: Item[][]): number; + getTotalStackCountSize(itemsInInventoryToList: IItem[][]): number; /** * Add amount to players ragfair rating * @param sessionId Profile to update @@ -173,7 +174,7 @@ export declare class RagfairOfferHelper { * @param offer The flea offer * @returns True if the given item is functional */ - isItemFunctional(offerRootItem: Item, offer: IRagfairOffer): boolean; + isItemFunctional(offerRootItem: IItem, offer: IRagfairOffer): boolean; /** * Should a ragfair offer be visible to the player * @param searchRequest Search request @@ -190,7 +191,7 @@ export declare class RagfairOfferHelper { * @param item Item to check * @returns True if has condition */ - protected isConditionItem(item: Item): boolean; + protected isConditionItem(item: IItem): boolean; /** * Is items quality value within desired range * @param item Item to check quality of @@ -198,5 +199,5 @@ export declare class RagfairOfferHelper { * @param max Desired maximum quality * @returns True if in range */ - protected itemQualityInRange(item: Item, min: number, max: number): boolean; + protected itemQualityInRange(item: IItem, min: number, max: number): boolean; } diff --git a/types/helpers/RagfairSellHelper.d.ts b/types/helpers/RagfairSellHelper.d.ts index fc9e4b50..232ec514 100644 --- a/types/helpers/RagfairSellHelper.d.ts +++ b/types/helpers/RagfairSellHelper.d.ts @@ -1,4 +1,4 @@ -import { SellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; +import { ISellResult } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -28,5 +28,5 @@ export declare class RagfairSellHelper { * @param sellInOneGo All items listed get sold at once * @returns Array of purchases of item(s) listed */ - rollForSale(sellChancePercent: number, itemSellCount: number, sellInOneGo?: boolean): SellResult[]; + rollForSale(sellChancePercent: number, itemSellCount: number, sellInOneGo?: boolean): ISellResult[]; } diff --git a/types/helpers/RagfairServerHelper.d.ts b/types/helpers/RagfairServerHelper.d.ts index 3e1fea9b..c7c72a0f 100644 --- a/types/helpers/RagfairServerHelper.d.ts +++ b/types/helpers/RagfairServerHelper.d.ts @@ -1,7 +1,7 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; @@ -65,7 +65,7 @@ export declare class RagfairServerHelper { * @param sessionID Player to send items to * @param returnedItems Items to send to player */ - returnItems(sessionID: string, returnedItems: Item[]): void; + returnItems(sessionID: string, returnedItems: IItem[]): void; calculateDynamicStackCount(tplId: string, isWeaponPreset: boolean): number; /** * Choose a currency at random with bias @@ -77,11 +77,11 @@ export declare class RagfairServerHelper { * @param item Preset item * @returns Array of weapon and its children */ - getPresetItems(item: Item): Item[]; + getPresetItems(item: IItem): IItem[]; /** * Possible bug, returns all items associated with an items tpl, could be multiple presets from globals.json * @param item Preset item * @returns */ - getPresetItemsByTpl(item: Item): Item[]; + getPresetItemsByTpl(item: IItem): IItem[]; } diff --git a/types/helpers/RepairHelper.d.ts b/types/helpers/RepairHelper.d.ts index 63c78c9b..538347e2 100644 --- a/types/helpers/RepairHelper.d.ts +++ b/types/helpers/RepairHelper.d.ts @@ -1,4 +1,4 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -24,7 +24,7 @@ export declare class RepairHelper { * @param traderQualityMultipler Trader quality value from traders base json * @param applyMaxDurabilityDegradation should item have max durability reduced */ - updateItemDurability(itemToRepair: Item, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; + updateItemDurability(itemToRepair: IItem, itemToRepairDetails: ITemplateItem, isArmor: boolean, amountToRepair: number, useRepairKit: boolean, traderQualityMultipler: number, applyMaxDurabilityDegradation?: boolean): void; /** * Repairing armor reduces the total durability value slightly, get a randomised (to 2dp) amount based on armor material * @param armorMaterial What material is the armor being repaired made of diff --git a/types/helpers/SecureContainerHelper.d.ts b/types/helpers/SecureContainerHelper.d.ts index b6bcffe0..76844860 100644 --- a/types/helpers/SecureContainerHelper.d.ts +++ b/types/helpers/SecureContainerHelper.d.ts @@ -1,8 +1,8 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; -import { Item } from "@spt/models/eft/common/tables/IItem"; -export interface OwnerInventoryItems { - from: Item[]; - to: Item[]; +import { IItem } from "@spt/models/eft/common/tables/IItem"; +export interface IOwnerInventoryItems { + from: IItem[]; + to: IItem[]; sameInventory: boolean; isMail: boolean; } @@ -14,5 +14,5 @@ export declare class SecureContainerHelper { * @param items Inventory items to look for secure container in * @returns Array of ids */ - getSecureContainerItems(items: Item[]): string[]; + getSecureContainerItems(items: IItem[]): string[]; } diff --git a/types/helpers/TradeHelper.d.ts b/types/helpers/TradeHelper.d.ts index 6e6f3a25..c7e1e140 100644 --- a/types/helpers/TradeHelper.d.ts +++ b/types/helpers/TradeHelper.d.ts @@ -3,7 +3,7 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { TraderAssortHelper } from "@spt/helpers/TraderAssortHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBuyTradeRequestData } from "@spt/models/eft/trade/IProcessBuyTradeRequestData"; import { IProcessSellTradeRequestData } from "@spt/models/eft/trade/IProcessSellTradeRequestData"; @@ -13,6 +13,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { RagfairServer } from "@spt/servers/RagfairServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { FenceService } from "@spt/services/FenceService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { PaymentService } from "@spt/services/PaymentService"; @@ -21,6 +22,7 @@ import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class TradeHelper { protected logger: ILogger; + protected databaseService: DatabaseService; protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; protected itemHelper: ItemHelper; @@ -36,7 +38,7 @@ export declare class TradeHelper { protected cloner: ICloner; protected traderConfig: ITraderConfig; protected inventoryConfig: IInventoryConfig; - constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, localisationService: LocalisationService, httpResponse: HttpResponseUtil, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer, traderAssortHelper: TraderAssortHelper, traderPurchasePersisterService: TraderPurchasePersisterService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, itemHelper: ItemHelper, paymentService: PaymentService, fenceService: FenceService, localisationService: LocalisationService, httpResponse: HttpResponseUtil, inventoryHelper: InventoryHelper, ragfairServer: RagfairServer, traderAssortHelper: TraderAssortHelper, traderPurchasePersisterService: TraderPurchasePersisterService, configServer: ConfigServer, cloner: ICloner); /** * Buy item from flea or trader * @param pmcData Player profile @@ -56,6 +58,7 @@ export declare class TradeHelper { * @param output IItemEventRouterResponse */ sellItem(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData, sessionID: string, output: IItemEventRouterResponse): void; + protected incrementCirculateSoldToTraderCounter(profileWithItemsToSell: IPmcData, profileToReceiveMoney: IPmcData, sellRequest: IProcessSellTradeRequestData): void; /** * Traders allow a limited number of purchases per refresh cycle (default 60 mins) * @param sessionId Session id @@ -65,5 +68,5 @@ export declare class TradeHelper { * @param assortId Id of assort being purchased * @param count How many of the item are being bought */ - protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; + protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: IItem, assortId: string, count: number): void; } diff --git a/types/helpers/TraderAssortHelper.d.ts b/types/helpers/TraderAssortHelper.d.ts index f1ecd3b6..a50b5894 100644 --- a/types/helpers/TraderAssortHelper.d.ts +++ b/types/helpers/TraderAssortHelper.d.ts @@ -4,7 +4,7 @@ import { AssortHelper } from "@spt/helpers/AssortHelper"; import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITrader, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -58,7 +58,7 @@ export declare class TraderAssortHelper { * Reset every traders root item `BuyRestrictionCurrent` property to 0 * @param assortItems Items to adjust */ - protected resetBuyRestrictionCurrentValue(assortItems: Item[]): void; + protected resetBuyRestrictionCurrentValue(assortItems: IItem[]): void; /** * Create a dict of all assort id = quest id mappings used to work out what items should be shown to player based on the quests they've started/completed/failed */ @@ -85,7 +85,7 @@ export declare class TraderAssortHelper { * @param traderId trader id * @returns array of Items */ - protected getPristineTraderAssorts(traderId: string): Item[]; + protected getPristineTraderAssorts(traderId: string): IItem[]; /** * Returns generated ragfair offers in a trader assort format * @returns Trader assort object diff --git a/types/helpers/TraderHelper.d.ts b/types/helpers/TraderHelper.d.ts index 12eabe92..0cce160f 100644 --- a/types/helpers/TraderHelper.d.ts +++ b/types/helpers/TraderHelper.d.ts @@ -2,7 +2,7 @@ import { HandbookHelper } from "@spt/helpers/HandbookHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IProfileTraderTemplate } from "@spt/models/eft/common/tables/IProfileTemplate"; import { ITraderAssort, ITraderBase, ITraderLoyaltyLevel } from "@spt/models/eft/common/tables/ITrader"; import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; @@ -52,7 +52,7 @@ export declare class TraderHelper { * @param assortId Id of assort to find * @returns Item object */ - getTraderAssortItemByAssortId(traderId: string, assortId: string): Item | undefined; + getTraderAssortItemByAssortId(traderId: string, assortId: string): IItem | undefined; /** * Reset a profiles trader data back to its initial state as seen by a level 1 player * Does NOT take into account different profile levels @@ -130,7 +130,7 @@ export declare class TraderHelper { count: number; }[]; traderId: string; - }, itemPurchased: Item): void; + }, itemPurchased: IItem): void; /** * EoD and Unheard get a 20% bonus to personal trader limit purchases * @param buyRestrictionMax Existing value from trader item diff --git a/types/loaders/BundleLoader.d.ts b/types/loaders/BundleLoader.d.ts index 8c0ed4d2..fcbf97d4 100644 --- a/types/loaders/BundleLoader.d.ts +++ b/types/loaders/BundleLoader.d.ts @@ -8,7 +8,7 @@ export declare class BundleInfo { filename: string; crc: number; dependencies: string[]; - constructor(modpath: string, bundle: BundleManifestEntry, bundleHash: number); + constructor(modpath: string, bundle: IBundleManifestEntry, bundleHash: number); } export declare class BundleLoader { protected httpServerHelper: HttpServerHelper; @@ -26,10 +26,10 @@ export declare class BundleLoader { addBundles(modpath: string): void; addBundle(key: string, b: BundleInfo): void; } -export interface BundleManifest { - manifest: BundleManifestEntry[]; +export interface IBundleManifest { + manifest: IBundleManifestEntry[]; } -export interface BundleManifestEntry { +export interface IBundleManifestEntry { key: string; dependencyKeys: string[]; } diff --git a/types/models/eft/bot/IGenerateBotsRequestData.d.ts b/types/models/eft/bot/IGenerateBotsRequestData.d.ts index f1f70132..f0f7168e 100644 --- a/types/models/eft/bot/IGenerateBotsRequestData.d.ts +++ b/types/models/eft/bot/IGenerateBotsRequestData.d.ts @@ -1,7 +1,7 @@ export interface IGenerateBotsRequestData { - conditions: Condition[]; + conditions: ICondition[]; } -export interface Condition { +export interface ICondition { /** e.g. assault/pmcBot/bossKilla */ Role: string; Limit: number; diff --git a/types/models/eft/common/IGlobals.d.ts b/types/models/eft/common/IGlobals.d.ts index 80d3fbe3..f23b608d 100644 --- a/types/models/eft/common/IGlobals.d.ts +++ b/types/models/eft/common/IGlobals.d.ts @@ -1,5 +1,5 @@ import { Ixyz } from "@spt/models/eft/common/Ixyz"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; export interface IGlobals { time: number; config: IConfig; @@ -9,7 +9,80 @@ export interface IGlobals { BotWeaponScatterings: IBotWeaponScattering[]; ItemPresets: Record; } +export interface IArtilleryShelling { + ArtilleryMapsConfigs: Record; + ProjectileExplosionParams: IProjectileExplosionParams; + MaxCalledShellingCount: number; +} +export interface IArtilleryMapSettings { + PlanedShellingOn: boolean; + InitShellingTimer: number; + BeforeShellingSignalTime: number; + ShellingCount: number; + ZonesInShelling: number; + NewZonesForEachShelling: boolean; + InitCalledShellingTime: number; + ShellingZones: IShellingZone[]; + Brigades: IBrigade[]; + ArtilleryShellingAirDropSettings: IArtilleryShellingAirDropSettings; + PauseBetweenShellings: Ixyz; +} +export interface IShellingZone { + ID: number; + PointsInShellings: Ixyz; + ShellingRounds: number; + ShotCount: number; + PauseBetweenRounds: Ixyz; + PauseBetweenShots: Ixyz; + Center: Ixyz; + Rotate: number; + GridStep: Ixyz; + Points: Ixyz; + PointRadius: number; + ExplosionDistanceRange: Ixyz; + AlarmStages: IAlarmStage[]; + BeforeShellingSignalTime: number; + UsedInPlanedShelling: boolean; + UseInCalledShelling: boolean; + IsActive: boolean; +} +export interface IAlarmStage { + Value: { + x: number; + y: number; + }; +} +export interface IBrigade { + ID: number; + ArtilleryGuns: IArtilleryGun[]; +} +export interface IArtilleryGun { + Position: Ixyz; +} +export interface IArtilleryShellingAirDropSettings { + UseAirDrop: boolean; + AirDropTime: number; + AirDropPosition: Ixyz; + LootTemplateId: string; +} +export interface IProjectileExplosionParams { + Blindness: Ixyz; + Contusion: Ixyz; + ArmorDistanceDistanceDamage: Ixyz; + MinExplosionDistance: number; + MaxExplosionDistance: number; + FragmentsCount: number; + Strength: number; + ArmorDamage: number; + StaminaBurnRate: number; + PenetrationPower: number; + DirectionalDamageAngle: number; + DirectionalDamageMultiplier: number; + FragmentType: string; + DeadlyDistance: number; +} export interface IConfig { + ArtilleryShelling: IArtilleryShelling; content: IContent; AimPunchMagnitude: number; WeaponSkillProgressRate: number; @@ -495,9 +568,9 @@ export interface IKarmaCalculationSettings { minSurvivedRaidCount: number; } export interface IArenaEftTransferSettings { - ArenaEftTransferSettings: ArenaEftTransferSettings; + ArenaEftTransferSettings: IArenaEftTransferSettings; } -export interface ArenaEftTransferSettings { +export interface IArenaEftTransferSettings { ArenaManagerReputationTaxMultiplier: number; CharismaTaxMultiplier: number; CreditPriceTaxMultiplier: number; @@ -933,7 +1006,6 @@ export interface IMaxActiveOfferCount { from: number; to: number; count: number; - countForSpecialEditions: number; } export interface IMaxSumForRarity { Common: IRarityMaxSum; @@ -1669,7 +1741,7 @@ export interface IPreset { _changeWeaponName: boolean; _name: string; _parent: string; - _items: Item[]; + _items: IItem[]; /** Default presets have this property */ _encyclopedia?: string; } diff --git a/types/models/eft/common/ILocation.d.ts b/types/models/eft/common/ILocation.d.ts index b8589c99..15a495c7 100644 --- a/types/models/eft/common/ILocation.d.ts +++ b/types/models/eft/common/ILocation.d.ts @@ -1,7 +1,7 @@ -import { Exit, ILocationBase } from "@spt/models/eft/common/ILocationBase"; -import { ILooseLoot } from "@spt/models/eft/common/ILooseLoot"; +import { IExit, ILocationBase } from "@spt/models/eft/common/ILocationBase"; +import { IGroupPostion, ILooseLoot } from "@spt/models/eft/common/ILooseLoot"; import { Ixyz } from "@spt/models/eft/common/Ixyz"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; export interface ILocation { /** Map meta-data */ base: ILocationBase; @@ -15,7 +15,7 @@ export interface ILocation { /** All possible static containers on map + their assign groupings */ statics: IStaticContainer; /** All possible map extracts */ - allExtracts: Exit[]; + allExtracts: IExit[]; } export interface IStaticContainer { containersGroups: Record; @@ -51,12 +51,12 @@ export interface IStaticPropsBase { Rotation: Ixyz; IsGroupPosition: boolean; IsAlwaysSpawn: boolean; - GroupPositions: any[]; + GroupPositions: IGroupPostion[]; Root: string; - Items: any[]; + Items: IItem[]; } export interface IStaticWeaponProps extends IStaticPropsBase { - Items: Item[]; + Items: IItem[]; } export interface IStaticContainerDetails { staticWeapons: IStaticWeaponProps[]; @@ -76,9 +76,9 @@ export interface IStaticForcedProps { itemTpl: string; } export interface IStaticContainerProps extends IStaticPropsBase { - Items: StaticItem[]; + Items: IStaticItem[]; } -export interface StaticItem { +export interface IStaticItem { _id: string; _tpl: string; } diff --git a/types/models/eft/common/ILocationBase.d.ts b/types/models/eft/common/ILocationBase.d.ts index 817664cc..473648da 100644 --- a/types/models/eft/common/ILocationBase.d.ts +++ b/types/models/eft/common/ILocationBase.d.ts @@ -1,18 +1,20 @@ import { MinMax } from "@spt/models/common/MinMax"; import { Ixyz } from "@spt/models/eft/common/Ixyz"; +import { ISpawnpointTemplate } from "./ILooseLoot"; export interface ILocationBase { AccessKeys: string[]; - AirdropParameters: AirdropParameter[]; + AccessKeysPvE: string[]; + AirdropParameters: IAirdropParameter[]; Area: number; AveragePlayTime: number; AveragePlayerLevel: number; - Banners: Banner[]; - BossLocationSpawn: BossLocationSpawn[]; + Banners: IBanner[]; + BossLocationSpawn: IBossLocationSpawn[]; BotAssault: number; BotEasy: number; BotHard: number; BotImpossible: number; - BotLocationModifier: BotLocationModifier; + BotLocationModifier: IBotLocationModifier; BotMarksman: number; BotMax: number; BotMaxPlayer: number; @@ -41,14 +43,14 @@ export interface ILocationBase { Insurance: boolean; IsSecret: boolean; Locked: boolean; - Loot: any[]; - MatchMakerMinPlayersByWaitTime: MinPlayerWaitTime[]; + Loot: ISpawnpointTemplate[]; + MatchMakerMinPlayersByWaitTime: IMinPlayerWaitTime[]; MaxBotPerZone: number; MaxDistToFreePoint: number; MaxPlayers: number; MinDistToExitPoint: number; MinDistToFreePoint: number; - MinMaxBots: MinMaxBot[]; + MinMaxBots: IMinMaxBot[]; MinPlayers: number; MaxCoopGroup: number; Name: string; @@ -57,7 +59,7 @@ export interface ILocationBase { OcculsionCullingEnabled: boolean; OldSpawn: boolean; OpenZones: string; - Preview: Preview; + Preview: IPreview; PlayersRequestCount: number; RequiredPlayerLevel?: number; RequiredPlayerLevelMin?: number; @@ -67,8 +69,8 @@ export interface ILocationBase { ScavMaxPlayersInGroup: number; Rules: string; SafeLocation: boolean; - Scene: Scene; - SpawnPointParams: SpawnPointParam[]; + Scene: IScene; + SpawnPointParams: ISpawnPointParam[]; UnixDateTime: number; _Id: string; doors: any[]; @@ -79,12 +81,12 @@ export interface ILocationBase { ForceOnlineRaidInPVE: boolean; exit_count: number; exit_time: number; - exits: Exit[]; + exits: IExit[]; filter_ex: string[]; limits: ILimit[]; matching_min_seconds: number; GenerateLocalLootCache: boolean; - maxItemCountInLocation: MaxItemCountInLocation[]; + maxItemCountInLocation: IMaxItemCountInLocation[]; sav_summon_seconds: number; tmp_location_field_remove_me: number; transits: ITransit[]; @@ -92,7 +94,7 @@ export interface ILocationBase { users_spawn_seconds_n: number; users_spawn_seconds_n2: number; users_summon_seconds: number; - waves: Wave[]; + waves: IWave[]; } export interface ITransit { activateAfterSec: string; @@ -113,7 +115,7 @@ export interface INonWaveGroupScenario { export interface ILimit extends MinMax { items: any[]; } -export interface AirdropParameter { +export interface IAirdropParameter { AirdropPointDeactivateDistance: number; MinPlayersCountToSpawnAirdrop: number; PlaneAirdropChance: number; @@ -125,15 +127,15 @@ export interface AirdropParameter { PlaneAirdropStartMin: number; UnsuccessfulTryPenalty: number; } -export interface Banner { +export interface IBanner { id: string; - pic: Pic; + pic: IPic; } -export interface Pic { +export interface IPic { path: string; rcid: string; } -export interface BossLocationSpawn { +export interface IBossLocationSpawn { BossChance: number; BossDifficult: string; BossEscortAmount: string; @@ -151,16 +153,16 @@ export interface BossLocationSpawn { DependKarmaPVE?: boolean; ForceSpawn?: boolean; IgnoreMaxBots?: boolean; - Supports?: BossSupport[]; + Supports?: IBossSupport[]; sptId?: string; spawnMode: string[]; } -export interface BossSupport { +export interface IBossSupport { BossEscortAmount: string; BossEscortDifficult: string[]; BossEscortType: string; } -export interface BotLocationModifier { +export interface IBotLocationModifier { AccuracySpeed: number; AdditionalHostilitySettings: IAdditionalHostilitySettings[]; DistToActivate: number; @@ -195,25 +197,25 @@ export interface IChancedEnemy { EnemyChance: number; Role: string; } -export interface MinMaxBot extends MinMax { +export interface IMinMaxBot extends MinMax { WildSpawnType: WildSpawnType | string; } -export interface MinPlayerWaitTime { +export interface IMinPlayerWaitTime { minPlayers: number; time: number; } -export interface Preview { +export interface IPreview { path: string; rcid: string; } -export interface Scene { +export interface IScene { path: string; rcid: string; } -export interface SpawnPointParam { +export interface ISpawnPointParam { BotZoneName: string; Categories: string[]; - ColliderParams: ColliderParams; + ColliderParams: IColliderParams; CorePointId: number; DelayToCanSpawnSec: number; Id: string; @@ -222,15 +224,15 @@ export interface SpawnPointParam { Rotation: number; Sides: string[]; } -export interface ColliderParams { +export interface IColliderParams { _parent: string; - _props: Props; + _props: IProps; } -export interface Props { +export interface IProps { Center: Ixyz; Radius: number; } -export interface Exit { +export interface IExit { /** % Chance out of 100 exit will appear in raid */ Chance: number; ChancePVE: number; @@ -254,11 +256,11 @@ export interface Exit { RequirementTip: string; Side?: string; } -export interface MaxItemCountInLocation { +export interface IMaxItemCountInLocation { TemplateId: string; Value: number; } -export interface Wave { +export interface IWave { BotPreset: string; BotSide: string; SpawnPoints: string; @@ -276,5 +278,7 @@ export interface Wave { export declare enum WildSpawnType { ASSAULT = "assault", MARKSMAN = "marksman", - PMCBOT = "pmcbot" + PMCBOT = "pmcbot", + BOSSKILLA = "bosskilla", + BOSSKNIGHT = "bossknight" } diff --git a/types/models/eft/common/ILocationsSourceDestinationBase.d.ts b/types/models/eft/common/ILocationsSourceDestinationBase.d.ts index e6bc8ee3..4e455a1a 100644 --- a/types/models/eft/common/ILocationsSourceDestinationBase.d.ts +++ b/types/models/eft/common/ILocationsSourceDestinationBase.d.ts @@ -1,9 +1,9 @@ import { ILocations } from "@spt/models/spt/server/ILocations"; export interface ILocationsGenerateAllResponse { locations: ILocations; - paths: Path[]; + paths: IPath[]; } -export interface Path { +export interface IPath { Source: string; Destination: string; } diff --git a/types/models/eft/common/ILooseLoot.d.ts b/types/models/eft/common/ILooseLoot.d.ts index b5b538c1..392a48cd 100644 --- a/types/models/eft/common/ILooseLoot.d.ts +++ b/types/models/eft/common/ILooseLoot.d.ts @@ -1,20 +1,20 @@ import { Ixyz } from "@spt/models/eft/common/Ixyz"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; export interface ILooseLoot { - spawnpointCount: SpawnpointCount; - spawnpointsForced: SpawnpointsForced[]; - spawnpoints: Spawnpoint[]; + spawnpointCount: ISpawnpointCount; + spawnpointsForced: ISpawnpointsForced[]; + spawnpoints: ISpawnpoint[]; } -export interface SpawnpointCount { +export interface ISpawnpointCount { mean: number; std: number; } -export interface SpawnpointsForced { +export interface ISpawnpointsForced { locationId: string; probability: number; - template: SpawnpointTemplate; + template: ISpawnpointTemplate; } -export interface SpawnpointTemplate { +export interface ISpawnpointTemplate { Id: string; IsContainer: boolean; useGravity: boolean; @@ -23,20 +23,26 @@ export interface SpawnpointTemplate { Rotation: Ixyz; IsAlwaysSpawn: boolean; IsGroupPosition: boolean; - GroupPositions: any[]; + GroupPositions: IGroupPostion[]; Root: string; - Items: Item[]; + Items: IItem[]; } -export interface Spawnpoint { +export interface IGroupPostion { + Name: string; + Weight: number; + Postion: Ixyz; + Rotation: Ixyz; +} +export interface ISpawnpoint { locationId: string; probability: number; - template: SpawnpointTemplate; + template: ISpawnpointTemplate; itemDistribution: ItemDistribution[]; } export interface ItemDistribution { - composedKey: ComposedKey; + composedKey: IComposedKey; relativeProbability: number; } -export interface ComposedKey { +export interface IComposedKey { key: string; } diff --git a/types/models/eft/common/tables/IBotBase.d.ts b/types/models/eft/common/tables/IBotBase.d.ts index 865df315..4def148c 100644 --- a/types/models/eft/common/tables/IBotBase.d.ts +++ b/types/models/eft/common/tables/IBotBase.d.ts @@ -1,4 +1,4 @@ -import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; +import { IItem, IUpd } from "@spt/models/eft/common/tables/IItem"; import { IPmcDataRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; import { BonusSkillType } from "@spt/models/enums/BonusSkillType"; @@ -13,25 +13,25 @@ export interface IBotBase { sessionId: string; savage?: string; karmaValue: number; - Info: Info; - Customization: Customization; - Health: Health; - Inventory: Inventory; - Skills: Skills; - Stats: Stats; + Info: IInfo; + Customization: ICustomization; + Health: IHealth; + Inventory: IInventory; + Skills: ISkills; + Stats: IStats; Encyclopedia: Record; TaskConditionCounters: Record; InsuredItems: IInsuredItem[]; - Hideout: Hideout; + Hideout: IHideout; Quests: IQuestStatus[]; - TradersInfo: Record; + TradersInfo: Record; UnlockedInfo: IUnlockedInfo; - RagfairInfo: RagfairInfo; + RagfairInfo: IRagfairInfo; /** Achievement id and timestamp */ Achievements: Record; RepeatableQuests: IPmcDataRepeatableQuest[]; - Bonuses: Bonus[]; - Notes: Notes; + Bonuses: IBonus[]; + Notes: INotes; CarExtractCounts: Record; CoopExtractCounts: Record; SurvivorClass: SurvivorClass; @@ -57,7 +57,7 @@ export interface ITaskConditionCounter { export interface IUnlockedInfo { unlockedProductionRecipe: string[]; } -export interface Info { +export interface IInfo { EntryPoint: string; Nickname: string; LowerNickname: string; @@ -76,18 +76,18 @@ export interface Info { lockedMoveCommands: boolean; SavageLockTime: number; LastTimePlayedAsSavage: number; - Settings: Settings; + Settings: IBotInfoSettings; NicknameChangeDate: number; NeedWipeOptions: any[]; - lastCompletedWipe: LastCompleted; + lastCompletedWipe: ILastCompleted; Bans: IBan[]; BannedState: boolean; BannedUntil: number; IsStreamerModeAvailable: boolean; - lastCompletedEvent?: LastCompleted; + lastCompletedEvent?: ILastCompleted; isMigratedSkills: boolean; } -export interface Settings { +export interface IBotInfoSettings { Role: string; BotDifficulty: string; Experience: number; @@ -107,43 +107,43 @@ export declare enum BanType { FRIENDS = 5, CHANGE_NICKNAME = 6 } -export interface Customization { +export interface ICustomization { Head: string; Body: string; Feet: string; Hands: string; } -export interface Health { - Hydration: CurrentMax; - Energy: CurrentMax; - Temperature: CurrentMax; - BodyParts: BodyPartsHealth; +export interface IHealth { + Hydration: ICurrentMax; + Energy: ICurrentMax; + Temperature: ICurrentMax; + BodyParts: IBodyPartsHealth; UpdateTime: number; Immortal?: boolean; } -export interface BodyPartsHealth { - Head: BodyPartHealth; - Chest: BodyPartHealth; - Stomach: BodyPartHealth; - LeftArm: BodyPartHealth; - RightArm: BodyPartHealth; - LeftLeg: BodyPartHealth; - RightLeg: BodyPartHealth; +export interface IBodyPartsHealth { + Head: IBodyPartHealth; + Chest: IBodyPartHealth; + Stomach: IBodyPartHealth; + LeftArm: IBodyPartHealth; + RightArm: IBodyPartHealth; + LeftLeg: IBodyPartHealth; + RightLeg: IBodyPartHealth; } -export interface BodyPartHealth { - Health: CurrentMax; - Effects?: Record; +export interface IBodyPartHealth { + Health: ICurrentMax; + Effects?: Record; } -export interface BodyPartEffectProperties { +export interface IBodyPartEffectProperties { ExtraData?: any; Time: number; } -export interface CurrentMax { +export interface ICurrentMax { Current: number; Maximum: number; } -export interface Inventory { - items: Item[]; +export interface IInventory { + items: IItem[]; equipment: string; stash: string; sortingTable: string; @@ -152,16 +152,16 @@ export interface Inventory { /** Key is hideout area enum numeric as string e.g. "24", value is area _id */ hideoutAreaStashes: Record; fastPanel: Record; - favoriteItems: Item[]; + favoriteItems: IItem[]; } export interface IBaseJsonSkills { Common: Record; - Mastering: Record; + Mastering: Record; Points: number; } -export interface Skills { +export interface ISkills { Common: Common[]; - Mastering: Mastering[]; + Mastering: IMastering[]; Points: number; } export interface IBaseSkill { @@ -174,26 +174,26 @@ export interface Common extends IBaseSkill { PointsEarnedDuringSession?: number; LastAccess?: number; } -export interface Mastering extends IBaseSkill { +export interface IMastering extends IBaseSkill { } -export interface Stats { +export interface IStats { Eft?: IEftStats; } export interface IEftStats { CarriedQuestItems: string[]; - Victims: Victim[]; + Victims: IVictim[]; TotalSessionExperience: number; LastSessionDate: number; - SessionCounters: SessionCounters; - OverallCounters: OverallCounters; + SessionCounters: ISessionCounters; + OverallCounters: IOverallCounters; SessionExperienceMult?: number; ExperienceBonusMult?: number; - Aggressor?: Aggressor; + Aggressor?: IAggressor; DroppedItems?: IDroppedItem[]; - FoundInRaidItems?: FoundInRaidItem[]; - DamageHistory?: DamageHistory; - DeathCause?: DeathCause; - LastPlayerState?: LastPlayerState; + FoundInRaidItems?: IFoundInRaidItem[]; + DamageHistory?: IDamageHistory; + DeathCause?: IDeathCause; + LastPlayerState?: ILastPlayerState; TotalInGameTime: number; SurvivorClass?: string; sptLastRaidFenceRepChange?: number; @@ -203,11 +203,11 @@ export interface IDroppedItem { ItemId: string; ZoneId: string; } -export interface FoundInRaidItem { +export interface IFoundInRaidItem { QuestId: string; ItemId: string; } -export interface Victim { +export interface IVictim { AccountId: string; ProfileId: string; Name: string; @@ -219,17 +219,17 @@ export interface Victim { Weapon: string; Role: string; } -export interface SessionCounters { - Items: CounterKeyValue[]; +export interface ISessionCounters { + Items: ICounterKeyValue[]; } -export interface OverallCounters { - Items: CounterKeyValue[]; +export interface IOverallCounters { + Items: ICounterKeyValue[]; } -export interface CounterKeyValue { +export interface ICounterKeyValue { Key: string[]; Value: number; } -export interface Aggressor { +export interface IAggressor { AccountId: string; ProfileId: string; MainProfileNickname: string; @@ -240,12 +240,12 @@ export interface Aggressor { WeaponName: string; Category: string; } -export interface DamageHistory { +export interface IDamageHistory { LethalDamagePart: string; - LethalDamage: LethalDamage; - BodyParts: BodyPartsDamageHistory; + LethalDamage: ILethalDamage; + BodyParts: IBodyPartsDamageHistory; } -export interface LethalDamage { +export interface ILethalDamage { Amount: number; Type: string; SourceId: string; @@ -253,17 +253,17 @@ export interface LethalDamage { Blunt: boolean; ImpactsCount: number; } -export interface BodyPartsDamageHistory { - Head: DamageStats[]; - Chest: DamageStats[]; - Stomach: DamageStats[]; - LeftArm: DamageStats[]; - RightArm: DamageStats[]; - LeftLeg: DamageStats[]; - RightLeg: DamageStats[]; - Common: DamageStats[]; -} -export interface DamageStats { +export interface IBodyPartsDamageHistory { + Head: IDamageStats[]; + Chest: IDamageStats[]; + Stomach: IDamageStats[]; + LeftArm: IDamageStats[]; + RightArm: IDamageStats[]; + LeftLeg: IDamageStats[]; + RightLeg: IDamageStats[]; + Common: IDamageStats[]; +} +export interface IDamageStats { Amount: number; Type: string; SourceId: string; @@ -271,24 +271,24 @@ export interface DamageStats { Blunt: boolean; ImpactsCount: number; } -export interface DeathCause { +export interface IDeathCause { DamageType: string; Side: string; Role: string; WeaponId: string; } -export interface LastPlayerState { - Info: LastPlayerStateInfo; +export interface ILastPlayerState { + Info: ILastPlayerStateInfo; Customization: Record; Equipment: any; } -export interface LastPlayerStateInfo { +export interface ILastPlayerStateInfo { Nickname: string; Side: string; Level: number; MemberCategory: MemberCategory; } -export interface BackendCounter { +export interface IBackendCounter { id: string; qid?: string; value: number; @@ -298,9 +298,9 @@ export interface IInsuredItem { tid: string; itemId: string; } -export interface Hideout { - Production: Record; - Areas: HideoutArea[]; +export interface IHideout { + Production: Record; + Areas: IBotHideoutArea[]; Improvements: Record; HideoutCounters: IHideoutCounters; Seed: number; @@ -317,8 +317,8 @@ export interface IHideoutImprovement { completed: boolean; improveCompleteTimestamp: number; } -export interface Productive { - Products: Product[]; +export interface IProductive { + Products: IProduct[]; /** Seconds passed of production */ Progress?: number; /** Is craft in some state of being worked on by client (crafting/ready to pick up) */ @@ -327,7 +327,7 @@ export interface Productive { SkipTime?: number; /** Seconds needed to fully craft */ ProductionTime?: number; - GivenItemsInStart?: Item[]; + GivenItemsInStart?: IItem[]; Interrupted?: boolean; Code?: string; Decoded?: boolean; @@ -342,23 +342,23 @@ export interface Productive { /** Is the craft a Continuous, e.g bitcoins/water collector */ sptIsContinuous?: boolean; /** Stores a list of tools used in this craft and whether they're FiR, to give back once the craft is done */ - sptRequiredTools?: Item[]; + sptRequiredTools?: IItem[]; sptIsCultistCircle?: boolean; } -export interface Production extends Productive { +export interface IProduction extends IProductive { RecipeId: string; SkipTime: number; ProductionTime: number; } -export interface ScavCase extends Productive { +export interface IScavCase extends IProductive { RecipeId: string; } -export interface Product { +export interface IProduct { _id: string; _tpl: string; - upd?: Upd; + upd?: IUpd; } -export interface HideoutArea { +export interface IBotHideoutArea { type: HideoutAreas; level: number; active: boolean; @@ -366,26 +366,25 @@ export interface HideoutArea { /** Must be integer */ completeTime: number; constructing: boolean; - slots: HideoutSlot[]; + slots: IHideoutSlot[]; lastRecipe: string; } -export interface HideoutSlot { +export interface IHideoutSlot { /** SPT specific value to keep track of what index this slot is (0,1,2,3 etc) */ locationIndex: number; - item?: HideoutItem[]; + item?: IHideoutItem[]; } -export interface HideoutItem { +export interface IHideoutItem { _id: string; _tpl: string; - upd?: Upd; + upd?: IUpd; } -export interface LastCompleted { +export interface ILastCompleted { $oid: string; } -export interface Notes { - Notes: Note[]; +export interface INotes { + Notes: INote[]; } -export type CarExtractCounts = {}; export declare enum SurvivorClass { UNKNOWN = 0, NEUTRALIZER = 1, @@ -402,7 +401,7 @@ export interface IQuestStatus { completedConditions?: string[]; availableAfter?: number; } -export interface TraderInfo { +export interface ITraderInfo { loyaltyLevel?: number; salesSum: number; standing: number; @@ -410,12 +409,12 @@ export interface TraderInfo { unlocked: boolean; disabled: boolean; } -export interface RagfairInfo { +export interface IRagfairInfo { rating: number; isRatingGrowing: boolean; offers: IRagfairOffer[]; } -export interface Bonus { +export interface IBonus { id?: string; type: BonusType; templateId?: string; @@ -427,7 +426,7 @@ export interface Bonus { filter?: string[]; skillType?: BonusSkillType; } -export interface Note { +export interface INote { Time: number; Text: string; } diff --git a/types/models/eft/common/tables/IBotType.d.ts b/types/models/eft/common/tables/IBotType.d.ts index 074a7d6a..6d4b0c72 100644 --- a/types/models/eft/common/tables/IBotType.d.ts +++ b/types/models/eft/common/tables/IBotType.d.ts @@ -1,28 +1,28 @@ import { MinMax } from "@spt/models/common/MinMax"; -import { Skills } from "@spt/models/eft/common/tables/IBotBase"; +import { ISkills } from "@spt/models/eft/common/tables/IBotBase"; export interface IBotType { - appearance: Appearance; - chances: Chances; - difficulty: Difficulties; - experience: Experience; + appearance: IAppearance; + chances: IChances; + difficulty: IDifficulties; + experience: IExperience; firstName: string[]; - generation: Generation; - health: Health; - inventory: Inventory; + generation: IGeneration; + health: IHealth; + inventory: IInventory; lastName: string[]; - skills: Skills; + skills: ISkills; } -export interface Appearance { +export interface IAppearance { body: Record; feet: Record; hands: Record; head: Record; voice: Record; } -export interface Chances { +export interface IChances { equipment: EquipmentChances; - weaponMods: ModsChances; - equipmentMods: ModsChances; + weaponMods: IModsChances; + equipmentMods: IModsChances; } export interface EquipmentChances { ArmBand: number; @@ -40,7 +40,7 @@ export interface EquipmentChances { SecuredContainer: number; TacticalVest: number; } -export interface ModsChances { +export interface IModsChances { mod_charge: number; mod_equipment: number; mod_equipment_000: number; @@ -74,13 +74,13 @@ export interface ModsChances { mod_tactical_003: number; mod_handguard: number; } -export interface Difficulties { - easy: Difficulty; - normal: Difficulty; - hard: Difficulty; - impossible: Difficulty; +export interface IDifficulties { + easy: IDifficultyCategories; + normal: IDifficultyCategories; + hard: IDifficultyCategories; + impossible: IDifficultyCategories; } -export interface Difficulty { +export interface IDifficultyCategories { Aiming: Record; Boss: Record; Change: Record; @@ -96,42 +96,42 @@ export interface Difficulty { Scattering: Record; Shoot: Record; } -export interface Experience { +export interface IExperience { aggressorBonus: number; level: MinMax; reward: MinMax; standingForKill: number; } -export interface Generation { - items: GenerationWeightingItems; -} -export interface GenerationWeightingItems { - grenades: GenerationData; - healing: GenerationData; - drugs: GenerationData; - food: GenerationData; - drink: GenerationData; - currency: GenerationData; - stims: GenerationData; - backpackLoot: GenerationData; - pocketLoot: GenerationData; - vestLoot: GenerationData; - magazines: GenerationData; - specialItems: GenerationData; -} -export interface GenerationData { +export interface IGeneration { + items: IGenerationWeightingItems; +} +export interface IGenerationWeightingItems { + grenades: IGenerationData; + healing: IGenerationData; + drugs: IGenerationData; + food: IGenerationData; + drink: IGenerationData; + currency: IGenerationData; + stims: IGenerationData; + backpackLoot: IGenerationData; + pocketLoot: IGenerationData; + vestLoot: IGenerationData; + magazines: IGenerationData; + specialItems: IGenerationData; +} +export interface IGenerationData { /** key: number of items, value: weighting */ weights: Record; /** Array of item tpls */ whitelist: Record; } -export interface Health { - BodyParts: BodyPart[]; +export interface IHealth { + BodyParts: IBodyPart[]; Energy: MinMax; Hydration: MinMax; Temperature: MinMax; } -export interface BodyPart { +export interface IBodyPart { Chest: MinMax; Head: MinMax; LeftArm: MinMax; @@ -140,13 +140,13 @@ export interface BodyPart { RightLeg: MinMax; Stomach: MinMax; } -export interface Inventory { - equipment: Equipment; - Ammo: Record>; - items: Items; - mods: Mods; +export interface IInventory { + equipment: IEquipment; + Ammo: IAmmo; + items: IItemPools; + mods: IMods; } -export interface Equipment { +export interface IEquipment { ArmBand: Record; ArmorVest: Record; Backpack: Record; @@ -162,11 +162,12 @@ export interface Equipment { SecuredContainer: Record; TacticalVest: Record; } -export interface Items { +export interface IItemPools { Backpack: Record; Pockets: Record; SecuredContainer: Record; SpecialLoot: Record; TacticalVest: Record; } -export type Mods = Record>; +export type IAmmo = Record>; +export type IMods = Record>; diff --git a/types/models/eft/common/tables/ICustomizationItem.d.ts b/types/models/eft/common/tables/ICustomizationItem.d.ts index 3883765b..97dc7081 100644 --- a/types/models/eft/common/tables/ICustomizationItem.d.ts +++ b/types/models/eft/common/tables/ICustomizationItem.d.ts @@ -17,13 +17,13 @@ export interface Props { Body: string; Hands: string; Feet: string; - Prefab: Prefab; - WatchPrefab: Prefab; + Prefab: IPrefab; + WatchPrefab: IPrefab; IntegratedArmorVest: boolean; WatchPosition: Ixyz; WatchRotation: Ixyz; } -export interface Prefab { +export interface IPrefab { path: string; rcid: string; } diff --git a/types/models/eft/common/tables/IItem.d.ts b/types/models/eft/common/tables/IItem.d.ts index 8f60c4fd..8139fa14 100644 --- a/types/models/eft/common/tables/IItem.d.ts +++ b/types/models/eft/common/tables/IItem.d.ts @@ -1,99 +1,107 @@ -export interface Item { +export interface IItem { _id: string; _tpl: string; parentId?: string; slotId?: string; - location?: Location | number; - upd?: Upd; + location?: IItemLocation | number; + upd?: IUpd; } -export interface Upd { - Buff?: Buff; +export interface IItemLocation { + x: number; + y: number; + r: string | number; + isSearched?: boolean; + /** SPT property? */ + rotation?: string | boolean; +} +export interface IUpd { + Buff?: IUpdBuff; OriginalStackObjectsCount?: number; - Togglable?: Togglable; - Map?: Map; - Tag?: Tag; + Togglable?: IUpdTogglable; + Map?: IUpdMap; + Tag?: IUpdTag; /** SPT specific property, not made by BSG */ sptPresetId?: string; - FaceShield?: FaceShield; + FaceShield?: IUpdFaceShield; StackObjectsCount?: number; UnlimitedCount?: boolean; - Repairable?: Repairable; - RecodableComponent?: RecodableComponent; - FireMode?: FireMode; + Repairable?: IUpdRepairable; + RecodableComponent?: IUpdRecodableComponent; + FireMode?: IUpdFireMode; SpawnedInSession?: boolean; - Light?: Light; - Key?: Key; - Resource?: Resource; - Sight?: Sight; - MedKit?: MedKit; - FoodDrink?: FoodDrink; - Dogtag?: Dogtag; + Light?: IUpdLight; + Key?: IUpdKey; + Resource?: IUpdResource; + Sight?: IUpdSight; + MedKit?: IUpdMedKit; + FoodDrink?: IUpdFoodDrink; + Dogtag?: IUpdDogtag; BuyRestrictionMax?: number; BuyRestrictionCurrent?: number; - Foldable?: Foldable; - SideEffect?: SideEffect; - RepairKit?: RepairKit; - CultistAmulet?: ICultistAmulet; + Foldable?: IUpdFoldable; + SideEffect?: IUpdSideEffect; + RepairKit?: IUpdRepairKit; + CultistAmulet?: IUpdCultistAmulet; } -export interface Buff { +export interface IUpdBuff { rarity: string; buffType: string; value: number; thresholdDurability?: number; } -export interface Togglable { +export interface IUpdTogglable { On: boolean; } -export interface Map { - Markers: MapMarker[]; +export interface IUpdMap { + Markers: IMapMarker[]; } -export interface MapMarker { +export interface IMapMarker { X: number; Y: number; } -export interface Tag { +export interface IUpdTag { Color: number; Name: string; } -export interface FaceShield { +export interface IUpdFaceShield { Hits: number; } -export interface Repairable { +export interface IUpdRepairable { Durability: number; MaxDurability: number; } -export interface RecodableComponent { +export interface IUpdRecodableComponent { IsEncoded: boolean; } -export interface MedKit { +export interface IUpdMedKit { HpResource: number; } -export interface Sight { +export interface IUpdSight { ScopesCurrentCalibPointIndexes: number[]; ScopesSelectedModes: number[]; SelectedScope: number; } -export interface Foldable { +export interface IUpdFoldable { Folded: boolean; } -export interface FireMode { +export interface IUpdFireMode { FireMode: string; } -export interface FoodDrink { +export interface IUpdFoodDrink { HpPercent: number; } -export interface Key { +export interface IUpdKey { NumberOfUsages: number; } -export interface Resource { +export interface IUpdResource { Value: number; UnitsConsumed: number; } -export interface Light { +export interface IUpdLight { IsActive: boolean; SelectedMode: number; } -export interface Dogtag { +export interface IUpdDogtag { AccountId: string; ProfileId: string; Nickname: string; @@ -106,20 +114,12 @@ export interface Dogtag { KillerName: string; WeaponName: string; } -export interface Location { - x: number; - y: number; - r: string | number; - isSearched?: boolean; - /** SPT property? */ - rotation?: string | boolean; -} -export interface SideEffect { +export interface IUpdSideEffect { Value: number; } -export interface RepairKit { +export interface IUpdRepairKit { Resource: number; } -export interface ICultistAmulet { +export interface IUpdCultistAmulet { NumberOfUsages: number; } diff --git a/types/models/eft/common/tables/ILocationServices.d.ts b/types/models/eft/common/tables/ILocationServices.d.ts index 46eda77e..399ae7b0 100644 --- a/types/models/eft/common/tables/ILocationServices.d.ts +++ b/types/models/eft/common/tables/ILocationServices.d.ts @@ -4,15 +4,16 @@ export interface ILocationServices { BTRServerSettings: IBtrServerSettings; } export interface ITraderServerSettings { - TraderServices: TraderServices; + TraderServices: ITraderServices; } -export interface TraderServices { +export interface ITraderServices { ExUsecLoyalty: ITraderService; ZryachiyAid: ITraderService; CultistsAid: ITraderService; PlayerTaxi: ITraderService; BtrItemsDelivery: ITraderService; BtrBotCover: ITraderService; + TransitItemsDelivery: ITraderService; } export interface ITraderService { TraderId: string; diff --git a/types/models/eft/common/tables/ILocationsBase.d.ts b/types/models/eft/common/tables/ILocationsBase.d.ts index 16bca247..e7730967 100644 --- a/types/models/eft/common/tables/ILocationsBase.d.ts +++ b/types/models/eft/common/tables/ILocationsBase.d.ts @@ -1,9 +1,9 @@ export interface ILocationsBase { - locations: Locations; - paths: Path[]; + locations: ILocations; + paths: IPath[]; } -export type Locations = {}; -export interface Path { +export type ILocations = {}; +export interface IPath { Source: string; Destination: string; } diff --git a/types/models/eft/common/tables/IMatch.d.ts b/types/models/eft/common/tables/IMatch.d.ts index 042f5bbc..5d18f57a 100644 --- a/types/models/eft/common/tables/IMatch.d.ts +++ b/types/models/eft/common/tables/IMatch.d.ts @@ -1,7 +1,7 @@ export interface IMatch { - metrics: Metrics; + metrics: IMetrics; } -export interface Metrics { +export interface IMetrics { Keys: number[]; NetProcessingBins: number[]; RenderBins: number[]; diff --git a/types/models/eft/common/tables/IQuest.d.ts b/types/models/eft/common/tables/IQuest.d.ts index 25a5f637..543a2a9b 100644 --- a/types/models/eft/common/tables/IQuest.d.ts +++ b/types/models/eft/common/tables/IQuest.d.ts @@ -1,4 +1,4 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { QuestRewardType } from "@spt/models/enums/QuestRewardType"; import { QuestStatus } from "@spt/models/enums/QuestStatus"; import { QuestTypeEnum } from "@spt/models/enums/QuestTypeEnum"; @@ -50,7 +50,7 @@ export interface IQuestCondition { index?: number; compareMethod?: string; dynamicLocale: boolean; - visibilityConditions?: VisibilityCondition[]; + visibilityConditions?: IVisibilityCondition[]; globalQuestCounterId?: string; parentId?: string; target: string[] | string; @@ -65,6 +65,7 @@ export interface IQuestCondition { isNecessary?: boolean; doNotResetIfCounterCompleted?: boolean; dogtagLevel?: number; + traderId?: string; maxDurability?: number; minDurability?: number; counter?: IQuestConditionCounter; @@ -122,7 +123,7 @@ export interface IDaytimeCounter { from: number; to: number; } -export interface VisibilityCondition { +export interface IVisibilityCondition { id: string; target: string; value?: number; @@ -145,7 +146,7 @@ export interface IQuestReward { type: QuestRewardType; index: number; target?: string; - items?: Item[]; + items?: IItem[]; loyaltyLevel?: number; /** Hideout area id */ traderId?: string; diff --git a/types/models/eft/common/tables/IRepeatableQuests.d.ts b/types/models/eft/common/tables/IRepeatableQuests.d.ts index 0753cff9..37e582a6 100644 --- a/types/models/eft/common/tables/IRepeatableQuests.d.ts +++ b/types/models/eft/common/tables/IRepeatableQuests.d.ts @@ -41,14 +41,14 @@ export interface IOptions { Completion: ICompletionFilter; } export interface ICompletionFilter { - itemsBlacklist: ItemsBlacklist[]; - itemsWhitelist: ItemsWhitelist[]; + itemsBlacklist: IItemsBlacklist[]; + itemsWhitelist: IItemsWhitelist[]; } -export interface ItemsBlacklist { +export interface IItemsBlacklist { minPlayerLevel: number; itemIds: string[]; } -export interface ItemsWhitelist { +export interface IItemsWhitelist { minPlayerLevel: number; itemIds: string[]; } diff --git a/types/models/eft/common/tables/ITemplateItem.d.ts b/types/models/eft/common/tables/ITemplateItem.d.ts index 0c15364e..145e013f 100644 --- a/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/types/models/eft/common/tables/ITemplateItem.d.ts @@ -25,8 +25,9 @@ export interface Props { SpawnChance?: number; CreditsPrice?: number; ItemSound?: string; - Prefab?: Prefab; - UsePrefab?: Prefab; + Prefab?: IPrefab; + UsePrefab?: IPrefab; + airDropTemplateId?: string; StackObjectsCount?: number; NotShownInSlot?: boolean; ExaminedByDefault?: boolean; @@ -51,6 +52,7 @@ export interface Props { ExtraSizeLeft?: number; ExtraSizeRight?: number; ExtraSizeUp?: number; + FlareTypes?: string[]; ExtraSizeDown?: number; ExtraSizeForceAdd?: boolean; MergesWithChildren?: boolean; @@ -70,8 +72,8 @@ export interface Props { MaxResource?: number; Resource?: number; DogTagQualities?: boolean; - Grids?: Grid[]; - Slots?: Slot[]; + Grids?: IGrid[]; + Slots?: ISlot[]; CanPutIntoDuringTheRaid?: boolean; CantRemoveFromSlotsDuringRaid?: string[]; KeyIds?: string[]; @@ -138,7 +140,7 @@ export interface Props { PixelationBlockCount?: number; ShiftsAimCamera?: number; magAnimationIndex?: number; - Cartridges?: Slot[]; + Cartridges?: ISlot[]; CanFast?: boolean; CanHit?: boolean; CanAdmin?: boolean; @@ -216,7 +218,7 @@ export interface Props { defAmmo?: string; AdjustCollimatorsToTrajectory?: boolean; shotgunDispersion?: number; - Chambers?: Slot[]; + Chambers?: ISlot[]; CameraSnap?: number; CameraToWeaponAngleSpeedRange?: Ixyz; CameraToWeaponAngleStep?: number; @@ -401,7 +403,7 @@ export interface Props { LightAndSoundShotSelfContusionStrength?: number; MalfMisfireChance?: number; MalfFeedChance?: number; - StackSlots?: StackSlot[]; + StackSlots?: IStackSlot[]; type?: string; eqMin?: number; eqMax?: number; @@ -427,7 +429,7 @@ export interface Props { RepairStrategyTypes?: string[]; IsEncoded?: boolean; LayoutName?: string; - Lower75Prefab?: Prefab; + Lower75Prefab?: IPrefab; MaxUsages?: number; ScavKillExpPenalty?: number; ScavKillExpPenaltyPVE?: number; @@ -440,19 +442,19 @@ export interface IHealthEffect { type: string; value: number; } -export interface Prefab { +export interface IPrefab { path: string; rcid: string; } -export interface Grid { +export interface IGrid { _name: string; _id: string; _parent: string; - _props: GridProps; + _props: IGridProps; _proto: string; } -export interface GridProps { - filters: GridFilter[]; +export interface IGridProps { + filters: IGridFilter[]; cellsH: number; cellsV: number; minCount: number; @@ -460,26 +462,26 @@ export interface GridProps { maxWeight: number; isSortingTable: boolean; } -export interface GridFilter { +export interface IGridFilter { Filter: string[]; ExcludedFilter: string[]; locked?: boolean; } -export interface Slot { +export interface ISlot { _name: string; _id: string; _parent: string; - _props: SlotProps; + _props: ISlotProps; _max_count?: number; _required?: boolean; _mergeSlotWithChildren?: boolean; _proto: string; } -export interface SlotProps { - filters: SlotFilter[]; +export interface ISlotProps { + filters: ISlotFilter[]; MaxStackCount?: number; } -export interface SlotFilter { +export interface ISlotFilter { Shift?: number; locked?: boolean; Plate?: string; @@ -488,17 +490,17 @@ export interface SlotFilter { Filter: string[]; AnimationIndex?: number; } -export interface StackSlot { +export interface IStackSlot { _name?: string; _id: string; _parent: string; _max_count: number; - _props: StackSlotProps; + _props: IStackSlotProps; _proto: string; upd?: any; } -export interface StackSlotProps { - filters: SlotFilter[]; +export interface IStackSlotProps { + filters: ISlotFilter[]; } export interface IRandomLootSettings { allowToSpawnIdenticalItems: boolean; @@ -515,14 +517,14 @@ export interface IRandomLootExcluded { rarity: string[]; templates: any[]; } -export interface EffectsHealth { - Energy: EffectsHealthProps; - Hydration: EffectsHealthProps; +export interface IEffectsHealth { + Energy: IEffectsHealthProps; + Hydration: IEffectsHealthProps; } -export interface EffectsHealthProps { +export interface IEffectsHealthProps { value: number; } -export interface EffectsDamage { +export interface IEffectsDamage { Pain: IEffectDamageProps; LightBleeding: IEffectDamageProps; HeavyBleeding: IEffectDamageProps; diff --git a/types/models/eft/common/tables/ITrader.d.ts b/types/models/eft/common/tables/ITrader.d.ts index 9347fee0..9e161c8a 100644 --- a/types/models/eft/common/tables/ITrader.d.ts +++ b/types/models/eft/common/tables/ITrader.d.ts @@ -1,4 +1,4 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { DogtagExchangeSide } from "@spt/models/enums/DogtagExchangeSide"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; export interface ITrader { @@ -74,7 +74,7 @@ export interface ITraderRepair { } export interface ITraderAssort { nextResupply: number; - items: Item[]; + items: IItem[]; barter_scheme: Record; loyal_level_items: Record; } diff --git a/types/models/eft/game/IGameConfigResponse.d.ts b/types/models/eft/game/IGameConfigResponse.d.ts index 2bff352d..c44867e5 100644 --- a/types/models/eft/game/IGameConfigResponse.d.ts +++ b/types/models/eft/game/IGameConfigResponse.d.ts @@ -5,7 +5,7 @@ export interface IGameConfigResponse { ndaFree: boolean; taxonomy: number; activeProfileId: string; - backend: Backend; + backend: IBackend; useProtobuf: boolean; utc_time: number; /** Total in game time */ @@ -13,7 +13,7 @@ export interface IGameConfigResponse { reportAvailable: boolean; twitchEventMember: boolean; } -export interface Backend { +export interface IBackend { Lobby: string; Trading: string; Messaging: string; diff --git a/types/models/eft/health/IHealthTreatmentRequestData.d.ts b/types/models/eft/health/IHealthTreatmentRequestData.d.ts index 598e60c6..e544bf9f 100644 --- a/types/models/eft/health/IHealthTreatmentRequestData.d.ts +++ b/types/models/eft/health/IHealthTreatmentRequestData.d.ts @@ -1,31 +1,31 @@ export interface IHealthTreatmentRequestData { Action: "RestoreHealth"; trader: string; - items: Cost[]; - difference: Difference; + items: IItemCost[]; + difference: IDifference; timestamp: number; } -export interface Cost { +export interface IItemCost { /** Id of stack to take money from */ id: string; /** Amount of money to take off player for treatment */ count: number; } -export interface Difference { - BodyParts: BodyParts; +export interface IDifference { + BodyParts: IBodyParts; Energy: number; Hydration: number; } -export interface BodyParts { - Head: BodyPart; - Chest: BodyPart; - Stomach: BodyPart; - LeftArm: BodyPart; - RightArm: BodyPart; - LeftLeg: BodyPart; - RightLeg: BodyPart; +export interface IBodyParts { + Head: IBodyPart; + Chest: IBodyPart; + Stomach: IBodyPart; + LeftArm: IBodyPart; + RightArm: IBodyPart; + LeftLeg: IBodyPart; + RightLeg: IBodyPart; } -export interface BodyPart { +export interface IBodyPart { Health: number; /** Effects in array are to be removed */ Effects: string[]; diff --git a/types/models/eft/health/ISyncHealthRequestData.d.ts b/types/models/eft/health/ISyncHealthRequestData.d.ts index 20e32f6d..7c7d05ca 100644 --- a/types/models/eft/health/ISyncHealthRequestData.d.ts +++ b/types/models/eft/health/ISyncHealthRequestData.d.ts @@ -1,20 +1,20 @@ export interface ISyncHealthRequestData { - Health: Health; + Health: IBodyPartCollection; IsAlive: boolean; Hydration?: number; Energy?: number; Temperature?: number; } -export interface Health { - Head?: BodyPartHealth; - Chest?: BodyPartHealth; - Stomach?: BodyPartHealth; - LeftArm?: BodyPartHealth; - RightArm?: BodyPartHealth; - LeftLeg?: BodyPartHealth; - RightLeg?: BodyPartHealth; +export interface IBodyPartCollection { + Head?: IBodyPartHealth; + Chest?: IBodyPartHealth; + Stomach?: IBodyPartHealth; + LeftArm?: IBodyPartHealth; + RightArm?: IBodyPartHealth; + LeftLeg?: IBodyPartHealth; + RightLeg?: IBodyPartHealth; } -export interface BodyPartHealth { +export interface IBodyPartHealth { Maximum: number; Current: number; Effects: Record; diff --git a/types/models/eft/hideout/IHideoutSettingsBase.d.ts b/types/models/eft/hideout/IHideoutSettingsBase.d.ts index 8e459391..513d3c71 100644 --- a/types/models/eft/hideout/IHideoutSettingsBase.d.ts +++ b/types/models/eft/hideout/IHideoutSettingsBase.d.ts @@ -2,5 +2,6 @@ export interface IHideoutSettingsBase { generatorSpeedWithoutFuel: number; generatorFuelFlowRate: number; airFilterUnitFlowRate: number; + cultistAmuletBonusPercent: number; gpuBoostRate: number; } diff --git a/types/models/eft/hideout/IHideoutSingleProductionStartRequestData.d.ts b/types/models/eft/hideout/IHideoutSingleProductionStartRequestData.d.ts index dfb92e25..1c97b221 100644 --- a/types/models/eft/hideout/IHideoutSingleProductionStartRequestData.d.ts +++ b/types/models/eft/hideout/IHideoutSingleProductionStartRequestData.d.ts @@ -1,11 +1,11 @@ export interface IHideoutSingleProductionStartRequestData { Action: "HideoutSingleProductionStart"; recipeId: string; - items: Item[]; - tools: Item[]; + items: IHandoverItem[]; + tools: IHandoverItem[]; timestamp: number; } -export interface Item { +export interface IHandoverItem { id: string; count: number; } diff --git a/types/models/eft/inRaid/IItemDeliveryRequestData.d.ts b/types/models/eft/inRaid/IItemDeliveryRequestData.d.ts index a27bfbbb..7e0fe983 100644 --- a/types/models/eft/inRaid/IItemDeliveryRequestData.d.ts +++ b/types/models/eft/inRaid/IItemDeliveryRequestData.d.ts @@ -1,5 +1,5 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; export interface IItemDeliveryRequestData { - items: Item[]; + items: IItem[]; traderId: string; } diff --git a/types/models/eft/inventory/IAddItemDirectRequest.d.ts b/types/models/eft/inventory/IAddItemDirectRequest.d.ts index 16169015..7f58d002 100644 --- a/types/models/eft/inventory/IAddItemDirectRequest.d.ts +++ b/types/models/eft/inventory/IAddItemDirectRequest.d.ts @@ -1,7 +1,7 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; export interface IAddItemDirectRequest { /** Item and child mods to add to player inventory */ - itemWithModsToAdd: Item[]; + itemWithModsToAdd: IItem[]; foundInRaid: boolean; callback: (buyCount: number) => void; useSortingTable: boolean; diff --git a/types/models/eft/inventory/IAddItemRequestData.d.ts b/types/models/eft/inventory/IAddItemRequestData.d.ts index 3fa86dcc..70241bcd 100644 --- a/types/models/eft/inventory/IAddItemRequestData.d.ts +++ b/types/models/eft/inventory/IAddItemRequestData.d.ts @@ -1,9 +1,9 @@ export interface IAddItemRequestData { /** Trader id */ tid: string; - items: AddItem[]; + items: IItemToAdd[]; } -export interface AddItem { +export interface IItemToAdd { count: number; sptIsPreset?: boolean; item_id: string; diff --git a/types/models/eft/inventory/IAddItemTempObject.d.ts b/types/models/eft/inventory/IAddItemTempObject.d.ts index 7b3a6ea3..a822d56a 100644 --- a/types/models/eft/inventory/IAddItemTempObject.d.ts +++ b/types/models/eft/inventory/IAddItemTempObject.d.ts @@ -1,8 +1,8 @@ -import { Item, Location } from "@spt/models/eft/common/tables/IItem"; +import { IItem, IItemLocation } from "@spt/models/eft/common/tables/IItem"; export interface IAddItemTempObject { - itemRef: Item; + itemRef: IItem; count: number; isPreset: boolean; - location?: Location; + location?: IItemLocation; containerId?: string; } diff --git a/types/models/eft/inventory/IAddItemsDirectRequest.d.ts b/types/models/eft/inventory/IAddItemsDirectRequest.d.ts index 386359ee..a7444872 100644 --- a/types/models/eft/inventory/IAddItemsDirectRequest.d.ts +++ b/types/models/eft/inventory/IAddItemsDirectRequest.d.ts @@ -1,7 +1,7 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; export interface IAddItemsDirectRequest { /** Item and child mods to add to player inventory */ - itemsWithModsToAdd: Item[][]; + itemsWithModsToAdd: IItem[][]; foundInRaid: boolean; /** Runs after EACH item with children is added */ callback?: (buyCount: number) => void; diff --git a/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts b/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts index cc7269cf..b133bff8 100644 --- a/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts +++ b/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts @@ -1,19 +1,13 @@ import { IBaseInteractionRequestData } from "@spt/models/eft/common/request/IBaseInteractionRequestData"; +import { IItemLocation } from "@spt/models/eft/common/tables/IItem"; export interface IInventoryBaseActionRequestData extends IBaseInteractionRequestData { } export interface To { id: string; container: string; - location?: ToLocation | number; + location?: IItemLocation | number; isSearched?: boolean; } -export interface ToLocation { - x: number; - y: number; - r: string; - rotation?: string; - isSearched: boolean; -} export interface Container { id: string; container: string; diff --git a/types/models/eft/inventory/IInventorySortRequestData.d.ts b/types/models/eft/inventory/IInventorySortRequestData.d.ts index d784c776..10ee2715 100644 --- a/types/models/eft/inventory/IInventorySortRequestData.d.ts +++ b/types/models/eft/inventory/IInventorySortRequestData.d.ts @@ -1,20 +1,6 @@ -import { Upd } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IInventoryBaseActionRequestData } from "@spt/models/eft/inventory/IInventoryBaseActionRequestData"; export interface IInventorySortRequestData extends IInventoryBaseActionRequestData { Action: "ApplyInventoryChanges"; - changedItems: ChangedItem[]; -} -export interface ChangedItem { - _id: string; - _tpl: string; - parentId: string; - slotId: string; - location: Location; - upd: Upd; -} -export interface Location { - x: number; - y: number; - r: string; - isSearched: boolean; + changedItems: IItem[]; } diff --git a/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index 9abe2b51..9d8a7407 100644 --- a/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -1,5 +1,5 @@ -import { Health, IQuestStatus, Productive, Skills } from "@spt/models/eft/common/tables/IBotBase"; -import { Item, Upd } from "@spt/models/eft/common/tables/IItem"; +import { IHealth, IHideoutImprovement, IMoneyTransferLimits, IProductive, IQuestStatus, ISkills } from "@spt/models/eft/common/tables/IBotBase"; +import { IItem, IItemLocation, IUpd } from "@spt/models/eft/common/tables/IItem"; import { IQuest } from "@spt/models/eft/common/tables/IQuest"; import { IPmcDataRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; @@ -8,27 +8,28 @@ export interface IItemEventRouterBase { warnings: Warning[]; profileChanges: TProfileChanges | ""; } -export type TProfileChanges = Record; +export type TProfileChanges = Record; export interface Warning { index: number; errmsg: string; code?: string; data?: any; } -export interface ProfileChange { +export interface IProfileChange { _id: string; experience: number; quests: IQuest[]; ragFairOffers: IRagfairOffer[]; weaponBuilds: IWeaponBuildChange[]; equipmentBuilds: IEquipmentBuildChange[]; - items: ItemChanges; - production: Record; + items: IItemChanges; + production: Record; /** Hideout area improvement id */ - improvements: Record; - skills: Skills; - health: Health; + improvements: Record; + skills: ISkills; + health: IHealth; traderRelations: Record; + moneyTransferLimitData: IMoneyTransferLimits; repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; changedHideoutStashes?: Record; @@ -42,25 +43,21 @@ export interface IWeaponBuildChange { id: string; name: string; root: string; - items: Item[]; + items: IItem[]; } export interface IEquipmentBuildChange { id: string; name: string; root: string; - items: Item[]; + items: IItem[]; type: string; fastpanel: any[]; buildType: EquipmentBuildType; } -export interface ItemChanges { - new: Product[]; - change: Product[]; - del: Product[]; -} -export interface Improvement { - completed: boolean; - improveCompleteTimestamp: number; +export interface IItemChanges { + new: IProduct[]; + change: IProduct[]; + del: IProduct[]; } /** Related to TraderInfo */ export interface TraderData { @@ -70,17 +67,11 @@ export interface TraderData { unlocked: boolean; disabled: boolean; } -export interface Product { +export interface IProduct { _id: string; _tpl?: string; parentId?: string; slotId?: string; - location?: ItemChangeLocation; - upd?: Upd; -} -export interface ItemChangeLocation { - x: number; - y: number; - r: number; - isSearched?: boolean; + location?: IItemLocation; + upd?: IUpd; } diff --git a/types/models/eft/location/IGetAirdropLootResponse.d.ts b/types/models/eft/location/IGetAirdropLootResponse.d.ts index 034c95f2..93950db1 100644 --- a/types/models/eft/location/IGetAirdropLootResponse.d.ts +++ b/types/models/eft/location/IGetAirdropLootResponse.d.ts @@ -1,6 +1,6 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { AirdropTypeEnum } from "@spt/models/enums/AirdropType"; export interface IGetAirdropLootResponse { icon: AirdropTypeEnum; - container: Item[]; + container: IItem[]; } diff --git a/types/models/eft/match/IEndLocalRaidRequestData.d.ts b/types/models/eft/match/IEndLocalRaidRequestData.d.ts index 6818f2ba..7f37b20f 100644 --- a/types/models/eft/match/IEndLocalRaidRequestData.d.ts +++ b/types/models/eft/match/IEndLocalRaidRequestData.d.ts @@ -1,14 +1,15 @@ import { ExitStatus } from "@spt/models/enums/ExitStatis"; import { IPmcData } from "../common/IPmcData"; -import { Item } from "../common/tables/IItem"; +import { IItem } from "../common/tables/IItem"; export interface IEndLocalRaidRequestData { /** ID of server player just left */ serverId: string; results: IEndRaidResult; /** Insured items left in raid by player */ - lostInsuredItems: Item[]; + lostInsuredItems: IItem[]; /** Items sent via traders to player, keyed to service e.g. BTRTransferStash */ - transferItems: Record; + transferItems: Record; + locationTransit: ILocationTransit; } export interface IEndRaidResult { profile: IPmcData; @@ -21,3 +22,19 @@ export interface IEndRaidResult { favorite: boolean; playTime: number; } +export interface ILocationTransit { + hash: string; + playersCount: number; + ip: string; + location: string; + profiles: Record; + transitionRaidId: string; + raidMode: string; + side: string; + dayTime: string; +} +export interface ITransitProfile { + _id: string; + keyId: string; + isSolo: boolean; +} diff --git a/types/models/eft/match/IGetRaidConfigurationRequestData.d.ts b/types/models/eft/match/IGetRaidConfigurationRequestData.d.ts index 959986c1..ad65e88f 100644 --- a/types/models/eft/match/IGetRaidConfigurationRequestData.d.ts +++ b/types/models/eft/match/IGetRaidConfigurationRequestData.d.ts @@ -1,6 +1,5 @@ import { IRaidSettings } from "@spt/models/eft/match/IRaidSettings"; export interface IGetRaidConfigurationRequestData extends IRaidSettings { keyId: string; - CanShowGroupPreview: boolean; MaxGroupCount: number; } diff --git a/types/models/eft/match/IGroupCharacter.d.ts b/types/models/eft/match/IGroupCharacter.d.ts index 013930a1..dbb8c876 100644 --- a/types/models/eft/match/IGroupCharacter.d.ts +++ b/types/models/eft/match/IGroupCharacter.d.ts @@ -1,4 +1,4 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { MemberCategory } from "@spt/models/enums/MemberCategory"; export interface IGroupCharacter { _id: string; @@ -29,7 +29,7 @@ export interface IGroupCharacter { }; Equipment: { Id: string; - Items: Item[]; + Items: IItem[]; }; }; isLeader: boolean; diff --git a/types/models/eft/match/IStartLocalRaidRequestData.d.ts b/types/models/eft/match/IStartLocalRaidRequestData.d.ts index 5483297f..d3b1debc 100644 --- a/types/models/eft/match/IStartLocalRaidRequestData.d.ts +++ b/types/models/eft/match/IStartLocalRaidRequestData.d.ts @@ -4,4 +4,12 @@ export interface IStartLocalRaidRequestData { timeVariant: string; mode: string; playerSide: string; + isLocationTransition: boolean; + transition: IStartLocalRaidTransition; +} +export interface IStartLocalRaidTransition { + isLocationTransition: boolean; + transitionRaidId: string; + transitionCount: number; + visitedLocations: string[]; } diff --git a/types/models/eft/match/IStartLocalRaidResponseData.d.ts b/types/models/eft/match/IStartLocalRaidResponseData.d.ts index 62a2aa88..50b35842 100644 --- a/types/models/eft/match/IStartLocalRaidResponseData.d.ts +++ b/types/models/eft/match/IStartLocalRaidResponseData.d.ts @@ -6,7 +6,14 @@ export interface IStartLocalRaidResponseData { serverSettings: ILocationServices; profile: IProfileInsuredItems; locationLoot: ILocationBase; + transition: ITransition; } export interface IProfileInsuredItems { insuredItems: IInsuredItem[]; } +export interface ITransition { + isLocationTransition: boolean; + transitionRaidId: string; + transitionCount: number; + visitedLocations: string[]; +} diff --git a/types/models/eft/player/IPlayerIncrementSkillLevelRequestData.d.ts b/types/models/eft/player/IPlayerIncrementSkillLevelRequestData.d.ts index 59713722..b59fe107 100644 --- a/types/models/eft/player/IPlayerIncrementSkillLevelRequestData.d.ts +++ b/types/models/eft/player/IPlayerIncrementSkillLevelRequestData.d.ts @@ -1,4 +1,4 @@ -import { Skills } from "@spt/models/eft/common/tables/IBotBase"; +import { ISkills } from "@spt/models/eft/common/tables/IBotBase"; export interface IPlayerIncrementSkillLevelRequestData { _id: string; experience: number; @@ -7,7 +7,7 @@ export interface IPlayerIncrementSkillLevelRequestData { builds: any[]; items: Items; production: Production; - skills: Skills; + skills: ISkills; traderRelations: TraderRelations; } export interface Items { diff --git a/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts b/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts index 3cb85339..9852ccbc 100644 --- a/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts +++ b/types/models/eft/presetBuild/IPresetBuildActionRequestData.d.ts @@ -1,9 +1,9 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; export interface IPresetBuildActionRequestData { Action: string; Id: string; /** name of preset given by player */ Name: string; Root: string; - Items: Item[]; + Items: IItem[]; } diff --git a/types/models/eft/profile/GetProfileStatusResponseData.d.ts b/types/models/eft/profile/GetProfileStatusResponseData.d.ts index 1228c2e2..2f3a6a86 100644 --- a/types/models/eft/profile/GetProfileStatusResponseData.d.ts +++ b/types/models/eft/profile/GetProfileStatusResponseData.d.ts @@ -1,8 +1,8 @@ -export interface GetProfileStatusResponseData { +export interface IGetProfileStatusResponseData { maxPveCountExceeded: false; - profiles: ProfileData[]; + profiles: IProfileStatusData[]; } -export interface ProfileData { +export interface IProfileStatusData { profileid: string; profileToken: string; status: string; diff --git a/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/types/models/eft/profile/IGetOtherProfileResponse.d.ts index f9a82f11..0b4683a1 100644 --- a/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -1,14 +1,14 @@ -import { OverallCounters, Skills } from "@spt/models/eft/common/tables/IBotBase"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IOverallCounters, ISkills } from "@spt/models/eft/common/tables/IBotBase"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; export interface IGetOtherProfileResponse { id: string; aid: number; info: IOtherProfileInfo; customization: IOtherProfileCustomization; - skills: Skills; + skills: ISkills; equipment: IOtherProfileEquipment; achievements: Record; - favoriteItems: Item[]; + favoriteItems: IItem[]; pmcStats: IOtherProfileStats; scavStats: IOtherProfileStats; } @@ -29,12 +29,12 @@ export interface IOtherProfileCustomization { } export interface IOtherProfileEquipment { Id: string; - Items: Item[]; + Items: IItem[]; } export interface IOtherProfileStats { eft: IOtherProfileSubStats; } export interface IOtherProfileSubStats { totalInGameTime: number; - overAllCounters: OverallCounters; + overAllCounters: IOverallCounters; } diff --git a/types/models/eft/profile/ISptProfile.d.ts b/types/models/eft/profile/ISptProfile.d.ts index bac97889..cc3be39e 100644 --- a/types/models/eft/profile/ISptProfile.d.ts +++ b/types/models/eft/profile/ISptProfile.d.ts @@ -1,5 +1,5 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { EquipmentBuildType } from "@spt/models/enums/EquipmentBuildType"; import { MemberCategory } from "@spt/models/enums/MemberCategory"; import { MessageType } from "@spt/models/enums/MessageType"; @@ -50,11 +50,11 @@ export interface IUserBuild { } export interface IWeaponBuild extends IUserBuild { Root: string; - Items: Item[]; + Items: IItem[]; } export interface IEquipmentBuild extends IUserBuild { Root: string; - Items: Item[]; + Items: IItem[]; BuildType: EquipmentBuildType; } export interface IMagazineBuild extends IUserBuild { @@ -69,7 +69,7 @@ export interface IMagazineTemplateAmmoItem { } /** Used by defaultEquipmentPresets.json */ export interface IDefaultEquipmentPreset extends IUserBuild { - Items: Item[]; + Items: IItem[]; Root: string; BuildType: EquipmentBuildType; type: string; @@ -138,7 +138,7 @@ export interface MessagePreview { } export interface MessageItems { stash?: string; - data?: Item[]; + data?: IItem[]; } export interface ISystemData { date?: string; @@ -171,6 +171,8 @@ export interface Spt { blacklistedItemTpls?: string[]; /** key: daily type */ freeRepeatableRefreshUsedCount?: Record; + /** When was a profile migrated, value is timestamp */ + migrations?: Record; } export interface ModDetails { name: string; @@ -235,7 +237,7 @@ export interface Insurance { systemData: ISystemData; messageType: MessageType; messageTemplateId: string; - items: Item[]; + items: IItem[]; } export interface MessageContentRagfair { offerId: string; diff --git a/types/models/eft/quests/IHandoverQuestRequestData.d.ts b/types/models/eft/quests/IHandoverQuestRequestData.d.ts index 63f10a8b..39604d5e 100644 --- a/types/models/eft/quests/IHandoverQuestRequestData.d.ts +++ b/types/models/eft/quests/IHandoverQuestRequestData.d.ts @@ -2,9 +2,9 @@ export interface IHandoverQuestRequestData { Action: "QuestHandover"; qid: string; conditionId: string; - items: Item[]; + items: IHandoverItem[]; } -export interface Item { +export interface IHandoverItem { id: string; count: number; } diff --git a/types/models/eft/ragfair/IRagfairOffer.d.ts b/types/models/eft/ragfair/IRagfairOffer.d.ts index f6c07fcd..b6b1ed88 100644 --- a/types/models/eft/ragfair/IRagfairOffer.d.ts +++ b/types/models/eft/ragfair/IRagfairOffer.d.ts @@ -1,10 +1,10 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { DogtagExchangeSide } from "@spt/models/enums/DogtagExchangeSide"; import { MemberCategory } from "@spt/models/enums/MemberCategory"; export interface IRagfairOffer { - sellResult?: SellResult[]; + sellResult?: ISellResult[]; _id: string; - items: Item[]; + items: IItem[]; requirements: OfferRequirement[]; root: string; intId: number; @@ -42,7 +42,7 @@ export interface IRagfairOfferUser { isRatingGrowing?: boolean; aid?: number; } -export interface SellResult { +export interface ISellResult { sellTime: number; amount: number; } diff --git a/types/models/eft/trade/IProcessBuyTradeRequestData.d.ts b/types/models/eft/trade/IProcessBuyTradeRequestData.d.ts index d64b2c92..d72a1316 100644 --- a/types/models/eft/trade/IProcessBuyTradeRequestData.d.ts +++ b/types/models/eft/trade/IProcessBuyTradeRequestData.d.ts @@ -6,9 +6,9 @@ export interface IProcessBuyTradeRequestData extends IProcessBaseTradeRequestDat item_id: string; count: number; scheme_id: number; - scheme_items: SchemeItem[]; + scheme_items: ISchemeItem[]; } -export interface SchemeItem { +export interface ISchemeItem { /** Id of stack to take money from, is money tpl when Action is `SptInsure` */ id: string; count: number; diff --git a/types/models/eft/trade/IProcessSellTradeRequestData.d.ts b/types/models/eft/trade/IProcessSellTradeRequestData.d.ts index 459bd288..b345c3e4 100644 --- a/types/models/eft/trade/IProcessSellTradeRequestData.d.ts +++ b/types/models/eft/trade/IProcessSellTradeRequestData.d.ts @@ -4,9 +4,9 @@ export interface IProcessSellTradeRequestData extends IProcessBaseTradeRequestDa type: string; tid: string; price: number; - items: Item[]; + items: ISoldItem[]; } -export interface Item { +export interface ISoldItem { id: string; count: number; scheme_id: number; diff --git a/types/models/enums/AirdropType.d.ts b/types/models/enums/AirdropType.d.ts index f090a30e..2c21ead0 100644 --- a/types/models/enums/AirdropType.d.ts +++ b/types/models/enums/AirdropType.d.ts @@ -1,6 +1,6 @@ export declare enum AirdropTypeEnum { - COMMON = "common", - SUPPLY = "supply", - MEDICAL = "medical", - WEAPON = "weapon" + COMMON = "mixed", + SUPPLY = "barter", + FOOD_MEDICAL = "foodMedical", + WEAPON_ARMOR = "weaponArmor" } diff --git a/types/models/enums/WildSpawnTypeNumber.d.ts b/types/models/enums/WildSpawnTypeNumber.d.ts index dddbda59..407fcb00 100644 --- a/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/types/models/enums/WildSpawnTypeNumber.d.ts @@ -52,6 +52,9 @@ export declare enum WildSpawnTypeNumber { PMCBEAR = 51, PMCUSEC = 52, SKIER = 53, + SECTANTPREDVESTNIK = 57, + SECTANTPRIZRAK = 58, + SECTANTONI = 59, SPTUSEC = 100, SPTBEAR = 101 } diff --git a/types/models/spt/bots/GenerateWeaponResult.d.ts b/types/models/spt/bots/GenerateWeaponResult.d.ts index d4a25267..73209ac8 100644 --- a/types/models/spt/bots/GenerateWeaponResult.d.ts +++ b/types/models/spt/bots/GenerateWeaponResult.d.ts @@ -1,10 +1,10 @@ -import { Mods } from "@spt/models/eft/common/tables/IBotType"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IMods } from "@spt/models/eft/common/tables/IBotType"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; export declare class GenerateWeaponResult { - weapon: Item[]; + weapon: IItem[]; chosenAmmoTpl: string; chosenUbglAmmoTpl: string; - weaponMods: Mods; + weaponMods: IMods; weaponTemplate: ITemplateItem; } diff --git a/types/models/spt/bots/IGenerateEquipmentProperties.d.ts b/types/models/spt/bots/IGenerateEquipmentProperties.d.ts index 9cf76855..5381cdfc 100644 --- a/types/models/spt/bots/IGenerateEquipmentProperties.d.ts +++ b/types/models/spt/bots/IGenerateEquipmentProperties.d.ts @@ -1,14 +1,14 @@ -import { Inventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase"; -import { Chances, Mods } from "@spt/models/eft/common/tables/IBotType"; +import { IInventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase"; +import { IChances, IMods } from "@spt/models/eft/common/tables/IBotType"; import { EquipmentFilters, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; export interface IGenerateEquipmentProperties { /** Root Slot being generated */ rootEquipmentSlot: string; /** Equipment pool for root slot being generated */ rootEquipmentPool: Record; - modPool: Mods; + modPool: IMods; /** Dictionary of mod items and their chance to spawn for this bot type */ - spawnChances: Chances; + spawnChances: IChances; /** Role being generated for */ botRole: string; /** Level of bot being generated */ diff --git a/types/models/spt/bots/IGenerateWeaponRequest.d.ts b/types/models/spt/bots/IGenerateWeaponRequest.d.ts index 6fbfecf2..3be9412c 100644 --- a/types/models/spt/bots/IGenerateWeaponRequest.d.ts +++ b/types/models/spt/bots/IGenerateWeaponRequest.d.ts @@ -1,18 +1,18 @@ -import { Mods, ModsChances } from "@spt/models/eft/common/tables/IBotType"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IMods, IModsChances } from "@spt/models/eft/common/tables/IBotType"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { BotModLimits } from "@spt/services/BotWeaponModLimitService"; export interface IGenerateWeaponRequest { /** Weapon to add mods to / result that is returned */ - weapon: Item[]; + weapon: IItem[]; /** Pool of compatible mods to attach to weapon */ - modPool: Mods; + modPool: IMods; /** ParentId of weapon */ weaponId: string; /** Weapon which mods will be generated on */ parentTemplate: ITemplateItem; /** Chance values mod will be added */ - modSpawnChances: ModsChances; + modSpawnChances: IModsChances; /** Ammo tpl to use when generating magazines/cartridges */ ammoTpl: string; /** Bot-specific properties */ diff --git a/types/models/spt/bots/IModToSpawnRequest.d.ts b/types/models/spt/bots/IModToSpawnRequest.d.ts index 9d11109c..d92eea63 100644 --- a/types/models/spt/bots/IModToSpawnRequest.d.ts +++ b/types/models/spt/bots/IModToSpawnRequest.d.ts @@ -1,4 +1,4 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ModSpawn } from "@spt/models/enums/ModSpawn"; import { IBotData, IWeaponStats } from "@spt/models/spt/bots/IGenerateWeaponRequest"; @@ -15,7 +15,7 @@ export interface IModToSpawnRequest { /** Pool of items to pick from */ itemModPool: Record; /** Array with only weapon tpl in it, ready for mods to be added */ - weapon: Item[]; + weapon: IItem[]; /** Ammo tpl to use if slot requires a cartridge to be added (e.g. mod_magazine) */ ammoTpl: string; /** Parent item the mod will go into */ diff --git a/types/models/spt/config/IAirdropConfig.d.ts b/types/models/spt/config/IAirdropConfig.d.ts index 15960dd4..1858e061 100644 --- a/types/models/spt/config/IAirdropConfig.d.ts +++ b/types/models/spt/config/IAirdropConfig.d.ts @@ -5,10 +5,10 @@ export interface IAirdropConfig extends IBaseConfig { kind: "spt-airdrop"; airdropTypeWeightings: Record; /** What rewards will the loot crate contain, keyed by drop type e.g. mixed/weaponArmor/foodMedical/barter */ - loot: Record; + loot: Record; } /** Chance map will have an airdrop occur out of 100 - locations not included count as 0% */ -export interface AirdropChancePercent { +export interface IAirdropChancePercent { bigmap: number; woods: number; lighthouse: number; @@ -19,7 +19,7 @@ export interface AirdropChancePercent { sandbox: number; } /** Loot inside crate */ -export interface AirdropLoot { +export interface IAirdropLoot { /** Min/max of weapons inside crate */ weaponPresetCount?: MinMax; /** Min/max of armors (head/chest/rig) inside crate */ diff --git a/types/models/spt/config/IBotConfig.d.ts b/types/models/spt/config/IBotConfig.d.ts index b8c782af..1954eb07 100644 --- a/types/models/spt/config/IBotConfig.d.ts +++ b/types/models/spt/config/IBotConfig.d.ts @@ -1,5 +1,5 @@ import { MinMax } from "@spt/models/common/MinMax"; -import { GenerationData } from "@spt/models/eft/common/tables/IBotType"; +import { IGenerationData } from "@spt/models/eft/common/tables/IBotType"; import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; import { IBotDurability } from "@spt/models/spt/config/IBotDurability"; export interface IBotConfig extends IBaseConfig { @@ -133,6 +133,7 @@ export interface EquipmentFilters { /** Should the stock mod be forced to spawn on bot */ forceStock?: boolean; armorPlateWeighting?: IArmorPlateWeights[]; + forceRigWhenNoVest?: boolean; } export interface ModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ @@ -143,7 +144,7 @@ export interface ModLimits { export interface RandomisationDetails { /** Between what levels do these randomisation setting apply to */ levelRange: MinMax; - generation?: Record; + generation?: Record; /** Mod slots that should be fully randomised -ignores mods from bottype.json and instaed creates a pool using items.json */ randomisedWeaponModSlots?: string[]; /** Armor slots that should be randomised e.g. 'Headwear, Armband' */ diff --git a/types/models/spt/config/IBotDurability.d.ts b/types/models/spt/config/IBotDurability.d.ts index 728db97d..8dc9d028 100644 --- a/types/models/spt/config/IBotDurability.d.ts +++ b/types/models/spt/config/IBotDurability.d.ts @@ -1,45 +1,45 @@ export interface IBotDurability { - default: DefaultDurability; + default: IDefaultDurability; pmc: PmcDurability; - boss: BotDurability; - follower: BotDurability; - assault: BotDurability; - cursedassault: BotDurability; - marksman: BotDurability; - pmcbot: BotDurability; - arenafighterevent: BotDurability; - arenafighter: BotDurability; - crazyassaultevent: BotDurability; - exusec: BotDurability; - gifter: BotDurability; - sectantpriest: BotDurability; - sectantwarrior: BotDurability; + boss: IBotDurability; + follower: IBotDurability; + assault: IBotDurability; + cursedassault: IBotDurability; + marksman: IBotDurability; + pmcbot: IBotDurability; + arenafighterevent: IBotDurability; + arenafighter: IBotDurability; + crazyassaultevent: IBotDurability; + exusec: IBotDurability; + gifter: IBotDurability; + sectantpriest: IBotDurability; + sectantwarrior: IBotDurability; } /** Durability values to be used when a more specific bot type cant be found */ -export interface DefaultDurability { - armor: ArmorDurability; - weapon: WeaponDurability; +export interface IDefaultDurability { + armor: IArmorDurability; + weapon: IWeaponDurability; } export interface PmcDurability { - armor: PmcDurabilityArmor; - weapon: WeaponDurability; + armor: IPmcDurabilityArmor; + weapon: IWeaponDurability; } -export interface PmcDurabilityArmor { +export interface IPmcDurabilityArmor { lowestMaxPercent: number; highestMaxPercent: number; maxDelta: number; minDelta: number; } -export interface BotDurability { - armor: ArmorDurability; - weapon: WeaponDurability; +export interface IBotDurability { + armor: IArmorDurability; + weapon: IWeaponDurability; } -export interface ArmorDurability { +export interface IArmorDurability { maxDelta: number; minDelta: number; minLimitPercent: number; } -export interface WeaponDurability { +export interface IWeaponDurability { lowestMax: number; highestMax: number; maxDelta: number; diff --git a/types/models/spt/config/ICoreConfig.d.ts b/types/models/spt/config/ICoreConfig.d.ts index 6d086f7f..39c4f18f 100644 --- a/types/models/spt/config/ICoreConfig.d.ts +++ b/types/models/spt/config/ICoreConfig.d.ts @@ -67,6 +67,7 @@ export interface IServerFeatures { } export interface IChatbotFeatures { sptFriendEnabled: boolean; + sptFriendGiftsEnabled: boolean; commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; commandUseLimits: Record; diff --git a/types/models/spt/config/IGiftsConfig.d.ts b/types/models/spt/config/IGiftsConfig.d.ts index 736c4b76..4a9450e6 100644 --- a/types/models/spt/config/IGiftsConfig.d.ts +++ b/types/models/spt/config/IGiftsConfig.d.ts @@ -1,4 +1,4 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { GiftSenderType } from "@spt/models/enums/GiftSenderType"; import { SeasonalEventType } from "@spt/models/enums/SeasonalEventType"; @@ -7,11 +7,11 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; import { IProfileChangeEvent } from "@spt/models/spt/dialog/ISendMessageDetails"; export interface IGiftsConfig extends IBaseConfig { kind: "spt-gifts"; - gifts: Record; + gifts: Record; } -export interface Gift { +export interface IGift { /** Items to send to player */ - items: Item[]; + items: IItem[]; /** Who is sending the gift to player */ sender: GiftSenderType; /** Optinal - supply a users id to send from, not necessary when sending from SYSTEM or TRADER */ diff --git a/types/models/spt/config/ILocationConfig.d.ts b/types/models/spt/config/ILocationConfig.d.ts index b650ab03..55123d6f 100644 --- a/types/models/spt/config/ILocationConfig.d.ts +++ b/types/models/spt/config/ILocationConfig.d.ts @@ -1,5 +1,5 @@ import { MinMax } from "@spt/models/common/MinMax"; -import { BossLocationSpawn, Wave } from "@spt/models/eft/common/ILocationBase"; +import { IBossLocationSpawn, IWave } from "@spt/models/eft/common/ILocationBase"; import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface ILocationConfig extends IBaseConfig { kind: "spt-location"; @@ -9,10 +9,10 @@ export interface ILocationConfig extends IBaseConfig { rogueLighthouseSpawnTimeSettings: IRogueLighthouseSpawnTimeSettings; /** When a map has hit max alive bots, any wave that should spawn will be reduced to 1 bot in size and placed in a spawn queue, this splits waves into smaller sizes to reduce the impact of this behaviour */ splitWaveIntoSingleSpawnsSettings: ISplitWaveSettings; - looseLootMultiplier: LootMultiplier; - staticLootMultiplier: LootMultiplier; + looseLootMultiplier: ILootMultiplier; + staticLootMultiplier: ILootMultiplier; /** Custom bot waves to add to a locations base json on game start if addCustomBotWavesToMaps is true */ - customWaves: CustomWaves; + customWaves: ICustomWaves; /** Open zones to add to map */ openZones: Record; /** Key = map id, value = item tpls that should only have one forced loot spawn position */ @@ -61,16 +61,16 @@ export interface ISplitWaveSettings { ignoreMaps: string[]; waveSizeThreshold: number; } -export interface CustomWaves { +export interface ICustomWaves { /** Bosses spawn on raid start */ - boss: Record; - normal: Record; + boss: Record; + normal: Record; } export interface IBotTypeLimit extends MinMax { type: string; } /** Multiplier to apply to the loot count for a given map */ -export interface LootMultiplier { +export interface ILootMultiplier { bigmap: number; develop: number; factory4_day: number; diff --git a/types/models/spt/config/ILootConfig.d.ts b/types/models/spt/config/ILootConfig.d.ts index e22c3ea8..4e73ea0e 100644 --- a/types/models/spt/config/ILootConfig.d.ts +++ b/types/models/spt/config/ILootConfig.d.ts @@ -1,9 +1,9 @@ -import { Spawnpoint } from "@spt/models/eft/common/ILooseLoot"; +import { ISpawnpoint } from "@spt/models/eft/common/ILooseLoot"; import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface ILootConfig extends IBaseConfig { kind: "spt-loot"; /** Spawn positions to add into a map, key=mapid */ - looseLoot: Record; + looseLoot: Record; /** Loose loot probability adjustments to apply on game start */ looseLootSpawnPointAdjustments: Record>; } diff --git a/types/models/spt/config/ILostOnDeathConfig.d.ts b/types/models/spt/config/ILostOnDeathConfig.d.ts index 85746460..71408ce4 100644 --- a/types/models/spt/config/ILostOnDeathConfig.d.ts +++ b/types/models/spt/config/ILostOnDeathConfig.d.ts @@ -2,13 +2,13 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface ILostOnDeathConfig extends IBaseConfig { kind: "spt-lostondeath"; /** What equipment in each slot should be lost on death */ - equipment: Equipment; + equipment: ILostEquipment; /** Should special slot items be removed from quest inventory on death e.g. wifi camera/markers */ specialSlotItems: boolean; /** Should quest items be removed from quest inventory on death */ questItems: boolean; } -export interface Equipment { +export interface ILostEquipment { ArmBand: boolean; Headwear: boolean; Earpiece: boolean; diff --git a/types/models/spt/config/IPlayerScavConfig.d.ts b/types/models/spt/config/IPlayerScavConfig.d.ts index 8834768f..9c1046fe 100644 --- a/types/models/spt/config/IPlayerScavConfig.d.ts +++ b/types/models/spt/config/IPlayerScavConfig.d.ts @@ -1,4 +1,4 @@ -import { GenerationData } from "@spt/models/eft/common/tables/IBotType"; +import { IGenerationData } from "@spt/models/eft/common/tables/IBotType"; import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IPlayerScavConfig extends IBaseConfig { kind: "spt-playerscav"; @@ -16,10 +16,10 @@ export interface Modifiers { mod: Record; } export interface ItemLimits { - healing: GenerationData; - drugs: GenerationData; - stims: GenerationData; - looseLoot: GenerationData; - magazines: GenerationData; - grenades: GenerationData; + healing: IGenerationData; + drugs: IGenerationData; + stims: IGenerationData; + looseLoot: IGenerationData; + magazines: IGenerationData; + grenades: IGenerationData; } diff --git a/types/models/spt/config/IPmcConfig.d.ts b/types/models/spt/config/IPmcConfig.d.ts index c6e55331..8fd2e5fb 100644 --- a/types/models/spt/config/IPmcConfig.d.ts +++ b/types/models/spt/config/IPmcConfig.d.ts @@ -35,8 +35,8 @@ export interface IPmcConfig extends IBaseConfig { maxBackpackLootTotalRub: MinMaxLootValue[]; maxPocketLootTotalRub: number; maxVestLootTotalRub: number; - /** Percentage chance a bot from a wave is converted into a PMC, key = bot wildspawn tpye (assault/exusec), value: min+max chance to be converted */ - convertIntoPmcChance: Record; + /** Percentage chance a bot from a wave is converted into a PMC, first key = map, second key = bot wildspawn type (assault/exusec), value: min+max chance to be converted */ + convertIntoPmcChance: Record>; /** How many levels above player level can a PMC be */ botRelativeLevelDeltaMax: number; /** How many levels below player level can a PMC be */ diff --git a/types/models/spt/config/IQuestConfig.d.ts b/types/models/spt/config/IQuestConfig.d.ts index e37ce7c1..e4e76ebd 100644 --- a/types/models/spt/config/IQuestConfig.d.ts +++ b/types/models/spt/config/IQuestConfig.d.ts @@ -13,6 +13,10 @@ export interface IQuestConfig extends IBaseConfig { locationIdMap: Record; bearOnlyQuests: string[]; usecOnlyQuests: string[]; + /** Quests that the keyed game version do not see/access */ + profileBlacklist: Record; + /** Quests that only the keyed game version can see/access */ + profileWhitelist: Record; } export interface IPlayerTypeQuestIds { pmc: IQuestTypeIds; diff --git a/types/models/spt/config/IRagfairConfig.d.ts b/types/models/spt/config/IRagfairConfig.d.ts index bb318de4..a62f2c9b 100644 --- a/types/models/spt/config/IRagfairConfig.d.ts +++ b/types/models/spt/config/IRagfairConfig.d.ts @@ -11,6 +11,7 @@ export interface IRagfairConfig extends IBaseConfig { /** Trader ids + should their assorts be listed on flea */ traders: Record; dynamic: Dynamic; + tieredFlea: ITieredFlea; } export interface Sell { /** Should a fee be deducted from player when liting an item for sale */ @@ -156,3 +157,9 @@ export interface IArmorSettings { /** What slots are to be removed when removeRemovablePlateChance is true */ plateSlotIdToRemovePool: string[]; } +export interface ITieredFlea { + enabled: boolean; + unlocks: Record; + ammoTiersEnabled: boolean; + ammoTplUnlocks: Record; +} diff --git a/types/models/spt/config/IScavCaseConfig.d.ts b/types/models/spt/config/IScavCaseConfig.d.ts index f2ff2f2b..949180ea 100644 --- a/types/models/spt/config/IScavCaseConfig.d.ts +++ b/types/models/spt/config/IScavCaseConfig.d.ts @@ -3,27 +3,27 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IScavCaseConfig extends IBaseConfig { kind: "spt-scavcase"; rewardItemValueRangeRub: Record; - moneyRewards: MoneyRewards; - ammoRewards: AmmoRewards; + moneyRewards: IMoneyRewards; + ammoRewards: IAmmoRewards; rewardItemParentBlacklist: string[]; rewardItemBlacklist: string[]; allowMultipleMoneyRewardsPerRarity: boolean; allowMultipleAmmoRewardsPerRarity: boolean; allowBossItemsAsRewards: boolean; } -export interface MoneyRewards { +export interface IMoneyRewards { moneyRewardChancePercent: number; - rubCount: MoneyLevels; - usdCount: MoneyLevels; - eurCount: MoneyLevels; - gpCount: MoneyLevels; + rubCount: IMoneyLevels; + usdCount: IMoneyLevels; + eurCount: IMoneyLevels; + gpCount: IMoneyLevels; } -export interface MoneyLevels { +export interface IMoneyLevels { common: MinMax; rare: MinMax; superrare: MinMax; } -export interface AmmoRewards { +export interface IAmmoRewards { ammoRewardChancePercent: number; ammoRewardBlacklist: Record; ammoRewardValueRangeRub: Record; diff --git a/types/models/spt/config/ISeasonalEventConfig.d.ts b/types/models/spt/config/ISeasonalEventConfig.d.ts index da7070b1..1280bc5b 100644 --- a/types/models/spt/config/ISeasonalEventConfig.d.ts +++ b/types/models/spt/config/ISeasonalEventConfig.d.ts @@ -1,4 +1,4 @@ -import { BossLocationSpawn } from "@spt/models/eft/common/ILocationBase"; +import { IBossLocationSpawn } from "@spt/models/eft/common/ILocationBase"; import { SeasonalEventType } from "@spt/models/enums/SeasonalEventType"; import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface ISeasonalEventConfig extends IBaseConfig { @@ -8,8 +8,8 @@ export interface ISeasonalEventConfig extends IBaseConfig { eventGear: Record>>>; events: ISeasonalEvent[]; eventBotMapping: Record; - eventBossSpawns: Record>; - gifterSettings: GifterSetting[]; + eventBossSpawns: Record>; + gifterSettings: IGifterSetting[]; } export interface ISeasonalEvent { name: string; @@ -19,7 +19,7 @@ export interface ISeasonalEvent { endDay: number; endMonth: number; } -export interface GifterSetting { +export interface IGifterSetting { map: string; zones: string; spawnChance: number; diff --git a/types/models/spt/controllers/IBotController.d.ts b/types/models/spt/controllers/IBotController.d.ts index e5774970..329dd439 100644 --- a/types/models/spt/controllers/IBotController.d.ts +++ b/types/models/spt/controllers/IBotController.d.ts @@ -1,10 +1,10 @@ import { IGenerateBotsRequestData } from "@spt/models/eft/bot/IGenerateBotsRequestData"; import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; -import { Difficulty } from "@spt/models/eft/common/tables/IBotType"; +import { IDifficultyCategories } from "@spt/models/eft/common/tables/IBotType"; export interface IBotController { getBotLimit(type: string): number; - getBotDifficulty(type: string, difficulty: string): IBotCore | Difficulty; + getBotDifficulty(type: string, difficulty: string): IBotCore | IDifficultyCategories; isBotPmc(botRole: string): boolean; isBotBoss(botRole: string): boolean; isBotFollower(botRole: string): boolean; diff --git a/types/models/spt/dialog/ISendMessageDetails.d.ts b/types/models/spt/dialog/ISendMessageDetails.d.ts index 1625f47c..c3c23db0 100644 --- a/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -1,4 +1,4 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ISystemData, IUserDialogInfo, MessageContentRagfair } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; @@ -16,7 +16,7 @@ export interface ISendMessageDetails { /** Optional - used in player/system messages, otherwise templateId is used */ messageText?: string; /** Optinal - Items to send to player */ - items?: Item[]; + items?: IItem[]; /** Optional - How long items will be stored in mail before expiry */ itemsMaxStorageLifetimeSeconds?: number; /** Optional - Used when sending messages from traders who send text from locale json */ diff --git a/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/types/models/spt/fence/ICreateFenceAssortsResult.d.ts index 553f4e29..1af9f84d 100644 --- a/types/models/spt/fence/ICreateFenceAssortsResult.d.ts +++ b/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -1,7 +1,7 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader"; export interface ICreateFenceAssortsResult { - sptItems: Item[][]; + sptItems: IItem[][]; barter_scheme: Record; loyal_level_items: Record; } diff --git a/types/models/spt/generators/IBotGenerator.d.ts b/types/models/spt/generators/IBotGenerator.d.ts index e46ce24e..ebc954de 100644 --- a/types/models/spt/generators/IBotGenerator.d.ts +++ b/types/models/spt/generators/IBotGenerator.d.ts @@ -1,5 +1,5 @@ -import { Inventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase"; -import { Chances, Generation, Inventory } from "@spt/models/eft/common/tables/IBotType"; +import { IInventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase"; +import { IChances, IGeneration, IInventory } from "@spt/models/eft/common/tables/IBotType"; export interface IBotGenerator { - generateInventory(templateInventory: Inventory, equipmentChances: Chances, generation: Generation, botRole: string, isPmc: boolean): PmcInventory; + generateInventory(templateInventory: IInventory, equipmentChances: IChances, generation: IGeneration, botRole: string, isPmc: boolean): PmcInventory; } diff --git a/types/models/spt/generators/ILocationGenerator.d.ts b/types/models/spt/generators/ILocationGenerator.d.ts index 2df98e72..80905385 100644 --- a/types/models/spt/generators/ILocationGenerator.d.ts +++ b/types/models/spt/generators/ILocationGenerator.d.ts @@ -1,6 +1,6 @@ import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticLootDetails } from "@spt/models/eft/common/ILocation"; -import { ILooseLoot, SpawnpointTemplate } from "@spt/models/eft/common/ILooseLoot"; +import { ILooseLoot, ISpawnpointTemplate } from "@spt/models/eft/common/ILooseLoot"; export interface ILocationGenerator { generateContainerLoot(containerIn: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record, staticAmmoDist: Record, locationName: string): IStaticContainerProps; - generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record, locationName: string): SpawnpointTemplate[]; + generateDynamicLoot(dynamicLootDist: ILooseLoot, staticAmmoDist: Record, locationName: string): ISpawnpointTemplate[]; } diff --git a/types/models/spt/generators/IRagfairAssortGenerator.d.ts b/types/models/spt/generators/IRagfairAssortGenerator.d.ts index 193b6856..380387ed 100644 --- a/types/models/spt/generators/IRagfairAssortGenerator.d.ts +++ b/types/models/spt/generators/IRagfairAssortGenerator.d.ts @@ -1,4 +1,4 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; export interface IRagfairAssortGenerator { - getAssortItems(): Item[]; + getAssortItems(): IItem[]; } diff --git a/types/models/spt/generators/IRagfairOfferGenerator.d.ts b/types/models/spt/generators/IRagfairOfferGenerator.d.ts index 66d28e94..e3d3f1b2 100644 --- a/types/models/spt/generators/IRagfairOfferGenerator.d.ts +++ b/types/models/spt/generators/IRagfairOfferGenerator.d.ts @@ -1,6 +1,6 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; export interface IRagfairOfferGenerator { - createOffer(userID: string, time: number, items: Item[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece: boolean): IRagfairOffer; + createOffer(userID: string, time: number, items: IItem[], barterScheme: IBarterScheme[], loyalLevel: number, price: number, sellInOnePiece: boolean): IRagfairOffer; } diff --git a/types/models/spt/inventory/IOwnerInventoryItems.d.ts b/types/models/spt/inventory/IOwnerInventoryItems.d.ts index dd4efab2..95ed39ec 100644 --- a/types/models/spt/inventory/IOwnerInventoryItems.d.ts +++ b/types/models/spt/inventory/IOwnerInventoryItems.d.ts @@ -1,9 +1,9 @@ -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; export interface IOwnerInventoryItems { /** Inventory items from source */ - from: Item[]; + from: IItem[]; /** Inventory items at destination */ - to: Item[]; + to: IItem[]; sameInventory: boolean; isMail: boolean; } diff --git a/types/models/spt/services/IInsuranceEquipmentPkg.d.ts b/types/models/spt/services/IInsuranceEquipmentPkg.d.ts index 92d05655..93aecfa0 100644 --- a/types/models/spt/services/IInsuranceEquipmentPkg.d.ts +++ b/types/models/spt/services/IInsuranceEquipmentPkg.d.ts @@ -1,8 +1,8 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; export interface IInsuranceEquipmentPkg { sessionID: string; pmcData: IPmcData; - itemToReturnToPlayer: Item; + itemToReturnToPlayer: IItem; traderId: string; } diff --git a/types/routers/EventOutputHolder.d.ts b/types/routers/EventOutputHolder.d.ts index 148461a0..614a75c2 100644 --- a/types/routers/EventOutputHolder.d.ts +++ b/types/routers/EventOutputHolder.d.ts @@ -1,6 +1,6 @@ import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { IHideoutImprovement, Productive, TraderInfo } from "@spt/models/eft/common/tables/IBotBase"; +import { IHideoutImprovement, IMoneyTransferLimits, IProductive, ITraderInfo } from "@spt/models/eft/common/tables/IBotBase"; import { TraderData } from "@spt/models/eft/itemEvent/IItemEventRouterBase"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { TimeUtil } from "@spt/utils/TimeUtil"; @@ -30,12 +30,13 @@ export declare class EventOutputHolder { * @param sessionId Session id */ updateOutputProperties(sessionId: string): void; + protected resetMoneyTransferLimit(limit: IMoneyTransferLimits): void; /** * Convert the internal trader data object into an object we can send to the client * @param traderData server data for traders * @returns dict of trader id + TraderData */ - protected constructTraderRelations(traderData: Record): Record; + protected constructTraderRelations(traderData: Record): Record; /** * Return all hideout Improvements from player profile, adjust completed Improvements' completed property to be true * @param pmcData Player profile @@ -47,10 +48,10 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; + protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile */ - protected cleanUpCompleteCraftsInProfile(productions: Record): void; + protected cleanUpCompleteCraftsInProfile(productions: Record): void; } diff --git a/types/services/AirdropService.d.ts b/types/services/AirdropService.d.ts index b17defae..465ee48a 100644 --- a/types/services/AirdropService.d.ts +++ b/types/services/AirdropService.d.ts @@ -1,7 +1,7 @@ import { LootGenerator } from "@spt/generators/LootGenerator"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IGetAirdropLootResponse } from "@spt/models/eft/location/IGetAirdropLootResponse"; import { AirdropTypeEnum } from "@spt/models/enums/AirdropType"; import { IAirdropConfig } from "@spt/models/spt/config/IAirdropConfig"; @@ -38,7 +38,7 @@ export declare class AirdropService { * @param airdropType What tpye of container: weapon/common etc * @returns Item */ - protected getAirdropCrateItem(airdropType: AirdropTypeEnum): Item; + protected getAirdropCrateItem(airdropType: AirdropTypeEnum): IItem; /** * Randomly pick a type of airdrop loot using weighted values from config * @returns airdrop type value diff --git a/types/services/BotEquipmentFilterService.d.ts b/types/services/BotEquipmentFilterService.d.ts index 780d7a2f..7d51b1e8 100644 --- a/types/services/BotEquipmentFilterService.d.ts +++ b/types/services/BotEquipmentFilterService.d.ts @@ -1,6 +1,6 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; -import { EquipmentChances, Generation, GenerationData, IBotType, ModsChances } from "@spt/models/eft/common/tables/IBotType"; +import { EquipmentChances, IBotType, IGeneration, IGenerationData, IModsChances } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { EquipmentFilterDetails, EquipmentFilters, IAdjustmentDetails, IBotConfig, WeightingAdjustmentDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -26,13 +26,13 @@ export declare class BotEquipmentFilterService { * @param equipmentChanges Changes to apply * @param baseValues data to update */ - protected adjustChances(equipmentChanges: Record, baseValues: EquipmentChances | ModsChances): void; + protected adjustChances(equipmentChanges: Record, baseValues: EquipmentChances | IModsChances): void; /** * Iterate over the Generation changes and alter data in baseValues.Generation * @param generationChanges Changes to apply * @param baseBotGeneration dictionary to update */ - protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: Generation): void; + protected adjustGenerationChances(generationChanges: Record, baseBotGeneration: IGeneration): void; /** * Get equipment settings for bot * @param botEquipmentRole equipment role to return diff --git a/types/services/BotEquipmentModPoolService.d.ts b/types/services/BotEquipmentModPoolService.d.ts index 7b2b4420..080dc7b1 100644 --- a/types/services/BotEquipmentModPoolService.d.ts +++ b/types/services/BotEquipmentModPoolService.d.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; -import { Mods } from "@spt/models/eft/common/tables/IBotType"; +import { IMods } from "@spt/models/eft/common/tables/IBotType"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -16,8 +16,8 @@ export declare class BotEquipmentModPoolService { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - protected weaponModPool: Mods; - protected gearModPool: Mods; + protected weaponModPool: IMods; + protected gearModPool: IMods; protected weaponPoolGenerated: boolean; protected armorPoolGenerated: boolean; constructor(logger: ILogger, vfs: VFS, itemHelper: ItemHelper, databaseService: DatabaseService, localisationService: LocalisationService, configServer: ConfigServer); diff --git a/types/services/BotGenerationCacheService.d.ts b/types/services/BotGenerationCacheService.d.ts index c85489fd..181031a5 100644 --- a/types/services/BotGenerationCacheService.d.ts +++ b/types/services/BotGenerationCacheService.d.ts @@ -43,7 +43,7 @@ export declare class BotGenerationCacheService { * Does cache have a bot with requested key * @returns false if empty */ - cacheHasBotOfRole(key: string): boolean; + cacheHasBotWithKey(key: string, size?: number): boolean; getCachedBotCount(key: string): number; createCacheKey(role: string, difficulty: string): string; } diff --git a/types/services/BotWeaponModLimitService.d.ts b/types/services/BotWeaponModLimitService.d.ts index 63c4967f..cce8f294 100644 --- a/types/services/BotWeaponModLimitService.d.ts +++ b/types/services/BotWeaponModLimitService.d.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -39,7 +39,7 @@ export declare class BotWeaponModLimitService { * @param modsParent The parent of the mod to be checked * @returns true if over item limit */ - weaponModHasReachedLimit(botRole: string, modTemplate: ITemplateItem, modLimits: BotModLimits, modsParent: ITemplateItem, weapon: Item[]): boolean; + weaponModHasReachedLimit(botRole: string, modTemplate: ITemplateItem, modLimits: BotModLimits, modsParent: ITemplateItem, weapon: IItem[]): boolean; /** * Check if the specific item type on the weapon has reached the set limit * @param modTpl log mod tpl if over type limit diff --git a/types/services/CircleOfCultistService.d.ts b/types/services/CircleOfCultistService.d.ts index a6e4dc72..7b217506 100644 --- a/types/services/CircleOfCultistService.d.ts +++ b/types/services/CircleOfCultistService.d.ts @@ -4,8 +4,8 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { HideoutArea } from "@spt/models/eft/common/tables/IBotBase"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IBotHideoutArea } from "@spt/models/eft/common/tables/IBotBase"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IStageRequirement } from "@spt/models/eft/hideout/IHideoutArea"; import { IHideoutCircleOfCultistProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData"; import { IHideoutProduction, IHideoutProductionData, IRequirementBase, Requirement } from "@spt/models/eft/hideout/IHideoutProduction"; @@ -59,7 +59,7 @@ export declare class CircleOfCultistService { * @param rewardAmountRoubles Rouble amount to reward player in items with * @param directRewardSettings OPTIONAL: If craft is giving direct rewards */ - protected registerCircleOfCultistProduction(sessionId: string, pmcData: IPmcData, recipeId: string, sacrificedItems: Item[], rewardAmountRoubles: number, directRewardSettings?: DirectRewardSettings): void; + protected registerCircleOfCultistProduction(sessionId: string, pmcData: IPmcData, recipeId: string, sacrificedItems: IItem[], rewardAmountRoubles: number, directRewardSettings?: DirectRewardSettings): void; /** * Get the circle craft time as seconds, value is based on reward item value * OR rewards are direct, then use custom craft time defined in oarameter object @@ -73,7 +73,7 @@ export declare class CircleOfCultistService { * @param pmcData Player profile * @returns Array of its from player inventory */ - protected getSacrificedItems(pmcData: IPmcData): Item[]; + protected getSacrificedItems(pmcData: IPmcData): IItem[]; /** * Given a pool of items + rouble budget, pick items until the budget is reached * @param rewardItemTplPool Items that can be picekd @@ -81,14 +81,14 @@ export declare class CircleOfCultistService { * @param cultistCircleStashId Id of stash item * @returns Array of item arrays */ - protected getRewardsWithinBudget(rewardItemTplPool: string[], rewardBudget: number, cultistCircleStashId: string): Item[][]; + protected getRewardsWithinBudget(rewardItemTplPool: string[], rewardBudget: number, cultistCircleStashId: string): IItem[][]; /** * Give every item as a reward that's passed in * @param rewardTpls Item tpls to turn into reward items * @param cultistCircleStashId Id of stash item * @returns Array of item arrays */ - protected getExplicitRewards(explicitRewardSettings: DirectRewardSettings, cultistCircleStashId: string): Item[][]; + protected getExplicitRewards(explicitRewardSettings: DirectRewardSettings, cultistCircleStashId: string): IItem[][]; /** * Explicit rewards have thier own stack sizes as they dont use a reward rouble pool * @param rewardTpl Item being rewarded to get stack size of @@ -115,7 +115,7 @@ export declare class CircleOfCultistService { * @param areas Hideout areas to iterate over * @returns Active area array */ - protected getPlayerAccessibleHideoutAreas(areas: HideoutArea[]): HideoutArea[]; + protected getPlayerAccessibleHideoutAreas(areas: IBotHideoutArea[]): IBotHideoutArea[]; /** * Get all recipes the player has access to, includes base + unlocked recipes * @param unlockedRecipes Recipes player has flagged as unlocked diff --git a/types/services/CustomLocationWaveService.d.ts b/types/services/CustomLocationWaveService.d.ts index c72d5bb1..f69ce2b0 100644 --- a/types/services/CustomLocationWaveService.d.ts +++ b/types/services/CustomLocationWaveService.d.ts @@ -1,4 +1,4 @@ -import { BossLocationSpawn, Wave } from "@spt/models/eft/common/ILocationBase"; +import { IBossLocationSpawn, IWave } from "@spt/models/eft/common/ILocationBase"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -16,13 +16,13 @@ export declare class CustomLocationWaveService { * @param locationId e.g. factory4_day, bigmap * @param waveToAdd Boss wave to add to map */ - addBossWaveToMap(locationId: string, waveToAdd: BossLocationSpawn): void; + addBossWaveToMap(locationId: string, waveToAdd: IBossLocationSpawn): void; /** * Add a normal bot wave to a map * @param locationId e.g. factory4_day, bigmap * @param waveToAdd Wave to add to map */ - addNormalWaveToMap(locationId: string, waveToAdd: Wave): void; + addNormalWaveToMap(locationId: string, waveToAdd: IWave): void; /** * Clear all custom boss waves from a map * @param locationId e.g. factory4_day, bigmap diff --git a/types/services/FenceService.d.ts b/types/services/FenceService.d.ts index 58dc0765..b4079e67 100644 --- a/types/services/FenceService.d.ts +++ b/types/services/FenceService.d.ts @@ -3,8 +3,8 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { IFenceLevel } from "@spt/models/eft/common/IGlobals"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item, Repairable } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem, Slot } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IItem, IUpdRepairable } from "@spt/models/eft/common/tables/IItem"; +import { ISlot, ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ICreateFenceAssortsResult } from "@spt/models/spt/fence/ICreateFenceAssortsResult"; @@ -79,21 +79,21 @@ export declare class FenceService { * @param items the items to add with all its childrens * @param mainItem the most parent item of the array */ - addItemsToFenceAssort(items: Item[], mainItem: Item): void; + addItemsToFenceAssort(items: IItem[], mainItem: IItem): void; /** * Calculates the overall price for an item (with all its children) * @param itemTpl the item tpl to calculate the fence price for * @param items the items (with its children) to calculate fence price for * @returns the fence price of the item */ - getItemPrice(itemTpl: string, items: Item[]): number; + getItemPrice(itemTpl: string, items: IItem[]): number; /** * Calculate the overall price for an ammo box, where only one item is * the ammo box itself and every other items are the bullets in that box * @param items the ammo box (and all its children ammo items) * @returns the price of the ammo box */ - protected getAmmoBoxPrice(items: Item[]): number; + protected getAmmoBoxPrice(items: IItem[]): number; /** * Adjust all items contained inside an assort by a multiplier * @param assort (clone)Assort that contains items with prices to adjust @@ -115,7 +115,7 @@ export declare class FenceService { * @param modifier value to multiply item price by * @param presetModifier value to multiply preset price by */ - protected adjustItemPriceByModifier(item: Item, assort: ITraderAssort, modifier: number, presetModifier: number): void; + protected adjustItemPriceByModifier(item: IItem, assort: ITraderAssort, modifier: number, presetModifier: number): void; /** * Get fence assorts with no price adjustments based on fence rep * @returns ITraderAssort @@ -146,7 +146,7 @@ export declare class FenceService { * @param generationValues Base counts assorts should be adjusted to * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; + protected getItemCountsToGenerate(assortItems: IItem[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -158,7 +158,7 @@ export declare class FenceService { * @param assort Trader assort to remove item from * @param rootItems Pool of root items to pick from to remove */ - protected removeRandomItemFromAssorts(assort: ITraderAssort, rootItems: Item[]): void; + protected removeRandomItemFromAssorts(assort: ITraderAssort, rootItems: IItem[]): void; /** * Get an integer rounded count of items to replace based on percentrage from traderConfig value * @param totalItemCount total item count @@ -217,14 +217,14 @@ export declare class FenceService { * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item | undefined; + protected getMatchingItem(rootItemBeingAdded: IItem, itemDbDetails: ITemplateItem, itemsWithChildren: IItem[][]): IItem | undefined; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort * @param itemDbDetails Item we want to add db details * @returns True item should be force stacked */ - protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemShouldBeForceStacked(existingItem: IItem, itemDbDetails: ITemplateItem): boolean; protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) @@ -232,7 +232,7 @@ export declare class FenceService { * @param itemRoot Root item having price adjusted * @param itemTemplate Db template of item */ - protected adjustItemPriceByQuality(barterSchemes: Record, itemRoot: Item, itemTemplate: ITemplateItem): void; + protected adjustItemPriceByQuality(barterSchemes: Record, itemRoot: IItem, itemTemplate: ITemplateItem): void; protected getMatchingItemLimit(itemTypeLimits: Record; + getGifts(): Record; /** * Get an array of all gift ids * @returns string array of gift ids @@ -47,13 +47,13 @@ export declare class GiftService { * @param giftData Gift to send player * @returns trader/user/system id */ - protected getSenderId(giftData: Gift): string | undefined; + protected getSenderId(giftData: IGift): string | undefined; /** * Convert GiftSenderType into a dialog MessageType * @param giftData Gift to send player * @returns MessageType enum value */ - protected getMessageType(giftData: Gift): MessageType | undefined; + protected getMessageType(giftData: IGift): MessageType | undefined; /** * Prapor sends gifts to player for first week after profile creation * @param sessionId Player id diff --git a/types/services/InsuranceService.d.ts b/types/services/InsuranceService.d.ts index 4e087dc4..8b7b1b38 100644 --- a/types/services/InsuranceService.d.ts +++ b/types/services/InsuranceService.d.ts @@ -2,7 +2,7 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITraderBase } from "@spt/models/eft/common/tables/ITrader"; import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { IInsuranceEquipmentPkg } from "@spt/models/spt/services/IInsuranceEquipmentPkg"; @@ -30,7 +30,7 @@ export declare class InsuranceService { protected mailSendService: MailSendService; protected configServer: ConfigServer; protected cloner: ICloner; - protected insured: Record>; + protected insured: Record>; protected insuranceConfig: IInsuranceConfig; constructor(logger: ILogger, databaseService: DatabaseService, randomUtil: RandomUtil, itemHelper: ItemHelper, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, traderHelper: TraderHelper, profileHelper: ProfileHelper, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer, cloner: ICloner); /** @@ -44,15 +44,16 @@ export declare class InsuranceService { * @param sessionId Profile id (session id) * @returns Item array */ - getInsurance(sessionId: string): Record; + getInsurance(sessionId: string): Record; resetInsurance(sessionId: string): void; /** - * Sends stored insured items as message to player - * @param pmcData profile to send insured items to + * Sends `i will go look for your stuff` trader message + + * Store lost insurance items inside profile for later retreval + * @param pmcData Profile to send insured items to * @param sessionID SessionId of current player - * @param mapId Id of the map player died/exited that caused the insurance to be issued on + * @param mapId Id of the location player died/exited that caused the insurance to be issued on */ - sendInsuredItems(pmcData: IPmcData, sessionID: string, mapId: string): void; + startPostRaidInsuranceLostProcess(pmcData: IPmcData, sessionID: string, mapId: string): void; /** * Get a timestamp of when insurance items should be sent to player based on trader used to insure * Apply insurance return bonus if found in profile @@ -81,14 +82,14 @@ export declare class InsuranceService { * @param pmcProfile Player profile * @returns IInsuranceEquipmentPkg array */ - mapInsuredItemsToTrader(sessionId: string, lostInsuredItems: Item[], pmcProfile: IPmcData): IInsuranceEquipmentPkg[]; + mapInsuredItemsToTrader(sessionId: string, lostInsuredItems: IItem[], pmcProfile: IPmcData): IInsuranceEquipmentPkg[]; /** * Some items should never be returned in insurance but BSG send them in the request * @param lostItem Item being returned in insurance * @param inventoryItems Player inventory * @returns True if item */ - protected itemCannotBeLostOnDeath(lostItem: Item, inventoryItems: Item[]): boolean; + protected itemCannotBeLostOnDeath(lostItem: IItem, inventoryItems: IItem[]): boolean; /** * Add gear item to InsuredItems array in player profile * @param sessionID Session id @@ -116,7 +117,7 @@ export declare class InsuranceService { * @param traderId Trader item insured with * @param itemToAdd Insured item (with children) */ - addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: Item): void; + addInsuranceItemToArray(sessionId: string, traderId: string, itemToAdd: IItem): void; /** * Get price of insurance * multiplier from config * @param pmcData Player profile @@ -124,7 +125,7 @@ export declare class InsuranceService { * @param traderId Trader item is insured with * @returns price in roubles */ - getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: Item, traderId: string): number; + getRoublePriceToInsureItemWithTrader(pmcData: IPmcData, inventoryItem: IItem, traderId: string): number; /** * Returns the ID that should be used for a root-level Item's parentId property value within in the context of insurance. * @param sessionID Players id diff --git a/types/services/LocationLifecycleService.d.ts b/types/services/LocationLifecycleService.d.ts index f95597c5..0fc4c4d0 100644 --- a/types/services/LocationLifecycleService.d.ts +++ b/types/services/LocationLifecycleService.d.ts @@ -8,8 +8,8 @@ import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Common, IQuestStatus, TraderInfo } from "@spt/models/eft/common/tables/IBotBase"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { Common, IQuestStatus, ITraderInfo } from "@spt/models/eft/common/tables/IBotBase"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IEndLocalRaidRequestData, IEndRaidResult } from "@spt/models/eft/match/IEndLocalRaidRequestData"; import { IStartLocalRaidRequestData } from "@spt/models/eft/match/IStartLocalRaidRequestData"; import { IStartLocalRaidResponseData } from "@spt/models/eft/match/IStartLocalRaidResponseData"; @@ -139,21 +139,22 @@ export declare class LocationLifecycleService { * @param tradersServerProfile Server * @param tradersClientProfile Client */ - protected applyTraderStandingAdjustments(tradersServerProfile: Record, tradersClientProfile: Record): void; + protected applyTraderStandingAdjustments(tradersServerProfile: Record, tradersClientProfile: Record): void; /** * Check if player used BTR item sending service and send items to player via mail if found * @param sessionId Session id * @param request End raid request */ protected handleBTRItemTransferEvent(sessionId: string, request: IEndLocalRaidRequestData): void; - protected btrItemDelivery(sessionId: string, traderId: string, items: Item[]): void; + protected btrItemDelivery(sessionId: string, traderId: string, items: IItem[]): void; + protected handleTransitItemTransferEvent(sessionId: string, request: IEndLocalRaidRequestData): void; protected handleInsuredItemLostEvent(sessionId: string, preRaidPmcProfile: IPmcData, request: IEndLocalRaidRequestData, locationName: string): void; /** * Return the equipped items from a players inventory * @param items Players inventory to search through * @returns an array of equipped items */ - protected getEquippedGear(items: Item[]): Item[]; + protected getEquippedGear(items: IItem[]): IItem[]; /** * Checks to see if player survives. run through will return false * @param statusOnExit Exit value from offraidData object diff --git a/types/services/MailSendService.d.ts b/types/services/MailSendService.d.ts index 8f1f9749..58455204 100644 --- a/types/services/MailSendService.d.ts +++ b/types/services/MailSendService.d.ts @@ -3,7 +3,7 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: IItem[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: Item[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: IItem[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -55,7 +55,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], maxStorageTimeSeconds?: number, profileChangeEvents?: IProfileChangeEvent[]): void; + sendSystemMessageToPlayer(sessionId: string, message: string, items?: IItem[], maxStorageTimeSeconds?: number, profileChangeEvents?: IProfileChangeEvent[]): void; /** * Send a message from SYSTEM to the player with or without items with localised text * @param sessionId The session ID to send the message to @@ -63,7 +63,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], profileChangeEvents?: IProfileChangeEvent[], maxStorageTimeSeconds?: number): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: IItem[], profileChangeEvents?: IProfileChangeEvent[], maxStorageTimeSeconds?: number): void; /** * Send a USER message to a player with or without items * @param sessionId The session ID to send the message to @@ -72,7 +72,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: Item[], maxStorageTimeSeconds?: number): void; + sendUserMessageToPlayer(sessionId: string, senderDetails: IUserDialogInfo, message: string, items?: IItem[], maxStorageTimeSeconds?: number): void; /** * Large function to send messages to players from a variety of sources (SYSTEM/NPC/USER) * Helper functions in this class are available to simplify common actions @@ -112,7 +112,7 @@ export declare class MailSendService { * @param items Possible items to choose from * @returns Chosen 'primary' item */ - protected getBaseItemFromRewards(items: Item[]): Item; + protected getBaseItemFromRewards(items: IItem[]): IItem; /** * Get a dialog with a specified entity (user/trader) * Create and store empty dialog if none exists in profile diff --git a/types/services/MapMarkerService.d.ts b/types/services/MapMarkerService.d.ts index aed5430b..a3ef6dfd 100644 --- a/types/services/MapMarkerService.d.ts +++ b/types/services/MapMarkerService.d.ts @@ -1,5 +1,5 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IInventoryCreateMarkerRequestData } from "@spt/models/eft/inventory/IInventoryCreateMarkerRequestData"; import { IInventoryDeleteMarkerRequestData } from "@spt/models/eft/inventory/IInventoryDeleteMarkerRequestData"; import { IInventoryEditMarkerRequestData } from "@spt/models/eft/inventory/IInventoryEditMarkerRequestData"; @@ -13,21 +13,21 @@ export declare class MapMarkerService { * @param request Add marker request * @returns Item */ - createMarkerOnMap(pmcData: IPmcData, request: IInventoryCreateMarkerRequestData): Item; + createMarkerOnMap(pmcData: IPmcData, request: IInventoryCreateMarkerRequestData): IItem; /** * Delete a map marker * @param pmcData Player profile * @param request Delete marker request * @returns Item */ - deleteMarkerFromMap(pmcData: IPmcData, request: IInventoryDeleteMarkerRequestData): Item; + deleteMarkerFromMap(pmcData: IPmcData, request: IInventoryDeleteMarkerRequestData): IItem; /** * Edit an existing map marker * @param pmcData Player profile * @param request Edit marker request * @returns Item */ - editMarkerOnMap(pmcData: IPmcData, request: IInventoryEditMarkerRequestData): Item; + editMarkerOnMap(pmcData: IPmcData, request: IInventoryEditMarkerRequestData): IItem; /** * Strip out characters from note string that are not: letter/numbers/unicode/spaces * @param mapNoteText Marker text to sanitise diff --git a/types/services/PaymentService.d.ts b/types/services/PaymentService.d.ts index 61d57318..51fced12 100644 --- a/types/services/PaymentService.d.ts +++ b/types/services/PaymentService.d.ts @@ -4,7 +4,7 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { PaymentHelper } from "@spt/helpers/PaymentHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { IProcessBuyTradeRequestData } from "@spt/models/eft/trade/IProcessBuyTradeRequestData"; import { IProcessSellTradeRequestData } from "@spt/models/eft/trade/IProcessSellTradeRequestData"; @@ -66,7 +66,7 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns Sorting money items */ - protected getSortedMoneyItemsInInventory(pmcData: IPmcData, currencyTpl: string, playerStashId: string): Item[]; + protected getSortedMoneyItemsInInventory(pmcData: IPmcData, currencyTpl: string, playerStashId: string): IItem[]; /** * Prioritise player stash first over player inventory * Post-raid healing would often take money out of the players pockets/secure container @@ -76,7 +76,7 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns sort order */ - protected prioritiseStashSort(a: Item, b: Item, inventoryItems: Item[], playerStashId: string): number; + protected prioritiseStashSort(a: IItem, b: IItem, inventoryItems: IItem[], playerStashId: string): number; /** * Recursivly check items parents to see if it is inside the players inventory, not stash * @param itemId item id to check @@ -84,5 +84,5 @@ export declare class PaymentService { * @param playerStashId Players stash id * @returns true if its in inventory */ - protected isInStash(itemId: string | undefined, inventoryItems: Item[], playerStashId: string): boolean; + protected isInStash(itemId: string | undefined, inventoryItems: IItem[], playerStashId: string): boolean; } diff --git a/types/services/PmcChatResponseService.d.ts b/types/services/PmcChatResponseService.d.ts index 4a22f102..f44b12d0 100644 --- a/types/services/PmcChatResponseService.d.ts +++ b/types/services/PmcChatResponseService.d.ts @@ -1,7 +1,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Aggressor, Victim } from "@spt/models/eft/common/tables/IBotBase"; +import { IAggressor, IVictim } from "@spt/models/eft/common/tables/IBotBase"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { IGiftsConfig } from "@spt/models/spt/config/IGiftsConfig"; import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; @@ -31,14 +31,14 @@ export declare class PmcChatResponseService { * @param pmcVictims Array of bots killed by player * @param pmcData Player profile */ - sendVictimResponse(sessionId: string, pmcVictims: Victim[], pmcData: IPmcData): void; + sendVictimResponse(sessionId: string, pmcVictims: IVictim[], pmcData: IPmcData): void; /** * Not fully implemented yet, needs method of acquiring killers details after raid * @param sessionId Session id * @param pmcData Players profile * @param killer The bot who killed the player */ - sendKillerResponse(sessionId: string, pmcData: IPmcData, killer: Aggressor): void; + sendKillerResponse(sessionId: string, pmcData: IPmcData, killer: IAggressor): void; /** * Choose a localised message to send the player (different if sender was killed or killed player) * @param isVictim Is the message coming from a bot killed by the player @@ -87,11 +87,11 @@ export declare class PmcChatResponseService { * @param pmcVictims Possible victims to choose from * @returns IUserDialogInfo */ - protected chooseRandomVictim(pmcVictims: Victim[]): IUserDialogInfo; + protected chooseRandomVictim(pmcVictims: IVictim[]): IUserDialogInfo; /** * Convert a victim object into a IUserDialogInfo object * @param pmcVictim victim to convert * @returns IUserDialogInfo */ - protected getVictimDetails(pmcVictim: Victim): IUserDialogInfo; + protected getVictimDetails(pmcVictim: IVictim): IUserDialogInfo; } diff --git a/types/services/ProfileFixerService.d.ts b/types/services/ProfileFixerService.d.ts index e1026281..458828f7 100644 --- a/types/services/ProfileFixerService.d.ts +++ b/types/services/ProfileFixerService.d.ts @@ -4,7 +4,7 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Bonus, HideoutSlot } from "@spt/models/eft/common/tables/IBotBase"; +import { IBonus, IHideoutSlot } from "@spt/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt/models/eft/hideout/IHideoutArea"; @@ -83,7 +83,7 @@ export declare class ProfileFixerService { * @param pmcProfile profile to update */ protected addEmptyObjectsToHideoutAreaSlots(areaType: HideoutAreas, emptyItemCount: number, pmcProfile: IPmcData): void; - protected addObjectsToArray(count: number, slots: HideoutSlot[]): HideoutSlot[]; + protected addObjectsToArray(count: number, slots: IHideoutSlot[]): IHideoutSlot[]; /** * Check for and cap profile skills at 5100. * @param pmcProfile profile to check and fix @@ -119,5 +119,5 @@ export declare class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: Bonus[], bonus: StageBonus): Bonus | undefined; + protected getBonusFromProfile(profileBonuses: IBonus[], bonus: StageBonus): IBonus | undefined; } diff --git a/types/services/RagfairOfferService.d.ts b/types/services/RagfairOfferService.d.ts index ef33d324..7f28fe08 100644 --- a/types/services/RagfairOfferService.d.ts +++ b/types/services/RagfairOfferService.d.ts @@ -1,7 +1,7 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -53,7 +53,7 @@ export declare class RagfairOfferService { * Get an array of arrays of expired offer items + children * @returns Expired offer assorts */ - getExpiredOfferAssorts(): Item[][]; + getExpiredOfferAssorts(): IItem[][]; /** * Clear out internal expiredOffers dictionary of all items */ @@ -97,5 +97,5 @@ export declare class RagfairOfferService { * @param items Offer items to unstack * @returns Unstacked array of items */ - protected unstackOfferItems(items: Item[]): Item[]; + protected unstackOfferItems(items: IItem[]): IItem[]; } diff --git a/types/services/RagfairPriceService.d.ts b/types/services/RagfairPriceService.d.ts index 736ab01f..0284aee3 100644 --- a/types/services/RagfairPriceService.d.ts +++ b/types/services/RagfairPriceService.d.ts @@ -6,7 +6,7 @@ import { TraderHelper } from "@spt/helpers/TraderHelper"; import { MinMax } from "@spt/models/common/MinMax"; import { IPreset } from "@spt/models/eft/common/IGlobals"; import { IHandbookItem } from "@spt/models/eft/common/tables/IHandbookBase"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader"; import { IRagfairConfig, IUnreasonableModPrices } from "@spt/models/spt/config/IRagfairConfig"; import { IRagfairServerPrices } from "@spt/models/spt/ragfair/IRagfairServerPrices"; @@ -56,7 +56,7 @@ export declare class RagfairPriceService implements OnLoad { * @param offerItems offer item + children to process * @returns Rouble price */ - getFleaPriceForOfferItems(offerItems: Item[]): number; + getFleaPriceForOfferItems(offerItems: IItem[]): number; /** * get the dynamic (flea) price for an item * @param itemTpl item template id to look up @@ -96,7 +96,7 @@ export declare class RagfairPriceService implements OnLoad { * @param isPackOffer Price is for a pack type offer * @returns cost of item in desired currency */ - getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + getDynamicOfferPriceForOffer(offerItems: IItem[], desiredCurrency: string, isPackOffer: boolean): number; /** * @param itemTemplateId items tpl value * @param desiredCurrency Currency to return result in @@ -105,7 +105,7 @@ export declare class RagfairPriceService implements OnLoad { * @param isPackOffer * @returns */ - getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], isPackOffer?: boolean): number; + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: IItem, offerItems?: IItem[], isPackOffer?: boolean): number; /** * using data from config, adjust an items price to be relative to its handbook price * @param handbookPrices Prices of items in handbook @@ -143,7 +143,7 @@ export declare class RagfairPriceService implements OnLoad { * @param existingPrice price of existing base weapon * @returns price of weapon in roubles */ - protected getWeaponPresetPrice(weaponRootItem: Item, weaponWithChildren: Item[], existingPrice: number): number; + protected getWeaponPresetPrice(weaponRootItem: IItem, weaponWithChildren: IItem[], existingPrice: number): number; /** * Get the highest price for an item that is stored in handbook or trader assorts * @param itemTpl Item to get highest price of @@ -156,7 +156,7 @@ export declare class RagfairPriceService implements OnLoad { * @param presets weapon presets to choose from * @returns Default preset object */ - protected getWeaponPreset(weapon: Item): { + protected getWeaponPreset(weapon: IItem): { isDefault: boolean; preset: IPreset; }; diff --git a/types/services/RagfairTaxService.d.ts b/types/services/RagfairTaxService.d.ts index ab263661..f42f1e8f 100644 --- a/types/services/RagfairTaxService.d.ts +++ b/types/services/RagfairTaxService.d.ts @@ -1,7 +1,7 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IStorePlayerOfferTaxAmountRequestData } from "@spt/models/eft/ragfair/IStorePlayerOfferTaxAmountRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -30,6 +30,6 @@ export declare class RagfairTaxService { * @param sellInOnePiece * @returns Tax in roubles */ - calculateTax(item: Item, pmcData: IPmcData, requirementsValue: number, offerItemCount: number, sellInOnePiece: boolean): number; - protected calculateItemWorth(item: Item, itemTemplate: ITemplateItem, itemCount: number, pmcData: IPmcData, isRootItem?: boolean): number; + calculateTax(item: IItem, pmcData: IPmcData, requirementsValue: number, offerItemCount: number, sellInOnePiece: boolean): number; + protected calculateItemWorth(item: IItem, itemTemplate: ITemplateItem, itemCount: number, pmcData: IPmcData, isRootItem?: boolean): number; } diff --git a/types/services/RaidTimeAdjustmentService.d.ts b/types/services/RaidTimeAdjustmentService.d.ts index bfc099ae..3f32776e 100644 --- a/types/services/RaidTimeAdjustmentService.d.ts +++ b/types/services/RaidTimeAdjustmentService.d.ts @@ -3,7 +3,7 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; import { IGetRaidTimeRequest } from "@spt/models/eft/game/IGetRaidTimeRequest"; import { ExtractChange, IGetRaidTimeResponse } from "@spt/models/eft/game/IGetRaidTimeResponse"; -import { ILocationConfig, IScavRaidTimeLocationSettings, LootMultiplier } from "@spt/models/spt/config/ILocationConfig"; +import { ILocationConfig, ILootMultiplier, IScavRaidTimeLocationSettings } from "@spt/models/spt/config/ILocationConfig"; import { IRaidChanges } from "@spt/models/spt/location/IRaidChanges"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -30,7 +30,7 @@ export declare class RaidTimeAdjustmentService { * @param mapLootMultiplers Multiplers to adjust * @param loosePercent Percent to change values to */ - protected adjustLootMultipliers(mapLootMultiplers: LootMultiplier, loosePercent: number): void; + protected adjustLootMultipliers(mapLootMultiplers: ILootMultiplier, loosePercent: number): void; /** * Adjust bot waves to act as if player spawned later * @param mapBase map to adjust diff --git a/types/services/RepairService.d.ts b/types/services/RepairService.d.ts index 48f306e1..ec6144ef 100644 --- a/types/services/RepairService.d.ts +++ b/types/services/RepairService.d.ts @@ -4,7 +4,7 @@ import { RepairHelper } from "@spt/helpers/RepairHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { RepairKitsInfo } from "@spt/models/eft/repair/IRepairActionDataRequest"; @@ -100,7 +100,7 @@ export declare class RepairService { * @param repairKitDetails Repair kit details from db * @param repairKitInInventory Repair kit to update */ - protected addMaxResourceToKitIfMissing(repairKitDetails: ITemplateItem, repairKitInInventory: Item): void; + protected addMaxResourceToKitIfMissing(repairKitDetails: ITemplateItem, repairKitInInventory: IItem): void; /** * Chance to apply buff to an item (Armor/weapon) if repaired by armor kit * @param repairDetails Repair details of item @@ -112,7 +112,7 @@ export declare class RepairService { * @param itemConfig weapon/armor config * @param repairDetails Details for item to repair */ - addBuff(itemConfig: BonusSettings, item: Item): void; + addBuff(itemConfig: BonusSettings, item: IItem): void; /** * Check if item should be buffed by checking the item type and relevant player skill level * @param repairDetails Item that was repaired @@ -138,7 +138,7 @@ export declare class RepairService { export declare class RepairDetails { repairCost?: number; repairPoints?: number; - repairedItem: Item; + repairedItem: IItem; repairedItemIsArmor: boolean; repairAmount: number; repairedByKit: boolean; diff --git a/types/services/SeasonalEventService.d.ts b/types/services/SeasonalEventService.d.ts index 0750f387..ca4a33cc 100644 --- a/types/services/SeasonalEventService.d.ts +++ b/types/services/SeasonalEventService.d.ts @@ -1,7 +1,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IConfig } from "@spt/models/eft/common/IGlobals"; -import { Inventory } from "@spt/models/eft/common/tables/IBotType"; +import { IInventory } from "@spt/models/eft/common/tables/IBotType"; import { Season } from "@spt/models/enums/Season"; import { SeasonalEventType } from "@spt/models/enums/SeasonalEventType"; import { IHttpConfig } from "@spt/models/spt/config/IHttpConfig"; @@ -109,7 +109,7 @@ export declare class SeasonalEventService { * @param botInventory Bots inventory to iterate over * @param botRole the role of the bot being processed */ - removeChristmasItemsFromBotInventory(botInventory: Inventory, botRole: string): void; + removeChristmasItemsFromBotInventory(botInventory: IInventory, botRole: string): void; /** * Make adjusted to server code based on the name of the event passed in * @param sessionId Player id diff --git a/types/utils/HashUtil.d.ts b/types/utils/HashUtil.d.ts index 195dcdb4..c938b6cf 100644 --- a/types/utils/HashUtil.d.ts +++ b/types/utils/HashUtil.d.ts @@ -9,6 +9,12 @@ export declare class HashUtil { * @returns 24 character hash */ generate(): string; + /** + * is the passed in string a valid mongo id + * @param stringToCheck String to check + * @returns True when string is a valid mongo id + */ + isValidMongoId(stringToCheck: string): boolean; generateMd5ForData(data: string): string; generateSha1ForData(data: string): string; generateCRC32ForFile(filePath: fs.PathLike): number; From e33ef7be072662cc445cf3670449c70b6d11681f Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Fri, 27 Sep 2024 19:21:32 +0200 Subject: [PATCH 032/119] Update types --- types/callbacks/LocationCallbacks.d.ts | 3 +- types/controllers/LocationController.d.ts | 3 +- types/generators/LootGenerator.d.ts | 1 + .../eft/location/IGetAirdropLootRequest.d.ts | 3 + types/models/enums/AirdropType.d.ts | 3 +- types/models/enums/ItemTpl.d.ts | 168 ++++++++++-------- types/models/enums/TraderServiceType.d.ts | 3 +- types/models/enums/Weapons.d.ts | 2 + types/models/spt/config/IAirdropConfig.d.ts | 4 + types/models/spt/services/LootRequest.d.ts | 6 + types/services/AirdropService.d.ts | 8 +- types/services/LocationLifecycleService.d.ts | 7 +- .../tools/ItemTplGenerator/itemOverrides.d.ts | 2 + 13 files changed, 123 insertions(+), 90 deletions(-) create mode 100644 types/models/eft/location/IGetAirdropLootRequest.d.ts diff --git a/types/callbacks/LocationCallbacks.d.ts b/types/callbacks/LocationCallbacks.d.ts index 2d121b04..f3ffea37 100644 --- a/types/callbacks/LocationCallbacks.d.ts +++ b/types/callbacks/LocationCallbacks.d.ts @@ -2,6 +2,7 @@ import { LocationController } from "@spt/controllers/LocationController"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { ILocationsGenerateAllResponse } from "@spt/models/eft/common/ILocationsSourceDestinationBase"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; +import { IGetAirdropLootRequest } from "@spt/models/eft/location/IGetAirdropLootRequest"; import { IGetAirdropLootResponse } from "@spt/models/eft/location/IGetAirdropLootResponse"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; export declare class LocationCallbacks { @@ -11,5 +12,5 @@ export declare class LocationCallbacks { /** Handle client/locations */ getLocationData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/airdrop/loot */ - getAirdropLoot(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getAirdropLoot(url: string, info: IGetAirdropLootRequest, sessionID: string): IGetBodyResponseData; } diff --git a/types/controllers/LocationController.d.ts b/types/controllers/LocationController.d.ts index 64aa20fb..1321d63e 100644 --- a/types/controllers/LocationController.d.ts +++ b/types/controllers/LocationController.d.ts @@ -1,4 +1,5 @@ import { ILocationsGenerateAllResponse } from "@spt/models/eft/common/ILocationsSourceDestinationBase"; +import { IGetAirdropLootRequest } from "@spt/models/eft/location/IGetAirdropLootRequest"; import { IGetAirdropLootResponse } from "@spt/models/eft/location/IGetAirdropLootResponse"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -22,5 +23,5 @@ export declare class LocationController { */ generateAll(sessionId: string): ILocationsGenerateAllResponse; /** Handle client/airdrop/loot */ - getAirdropLoot(): IGetAirdropLootResponse; + getAirdropLoot(request: IGetAirdropLootRequest): IGetAirdropLootResponse; } diff --git a/types/generators/LootGenerator.d.ts b/types/generators/LootGenerator.d.ts index 37124a06..be1c58bf 100644 --- a/types/generators/LootGenerator.d.ts +++ b/types/generators/LootGenerator.d.ts @@ -37,6 +37,7 @@ export declare class LootGenerator { * @returns An array of loot items */ createRandomLoot(options: LootRequest): IItem[]; + createForcedLoot(airdropConfig: LootRequest): IItem[]; protected getItemRewardPool(itemTplBlacklist: string[], itemTypeWhitelist: string[], useRewardItemBlacklist: boolean, allowBossItems: boolean): { itemPool: [string, ITemplateItem][]; blacklist: Set; diff --git a/types/models/eft/location/IGetAirdropLootRequest.d.ts b/types/models/eft/location/IGetAirdropLootRequest.d.ts new file mode 100644 index 00000000..c8a9cc9b --- /dev/null +++ b/types/models/eft/location/IGetAirdropLootRequest.d.ts @@ -0,0 +1,3 @@ +export interface IGetAirdropLootRequest { + containerId: string; +} diff --git a/types/models/enums/AirdropType.d.ts b/types/models/enums/AirdropType.d.ts index 2c21ead0..98c13cfa 100644 --- a/types/models/enums/AirdropType.d.ts +++ b/types/models/enums/AirdropType.d.ts @@ -2,5 +2,6 @@ export declare enum AirdropTypeEnum { COMMON = "mixed", SUPPLY = "barter", FOOD_MEDICAL = "foodMedical", - WEAPON_ARMOR = "weaponArmor" + WEAPON_ARMOR = "weaponArmor", + RADAR = "radar" } diff --git a/types/models/enums/ItemTpl.d.ts b/types/models/enums/ItemTpl.d.ts index 4dd29099..46502ac4 100644 --- a/types/models/enums/ItemTpl.d.ts +++ b/types/models/enums/ItemTpl.d.ts @@ -37,8 +37,8 @@ export declare enum ItemTpl { AMMOBOX_366TKM_GEKSA_20RND = "657023fcbfc87b3a34093213", AMMOBOX_45ACP_AP_50RND = "6489879db5a2df1c815a04ef", AMMOBOX_45ACP_FMJ_50RND = "6570240ecfc010a0f50069f2", - AMMOBOX_45ACP_HSHOCK_50RND = "65702406bfc87b3a34093216", - AMMOBOX_45ACP_LASERFMJ_50RND = "6570240a1419851aef03e6f7", + AMMOBOX_45ACP_HYDRASHOK_50RND = "65702406bfc87b3a34093216", + AMMOBOX_45ACP_LASERMATCH_50RND = "6570240a1419851aef03e6f7", AMMOBOX_45ACP_RIP_50RND = "65702414c5d7d4cb4d078555", AMMOBOX_46X30_ACTION_SX_40RND = "657024c81419851aef03e712", AMMOBOX_46X30_AP_SX_40RND = "6489870774a806211e4fb685", @@ -245,8 +245,10 @@ export declare enum ItemTpl { AMMO_26X75_FLARE = "62389bc9423ed1685422dc57", AMMO_26X75_GREEN = "62389aaba63f32501b1b444f", AMMO_26X75_RED = "62389ba9a63f32501b1b4451", + AMMO_26X75_SIGNAL_FLARE_BLUE = "66d97834d2985e11480d5c1e", AMMO_26X75_SIGNAL_FLARE_GREEN = "624c0570c9b794431568f5d5", AMMO_26X75_SIGNAL_FLARE_RED = "624c09cfbc2e27219346d955", + AMMO_26X75_SIGNAL_FLARE_SPECIAL_YELLOW = "66d9f3047b82b9a9aa055d81", AMMO_26X75_SIGNAL_FLARE_WHITE = "624c09da2cec124eb67c1046", AMMO_26X75_SIGNAL_FLARE_YELLOW = "624c09e49b98e019a3315b66", AMMO_26X75_YELLOW = "62389be94d5d474bf712e709", @@ -556,8 +558,8 @@ export declare enum ItemTpl { ASSAULTRIFLE_RIFLE_DYNAMICS_RD704_762X39_ASSAULT_RIFLE = "628a60ae6b1d481ff772e9c8", ASSAULTRIFLE_SAG_AK545_545X39_CARBINE = "628b5638ad252a16da6dd245", ASSAULTRIFLE_SAG_AK545_SHORT_545X39_CARBINE = "628b9c37a733087d0d7fe84b", + ASSAULTRIFLE_SIG_MCXSPEAR_68X51_ASSAULT_RIFLE = "65290f395ae2ae97b80fdf2d", ASSAULTRIFLE_SIG_MCX_300_BLACKOUT_ASSAULT_RIFLE = "5fbcc1d9016cce60e8341ab3", - ASSAULTRIFLE_SIG_MCX_SPEAR_68X51_ASSAULT_RIFLE = "65290f395ae2ae97b80fdf2d", ASSAULTRIFLE_STEYR_AUG_A1_556X45_ASSAULT_RIFLE = "62e7c4fba689e8c9c50dfc38", ASSAULTRIFLE_STEYR_AUG_A3_556X45_ASSAULT_RIFLE = "63171672192e68c5460cebc5", ASSAULTSCOPE_ELCAN_SPECTERDR_1X4X_SCOPE = "57ac965c24597706be5f975c", @@ -644,7 +646,7 @@ export declare enum ItemTpl { BACKPACK_MYSTERY_RANCH_SATL_BRIDGER_ASSAULT_PACK_FOLIAGE = "656e0436d44a1bb4220303a0", BACKPACK_MYSTERY_RANCH_TERRAPLANE = "56e294cdd2720b603a8b4575", BACKPACK_OAKLEY_MECHANISM_HEAVY_DUTY_BACKPACK_BLACK = "5d5d940f86f7742797262046", - BACKPACK_PARTIZANS_BAG = "66a9f98f3bd5a41b162030f4", + BACKPACK_PARTISANS_BAG = "66a9f98f3bd5a41b162030f4", BACKPACK_PILGRIM_TOURIST = "59e763f286f7742ee57895da", BACKPACK_SANITARS_BAG = "5e997f0b86f7741ac73993e2", BACKPACK_SANTAS_BAG = "61b9e1aaef9a1b5d6a79899a", @@ -734,9 +736,9 @@ export declare enum ItemTpl { BARREL_M870_12GA_660MM_VENT_RIB = "5a787fadc5856700155a6ca1", BARREL_M870_12GA_SAWEDOFF_325MM = "5a787fdfc5856700142fdd9a", BARREL_M9A3_9X19_THREADED = "5cadc1c6ae9215000f2775a4", + BARREL_MCXSPEAR_68X51_330MM = "652910565ae2ae97b80fdf35", BARREL_MCX_300_BLK_171MM = "5fbbfabed5cb881a7363194e", BARREL_MCX_300_BLK_229MM = "5fbbfacda56d053a3543f799", - BARREL_MCX_SPEAR_68X51_330MM = "652910565ae2ae97b80fdf35", BARREL_MDR_556X45_16_INCH = "5c48a2852e221602b21d5923", BARREL_MDR_762X51_16_INCH = "5dcbe9431e1f4616d354987e", BARREL_MK18_338_LM_24_INCH = "5fc23678ab884124df0cd590", @@ -816,7 +818,7 @@ export declare enum ItemTpl { BARREL_UZI_PRO_9X19_210MM = "66867023c3d473265104f384", BARREL_UZI_PRO_9X19_240MM = "668670432b934a68630a7fe8", BARREL_UZI_PRO_9X19_PIKE_ARMS_114MM_THREADED = "668031705014e211b4078046", - BARREL_VPO215_GORNOSTAY_366TKM_600MM = "5de65547883dde217541644b", + BARREL_VPO21502_366TKM_600MM = "5de65547883dde217541644b", BARREL_VSK94_9X39 = "645123013d52156624001fd1", BARTER_42_SIGNATURE_BLEND_ENGLISH_TEA = "5bc9be8fd4351e00334cae6e", BARTER_6STEN140M_MILITARY_BATTERY = "5d03794386f77420415576f5", @@ -894,6 +896,7 @@ export declare enum ItemTpl { BARTER_FLEECE_FABRIC = "5e2af47786f7746d404f3aaa", BARTER_FP100_FILTER_ABSORBER = "5d1b2f3f86f774252167a52c", BARTER_FUEL_CONDITIONER = "5b43575a86f77424f443fe62", + BARTER_GARY_ZONT_PORTABLE_ELECTRONIC_WARFARE_DEVICE = "66d9f8744827a77e870ecaf1", BARTER_GAS_ANALYZER = "590a3efd86f77437d351a25b", BARTER_GAS_MASK_AIR_FILTER = "590c595c86f7747884343ad7", BARTER_GEIGERMULLER_COUNTER = "5672cb724bdc2dc2088b456b", @@ -915,6 +918,7 @@ export declare enum ItemTpl { BARTER_IRIDIUM_MILITARY_THERMAL_VISION_MODULE = "5d0377ce86f774186372f689", BARTER_KEKTAPE_DUCT_TAPE = "5e2af29386f7746d4159f077", BARTER_KILLA_FIGURINE = "66572c82ad599021091c6118", + BARTER_KOSA_UAV_ELECTRONIC_JAMMING_DEVICE = "66d9f7e7099cf6adcc07a369", BARTER_LEDX_SKIN_TRANSILLUMINATOR = "5c0530ee86f774697952d952", BARTER_LEGA_MEDAL = "6656560053eaaa7a23349c86", BARTER_LIGHT_BULB = "5d1b392c86f77425243e98fe", @@ -980,6 +984,7 @@ export declare enum ItemTpl { BARTER_PRINTED_CIRCUIT_BOARD = "590a3b0486f7743954552bdb", BARTER_PRINTER_PAPER = "577e1c9d2459773cd707c525", BARTER_PROPANE_TANK_5L = "59fafb5d86f774067a6f2084", + BARTER_RADAR_STATION_SPARE_PARTS = "66d9f7256916142b3b02276e", BARTER_RADIATOR_HELIX = "5d1c774f86f7746d6620f8db", BARTER_RAM_STICK = "57347baf24597738002c6178", BARTER_RATCHET_WRENCH = "60391afc25aff57af81f7085", @@ -1393,8 +1398,8 @@ export declare enum ItemTpl { CHARGE_AR15_GEISSELE_ACH_CHARGING_HANDLE_DDC = "5ea16d4d5aad6446a939753d", CHARGE_AR15_HK_EXTENDED_LATCH_CHARGING_HANDLE = "5bb20dbcd4351e44f824c04e", CHARGE_AR15_MASP_INDUSTRIES_AMBIDEXTROUS_BATTLE_CHARGING_HANDLE = "6033749e88382f4fab3fd2c5", - CHARGE_AR15_RADIAN_WEAPONS_RAPTOR_CHARGING_HANDLE = "5b2240bf5acfc40dc528af69", - CHARGE_AR15_RADIAN_WEAPONS_RAPTOR_CHARGING_HANDLE_GREY = "5d44334ba4b9362b346d1948", + CHARGE_AR15_RADIAN_WEAPONS_RAPTOR_CHARGING_HANDLE_FDE = "5b2240bf5acfc40dc528af69", + CHARGE_AR15_RADIAN_WEAPONS_RAPTOR_CHARGING_HANDLE_TUNGSTEN_GREY = "5d44334ba4b9362b346d1948", CHARGE_AR15_RAINIER_ARMS_AVALANCHE_MOD2_CHARGING_HANDLE = "5f633ff5c444ce7e3c30a006", CHARGE_BENELLI_M3_SUPER_90_CHARGING_HANDLE = "625ec45bb14d7326ac20f572", CHARGE_FN_P90_CHARGING_HANDLE = "5cc6ea78e4a949000e1ea3c1", @@ -1403,8 +1408,8 @@ export declare enum ItemTpl { CHARGE_HK417_E1_EXTENDED_CHARGING_HANDLE = "61702d8a67085e45ef140b24", CHARGE_HK_MP5K_COCKING_HANDLE = "5d2f2d5748f03572ec0c0139", CHARGE_HK_MP5_COCKING_HANDLE = "5926c32286f774616e42de99", + CHARGE_MCXSPEAR_CHARGING_HANDLE = "6529109524cbe3c74a05e5b7", CHARGE_MCX_CHARGING_HANDLE = "5fbcc640016cce60e8341acc", - CHARGE_MCX_SPEAR_CHARGING_HANDLE = "6529109524cbe3c74a05e5b7", CHARGE_MK47_AMBIDEXTROUS_CHARGING_HANDLE = "606587bd6d0bd7580617bacc", CHARGE_MP9_CHARGING_HANDLE = "5de922d4b11454561e39239f", CHARGE_MPX_DOUBLE_LATCH_CHARGING_HANDLE = "58949edd86f77409483e16a9", @@ -1545,26 +1550,28 @@ export declare enum ItemTpl { FACECOVER_VENGEFUL_ZRYACHIYS_BALACLAVA = "6530e8587cbfc1e309011e37", FACECOVER_ZRYACHIYS_BALACLAVA = "63626d904aa74b8fe30ab426", FLARE_ROP30_REACTIVE_FLARE_CARTRIDGE_WHITE = "62178be9d0050232da3485d9", + FLARE_RSP30_REACTIVE_SIGNAL_CARTRIDGE_BLUE = "66d98233302686954b0c6f81", FLARE_RSP30_REACTIVE_SIGNAL_CARTRIDGE_GREEN = "6217726288ed9f0845317459", FLARE_RSP30_REACTIVE_SIGNAL_CARTRIDGE_RED = "62178c4d4ecf221597654e3d", + FLARE_RSP30_REACTIVE_SIGNAL_CARTRIDGE_SPECIAL_YELLOW = "66d9f1abb16d9aacf5068468", FLARE_RSP30_REACTIVE_SIGNAL_CARTRIDGE_YELLOW = "624c0b3340357b5f566e8766", FLASHHIDER_AAC_SCARSD_51T_762X51_FLASH_HIDER = "618178aa1cb55961fa0fdc80", FLASHHIDER_AI_338_LM_TACTICAL_MUZZLE_BRAKE = "62812081d23f207deb0ab216", FLASHHIDER_AK101_556X45_MUZZLE_BRAKECOMPENSATOR = "5ac72e615acfc43f67248aa0", - FLASHHIDER_AK102_556X45_MUZZLE_BRAKECOMPENSATOR_6P44_020 = "5ac72e725acfc400180ae701", + FLASHHIDER_AK102_556X45_MUZZLE_BRAKECOMPENSATOR = "5ac72e725acfc400180ae701", FLASHHIDER_AK103_762X39_MUZZLE_BRAKECOMPENSATOR = "5ac72e7d5acfc40016339a02", - FLASHHIDER_AK104_762X39_MUZZLE_BRAKECOMPENSATOR_6P46_020 = "5ac72e895acfc43b321d4bd5", - FLASHHIDER_AK105_545X39_MUZZLE_BRAKECOMPENSATOR_6P44_020 = "5ac72e945acfc43f3b691116", + FLASHHIDER_AK104_762X39_MUZZLE_BRAKECOMPENSATOR = "5ac72e895acfc43b321d4bd5", + FLASHHIDER_AK105_545X39_MUZZLE_BRAKECOMPENSATOR = "5ac72e945acfc43f3b691116", FLASHHIDER_AK12_545X39_MUZZLE_BRAKE = "649ec2af961514b22506b10f", - FLASHHIDER_AK74M_545X39_MUZZLE_BRAKECOMPENSATOR_6P20_020 = "5ac7655e5acfc40016339a19", - FLASHHIDER_AK74_545X39_MUZZLE_BRAKECOMPENSATOR_6P20_020 = "5649aa744bdc2ded0b8b457e", + FLASHHIDER_AK74M_545X39_MUZZLE_BRAKECOMPENSATOR = "5ac7655e5acfc40016339a19", + FLASHHIDER_AK74_545X39_MUZZLE_BRAKECOMPENSATOR = "5649aa744bdc2ded0b8b457e", FLASHHIDER_AK74_PWS_CQB_74_545X39_MUZZLE_BRAKE = "5943eeeb86f77412d6384f6b", FLASHHIDER_AK74_SRVV_MBR_JET_545X39_MUZZLE_BRAKE = "5cc9a96cd7f00c011c04e04a", FLASHHIDER_AK74_THREAD_TYPE_JMAC_CUSTOMS_RRD4C_MULTICALIBER_MUZZLE_BRAKE = "5f633f791b231926f2329f13", FLASHHIDER_AKML_SYSTEM_762X39_FLASH_HIDER = "5a0d716f1526d8000d26b1e2", FLASHHIDER_AKM_762X39_MUZZLE_BRAKECOMPENSATOR_6P1_014 = "59d64fc686f774171b243fe2", FLASHHIDER_AKM_THREAD_TYPE_JMAC_CUSTOMS_RRD4C_762X39_MUZZLE_BRAKE = "5f633f68f5750b524b45f112", - FLASHHIDER_AKS74U_545X39_MUZZLE_BRAKE_6P26_020 = "57dc324a24597759501edc20", + FLASHHIDER_AKS74U_545X39_MUZZLE_BRAKE = "57dc324a24597759501edc20", FLASHHIDER_AK_HEXAGON_REACTOR_545X39_MUZZLE_BRAKE = "615d8f5dd92c473c770212ef", FLASHHIDER_AK_LANTAC_DRAKON_762X39_MUZZLE_BRAKE = "5c878ebb2e2216001219d48a", FLASHHIDER_AK_SPIKES_TACTICAL_DYNACOMP_762X39_MUZZLE_BRAKECOMPENSATOR = "5a9ea27ca2750c00137fa672", @@ -1656,7 +1663,7 @@ export declare enum ItemTpl { FLASHHIDER_M1A_SOCOM_16_762X51_MUZZLE_BRAKECOMPENSATOR = "5aafa1c2e5b5b00015042a56", FLASHHIDER_M60E3_762X51_FLASH_HIDER = "6601281fc752a02bbe05e696", FLASHHIDER_M60E6_762X51_FLASH_HIDER = "66012a1d3dff5074ed002e2a", - FLASHHIDER_MCX_SPEAR_CLUTCHLOK_QD_68X51_SHOULDERED_FLASH_HIDER = "6529113b5ae2ae97b80fdf39", + FLASHHIDER_MCXSPEAR_CLUTCHLOK_QD_68X51_SHOULDERED_FLASH_HIDER = "6529113b5ae2ae97b80fdf39", FLASHHIDER_MOSIN_RIFLE_TACFIRE_TANKER_STYLE_762X54R_MUZZLE_BRAKE = "5bbdb83fd4351e44f824c44b", FLASHHIDER_MOSIN_RIFLE_TEXAS_PRECISION_PRODUCTS_762X54R_MUZZLE_BRAKE = "5bc5a351d4351e003477a414", FLASHHIDER_MOSIN_RIFLE_WITT_MACHINE_762X54R_MUZZLE_BRAKE = "5bc5a35cd4351e450201232f", @@ -1771,10 +1778,10 @@ export declare enum ItemTpl { FOREGRIP_ZENIT_RK5_TACTICAL = "5c1bc7432e221602b412949d", FOREGRIP_ZENIT_RK6_TACTICAL = "5c1bc7752e221602b1779b34", GASBLOCK_AK12_GAS_TUBE = "649ec107961514b22506b10c", - GASBLOCK_AK545_SAG_MK_21_GAS_TUBE = "628b8d83717774443b15e248", - GASBLOCK_AK74_GAS_TUBE_6P20_SB12 = "59c6633186f7740cf0493bb9", - GASBLOCK_AKM_GAS_TUBE_6P1_SB12 = "59d64ec286f774171d1e0a42", - GASBLOCK_AKS74U_GAS_TUBE_6P26_SB12 = "59d36a0086f7747e673f3946", + GASBLOCK_AK545_MK_21_GAS_TUBE = "628b8d83717774443b15e248", + GASBLOCK_AK74_GAS_TUBE = "59c6633186f7740cf0493bb9", + GASBLOCK_AKM_GAS_TUBE = "59d64ec286f774171d1e0a42", + GASBLOCK_AKS74U_GAS_TUBE = "59d36a0086f7747e673f3946", GASBLOCK_AK_KIBA_ARMS_VDM_CS_GAS_TUBE = "5a01ad4786f77450561fda02", GASBLOCK_AK_TROY_FULL_LENGTH_RAIL_HANDGUARD_GAS_TUBE_COMBO = "5b237e425acfc4771e1be0b6", GASBLOCK_AK_ULTIMAK_M1B_GAS_TUBE_HANDGUARD = "59ccfdba86f7747f2109a587", @@ -1791,8 +1798,8 @@ export declare enum ItemTpl { GASBLOCK_HK_416A5_LOW_PROFILE_GAS_BLOCK = "5bb20dcad4351e3bac1212da", GASBLOCK_HK_G36_GAS_BLOCK = "622b327b267a1b13a44abea3", GASBLOCK_M4A1_FRONT_SIGHT_WITH_GAS_BLOCK = "5ae30e795acfc408fb139a0b", + GASBLOCK_MCXSPEAR_ADJUSTABLE_GAS_PISTON = "652910bc24cbe3c74a05e5b9", GASBLOCK_MCX_GAS_BLOCK = "5fbc210bf24b94483f726481", - GASBLOCK_MCX_SPEAR_ADJUSTABLE_GAS_PISTON = "652910bc24cbe3c74a05e5b9", GASBLOCK_MK18_GAS_BLOCK = "5fc2360f900b1d5091531e19", GASBLOCK_MOLOT_ARMS_AKMTYPE_GAS_TUBE = "59e649f986f77411d949b246", GASBLOCK_OPSKS_GAS_TUBE = "634f036a517ccc8a960fc746", @@ -1800,7 +1807,7 @@ export declare enum ItemTpl { GASBLOCK_RD704_SLR_ION_LITE_RAILED_GAS_TUBE_HANDGUARD_GAS_TUBE_COMBO = "628a83c29179c324ed269508", GASBLOCK_SKS_GAS_TUBE = "634f02d7517ccc8a960fc744", GASBLOCK_SVDS_GAS_TUBE = "5c471c842e221615214259b5", - GASBLOCK_VPO101_VEPRHUNTER_GAS_TUBE = "5c5039be2e221602b177c9ff", + GASBLOCK_VPO101_GAS_TUBE = "5c5039be2e221602b177c9ff", GRENADELAUNCHER_FN40GL_01 = "5e81ebcd8e146c7080625e15", GRENADELAUNCHER_FN40GL_02 = "639c3fbbd0446708ee622ee9", GRENADELAUNCHER_FN40GL_03 = "639af924d0446708ee62294e", @@ -1818,11 +1825,11 @@ export declare enum ItemTpl { HANDGUARD_9A91 = "644675573d52156624001fc9", HANDGUARD_AI_AXMC_AX_KEYSLOT_16_INCH = "6281209662cba23f6c4d7a19", HANDGUARD_AK12 = "649ec127c93611967b034957", - HANDGUARD_AK545_SAG_MK3 = "628b916469015a4e1711ed8d", - HANDGUARD_AK74_6P20_SB9_POLYMER_HANDGUARD_PLUM = "5cbda9f4ae9215000e5b9bfc", - HANDGUARD_AK74_POLYMER_HANDGUARD_6P20_SB9 = "5648b1504bdc2d9d488b4584", - HANDGUARD_AK74_WOODEN_HANDGUARD_6P20_SB6 = "5648b0744bdc2d363b8b4578", - HANDGUARD_AKM_WOODEN_HANDGUARD_6P1_SB61 = "59d64f2f86f77417193ef8b3", + HANDGUARD_AK545_MK3 = "628b916469015a4e1711ed8d", + HANDGUARD_AK74M_POLYMER = "5648b1504bdc2d9d488b4584", + HANDGUARD_AK74_POLYMER_HANDGUARD_PLUM = "5cbda9f4ae9215000e5b9bfc", + HANDGUARD_AK74_WOODEN = "5648b0744bdc2d363b8b4578", + HANDGUARD_AKM_WOODEN = "59d64f2f86f77417193ef8b3", HANDGUARD_AKS74U_ALFA_ARMS_GOLIAF = "5d15ce51d7ad1a1eff619092", HANDGUARD_AKS74U_ALFA_ARMS_GOLIAF_MLOK = "647db1eca8d3399c380d195c", HANDGUARD_AKS74U_CAA_XRSU47SU_TACTICAL = "5a957c3fa2750c00137fa5f7", @@ -1933,9 +1940,9 @@ export declare enum ItemTpl { HANDGUARD_M870_FAB_DEFENSE_PR870_FORESTOCK = "5a788031c585673f2b5c1c79", HANDGUARD_M870_MAGPUL_MOE = "5a788068c5856700137e4c8f", HANDGUARD_M870_SPEEDFEED_SHORT = "5a788089c5856700142fdd9c", + HANDGUARD_MCXSPEAR_11_INCH_MLOK = "652910ef50dc782999054b97", HANDGUARD_MCX_GEN1_KEYMOD_12_INCH = "5fbc227aa56d053a3543f79e", HANDGUARD_MCX_GEN1_KEYMOD_8_INCH = "5fbc226eca32ed67276c155d", - HANDGUARD_MCX_SPEAR_11_INCH_MLOK = "652910ef50dc782999054b97", HANDGUARD_MDR_HANDGUARD_BLACK = "5dcbd6b46ec07c0c4347a564", HANDGUARD_MDR_HANDGUARD_FDE = "5c48a14f2e2216152006edd7", HANDGUARD_MK18_18_INCH = "5fc235db2770a0045c59c683", @@ -2130,16 +2137,16 @@ export declare enum ItemTpl { INFO_TOPOGRAPHIC_SURVEY_MAPS = "62a0a124de7ac81993580542", INFO_VIDEO_CASSETTE_WITH_THE_CYBORG_KILLER_MOVIE = "62a09e974f842e1bd12da3f0", INVENTORY_DEFAULT = "55d7217a4bdc2d86028b456d", - IRONSIGHT_AK105_REAR_SIGHT_6P44_SB130 = "5ac733a45acfc400192630e2", + IRONSIGHT_AK105_REAR_SIGHT = "5ac733a45acfc400192630e2", IRONSIGHT_AK12_REAR_SIGHT = "649ec2cec93611967b03495e", - IRONSIGHT_AK12_REAR_SIGHT_BASE = "649ec2da59cbb3c813042dca", - IRONSIGHT_AK545_SAG_REAR_SIGHT = "628b9471078f94059a4b9bfb", - IRONSIGHT_AK74M_REAR_SIGHT_6P20_SB2 = "5ac72e475acfc400180ae6fe", - IRONSIGHT_AK74_REAR_SIGHT_6P20_SB2 = "5649b0544bdc2d1b2b8b458a", + IRONSIGHT_AK12_REAR_SIGHT_MOUNT = "649ec2da59cbb3c813042dca", + IRONSIGHT_AK545_REAR_SIGHT = "628b9471078f94059a4b9bfb", + IRONSIGHT_AK74M_REAR_SIGHT = "5ac72e475acfc400180ae6fe", + IRONSIGHT_AK74_REAR_SIGHT = "5649b0544bdc2d1b2b8b458a", IRONSIGHT_AKMB_SYSTEM_REAR_SIGHT = "5a0eb980fcdbcb001a3b00a6", IRONSIGHT_AKMP_SYSTEM_FRONT_SIGHT_DEVICE = "5a0f096dfcdbcb0176308b15", IRONSIGHT_AKMP_SYSTEM_REAR_SIGHT_DEVICE = "5a0ed824fcdbcb0176308b0d", - IRONSIGHT_AKM_REAR_SIGHT_6P1_SB21 = "59d650cf86f7741b846413a4", + IRONSIGHT_AKM_REAR_SIGHT = "59d650cf86f7741b846413a4", IRONSIGHT_AK_RD_ENHANCED_V2_REAR_SIGHT = "628a7b23b0f75035732dd565", IRONSIGHT_AK_TAKTIKA_TULA_TT01_REAR_SIGHT_RAIL = "5649d9a14bdc2d79388b4580", IRONSIGHT_APB_REAR_SIGHT = "5aba639ed8ce8700182ece67", @@ -2241,7 +2248,7 @@ export declare enum ItemTpl { IRONSIGHT_SVT40_FRONT_SIGHT = "64119d672c6d6f921a0929fb", IRONSIGHT_SVT40_REAR_SIGHT = "64119d90dcf48d656f0aa275", IRONSIGHT_TRIJICON_ACOG_BACKUP_REAR_SIGHT = "5c05295e0db834001a66acbb", - IRONSIGHT_VPO101_VEPRHUNTER_REAR_SIGHT = "5c503b1c2e221602b21d6e9d", + IRONSIGHT_VPO101_REAR_SIGHT = "5c503b1c2e221602b21d6e9d", IRONSIGHT_VPO209_REAR_SIGHT = "59e8977386f77415a553c453", IRONSIGHT_VSS_REAR_SIGHT = "57838e1b2459774a256959b1", KEYCARD_OBJECT_11SR = "5e42c81886f7742a01529f57", @@ -2478,6 +2485,8 @@ export declare enum ItemTpl { LOOTCONTAINER_AIRDROP_COMMON_SUPPLY_CRATE = "6223349b3136504a544d1608", LOOTCONTAINER_AIRDROP_MEDICAL_CRATE = "622334c873090231d904a9fc", LOOTCONTAINER_AIRDROP_SUPPLY_CRATE = "622334fa3136504a544d160c", + LOOTCONTAINER_AIRDROP_TECHNICAL_SUPPLY_CRATE_EVENT_1 = "66da1b49099cf6adcc07a36b", + LOOTCONTAINER_AIRDROP_TECHNICAL_SUPPLY_CRATE_EVENT_2 = "66da1b546916142b3b022777", LOOTCONTAINER_AIRDROP_WEAPON_CRATE = "6223351bb5d97a7b2c635ca7", LOOTCONTAINER_BANK_CASH_REGISTER = "64d116f41a9c6143a956127d", LOOTCONTAINER_BANK_SAFE_3X3 = "66acff0a1d8e1083b303f5af", @@ -2967,7 +2976,7 @@ export declare enum ItemTpl { MOUNT_VLTOR_CASV_KEYMOD_6_INCH_RAIL = "59e0bed186f774156f04ce84", MOUNT_VOMZ_PILAD_04302_DOVETAIL = "57acb6222459771ec34b5cb0", MOUNT_VPO102_ARBALET = "609a4b4fe2ff132951242d04", - MOUNT_VPO215_GORNOSTAY_SCOPE_RAIL = "5de6558e9f98ac2bc65950fc", + MOUNT_VPO215_SCOPE_RAIL = "5de6558e9f98ac2bc65950fc", MOUNT_VSSVAL_TOZ_6P29M = "59eb7ebe86f7740b373438ce", MOUNT_VSSVAL_ZENIT_B3_MOUNT_COMBO = "5a9fc7e6a2750c0032157184", MOUNT_VSSVAL_ZENIT_B3_RING = "57a3459f245977764a01f703", @@ -3025,9 +3034,9 @@ export declare enum ItemTpl { MUZZLECOMBO_UZI_9X19_BARREL_RETAINING_NUT = "6698c9aa36ba38d29101770f", MUZZLECOMBO_UZI_PRO_9X19_BARREL_RETAINING_NUT = "668670e3fb75ee4a5e02eb16", MUZZLECOMBO_UZI_PRO_9X19_MASADA_THREAD_PROTECTOR = "668670f52a2296a8d909963c", - MUZZLECOMBO_VPO215_GORNOSTAY_THREAD_PROTECTOR = "5de6556a205ddc616a6bc4f7", - NIGHTVISION_ANPVS14_NIGHT_VISION_MONOCULAR = "57235b6f24597759bf5a30f1", + MUZZLECOMBO_VPO215_THREAD_PROTECTOR = "5de6556a205ddc616a6bc4f7", NIGHTVISION_ARMASIGHT_N15_NIGHT_VISION_GOGGLES = "5c066e3a0db834001b7353f0", + NIGHTVISION_L3HARRIS_ANPVS14_NIGHT_VISION_MONOCULAR = "57235b6f24597759bf5a30f1", NIGHTVISION_L3HARRIS_GPNVG18_NIGHT_VISION_GOGGLES = "5c0558060db834001b735271", NIGHTVISION_PNV10T_NIGHT_VISION_GOGGLES = "5c0696830db834001d23f5da", OPTICSCOPE_BELOMO_PSO1M21_4X24_SCOPE = "576fd4ec2459777f0b518431", @@ -3055,20 +3064,20 @@ export declare enum ItemTpl { OPTICSCOPE_VORTEX_RAZOR_HD_GEN2_16X24_30MM_RIFLESCOPE = "618ba27d9008e4636a67f61d", PISTOLGRIP_9A91_PISTOL_GRIP = "6450f21a3d52156624001fcf", PISTOLGRIP_AK12_PISTOL_GRIP = "5beec8ea0db834001a6f9dbf", + PISTOLGRIP_AK74_BAKELITE_PISTOL_GRIP = "5649ad3f4bdc2df8348b4585", + PISTOLGRIP_AK74_POLYMER_PISTOL_GRIP = "5649ade84bdc2d1b2b8b4587", PISTOLGRIP_AKM_BAKELITE_PISTOL_GRIP = "59e62cc886f77440d40b52a1", PISTOLGRIP_AKM_WOODEN_PISTOL_GRIP = "5a0071d486f77404e23a12b2", + PISTOLGRIP_AKS74U_BAKELITE_PISTOL_GRIP = "57e3dba62459770f0c32322b", PISTOLGRIP_AK_AEROKNOX_SCORPIUS_PISTOL_GRIP = "5f6341043ada5942720e2dc5", - PISTOLGRIP_AK_BAKELITE_PISTOL_GRIP = "59e6318286f77444dd62c4cc", - PISTOLGRIP_AK_BAKELITE_PISTOL_GRIP_6P1_SB8V = "5649ad3f4bdc2df8348b4585", - PISTOLGRIP_AK_BAKELITE_PISTOL_GRIP_6P4_SB9 = "57e3dba62459770f0c32322b", - PISTOLGRIP_AK_CG101_ARTYPE_PISTOL_GRIP_ADAPTER = "648ae3e356c6310a830fc291", PISTOLGRIP_AK_CUSTOM_ARMS_AGS74_PRO_SNIPER_KIT_PISTOL_GRIP = "6087e663132d4d12c81fd96b", - PISTOLGRIP_AK_FAB_DEFENSE_AGR47_PISTOL_GRIP = "623c3be0484b5003161840dc", + PISTOLGRIP_AK_CUSTOM_GUNS_CG101_ARTYPE_PISTOL_GRIP_ADAPTER = "648ae3e356c6310a830fc291", + PISTOLGRIP_AK_FAB_DEFENSE_AGR47_PISTOL_GRIP_FDE = "623c3be0484b5003161840dc", PISTOLGRIP_AK_KGB_MG47_PISTOL_GRIP = "5cf54404d7f00c108840b2ef", PISTOLGRIP_AK_KGB_MG47_PISTOL_GRIP_ANODIZED_RED = "5e2192a498a36665e8337386", PISTOLGRIP_AK_MAGPUL_MOE_PISTOL_GRIP_BLACK = "5b30ac585acfc433000eb79c", PISTOLGRIP_AK_MISSION_FIRST_TACTICAL_ENGAGE_AK47_PISTOL_GRIP = "63f4da90f31d4a33b87bd054", - PISTOLGRIP_AK_POLYMER_PISTOL_GRIP_6P1_SB8 = "5649ade84bdc2d1b2b8b4587", + PISTOLGRIP_AK_MOLOT_BAKELITE_PISTOL_GRIP = "59e6318286f77444dd62c4cc", PISTOLGRIP_AK_PUFGUN_SGM2_PISTOL_GRIP = "651580dc71a4f10aec4b6056", PISTOLGRIP_AK_STRIKE_INDUSTRIES_ENHANCED_PISTOL_GRIP_BLACK = "5cf50850d7f00c056e24104c", PISTOLGRIP_AK_STRIKE_INDUSTRIES_ENHANCED_PISTOL_GRIP_FDE = "5cf508bfd7f00c056e24104e", @@ -3096,14 +3105,14 @@ export declare enum ItemTpl { PISTOLGRIP_AR15_MAGPUL_MOE_PISTOL_GRIP_BLACK = "55802f5d4bdc2dac148b458f", PISTOLGRIP_AR15_MAGPUL_MOE_PISTOL_GRIP_FDE = "5d15cf3bd7ad1a67e71518b2", PISTOLGRIP_AR15_NAROH_ARMS_GRALS_PISTOL_GRIP = "59db3a1d86f77429e05b4e92", - PISTOLGRIP_AR15_SIG_M400_REDUCED_ANGLE_PISTOL_GRIP_COYOTE_TAN = "652911675ae2ae97b80fdf3c", + PISTOLGRIP_AR15_SIG_REDUCED_ANGLE_PISTOL_GRIP_COYOTE_TAN = "652911675ae2ae97b80fdf3c", PISTOLGRIP_AR15_STARK_AR_RIFLE_GRIP_BLACK = "59db3acc86f7742a2c4ab912", PISTOLGRIP_AR15_STARK_AR_RIFLE_GRIP_FDE = "59db3b0886f77429d72fb895", PISTOLGRIP_AR15_TACTICAL_DYNAMICS_HEXGRIP_PISTOL_GRIP = "615d8faecabb9b7ad90f4d5d", PISTOLGRIP_AR15_TACTICAL_DYNAMICS_SKELETONIZED_PISTOL_GRIP = "5b07db875acfc40dc528a5f6", PISTOLGRIP_AS_VAL_PISTOL_GRIP_BLACK = "6565b91666492762f5029c0b", PISTOLGRIP_AS_VAL_PISTOL_GRIP_PLUM = "57c44fa82459772d2d75e415", - PISTOLGRIP_AS_VAL_ROTOR_43_PISTOL_GRIP_BUFFER_TUBE = "5a69a2ed8dc32e000d46d1f1", + PISTOLGRIP_AS_VAL_ROTOR_43_PISTOL_GRIP_WITH_BUFFER_TUBE = "5a69a2ed8dc32e000d46d1f1", PISTOLGRIP_BENELLI_M3_TELESCOPIC_STOCK_PISTOL_GRIP = "6259c3d8012d6678ec38eeb8", PISTOLGRIP_CHIAPPA_RHINO_PLASTIC_PISTOL_GRIP = "619f4ab2d25cbd424731fb95", PISTOLGRIP_CHIAPPA_RHINO_WOODEN_PISTOL_GRIP = "619f4bffd25cbd424731fb97", @@ -3408,14 +3417,14 @@ export declare enum ItemTpl { RANGEFINDER_VORTEX_RANGER_1500 = "61605e13ffa6e502ac5e7eef", RECEIVER_AI_AXMC_338_LM_CHASSIS = "6281204f308cb521f87a8f9b", RECEIVER_AI_AXMC_UPPER = "62811fbf09427b40ab14e767", - RECEIVER_AK12_DUST_COVER = "649ec2f3961514b22506b111", - RECEIVER_AK545_SAG_RAILED_DUST_COVER = "628b9be6cff66b70c002b14c", - RECEIVER_AK74M_DUST_COVER_6P34_01 = "5ac50da15acfc4001718d287", - RECEIVER_AK74_DUST_COVER_6P20_01 = "5649af094bdc2df8348b4586", - RECEIVER_AKM_DUST_COVER_6P1_01 = "59d6507c86f7741b846413a2", + RECEIVER_AK12_RAILED_DUST_COVER = "649ec2f3961514b22506b111", + RECEIVER_AK545_RAILED_DUST_COVER = "628b9be6cff66b70c002b14c", + RECEIVER_AK74M_DUST_COVER = "5ac50da15acfc4001718d287", + RECEIVER_AK74_DUST_COVER = "5649af094bdc2df8348b4586", + RECEIVER_AKM_DUST_COVER = "59d6507c86f7741b846413a2", RECEIVER_AKS74UB_DUST_COVER = "5839a7742459773cf9693481", - RECEIVER_AKS74U_DUST_COVER_6P26_SB7 = "57dc334d245977597164366f", - RECEIVER_AKS74U_LEGAL_ARSENAL_PILIGRIM_RAILED_DUST_COVER = "655cb6b5d680a544f30607fa", + RECEIVER_AKS74U_DUST_COVER = "57dc334d245977597164366f", + RECEIVER_AKS74U_LEGAL_ARSENAL_PILGRIM_RAILED_DUST_COVER = "655cb6b5d680a544f30607fa", RECEIVER_AK_AKADEMIA_BASTION_DUST_COVER = "5d2c76ed48f03532f2136169", RECEIVER_AK_FAB_DEFENSE_PDC_DUST_COVER = "5d2c770c48f0354b4a07c100", RECEIVER_AK_TWS_DOG_LEG_RAIL_DUST_COVER = "5d2c772c48f0355d95672c25", @@ -3464,8 +3473,8 @@ export declare enum ItemTpl { RECEIVER_M45A1_PISTOL_SLIDE = "5f3e7823ddc4f03b010e2045", RECEIVER_M4A1_556X45_UPPER = "55d355e64bdc2d962f8b4569", RECEIVER_M9A3_PISTOL_SLIDE = "5cadc55cae921500103bb3be", + RECEIVER_MCXSPEAR_68X51_UPPER = "6529119424cbe3c74a05e5bb", RECEIVER_MCX_GEN1_300_BLK_UPPER = "5fbcc3e4d6fa9c00c571bb58", - RECEIVER_MCX_SPEAR_68X51_UPPER = "6529119424cbe3c74a05e5bb", RECEIVER_MK18_338_LM_UPPER = "5fc278107283c4046c581489", RECEIVER_MK47_RESOLUTE_762X39_UPPER = "606587a88900dc2d9a55b659", RECEIVER_MOLOT_ARMS_AKMTYPE_DUST_COVER = "59e6449086f7746c9f75e822", @@ -3498,7 +3507,7 @@ export declare enum ItemTpl { RECEIVER_SVT_DUST_COVER = "64119cdbdcf48d656f0aa272", RECEIVER_TX15_556X45_LIGHTWEIGHT_UPPER = "5d4405aaa4b9361e6a4e6bd3", RECEIVER_UZI_PRO_DUST_COVER = "6680326874b8f2050c0b9178", - RECEIVER_VPO101_VEPRHUNTER_DUST_COVER = "5c503d0a2e221602b542b7ef", + RECEIVER_VPO101_DUST_COVER = "5c503d0a2e221602b542b7ef", RECEIVER_VSS_DUST_COVER = "578395402459774a256959b5", REPAIRKITS_BODY_ARMOR_REPAIR_KIT = "591094e086f7747caa7bb2ef", REPAIRKITS_WEAPON_REPAIR_KIT = "5910968f86f77425cf569c32", @@ -3570,7 +3579,7 @@ export declare enum ItemTpl { SILENCER_KAC_QDC_65X35_SOUND_SUPPRESSOR = "55d617094bdc2d89028b4568", SILENCER_KAC_QDSS_NT4_556X45_SOUND_SUPPRESSOR_BLACK = "57da93632459771cb65bf83f", SILENCER_KAC_QDSS_NT4_556X45_SOUND_SUPPRESSOR_FDE = "57dbb57e2459774673234890", - SILENCER_MCX_SPEAR_SLX68MGQD_68X51_SOUND_SUPPRESSOR = "652911e650dc782999054b9d", + SILENCER_MCXSPEAR_SLX68MGQD_68X51_SOUND_SUPPRESSOR = "652911e650dc782999054b9d", SILENCER_MOSIN_RIFLE_BRAMIT_762X54R_SOUND_SUPPRESSOR = "5b86a0e586f7745b600ccb23", SILENCER_MP9_9X19_SOUND_SUPPRESSOR = "5de8f2d5b74cd90030650c72", SILENCER_MPXSD_9X19_INTEGRATED_SOUND_SUPPRESSOR = "58aeac1b86f77457c419f475", @@ -3578,17 +3587,17 @@ export declare enum ItemTpl { SILENCER_PL15_9X19_SOUND_SUPPRESSOR = "602a97060ddce744014caf6f", SILENCER_PP1901_VITYAZ_9X19_SOUND_SUPPRESSOR = "59bfc5c886f7743bf6794e62", SILENCER_PP9101_KEDRB_9X18PM_SOUND_SUPPRESSOR = "57f3c8cc2459773ec4480328", - SILENCER_ROTOR_43_366_TKM_MUZZLE_BRAKECOMPENSATOR = "5a9fbb74a2750c0032157181", - SILENCER_ROTOR_43_556X45_MUZZLE_BRAKECOMPENSATOR = "5a9fbb84a2750c00137fa685", - SILENCER_ROTOR_43_762X39_MUZZLE_BRAKECOMPENSATOR = "5a9fbacda2750c00141e080f", - SILENCER_ROTOR_43_762X54R_MUZZLE_BRAKECOMPENSATOR = "5e01ea19e9dc277128008c0b", - SILENCER_ROTOR_43_9X19_MUZZLE_BRAKECOMPENSATOR = "5a9fb739a2750c003215717f", + SILENCER_ROTOR_43_366_TKM_SOUND_SUPPRESSOR = "5a9fbb74a2750c0032157181", + SILENCER_ROTOR_43_556X45_SOUND_SUPPRESSOR = "5a9fbb84a2750c00137fa685", + SILENCER_ROTOR_43_762X39_SOUND_SUPPRESSOR = "5a9fbacda2750c00141e080f", + SILENCER_ROTOR_43_762X54R_SOUND_SUPPRESSOR = "5e01ea19e9dc277128008c0b", + SILENCER_ROTOR_43_9X19_SOUND_SUPPRESSOR = "5a9fb739a2750c003215717f", SILENCER_SIG_SAUER_SRD762QD_762X51_SOUND_SUPPRESSOR = "5fbe760793164a5b6278efc8", SILENCER_SIG_SAUER_SRD762TI_762X51_SOUND_SUPPRESSOR = "5fbe7618d6fa9c00c571bb6c", SILENCER_SIG_SAUER_SRD9_9X19_SOUND_SUPPRESSOR = "5c6165902e22160010261b28", SILENCER_SKS_HEXAGON_762X39_SOUND_SUPPRESSOR = "593d490386f7745ee97a1555", SILENCER_SR1MP_9X21_SOUND_SUPPRESSOR = "5a27b6bec4a282000e496f78", - SILENCER_SR2M_9X21_SOUND_SUPPRESSOR_SV1381 = "62e2a7138e1ac9380579c122", + SILENCER_SR2M_9X21_SV1381_SOUND_SUPPRESSOR = "62e2a7138e1ac9380579c122", SILENCER_SR3M_9X39_SOUND_SUPPRESSOR = "65144ff50e00edc79406836f", SILENCER_STEYR_AUG_ASE_UTRA_S_SERIES_SL7I_556X45_SOUND_SUPPRESSOR = "634eba08f69c710e0108d386", SILENCER_STEYR_AUG_RELFEX_T4AUG_RANGER_556X45_SOUND_SUPPRESSOR = "630f2982cdb9e392db0cbcc7", @@ -3599,7 +3608,7 @@ export declare enum ItemTpl { SILENCER_THUNDER_BEAST_ARMS_ULTRA_5_SOUND_SUPPRESSOR = "5d44064fa4b9361e4f6eb8b5", SILENCER_TT_762X25_MAKESHIFT_SOUND_SUPPRESSOR = "571a28e524597720b4066567", SILENCER_UZI_9X19_SOUND_SUPPRESSOR = "66993733f74fef4dfd0b04ff", - SILENCER_VPO101_VEPRHUNTER_ROTOR_43_762X51_MUZZLE_BRAKECOMPENSATOR = "5f63407e1b231926f2329f15", + SILENCER_VPO101_ROTOR_43_762X51_SOUND_SUPPRESSOR = "5f63407e1b231926f2329f15", SILENCER_VSS_9X39_INTEGRAL_BARRELSUPPRESSOR = "57838c962459774a1651ec63", SMG_BT_MP9N_9X19_SUBMACHINE_GUN = "5de7bd7bfd6b4e6e2276dc25", SMG_BT_MP9_9X19_SUBMACHINE_GUN = "5e00903ae9dc277128008b87", @@ -3643,6 +3652,7 @@ export declare enum ItemTpl { SPECITEM_MS2000_MARKER = "5991b51486f77447b112d44f", SPECITEM_RADIO_REPEATER = "63a0b2eabea67a6d93009e52", SPECITEM_SIGNAL_JAMMER = "5ac78a9b86f7741cca0bbd8d", + SPECITEM_THE_EYE_MORTAR_STRIKE_SIGNALING_DEVICE = "6655e35b6bc645cb7b059912", SPECITEM_WIFI_CAMERA = "5b4391a586f7745321235ab2", STASH_EDGE_OF_DARKNESS_STASH_10X68 = "5811ce772459770e9e5f9532", STASH_LEFT_BEHIND_STASH_10X40 = "5811ce572459770cba1a34ea", @@ -3679,13 +3689,13 @@ export declare enum ItemTpl { STOCK_AI_AXMC_PISTOL_GRIP = "62811e2510e26c1f344e6554", STOCK_AK12 = "5beec8c20db834001d2c465c", STOCK_AK12_BUFFER_TUBE = "649ec87d8007560a9001ab36", - STOCK_AK545_SAG_BUFFER_TUBE = "628b9a40717774443b15e9f2", + STOCK_AK545_BUFFER_TUBE = "628b9a40717774443b15e9f2", STOCK_AK74MAK100_ZENIT_PT_LOCK = "5ac78eaf5acfc4001926317a", STOCK_AK74M_CAA_AKTS_AK74_BUFFER_TUBE = "5cf50fc5d7f00c056c53f83c", - STOCK_AK74M_POLYMER_STOCK_6P34_SB15 = "5ac50c185acfc400163398d4", - STOCK_AK74_6P20_SB7_POLYMER_STOCK_PLUM = "5cbdb1b0ae9215000d50e105", - STOCK_AK74_POLYMER_STOCK_6P20_SB7 = "5649b0fc4bdc2d17108b4588", - STOCK_AK74_WOODEN_STOCK_6P20_SB5 = "5649b1c04bdc2d16268b457c", + STOCK_AK74M_POLYMER = "5ac50c185acfc400163398d4", + STOCK_AK74_POLYMER = "5649b0fc4bdc2d17108b4588", + STOCK_AK74_POLYMER_STOCK_PLUM = "5cbdb1b0ae9215000d50e105", + STOCK_AK74_WOODEN = "5649b1c04bdc2d16268b457c", STOCK_AKMAK74_CAA_AKTS_BUFFER_TUBE = "5cf518cfd7f00c065b422214", STOCK_AKMAK74_FAB_DEFENSE_UAS = "5b04473a5acfc40018632f70", STOCK_AKMAK74_HERA_ARMS_CQR47_PISTOL_GRIPBUTT = "619b69037b9de8162902673e", @@ -3695,12 +3705,12 @@ export declare enum ItemTpl { STOCK_AKMAK74_PROMAG_ARCHANGEL_OPFOR_AA47_BUTT = "6087e2a5232e5a31c233d552", STOCK_AKMAK74_RD_AK_TO_M4_BUFFER_TUBE_ADAPTER = "628a6678ccaab13006640e49", STOCK_AKMAK74_ZENIT_PT_LOCK = "5b222d335acfc4771e1be099", - STOCK_AKMSN_SHOULDER_PIECE_6P4N_SB119 = "5abcd472d8ce8700166032ae", - STOCK_AKMS_SHOULDER_PIECE_6P4_SB119 = "59ff3b6a86f77477562ff5ed", - STOCK_AKM_WOODEN_STOCK_6P1_SB5 = "59d6514b86f774171a068a08", + STOCK_AKMSN_FOLDING = "5abcd472d8ce8700166032ae", + STOCK_AKMS_FOLDING = "59ff3b6a86f77477562ff5ed", + STOCK_AKM_WOODEN = "59d6514b86f774171a068a08", STOCK_AKS74AKS74U_ZENIT_PT_LOCK = "59ecc28286f7746d7a68aa8c", - STOCK_AKS74U_METAL_SKELETON_STOCK_6P26_SB5 = "57dc347d245977596754e7a1", - STOCK_AKS74_METAL_SKELETONIZED_STOCK_6P21_SB5 = "5ab626e4d8ce87272e4c6e43", + STOCK_AKS74U_SKELETONIZED = "57dc347d245977596754e7a1", + STOCK_AKS74_SKELETONIZED = "5ab626e4d8ce87272e4c6e43", STOCK_AK_100SERIES_METAL_SKELETONIZED = "6386300124a1dc425c00577a", STOCK_AK_CUSTOM_ARMS_STEF_74_SKELETON_STOCK_EXTENSION = "6494094948796d891603e59f", STOCK_AK_GP25_ACCESSORY_KIT_RECOIL_PAD = "5a0c59791526d8dba737bba7", @@ -3893,28 +3903,28 @@ export declare enum ItemTpl { STOCK_UZI_TYPE_5_BUTT = "6699249f3c4fda6471005cba", STOCK_UZI_TYPE_6_BUTT = "669924a69950f5f4cd060295", STOCK_UZI_TYPE_7_BUTT = "6698c9e07356874dfe0a0b88", - STOCK_VPO101_VEPRHUNTER = "5c503af12e221602b177ca02", - STOCK_VPO101_VEPRHUNTER_SVDSTYLE = "5f63405df5750b524b45f114", + STOCK_VPO101_SVDSTYLE_WALNUT = "5f63405df5750b524b45f114", + STOCK_VPO101_WOODEN = "5c503af12e221602b177ca02", STOCK_VPO136_VEPRKM_WOODEN = "59e6227d86f77440d64f5dc2", STOCK_VPO209_WOODEN = "59e89d0986f77427600d226e", - STOCK_VPO215_GORNOSTAY_WOODEN = "5de655be4a9f347bc92edb88", + STOCK_VPO215_WOODEN = "5de655be4a9f347bc92edb88", STOCK_VSK94 = "6452519e3d52156624001fd5", STOCK_VSS_WOODEN = "578395e82459774a0e553c7b", + TACTICALCOMBO_BE_MEYERS_MAWLC1_TACTICAL_DEVICE = "644a3df63b0b6f03e101e065", TACTICALCOMBO_GLOCK_GTL_21_TACTICAL_FLASHLIGHT_WITH_LASER = "5a800961159bd4315e3a1657", TACTICALCOMBO_HOLOSUN_LS321_TACTICAL_DEVICE = "57fd23e32459772d0805bcf1", TACTICALCOMBO_INSIGHT_ANPEQ2_TACTICAL_DEVICE = "5d10b49bd7ad1a1a560708b0", TACTICALCOMBO_INSIGHT_WMX200_TACTICAL_FLASHLIGHT = "626becf9582c3e319310b837", TACTICALCOMBO_L3HARRIS_ANPEQ15_TACTICAL_DEVICE = "544909bb4bdc2d6f028b4577", TACTICALCOMBO_L3HARRIS_LA5BPEQ_TACTICAL_DEVICE = "5c06595c0db834001a66af6c", - TACTICALCOMBO_MAWLC1_TACTICAL_DEVICE = "644a3df63b0b6f03e101e065", - TACTICALCOMBO_NCSTAR_TACTICAL_BLUE_LASER_LAMMODULE = "5cc9c20cd7f00c001336c65d", + TACTICALCOMBO_NCSTAR_TACTICAL_BLUE_LASER = "5cc9c20cd7f00c001336c65d", TACTICALCOMBO_OLIGHT_BALDR_PRO_TACTICAL_FLASHLIGHT_WITH_LASER = "6272370ee4013c5d7e31f418", TACTICALCOMBO_OLIGHT_BALDR_PRO_TACTICAL_FLASHLIGHT_WITH_LASER_TAN = "6272379924e29f06af4d5ecb", TACTICALCOMBO_STEINER_DBALPL_TACTICAL_DEVICE = "5d2369418abbc306c62e0c80", TACTICALCOMBO_STEINER_LASTAC_2_TACTICAL_FLASHLIGHT = "5b07dd285acfc4001754240d", TACTICALCOMBO_SUREFIRE_X400_ULTRA_TACTICAL_FLASHLIGHT_WITH_LASER = "56def37dd2720bec348b456a", TACTICALCOMBO_SUREFIRE_XC1_TACTICAL_FLASHLIGHT = "5a7b483fe899ef0016170d15", - TACTICALCOMBO_TT_DLP_TACTICAL_PRECISION_LAMMODULE = "5c079ed60db834001a66b372", + TACTICALCOMBO_TT_DLP_TACTICAL_PRECISION_LASER_SIGHT = "5c079ed60db834001a66b372", TACTICALCOMBO_WILCOX_RAPTAR_ES_TACTICAL_RANGEFINDER = "61605d88ffa6e502ac5e7eeb", TACTICALCOMBO_ZENIT_KLESCH2IKS_IR_ILLUMINATOR_WITH_LASER = "5a5f1ce64f39f90b401987bc", TACTICALCOMBO_ZENIT_KLESCH2P_FLASHLIGHT_WITH_LASER = "560d657b4bdc2da74d8b4572", diff --git a/types/models/enums/TraderServiceType.d.ts b/types/models/enums/TraderServiceType.d.ts index f3586dc9..f0ca76dd 100644 --- a/types/models/enums/TraderServiceType.d.ts +++ b/types/models/enums/TraderServiceType.d.ts @@ -4,5 +4,6 @@ export declare enum TraderServiceType { CULTISTS_AID = "CultistsAid", BTR_ITEMS_DELIVERY = "BtrItemsDelivery", PLAYER_TAXI = "PlayerTaxi", - BTR_BOT_COVER = "BtrBotCover" + BTR_BOT_COVER = "BtrBotCover", + TRANSIT_ITEMS_DELIVERY = "TransitItemsDelivery" } diff --git a/types/models/enums/Weapons.d.ts b/types/models/enums/Weapons.d.ts index d0eaf91d..ff0ca8eb 100644 --- a/types/models/enums/Weapons.d.ts +++ b/types/models/enums/Weapons.d.ts @@ -50,9 +50,11 @@ export declare enum Weapons { ASSAULTRIFLE_762X51_MK_17_FDE = "6165ac306ef05c2ce828ef74", ASSAULTRIFLE_762X51_SA_58 = "5b0bbe4e5acfc40dc528a72d", ASSAULTRIFLE_9X18PM_MASTER_HAND = "5ae083b25acfc4001a5fc702", + FLARE_26X75_BLUE = "66d98233302686954b0c6f81", FLARE_26X75_FLARE_WHITE = "62178be9d0050232da3485d9", FLARE_26X75_GREEN = "6217726288ed9f0845317459", FLARE_26X75_RED = "62178c4d4ecf221597654e3d", + FLARE_26X75_S_YELLOW_SPECIAL_YELLOW = "66d9f1abb16d9aacf5068468", FLARE_26X75_YELLOW = "624c0b3340357b5f566e8766", GRENADELAUNCHER_40MMRU_FN40GL = "639af924d0446708ee62294e", GRENADELAUNCHER_40X46_FN40GL = "5e81ebcd8e146c7080625e15", diff --git a/types/models/spt/config/IAirdropConfig.d.ts b/types/models/spt/config/IAirdropConfig.d.ts index 1858e061..c1b04c70 100644 --- a/types/models/spt/config/IAirdropConfig.d.ts +++ b/types/models/spt/config/IAirdropConfig.d.ts @@ -6,6 +6,7 @@ export interface IAirdropConfig extends IBaseConfig { airdropTypeWeightings: Record; /** What rewards will the loot crate contain, keyed by drop type e.g. mixed/weaponArmor/foodMedical/barter */ loot: Record; + customAirdropMapping: Record; } /** Chance map will have an airdrop occur out of 100 - locations not included count as 0% */ export interface IAirdropChancePercent { @@ -20,6 +21,7 @@ export interface IAirdropChancePercent { } /** Loot inside crate */ export interface IAirdropLoot { + icon: AirdropTypeEnum; /** Min/max of weapons inside crate */ weaponPresetCount?: MinMax; /** Min/max of armors (head/chest/rig) inside crate */ @@ -40,4 +42,6 @@ export interface IAirdropLoot { armorLevelWhitelist?: number[]; /** Should boss items be added to airdrop crate */ allowBossItems: boolean; + useForcedLoot?: boolean; + forcedLoot?: Record; } diff --git a/types/models/spt/services/LootRequest.d.ts b/types/models/spt/services/LootRequest.d.ts index c52a8763..7e1329a0 100644 --- a/types/models/spt/services/LootRequest.d.ts +++ b/types/models/spt/services/LootRequest.d.ts @@ -1,4 +1,5 @@ import { MinMax } from "@spt/models/common/MinMax"; +import { AirdropTypeEnum } from "@spt/models/enums/AirdropType"; export interface LootRequest { weaponPresetCount: MinMax; armorPresetCount: MinMax; @@ -12,4 +13,9 @@ export interface LootRequest { armorLevelWhitelist: number[]; allowBossItems: boolean; useRewarditemBlacklist?: boolean; + useForcedLoot?: boolean; + forcedLoot?: Record; +} +export interface IAirdropLootRequest extends LootRequest { + icon?: AirdropTypeEnum; } diff --git a/types/services/AirdropService.d.ts b/types/services/AirdropService.d.ts index 465ee48a..239d6b2b 100644 --- a/types/services/AirdropService.d.ts +++ b/types/services/AirdropService.d.ts @@ -2,10 +2,11 @@ import { LootGenerator } from "@spt/generators/LootGenerator"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IItem } from "@spt/models/eft/common/tables/IItem"; +import { IGetAirdropLootRequest } from "@spt/models/eft/location/IGetAirdropLootRequest"; import { IGetAirdropLootResponse } from "@spt/models/eft/location/IGetAirdropLootResponse"; import { AirdropTypeEnum } from "@spt/models/enums/AirdropType"; import { IAirdropConfig } from "@spt/models/spt/config/IAirdropConfig"; -import { LootRequest } from "@spt/models/spt/services/LootRequest"; +import { IAirdropLootRequest } from "@spt/models/spt/services/LootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -26,13 +27,14 @@ export declare class AirdropService { protected cloner: ICloner; protected airdropConfig: IAirdropConfig; constructor(logger: ILogger, hashUtil: HashUtil, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, lootGenerator: LootGenerator, databaseService: DatabaseService, configServer: ConfigServer, cloner: ICloner); + generateCustomAirdropLoot(request: IGetAirdropLootRequest): IGetAirdropLootResponse; /** * Handle client/location/getAirdropLoot * Get loot for an airdrop container * Generates it randomly based on config/airdrop.json values * @returns Array of LootItem objects */ - generateAirdropLoot(): IGetAirdropLootResponse; + generateAirdropLoot(forcedAirdropType?: any): IGetAirdropLootResponse; /** * Create a container create item based on passed in airdrop type * @param airdropType What tpye of container: weapon/common etc @@ -49,5 +51,5 @@ export declare class AirdropService { * @param airdropType Type of airdrop to get settings for * @returns LootRequest */ - protected getAirdropLootConfigByType(airdropType: AirdropTypeEnum): LootRequest; + protected getAirdropLootConfigByType(airdropType: AirdropTypeEnum): IAirdropLootRequest; } diff --git a/types/services/LocationLifecycleService.d.ts b/types/services/LocationLifecycleService.d.ts index 0fc4c4d0..10be5afc 100644 --- a/types/services/LocationLifecycleService.d.ts +++ b/types/services/LocationLifecycleService.d.ts @@ -141,13 +141,12 @@ export declare class LocationLifecycleService { */ protected applyTraderStandingAdjustments(tradersServerProfile: Record, tradersClientProfile: Record): void; /** - * Check if player used BTR item sending service and send items to player via mail if found + * Check if player used BTR or transit item sending service and send items to player via mail if found * @param sessionId Session id * @param request End raid request */ - protected handleBTRItemTransferEvent(sessionId: string, request: IEndLocalRaidRequestData): void; - protected btrItemDelivery(sessionId: string, traderId: string, items: IItem[]): void; - protected handleTransitItemTransferEvent(sessionId: string, request: IEndLocalRaidRequestData): void; + protected handleItemTransferEvent(sessionId: string, request: IEndLocalRaidRequestData): void; + protected transferItemDelivery(sessionId: string, traderId: string, items: IItem[]): void; protected handleInsuredItemLostEvent(sessionId: string, preRaidPmcProfile: IPmcData, request: IEndLocalRaidRequestData, locationName: string): void; /** * Return the equipped items from a players inventory diff --git a/types/tools/ItemTplGenerator/itemOverrides.d.ts b/types/tools/ItemTplGenerator/itemOverrides.d.ts index 9d6089f0..5c4914a0 100644 --- a/types/tools/ItemTplGenerator/itemOverrides.d.ts +++ b/types/tools/ItemTplGenerator/itemOverrides.d.ts @@ -74,5 +74,7 @@ declare const _default: { "5e81ebcd8e146c7080625e15": string; "639c3fbbd0446708ee622ee9": string; "639af924d0446708ee62294e": string; + "66da1b49099cf6adcc07a36b": string; + "66da1b546916142b3b022777": string; }; export default _default; From e448479ee5d504295a00268538cdec44a85c0b72 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Tue, 1 Oct 2024 23:37:55 +0200 Subject: [PATCH 033/119] Remove unused service - Fixes several bugs with botgen due to override --- MIGRATION_NOTES.md | 5 -- src/di/Container.ts | 9 +-- src/models/fika/IFikaMatch.ts | 2 - .../services/LocationLifecycleService.ts | 70 ------------------- src/services/FikaMatchService.ts | 8 +-- types/controllers/MatchController.d.ts | 5 +- 6 files changed, 6 insertions(+), 93 deletions(-) delete mode 100644 MIGRATION_NOTES.md delete mode 100644 src/overrides/services/LocationLifecycleService.ts diff --git a/MIGRATION_NOTES.md b/MIGRATION_NOTES.md deleted file mode 100644 index e96c875e..00000000 --- a/MIGRATION_NOTES.md +++ /dev/null @@ -1,5 +0,0 @@ -# Migration Notes - -`LocationLifecycleService.generateLocationAndLoot` is protected. -The code in `src/overrides/services/LocationLifecycleService.ts` and `src/services/FikaMatchService.ts` works when running on a build SPT server, but not when running -from source on debug. diff --git a/src/di/Container.ts b/src/di/Container.ts index f0f1e30b..bb13dd03 100644 --- a/src/di/Container.ts +++ b/src/di/Container.ts @@ -4,20 +4,19 @@ import { FikaConfig } from "../utils/FikaConfig"; import { Overrider } from "../overrides/Overrider"; import { DialogueCallbacksOverride } from "../overrides/callbacks/DialogueCallbacks"; -import { LocationLifecycleServiceOverride } from "../overrides/services/LocationLifecycleService"; import { AchievementControllerOverride } from "../overrides/controllers/AchievementController"; import { DialogueControllerOverride } from "../overrides/controllers/DialogueController"; +import { LauncherControllerOverride } from "../overrides/controllers/LauncherController"; +import { MatchControllerOverride } from "../overrides/controllers/MatchController"; import { ProfileControllerOverride } from "../overrides/controllers/ProfileController"; // import { LocalesOverride } from "../overrides/other/Locales"; import { HttpRouterOverride } from "../overrides/routers/HttpRouter"; -import { LauncherControllerOverride } from "../overrides/controllers/LauncherController"; -import { MatchControllerOverride } from "../overrides/controllers/MatchController"; +import { FikaInsuranceService } from "../services/FikaInsuranceService"; import { FikaMatchService } from "../services/FikaMatchService"; import { FikaFriendRequestsCacheService } from "../services/cache/FikaFriendRequestsCacheService"; import { FikaPlayerRelationsCacheService } from "../services/cache/FikaPlayerRelationsCacheService"; import { FikaDedicatedRaidService } from "../services/dedicated/FikaDedicatedRaidService"; -import { FikaInsuranceService } from "../services/FikaInsuranceService"; import { FikaClientModHashesHelper } from "../helpers/FikaClientModHashesHelper"; import { FikaFriendRequestsHelper } from "../helpers/FikaFriendRequestsHelper"; @@ -82,7 +81,6 @@ export class Container { // container.registerType("Overrides", "LocalesOverride"); container.registerType("Overrides", "AchievementControllerOverride"); container.registerType("Overrides", "LauncherControllerOverride"); - container.registerType("Overrides", "LocationLifecycleServiceOverride"); container.registerType("Overrides", "MatchControllerOverride"); container.registerType("StaticRoutes", "FikaClientStaticRouter"); @@ -109,7 +107,6 @@ export class Container { container.register("Overrider", Overrider, { lifecycle: Lifecycle.Singleton }); container.register("AchievementControllerOverride", AchievementControllerOverride, { lifecycle: Lifecycle.Singleton }); container.register("LauncherControllerOverride", LauncherControllerOverride, { lifecycle: Lifecycle.Singleton }); - container.register("LocationLifecycleServiceOverride", LocationLifecycleServiceOverride, { lifecycle: Lifecycle.Singleton }); container.register("MatchControllerOverride", MatchControllerOverride, { lifecycle: Lifecycle.Singleton }); } diff --git a/src/models/fika/IFikaMatch.ts b/src/models/fika/IFikaMatch.ts index b13bae12..51773353 100644 --- a/src/models/fika/IFikaMatch.ts +++ b/src/models/fika/IFikaMatch.ts @@ -1,4 +1,3 @@ -import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; import { IGetRaidConfigurationRequestData } from "@spt/models/eft/match/IGetRaidConfigurationRequestData"; import { FikaMatchStatus } from "../enums/FikaMatchStatus"; @@ -15,7 +14,6 @@ export interface IFikaMatch { fikaVersion: string; gameVersion: string; raidConfig: IGetRaidConfigurationRequestData; - locationData: ILocationBase; status: FikaMatchStatus; timeout: number; players: Map; diff --git a/src/overrides/services/LocationLifecycleService.ts b/src/overrides/services/LocationLifecycleService.ts deleted file mode 100644 index fc326b72..00000000 --- a/src/overrides/services/LocationLifecycleService.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { DependencyContainer, inject, injectable } from "tsyringe"; - -import { LocationController } from "@spt/controllers/LocationController"; -import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; - -import { Override } from "../../di/Override"; -import { FikaMatchService } from "../../services/FikaMatchService"; -import { DatabaseService } from "@spt/services/DatabaseService"; -import { ProfileHelper } from "@spt/helpers/ProfileHelper"; -import { LocationLifecycleService } from "@spt/services/LocationLifecycleService"; -import { IStartLocalRaidRequestData } from "@spt/models/eft/match/IStartLocalRaidRequestData"; -import { IStartLocalRaidResponseData } from "@spt/models/eft/match/IStartLocalRaidResponseData"; -import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; -import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; -import { TimeUtil } from "@spt/utils/TimeUtil"; - -@injectable() -export class LocationLifecycleServiceOverride extends Override { - constructor( - @inject("DatabaseService") protected databaseService: DatabaseService, - @inject("ProfileHelper") protected profileHelper: ProfileHelper, - @inject("LocationController") protected locationController: LocationController, - @inject("HttpResponseUtil") protected httpResponseUtil: HttpResponseUtil, - @inject("FikaMatchService") protected fikaMatchService: FikaMatchService, - @inject("LocationLifecycleService") protected locationLifecycleService: LocationLifecycleService, - @inject("BotGenerationCacheService") protected botGenerationCacheService: BotGenerationCacheService, - @inject("TimeUtil") protected timeUtil: TimeUtil - ) { - super(); - } - - public execute(container: DependencyContainer): void { - container.afterResolution( - "LocationLifecycleService", - (_t, result: LocationLifecycleService) => { - result.startLocalRaid = (sessionId: string, request: IStartLocalRaidRequestData): IStartLocalRaidResponseData => { - let locationLoot: ILocationBase; - const matchId = this.fikaMatchService.getMatchIdByProfile(sessionId); - - if (matchId === undefined) { - // player isn't in a Fika match, generate new loot - locationLoot = this.locationLifecycleService.generateLocationAndLoot(request.location); - } else { - // player is in a Fika match, use match location loot - const match = this.fikaMatchService.getMatch(matchId); - locationLoot = match.locationData; - } - - const playerProfile = this.profileHelper.getPmcProfile(sessionId); - - const result: IStartLocalRaidResponseData = { - serverId: `${request.location}.${request.playerSide}.${this.timeUtil.getTimestamp()}`, // TODO - does this need to be more verbose - investigate client? - serverSettings: this.databaseService.getLocationServices(), // TODO - is this per map or global? - profile: { insuredItems: playerProfile.InsuredItems }, - - // --- ONLY PART THAT IS MODIFIED - locationLoot: locationLoot, - // --- - }; - - // Clear bot cache ready for a fresh raid - this.botGenerationCacheService.clearStoredBots(); - - return result; - }; - }, - { frequency: "Always" }, - ); - } -} diff --git a/src/services/FikaMatchService.ts b/src/services/FikaMatchService.ts index e610243a..ba11e9fa 100644 --- a/src/services/FikaMatchService.ts +++ b/src/services/FikaMatchService.ts @@ -1,19 +1,17 @@ import { inject, injectable } from "tsyringe"; -import { LocationLifecycleService } from "@spt/services/LocationLifecycleService"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { SaveServer } from "@spt/servers/SaveServer"; import { FikaMatchEndSessionMessage } from "../models/enums/FikaMatchEndSessionMessages"; import { FikaMatchStatus } from "../models/enums/FikaMatchStatus"; -import { FikaSide } from "../models/enums/FikaSide"; import { IFikaMatch } from "../models/fika/IFikaMatch"; import { IFikaPlayer } from "../models/fika/IFikaPlayer"; import { IFikaRaidCreateRequestData } from "../models/fika/routes/raid/create/IFikaRaidCreateRequestData"; import { FikaConfig } from "../utils/FikaConfig"; -import { FikaDedicatedRaidService } from "./dedicated/FikaDedicatedRaidService"; import { FikaInsuranceService } from "./FikaInsuranceService"; +import { FikaDedicatedRaidService } from "./dedicated/FikaDedicatedRaidService"; @injectable() export class FikaMatchService { @@ -22,7 +20,6 @@ export class FikaMatchService { constructor( @inject("WinstonLogger") protected logger: ILogger, - @inject("LocationLifecycleService") protected locationLifecycleService: LocationLifecycleService, @inject("SaveServer") protected saveServer: SaveServer, @inject("FikaConfig") protected fikaConfig: FikaConfig, @inject("FikaDedicatedRaidService") protected fikaDedicatedRaidService: FikaDedicatedRaidService, @@ -184,8 +181,6 @@ export class FikaMatchService { this.deleteMatch(data.serverId); } - const locationData = this.locationLifecycleService.generateLocationAndLoot(data.settings.location); - this.matches.set(data.serverId, { ips: null, port: null, @@ -193,7 +188,6 @@ export class FikaMatchService { timestamp: data.timestamp, expectedNumberOfPlayers: data.expectedNumberOfPlayers, raidConfig: data.settings, - locationData: locationData, status: FikaMatchStatus.LOADING, timeout: 0, players: new Map(), diff --git a/types/controllers/MatchController.d.ts b/types/controllers/MatchController.d.ts index a0fefced..01087ffa 100644 --- a/types/controllers/MatchController.d.ts +++ b/types/controllers/MatchController.d.ts @@ -12,7 +12,6 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { SaveServer } from "@spt/servers/SaveServer"; -import { LocationLifecycleService } from "@spt/services/LocationLifecycleService"; import { MatchLocationService } from "@spt/services/MatchLocationService"; import { ProfileSnapshotService } from "@spt/services/ProfileSnapshotService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -23,11 +22,11 @@ export declare class MatchController { protected configServer: ConfigServer; protected profileSnapshotService: ProfileSnapshotService; protected applicationContext: ApplicationContext; - protected locationLifecycleService: LocationLifecycleService; protected cloner: ICloner; protected matchConfig: IMatchConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, saveServer: SaveServer, matchLocationService: MatchLocationService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, applicationContext: ApplicationContext, locationLifecycleService: LocationLifecycleService, cloner: ICloner); + constructor(logger: ILogger, saveServer: SaveServer, matchLocationService: MatchLocationService, + configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, applicationContext: ApplicationContext, cloner: ICloner); getEnabled(): boolean; /** Handle client/match/group/delete */ deleteGroup(info: any): void; From 0aff7a40a93d346f3d09ca4c7df0a33eaed02369 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Thu, 3 Oct 2024 18:00:41 +0200 Subject: [PATCH 034/119] Update types --- types/controllers/MatchController.d.ts | 7 ++-- types/controllers/WeatherController.d.ts | 4 ++- types/generators/BotInventoryGenerator.d.ts | 9 ++++-- types/generators/WeatherGenerator.d.ts | 10 ++---- types/helpers/InRaidHelper.d.ts | 2 +- types/helpers/ProfileHelper.d.ts | 17 +--------- types/helpers/RagfairOfferHelper.d.ts | 2 +- types/helpers/WeatherHelper.d.ts | 24 ++++++++++++++ types/models/eft/common/tables/IQuest.d.ts | 32 +++++++++---------- .../eft/match/IEndLocalRaidRequestData.d.ts | 1 + .../eft/match/IStartLocalRaidRequestData.d.ts | 2 ++ types/models/eft/weather/IWeatherData.d.ts | 2 ++ types/models/spt/config/IBotConfig.d.ts | 5 +++ types/models/spt/config/IRagfairConfig.d.ts | 5 ++- types/services/InMemoryCacheService.d.ts | 29 +++++++++++++++++ types/services/LocationLifecycleService.d.ts | 25 ++++++++++++--- 16 files changed, 122 insertions(+), 54 deletions(-) create mode 100644 types/helpers/WeatherHelper.d.ts create mode 100644 types/services/InMemoryCacheService.d.ts diff --git a/types/controllers/MatchController.d.ts b/types/controllers/MatchController.d.ts index 01087ffa..7e6a34e7 100644 --- a/types/controllers/MatchController.d.ts +++ b/types/controllers/MatchController.d.ts @@ -12,21 +12,20 @@ import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { SaveServer } from "@spt/servers/SaveServer"; +import { LocationLifecycleService } from "@spt/services/LocationLifecycleService"; import { MatchLocationService } from "@spt/services/MatchLocationService"; -import { ProfileSnapshotService } from "@spt/services/ProfileSnapshotService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class MatchController { protected logger: ILogger; protected saveServer: SaveServer; protected matchLocationService: MatchLocationService; protected configServer: ConfigServer; - protected profileSnapshotService: ProfileSnapshotService; protected applicationContext: ApplicationContext; + protected locationLifecycleService: LocationLifecycleService; protected cloner: ICloner; protected matchConfig: IMatchConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, saveServer: SaveServer, matchLocationService: MatchLocationService, - configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, applicationContext: ApplicationContext, cloner: ICloner); + constructor(logger: ILogger, saveServer: SaveServer, matchLocationService: MatchLocationService, configServer: ConfigServer, applicationContext: ApplicationContext, locationLifecycleService: LocationLifecycleService, cloner: ICloner); getEnabled(): boolean; /** Handle client/match/group/delete */ deleteGroup(info: any): void; diff --git a/types/controllers/WeatherController.d.ts b/types/controllers/WeatherController.d.ts index a2ce0d8c..2717e6a8 100644 --- a/types/controllers/WeatherController.d.ts +++ b/types/controllers/WeatherController.d.ts @@ -1,4 +1,5 @@ import { WeatherGenerator } from "@spt/generators/WeatherGenerator"; +import { WeatherHelper } from "@spt/helpers/WeatherHelper"; import { IWeatherData } from "@spt/models/eft/weather/IWeatherData"; import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -10,8 +11,9 @@ export declare class WeatherController { protected logger: ILogger; protected configServer: ConfigServer; protected seasonalEventService: SeasonalEventService; + protected weatherHelper: WeatherHelper; protected weatherConfig: IWeatherConfig; - constructor(weatherGenerator: WeatherGenerator, logger: ILogger, configServer: ConfigServer, seasonalEventService: SeasonalEventService); + constructor(weatherGenerator: WeatherGenerator, logger: ILogger, configServer: ConfigServer, seasonalEventService: SeasonalEventService, weatherHelper: WeatherHelper); /** Handle client/weather */ generate(): IWeatherData; /** diff --git a/types/generators/BotInventoryGenerator.d.ts b/types/generators/BotInventoryGenerator.d.ts index 5c23c438..22bfe6ce 100644 --- a/types/generators/BotInventoryGenerator.d.ts +++ b/types/generators/BotInventoryGenerator.d.ts @@ -1,12 +1,15 @@ +import { ApplicationContext } from "@spt/context/ApplicationContext"; import { BotEquipmentModGenerator } from "@spt/generators/BotEquipmentModGenerator"; import { BotLootGenerator } from "@spt/generators/BotLootGenerator"; import { BotWeaponGenerator } from "@spt/generators/BotWeaponGenerator"; import { BotGeneratorHelper } from "@spt/helpers/BotGeneratorHelper"; import { BotHelper } from "@spt/helpers/BotHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; +import { WeatherHelper } from "@spt/helpers/WeatherHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IInventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase"; import { IBotType, IChances, IEquipment, IGeneration, IInventory } from "@spt/models/eft/common/tables/IBotType"; +import { IGetRaidConfigurationRequestData } from "@spt/models/eft/match/IGetRaidConfigurationRequestData"; import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { IGenerateEquipmentProperties } from "@spt/models/spt/bots/IGenerateEquipmentProperties"; import { EquipmentFilterDetails, IBotConfig } from "@spt/models/spt/config/IBotConfig"; @@ -22,18 +25,20 @@ export declare class BotInventoryGenerator { protected hashUtil: HashUtil; protected randomUtil: RandomUtil; protected databaseService: DatabaseService; + protected applicationContext: ApplicationContext; protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; protected botHelper: BotHelper; protected weightedRandomHelper: WeightedRandomHelper; protected itemHelper: ItemHelper; + protected weatherHelper: WeatherHelper; protected localisationService: LocalisationService; protected botEquipmentModPoolService: BotEquipmentModPoolService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, applicationContext: ApplicationContext, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, weatherHelper: WeatherHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); /** * Add equipment/weapons/loot to bot * @param sessionId Session id @@ -59,7 +64,7 @@ export declare class BotInventoryGenerator { * @param botLevel Level of bot * @param chosenGameVersion Game version for bot, only really applies for PMCs */ - protected generateAndAddEquipmentToBot(templateInventory: IInventory, wornItemChances: IChances, botRole: string, botInventory: PmcInventory, botLevel: number, chosenGameVersion: string): void; + protected generateAndAddEquipmentToBot(templateInventory: IInventory, wornItemChances: IChances, botRole: string, botInventory: PmcInventory, botLevel: number, chosenGameVersion: string, raidConfig: IGetRaidConfigurationRequestData): void; /** * Remove non-armored rigs from parameter data * @param templateEquipment Equpiment to filter TacticalVest of diff --git a/types/generators/WeatherGenerator.d.ts b/types/generators/WeatherGenerator.d.ts index c9ca02a2..4b349105 100644 --- a/types/generators/WeatherGenerator.d.ts +++ b/types/generators/WeatherGenerator.d.ts @@ -1,4 +1,5 @@ import { ApplicationContext } from "@spt/context/ApplicationContext"; +import { WeatherHelper } from "@spt/helpers/WeatherHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IWeather, IWeatherData } from "@spt/models/eft/weather/IWeatherData"; import { WindDirection } from "@spt/models/enums/WindDirection"; @@ -10,6 +11,7 @@ import { RandomUtil } from "@spt/utils/RandomUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class WeatherGenerator { protected weightedRandomHelper: WeightedRandomHelper; + protected weatherHelper: WeatherHelper; protected logger: ILogger; protected randomUtil: RandomUtil; protected timeUtil: TimeUtil; @@ -18,7 +20,7 @@ export declare class WeatherGenerator { protected configServer: ConfigServer; protected weatherConfig: IWeatherConfig; private serverStartTimestampMS; - constructor(weightedRandomHelper: WeightedRandomHelper, logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(weightedRandomHelper: WeightedRandomHelper, weatherHelper: WeatherHelper, logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer); /** * Get current + raid datetime and format into correct BSG format and return * @param data Weather data @@ -32,12 +34,6 @@ export declare class WeatherGenerator { * @returns formatted time */ protected getBsgFormattedInRaidTime(): string; - /** - * Get the current in-raid time - * @param currentDate (new Date()) - * @returns Date object of current in-raid time - */ - getInRaidTime(): Date; /** * Get current time formatted to fit BSGs requirement * @param date date to format into bsg style diff --git a/types/helpers/InRaidHelper.d.ts b/types/helpers/InRaidHelper.d.ts index 10b40d91..11b40439 100644 --- a/types/helpers/InRaidHelper.d.ts +++ b/types/helpers/InRaidHelper.d.ts @@ -39,7 +39,7 @@ export declare class InRaidHelper { * @param serverProfile Profile to update * @param postRaidProfile Profile returned by client after a raid */ - setInventory(sessionID: string, serverProfile: IPmcData, postRaidProfile: IPmcData, isSurvived: boolean): void; + setInventory(sessionID: string, serverProfile: IPmcData, postRaidProfile: IPmcData, isSurvived: boolean, isTransfer: boolean): void; /** * Iterate over inventory items and remove the property that defines an item as Found in Raid * Only removes property if item had FiR when entering raid diff --git a/types/helpers/ProfileHelper.d.ts b/types/helpers/ProfileHelper.d.ts index df468feb..e36a3497 100644 --- a/types/helpers/ProfileHelper.d.ts +++ b/types/helpers/ProfileHelper.d.ts @@ -11,7 +11,6 @@ import { ConfigServer } from "@spt/servers/ConfigServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; -import { ProfileSnapshotService } from "@spt/services/ProfileSnapshotService"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; import { Watermark } from "@spt/utils/Watermark"; @@ -24,12 +23,11 @@ export declare class ProfileHelper { protected saveServer: SaveServer; protected databaseService: DatabaseService; protected itemHelper: ItemHelper; - protected profileSnapshotService: ProfileSnapshotService; protected localisationService: LocalisationService; protected configServer: ConfigServer; protected cloner: ICloner; protected inventoryConfig: IInventoryConfig; - constructor(logger: ILogger, hashUtil: HashUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Remove/reset a completed quest condtion from players profile quest data * @param sessionID Session id @@ -47,19 +45,6 @@ export declare class ProfileHelper { * @returns Array of IPmcData objects */ getCompleteProfile(sessionId: string): IPmcData[]; - /** - * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen - * Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using - * the now updated profile values as a base, meaning it shows x2 xp gained - * Instead, clone the post-raid profile (so we dont alter its values), apply the pre-raid xp values to the cloned objects and return - * Delete snapshot of pre-raid profile prior to returning profile data - * @param sessionId Session id - * @param output pmc and scav profiles array - * @param pmcProfile post-raid pmc profile - * @param scavProfile post-raid scav profile - * @returns Updated profile array - */ - protected postRaidXpWorkaroundFix(sessionId: string, clonedPmc: IPmcData, clonedScav: IPmcData, output: IPmcData[]): IPmcData[]; /** * Sanitize any information from the profile that the client does not expect to receive * @param clonedProfile A clone of the full player profile diff --git a/types/helpers/RagfairOfferHelper.d.ts b/types/helpers/RagfairOfferHelper.d.ts index f5a21936..45b29815 100644 --- a/types/helpers/RagfairOfferHelper.d.ts +++ b/types/helpers/RagfairOfferHelper.d.ts @@ -65,7 +65,7 @@ export declare class RagfairOfferHelper { * @returns Offers the player should see */ getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcData: IPmcData): IRagfairOffer[]; - protected offerIsHiddenFromPlayerTieredFlea(tieredFlea: ITieredFlea, offer: IRagfairOffer, tieredFleaLimitTypes: string[], playerLevel: number): boolean; + protected checkAndLockOfferFromPlayerTieredFlea(tieredFlea: ITieredFlea, offer: IRagfairOffer, tieredFleaLimitTypes: string[], playerLevel: number): void; /** * Get matching offers that require the desired item and filter out offers from non traders if player is below ragfair unlock level * @param searchRequest Search request from client diff --git a/types/helpers/WeatherHelper.d.ts b/types/helpers/WeatherHelper.d.ts new file mode 100644 index 00000000..e5aa6bea --- /dev/null +++ b/types/helpers/WeatherHelper.d.ts @@ -0,0 +1,24 @@ +import { DateTime } from "@spt/models/enums/DateTime"; +import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt/servers/ConfigServer"; +import { TimeUtil } from "@spt/utils/TimeUtil"; +export declare class WeatherHelper { + protected logger: ILogger; + protected timeUtil: TimeUtil; + protected configServer: ConfigServer; + protected weatherConfig: IWeatherConfig; + constructor(logger: ILogger, timeUtil: TimeUtil, configServer: ConfigServer); + /** + * Get the current in-raid time + * @param currentDate (new Date()) + * @returns Date object of current in-raid time + */ + getInRaidTime(): Date; + /** + * Is the current raid at nighttime + * @param timeVariant PASS OR CURR (from raid settings) + * @returns True when nighttime + */ + isNightTime(timeVariant: DateTime): boolean; +} diff --git a/types/models/eft/common/tables/IQuest.d.ts b/types/models/eft/common/tables/IQuest.d.ts index 543a2a9b..68b263ea 100644 --- a/types/models/eft/common/tables/IQuest.d.ts +++ b/types/models/eft/common/tables/IQuest.d.ts @@ -17,21 +17,19 @@ export interface IQuest { image: string; type: QuestTypeEnum; isKey: boolean; - /** @deprecated - Likely not used, use 'status' instead */ - questStatus: QuestStatus; restartable: boolean; instantComplete: boolean; secretQuest: boolean; startedMessageText: string; successMessageText: string; - acceptPlayerMessage: string; + acceptPlayerMessage?: string; declinePlayerMessage: string; - completePlayerMessage: string; - templateId: string; + completePlayerMessage?: string; + templateId?: string; rewards: IQuestRewards; /** Becomes 'AppearStatus' inside client */ - status: string | number; - KeyQuest: boolean; + status?: string | number; + KeyQuest?: boolean; changeQuestMessageText: string; /** "Pmc" or "Scav" */ side: string; @@ -39,10 +37,10 @@ export interface IQuest { sptStatus?: QuestStatus; } export interface IQuestConditionTypes { - Started: IQuestCondition[]; + Started?: IQuestCondition[]; AvailableForFinish: IQuestCondition[]; AvailableForStart: IQuestCondition[]; - Success: IQuestCondition[]; + Success?: IQuestCondition[]; Fail: IQuestCondition[]; } export interface IQuestCondition { @@ -53,9 +51,9 @@ export interface IQuestCondition { visibilityConditions?: IVisibilityCondition[]; globalQuestCounterId?: string; parentId?: string; - target: string[] | string; + target?: string[] | string; value?: string | number; - type?: boolean; + type?: boolean | string; status?: QuestStatus[]; availableAfter?: number; dispersion?: number; @@ -64,10 +62,10 @@ export interface IQuestCondition { isResetOnConditionFailed?: boolean; isNecessary?: boolean; doNotResetIfCounterCompleted?: boolean; - dogtagLevel?: number; + dogtagLevel?: number | string; traderId?: string; - maxDurability?: number; - minDurability?: number; + maxDurability?: number | string; + minDurability?: number | string; counter?: IQuestConditionCounter; plantTime?: number; zoneId?: string; @@ -82,7 +80,7 @@ export interface IQuestConditionCounter { } export interface IQuestConditionCounterCondition { id: string; - dynamicLocale: boolean; + dynamicLocale?: boolean; target?: string[] | string; completeInSeconds?: number; energy?: IValueCompare; @@ -90,7 +88,7 @@ export interface IQuestConditionCounterCondition { hydration?: IValueCompare; time?: IValueCompare; compareMethod?: string; - value?: number; + value?: number | string; weapon?: string[]; distance?: ICounterConditionDistance; equipmentInclusive?: string[][]; @@ -128,7 +126,7 @@ export interface IVisibilityCondition { target: string; value?: number; dynamicLocale?: boolean; - oneSessionOnly: boolean; + oneSessionOnly?: boolean; conditionType: string; } export interface IQuestRewards { diff --git a/types/models/eft/match/IEndLocalRaidRequestData.d.ts b/types/models/eft/match/IEndLocalRaidRequestData.d.ts index 7f37b20f..08e3c120 100644 --- a/types/models/eft/match/IEndLocalRaidRequestData.d.ts +++ b/types/models/eft/match/IEndLocalRaidRequestData.d.ts @@ -13,6 +13,7 @@ export interface IEndLocalRaidRequestData { } export interface IEndRaidResult { profile: IPmcData; + /** "Survived/Transit etc" */ result: string; ExitStatus: ExitStatus; killerId: string; diff --git a/types/models/eft/match/IStartLocalRaidRequestData.d.ts b/types/models/eft/match/IStartLocalRaidRequestData.d.ts index d3b1debc..8477df54 100644 --- a/types/models/eft/match/IStartLocalRaidRequestData.d.ts +++ b/types/models/eft/match/IStartLocalRaidRequestData.d.ts @@ -6,6 +6,8 @@ export interface IStartLocalRaidRequestData { playerSide: string; isLocationTransition: boolean; transition: IStartLocalRaidTransition; + /** Should loot generation be skipped, default false */ + sptSkipLootGeneration?: boolean; } export interface IStartLocalRaidTransition { isLocationTransition: boolean; diff --git a/types/models/eft/weather/IWeatherData.d.ts b/types/models/eft/weather/IWeatherData.d.ts index 81bc7463..771e7009 100644 --- a/types/models/eft/weather/IWeatherData.d.ts +++ b/types/models/eft/weather/IWeatherData.d.ts @@ -12,10 +12,12 @@ export interface IWeather { temp: number; fog: number; rain_intensity: number; + /** 1 - 3 light rain, 3+ 'rain' */ rain: number; wind_gustiness: number; wind_direction: WindDirection; wind_speed: number; + /** < -0.4 = clear day */ cloud: number; time: string; date: string; diff --git a/types/models/spt/config/IBotConfig.d.ts b/types/models/spt/config/IBotConfig.d.ts index 1954eb07..2c2d822a 100644 --- a/types/models/spt/config/IBotConfig.d.ts +++ b/types/models/spt/config/IBotConfig.d.ts @@ -155,6 +155,11 @@ export interface RandomisationDetails { weaponMods?: Record; /** Equipment mod chances */ equipmentMods?: Record; + nighttimeChanges?: INighttimeChanges; +} +export interface INighttimeChanges { + /** Applies changes to values stored in equipmentMods */ + equipmentModsModifiers: Record; } export interface EquipmentFilterDetails { /** Between what levels do these equipment filter setting apply to */ diff --git a/types/models/spt/config/IRagfairConfig.d.ts b/types/models/spt/config/IRagfairConfig.d.ts index a62f2c9b..6c77bb55 100644 --- a/types/models/spt/config/IRagfairConfig.d.ts +++ b/types/models/spt/config/IRagfairConfig.d.ts @@ -159,7 +159,10 @@ export interface IArmorSettings { } export interface ITieredFlea { enabled: boolean; - unlocks: Record; + /** key: tpl, value: playerlevel */ + unlocksTpl: Record; + /** key: item type id, value: playerlevel */ + unlocksType: Record; ammoTiersEnabled: boolean; ammoTplUnlocks: Record; } diff --git a/types/services/InMemoryCacheService.d.ts b/types/services/InMemoryCacheService.d.ts new file mode 100644 index 00000000..6f11dd7d --- /dev/null +++ b/types/services/InMemoryCacheService.d.ts @@ -0,0 +1,29 @@ +import { ICloner } from "@spt/utils/cloners/ICloner"; +export declare class InMemoryCacheService { + protected cloner: ICloner; + protected cacheData: Record; + constructor(cloner: ICloner); + /** + * Store data into an in-memory object + * @param key key to store data against + * @param dataToCache - Data to store in cache + */ + storeByKey(key: string, dataToCache: any): void; + /** + * Retreve data stored by a key + * @param key key + * @returns Stored data + */ + getDataByKey(key: string): any | undefined; + /** + * Does data exists against the provided key + * @param key Key to check for data against + * @returns true if exists + */ + hasStoredDataByKey(key: string): boolean; + /** + * Remove data stored against key + * @param key Key to remove data against + */ + clearDataStoredByKey(key: string): void; +} diff --git a/types/services/LocationLifecycleService.d.ts b/types/services/LocationLifecycleService.d.ts index 10be5afc..77eef4f8 100644 --- a/types/services/LocationLifecycleService.d.ts +++ b/types/services/LocationLifecycleService.d.ts @@ -86,9 +86,10 @@ export declare class LocationLifecycleService { /** * Generate a maps base location (cloned) and loot * @param name Map name + * @param generateLoot OPTIONAL - Should loot be generated for the map before being returned * @returns ILocationBase */ - protected generateLocationAndLoot(name: string): ILocationBase; + protected generateLocationAndLoot(name: string, generateLoot?: boolean): ILocationBase; endLocalRaid(sessionId: string, request: IEndLocalRaidRequestData): void; /** * Was extract by car @@ -125,8 +126,18 @@ export declare class LocationLifecycleService { * @returns True if coop extract */ protected extractTakenWasCoop(extractName: string): boolean; - protected handlePostRaidPlayerScav(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, isDead: boolean, request: IEndLocalRaidRequestData): void; - protected handlePostRaidPmc(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, postRaidProfile: IPmcData, isDead: boolean, isSurvived: boolean, request: IEndLocalRaidRequestData, locationName: string): void; + protected handlePostRaidPlayerScav(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, isDead: boolean, isTransfer: boolean, request: IEndLocalRaidRequestData): void; + /** + * + * @param sessionId Player id + * @param pmcProfile Pmc profile + * @param scavProfile Scav profile + * @param isDead Player died/got left behind in raid + * @param isSurvived Not same as opposite of `isDead`, specific status + * @param request + * @param locationName + */ + protected handlePostRaidPmc(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, isDead: boolean, isSurvived: boolean, isTransfer: boolean, request: IEndLocalRaidRequestData, locationName: string): void; /** * Convert post-raid quests into correct format * Quest status comes back as a string version of the enum `Success`, not the expected value of 1 @@ -162,10 +173,16 @@ export declare class LocationLifecycleService { protected isPlayerSurvived(results: IEndRaidResult): boolean; /** * Is the player dead after a raid - dead = anything other than "survived" / "runner" - * @param statusOnExit Exit value from offraidData object + * @param results Post raid request * @returns true if dead */ protected isPlayerDead(results: IEndRaidResult): boolean; + /** + * Has the player moved from one map to another + * @param results Post raid request + * @returns True if players transfered + */ + protected isMapToMapTransfer(results: IEndRaidResult): boolean; /** * Reset the skill points earned in a raid to 0, ready for next raid * @param commonSkills Profile common skills to update From 9ae7d5071bbbe484e8d4e370fc98c0547761b946 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Thu, 3 Oct 2024 18:10:49 +0200 Subject: [PATCH 035/119] Revert "Remove unused service" This reverts commit e448479ee5d504295a00268538cdec44a85c0b72. --- src/di/Container.ts | 9 ++- src/models/fika/IFikaMatch.ts | 2 + .../services/LocationLifecycleService.ts | 70 +++++++++++++++++++ src/services/FikaMatchService.ts | 8 ++- types/controllers/MatchController.d.ts | 4 +- 5 files changed, 88 insertions(+), 5 deletions(-) create mode 100644 src/overrides/services/LocationLifecycleService.ts diff --git a/src/di/Container.ts b/src/di/Container.ts index bb13dd03..f0f1e30b 100644 --- a/src/di/Container.ts +++ b/src/di/Container.ts @@ -4,19 +4,20 @@ import { FikaConfig } from "../utils/FikaConfig"; import { Overrider } from "../overrides/Overrider"; import { DialogueCallbacksOverride } from "../overrides/callbacks/DialogueCallbacks"; +import { LocationLifecycleServiceOverride } from "../overrides/services/LocationLifecycleService"; import { AchievementControllerOverride } from "../overrides/controllers/AchievementController"; import { DialogueControllerOverride } from "../overrides/controllers/DialogueController"; -import { LauncherControllerOverride } from "../overrides/controllers/LauncherController"; -import { MatchControllerOverride } from "../overrides/controllers/MatchController"; import { ProfileControllerOverride } from "../overrides/controllers/ProfileController"; // import { LocalesOverride } from "../overrides/other/Locales"; import { HttpRouterOverride } from "../overrides/routers/HttpRouter"; +import { LauncherControllerOverride } from "../overrides/controllers/LauncherController"; +import { MatchControllerOverride } from "../overrides/controllers/MatchController"; -import { FikaInsuranceService } from "../services/FikaInsuranceService"; import { FikaMatchService } from "../services/FikaMatchService"; import { FikaFriendRequestsCacheService } from "../services/cache/FikaFriendRequestsCacheService"; import { FikaPlayerRelationsCacheService } from "../services/cache/FikaPlayerRelationsCacheService"; import { FikaDedicatedRaidService } from "../services/dedicated/FikaDedicatedRaidService"; +import { FikaInsuranceService } from "../services/FikaInsuranceService"; import { FikaClientModHashesHelper } from "../helpers/FikaClientModHashesHelper"; import { FikaFriendRequestsHelper } from "../helpers/FikaFriendRequestsHelper"; @@ -81,6 +82,7 @@ export class Container { // container.registerType("Overrides", "LocalesOverride"); container.registerType("Overrides", "AchievementControllerOverride"); container.registerType("Overrides", "LauncherControllerOverride"); + container.registerType("Overrides", "LocationLifecycleServiceOverride"); container.registerType("Overrides", "MatchControllerOverride"); container.registerType("StaticRoutes", "FikaClientStaticRouter"); @@ -107,6 +109,7 @@ export class Container { container.register("Overrider", Overrider, { lifecycle: Lifecycle.Singleton }); container.register("AchievementControllerOverride", AchievementControllerOverride, { lifecycle: Lifecycle.Singleton }); container.register("LauncherControllerOverride", LauncherControllerOverride, { lifecycle: Lifecycle.Singleton }); + container.register("LocationLifecycleServiceOverride", LocationLifecycleServiceOverride, { lifecycle: Lifecycle.Singleton }); container.register("MatchControllerOverride", MatchControllerOverride, { lifecycle: Lifecycle.Singleton }); } diff --git a/src/models/fika/IFikaMatch.ts b/src/models/fika/IFikaMatch.ts index 51773353..b13bae12 100644 --- a/src/models/fika/IFikaMatch.ts +++ b/src/models/fika/IFikaMatch.ts @@ -1,3 +1,4 @@ +import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; import { IGetRaidConfigurationRequestData } from "@spt/models/eft/match/IGetRaidConfigurationRequestData"; import { FikaMatchStatus } from "../enums/FikaMatchStatus"; @@ -14,6 +15,7 @@ export interface IFikaMatch { fikaVersion: string; gameVersion: string; raidConfig: IGetRaidConfigurationRequestData; + locationData: ILocationBase; status: FikaMatchStatus; timeout: number; players: Map; diff --git a/src/overrides/services/LocationLifecycleService.ts b/src/overrides/services/LocationLifecycleService.ts new file mode 100644 index 00000000..fc326b72 --- /dev/null +++ b/src/overrides/services/LocationLifecycleService.ts @@ -0,0 +1,70 @@ +import { DependencyContainer, inject, injectable } from "tsyringe"; + +import { LocationController } from "@spt/controllers/LocationController"; +import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; + +import { Override } from "../../di/Override"; +import { FikaMatchService } from "../../services/FikaMatchService"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; +import { LocationLifecycleService } from "@spt/services/LocationLifecycleService"; +import { IStartLocalRaidRequestData } from "@spt/models/eft/match/IStartLocalRaidRequestData"; +import { IStartLocalRaidResponseData } from "@spt/models/eft/match/IStartLocalRaidResponseData"; +import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; +import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { TimeUtil } from "@spt/utils/TimeUtil"; + +@injectable() +export class LocationLifecycleServiceOverride extends Override { + constructor( + @inject("DatabaseService") protected databaseService: DatabaseService, + @inject("ProfileHelper") protected profileHelper: ProfileHelper, + @inject("LocationController") protected locationController: LocationController, + @inject("HttpResponseUtil") protected httpResponseUtil: HttpResponseUtil, + @inject("FikaMatchService") protected fikaMatchService: FikaMatchService, + @inject("LocationLifecycleService") protected locationLifecycleService: LocationLifecycleService, + @inject("BotGenerationCacheService") protected botGenerationCacheService: BotGenerationCacheService, + @inject("TimeUtil") protected timeUtil: TimeUtil + ) { + super(); + } + + public execute(container: DependencyContainer): void { + container.afterResolution( + "LocationLifecycleService", + (_t, result: LocationLifecycleService) => { + result.startLocalRaid = (sessionId: string, request: IStartLocalRaidRequestData): IStartLocalRaidResponseData => { + let locationLoot: ILocationBase; + const matchId = this.fikaMatchService.getMatchIdByProfile(sessionId); + + if (matchId === undefined) { + // player isn't in a Fika match, generate new loot + locationLoot = this.locationLifecycleService.generateLocationAndLoot(request.location); + } else { + // player is in a Fika match, use match location loot + const match = this.fikaMatchService.getMatch(matchId); + locationLoot = match.locationData; + } + + const playerProfile = this.profileHelper.getPmcProfile(sessionId); + + const result: IStartLocalRaidResponseData = { + serverId: `${request.location}.${request.playerSide}.${this.timeUtil.getTimestamp()}`, // TODO - does this need to be more verbose - investigate client? + serverSettings: this.databaseService.getLocationServices(), // TODO - is this per map or global? + profile: { insuredItems: playerProfile.InsuredItems }, + + // --- ONLY PART THAT IS MODIFIED + locationLoot: locationLoot, + // --- + }; + + // Clear bot cache ready for a fresh raid + this.botGenerationCacheService.clearStoredBots(); + + return result; + }; + }, + { frequency: "Always" }, + ); + } +} diff --git a/src/services/FikaMatchService.ts b/src/services/FikaMatchService.ts index ba11e9fa..e610243a 100644 --- a/src/services/FikaMatchService.ts +++ b/src/services/FikaMatchService.ts @@ -1,17 +1,19 @@ import { inject, injectable } from "tsyringe"; +import { LocationLifecycleService } from "@spt/services/LocationLifecycleService"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { SaveServer } from "@spt/servers/SaveServer"; import { FikaMatchEndSessionMessage } from "../models/enums/FikaMatchEndSessionMessages"; import { FikaMatchStatus } from "../models/enums/FikaMatchStatus"; +import { FikaSide } from "../models/enums/FikaSide"; import { IFikaMatch } from "../models/fika/IFikaMatch"; import { IFikaPlayer } from "../models/fika/IFikaPlayer"; import { IFikaRaidCreateRequestData } from "../models/fika/routes/raid/create/IFikaRaidCreateRequestData"; import { FikaConfig } from "../utils/FikaConfig"; -import { FikaInsuranceService } from "./FikaInsuranceService"; import { FikaDedicatedRaidService } from "./dedicated/FikaDedicatedRaidService"; +import { FikaInsuranceService } from "./FikaInsuranceService"; @injectable() export class FikaMatchService { @@ -20,6 +22,7 @@ export class FikaMatchService { constructor( @inject("WinstonLogger") protected logger: ILogger, + @inject("LocationLifecycleService") protected locationLifecycleService: LocationLifecycleService, @inject("SaveServer") protected saveServer: SaveServer, @inject("FikaConfig") protected fikaConfig: FikaConfig, @inject("FikaDedicatedRaidService") protected fikaDedicatedRaidService: FikaDedicatedRaidService, @@ -181,6 +184,8 @@ export class FikaMatchService { this.deleteMatch(data.serverId); } + const locationData = this.locationLifecycleService.generateLocationAndLoot(data.settings.location); + this.matches.set(data.serverId, { ips: null, port: null, @@ -188,6 +193,7 @@ export class FikaMatchService { timestamp: data.timestamp, expectedNumberOfPlayers: data.expectedNumberOfPlayers, raidConfig: data.settings, + locationData: locationData, status: FikaMatchStatus.LOADING, timeout: 0, players: new Map(), diff --git a/types/controllers/MatchController.d.ts b/types/controllers/MatchController.d.ts index 7e6a34e7..eb854d08 100644 --- a/types/controllers/MatchController.d.ts +++ b/types/controllers/MatchController.d.ts @@ -14,6 +14,7 @@ import { ConfigServer } from "@spt/servers/ConfigServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { LocationLifecycleService } from "@spt/services/LocationLifecycleService"; import { MatchLocationService } from "@spt/services/MatchLocationService"; +import { ProfileSnapshotService } from "@spt/services/ProfileSnapshotService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class MatchController { protected logger: ILogger; @@ -25,7 +26,8 @@ export declare class MatchController { protected cloner: ICloner; protected matchConfig: IMatchConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, saveServer: SaveServer, matchLocationService: MatchLocationService, configServer: ConfigServer, applicationContext: ApplicationContext, locationLifecycleService: LocationLifecycleService, cloner: ICloner); + constructor(logger: ILogger, saveServer: SaveServer, matchLocationService: MatchLocationService, configServer: ConfigServer, + profileSnapshotService: ProfileSnapshotService, applicationContext: ApplicationContext, locationLifecycleService: LocationLifecycleService, cloner: ICloner); getEnabled(): boolean; /** Handle client/match/group/delete */ deleteGroup(info: any): void; From cf025689c996dc40c11d7d7549b75432b77d9632 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Thu, 3 Oct 2024 18:11:58 +0200 Subject: [PATCH 036/119] Update types --- types/controllers/MatchController.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/types/controllers/MatchController.d.ts b/types/controllers/MatchController.d.ts index eb854d08..f1488b08 100644 --- a/types/controllers/MatchController.d.ts +++ b/types/controllers/MatchController.d.ts @@ -14,7 +14,6 @@ import { ConfigServer } from "@spt/servers/ConfigServer"; import { SaveServer } from "@spt/servers/SaveServer"; import { LocationLifecycleService } from "@spt/services/LocationLifecycleService"; import { MatchLocationService } from "@spt/services/MatchLocationService"; -import { ProfileSnapshotService } from "@spt/services/ProfileSnapshotService"; import { ICloner } from "@spt/utils/cloners/ICloner"; export declare class MatchController { protected logger: ILogger; @@ -27,7 +26,7 @@ export declare class MatchController { protected matchConfig: IMatchConfig; protected pmcConfig: IPmcConfig; constructor(logger: ILogger, saveServer: SaveServer, matchLocationService: MatchLocationService, configServer: ConfigServer, - profileSnapshotService: ProfileSnapshotService, applicationContext: ApplicationContext, locationLifecycleService: LocationLifecycleService, cloner: ICloner); + applicationContext: ApplicationContext, locationLifecycleService: LocationLifecycleService, cloner: ICloner); getEnabled(): boolean; /** Handle client/match/group/delete */ deleteGroup(info: any): void; From 31736b87971c2ce8cd30581acb1d73c5c6daf2ab Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Thu, 3 Oct 2024 18:24:33 +0200 Subject: [PATCH 037/119] Improve LocationLifecycleService override --- .../controllers/ProfileController.ts | 6 +-- .../services/LocationLifecycleService.ts | 44 +++++++++++++------ 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/src/overrides/controllers/ProfileController.ts b/src/overrides/controllers/ProfileController.ts index cc91605e..d74c8aac 100644 --- a/src/overrides/controllers/ProfileController.ts +++ b/src/overrides/controllers/ProfileController.ts @@ -8,10 +8,10 @@ import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfi import { ISearchFriendRequestData } from "@spt/models/eft/profile/ISearchFriendRequestData"; import { ISearchFriendResponse } from "@spt/models/eft/profile/ISearchFriendResponse"; -import { Override } from "../../di/Override"; -import { FikaConfig } from "../../utils/FikaConfig"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { Override } from "../../di/Override"; +import { FikaConfig } from "../../utils/FikaConfig"; @injectable() export class ProfileControllerOverride extends Override { @@ -44,7 +44,7 @@ export class ProfileControllerOverride extends Override { for (const profile of Object.values(profiles)) { if (profile.info?.password === "fika-dedicated") continue; - + if (profile.characters?.pmc?.Info) { if (profile.characters.pmc.Info.Nickname.toLowerCase().startsWith(searchNicknameLowerCase)) { matches.push({ diff --git a/src/overrides/services/LocationLifecycleService.ts b/src/overrides/services/LocationLifecycleService.ts index fc326b72..9005ab07 100644 --- a/src/overrides/services/LocationLifecycleService.ts +++ b/src/overrides/services/LocationLifecycleService.ts @@ -3,16 +3,16 @@ import { DependencyContainer, inject, injectable } from "tsyringe"; import { LocationController } from "@spt/controllers/LocationController"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; -import { Override } from "../../di/Override"; -import { FikaMatchService } from "../../services/FikaMatchService"; -import { DatabaseService } from "@spt/services/DatabaseService"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; -import { LocationLifecycleService } from "@spt/services/LocationLifecycleService"; +import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; import { IStartLocalRaidRequestData } from "@spt/models/eft/match/IStartLocalRaidRequestData"; import { IStartLocalRaidResponseData } from "@spt/models/eft/match/IStartLocalRaidResponseData"; -import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { LocationLifecycleService } from "@spt/services/LocationLifecycleService"; import { TimeUtil } from "@spt/utils/TimeUtil"; +import { Override } from "../../di/Override"; +import { FikaMatchService } from "../../services/FikaMatchService"; @injectable() export class LocationLifecycleServiceOverride extends Override { @@ -36,10 +36,12 @@ export class LocationLifecycleServiceOverride extends Override { result.startLocalRaid = (sessionId: string, request: IStartLocalRaidRequestData): IStartLocalRaidResponseData => { let locationLoot: ILocationBase; const matchId = this.fikaMatchService.getMatchIdByProfile(sessionId); + // Stops TS from throwing a trantrum :) + const lifecycleService = (this.locationLifecycleService as any); if (matchId === undefined) { // player isn't in a Fika match, generate new loot - locationLoot = this.locationLifecycleService.generateLocationAndLoot(request.location); + locationLoot = lifecycleService.generateLocationAndLoot(request.location); } else { // player is in a Fika match, use match location loot const match = this.fikaMatchService.getMatch(matchId); @@ -49,17 +51,33 @@ export class LocationLifecycleServiceOverride extends Override { const playerProfile = this.profileHelper.getPmcProfile(sessionId); const result: IStartLocalRaidResponseData = { - serverId: `${request.location}.${request.playerSide}.${this.timeUtil.getTimestamp()}`, // TODO - does this need to be more verbose - investigate client? - serverSettings: this.databaseService.getLocationServices(), // TODO - is this per map or global? + serverId: `${request.location}.${request.playerSide}.${this.timeUtil.getTimestamp()}`, + serverSettings: this.databaseService.getLocationServices(), profile: { insuredItems: playerProfile.InsuredItems }, - - // --- ONLY PART THAT IS MODIFIED locationLoot: locationLoot, - // --- + transition: { + isLocationTransition: false, + transitionRaidId: "66f5750951530ca5ae09876d", + transitionCount: 0, + visitedLocations: [], + } }; - // Clear bot cache ready for a fresh raid - this.botGenerationCacheService.clearStoredBots(); + // Only has value when transitioning into map from previous one + if (request.transition) { + result.transition = request.transition; + } + + if (typeof matchId === "undefined" || sessionId === matchId) { + // Apply changes from pmcConfig to bot hostility values + lifecycleService.adjustBotHostilitySettings(result.locationLoot); + + lifecycleService.adjustExtracts(request.playerSide, request.location, result.locationLoot); + + // Clear bot cache ready for a fresh raid + lifecycleService.botGenerationCacheService.clearStoredBots(); + lifecycleService.botNameService.clearNameCache(); + } return result; }; From 16a0f1edacf769b4fcb6b93b2e310918edbdafa8 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Thu, 3 Oct 2024 18:24:45 +0200 Subject: [PATCH 038/119] Remove unused imports --- src/overrides/controllers/ProfileController.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/overrides/controllers/ProfileController.ts b/src/overrides/controllers/ProfileController.ts index d74c8aac..2768dcad 100644 --- a/src/overrides/controllers/ProfileController.ts +++ b/src/overrides/controllers/ProfileController.ts @@ -8,8 +8,6 @@ import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfi import { ISearchFriendRequestData } from "@spt/models/eft/profile/ISearchFriendRequestData"; import { ISearchFriendResponse } from "@spt/models/eft/profile/ISearchFriendResponse"; -import { Item } from "@spt/models/eft/common/tables/IItem"; -import { ILogger } from "@spt/models/spt/utils/ILogger"; import { Override } from "../../di/Override"; import { FikaConfig } from "../../utils/FikaConfig"; From 018f99dd63f5653c1d3272eaa6b5f8ce1c57aad8 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Fri, 4 Oct 2024 09:28:20 +0200 Subject: [PATCH 039/119] Update locales --- assets/database/locales/global/en.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/database/locales/global/en.json b/assets/database/locales/global/en.json index c3902922..0fc6f4f7 100644 --- a/assets/database/locales/global/en.json +++ b/assets/database/locales/global/en.json @@ -90,5 +90,6 @@ "F_UI_CoopGameMode": "Fika Co-op Game Mode", "F_UI_CoopRaidSettings": "Fika Co-op Raid Settings", "F_UI_FikaAlwaysCoop": "Co-op is always enabled in Fika", - "F_UI_UpnpFailed": "UPnP mapping failed. Make sure the selected port is not already open!\nDisable UPnP if you are using a VPN." + "F_UI_UpnpFailed": "UPnP mapping failed. Make sure the selected port is not already open!\nDisable UPnP if you are using a VPN.", + "F_UI_InitWeather": "Generating weather..." } \ No newline at end of file From 7f2e93a66fb7243400ada02620c24021dcbe8aac Mon Sep 17 00:00:00 2001 From: Archangel Date: Mon, 7 Oct 2024 18:29:53 +0200 Subject: [PATCH 040/119] Cleanup dedicated web socket --- src/di/Container.ts | 2 -- src/websockets/FikaDedicatedRaidWebSocket.ts | 9 ++++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/di/Container.ts b/src/di/Container.ts index f0f1e30b..a8f2c908 100644 --- a/src/di/Container.ts +++ b/src/di/Container.ts @@ -44,7 +44,6 @@ import { FikaRaidStaticRouter } from "../routers/static/FikaRaidStaticRouter"; import { FikaSendItemStaticRouter } from "../routers/static/FikaSendItemStaticRouter"; import { FikaUpdateStaticRouter } from "../routers/static/FikaUpdateStaticRouter"; -import { IWebSocketConnectionHandler } from "@spt/servers/ws/IWebSocketConnectionHandler"; import { FikaDedicatedRaidWebSocket } from "../websockets/FikaDedicatedRaidWebSocket"; import { Fika } from "../Fika"; @@ -157,6 +156,5 @@ export class Container { private static registerWebSockets(container: DependencyContainer): void { container.register("FikaDedicatedRaidWebSocket", FikaDedicatedRaidWebSocket, { lifecycle: Lifecycle.Singleton }); - container.register("FikaDedicatedRaidWebSocket", FikaDedicatedRaidWebSocket, { lifecycle: Lifecycle.Singleton }); } } diff --git a/src/websockets/FikaDedicatedRaidWebSocket.ts b/src/websockets/FikaDedicatedRaidWebSocket.ts index a8e24723..9ff7842f 100644 --- a/src/websockets/FikaDedicatedRaidWebSocket.ts +++ b/src/websockets/FikaDedicatedRaidWebSocket.ts @@ -1,12 +1,11 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { inject, injectable } from "tsyringe"; -import { IDedicatedClientInfo } from "../models/fika/dedicated/IDedicatedClientInfo"; import { IWebSocketConnectionHandler } from "@spt/servers/ws/IWebSocketConnectionHandler"; import { IncomingMessage } from "http"; import { WebSocket } from "ws"; @injectable() -export class FikaDedicatedRaidWebSocket implements IWebSocketConnectionHandler{ +export class FikaDedicatedRaidWebSocket implements IWebSocketConnectionHandler { public clientWebSockets: Record; constructor( @@ -22,7 +21,7 @@ export class FikaDedicatedRaidWebSocket implements IWebSocketConnectionHandler{ public getSocketId(): string { - return "FikaDedicatedRaidService"; + return "Fika Dedicated Raid Service"; } public getHookUrl(): string @@ -41,11 +40,11 @@ export class FikaDedicatedRaidWebSocket implements IWebSocketConnectionHandler{ ws.on("message", (msg) => this.onMessage(sessionID, msg.toString())); } - public onMessage(sessionID: string, msg: string) { + public onMessage(sessionID: string, msg: string): void { // Do nothing } - public keepWebSocketAlive() { + public keepWebSocketAlive(): void { for (const sessionId in this.clientWebSockets) { const clientWebSocket = this.clientWebSockets[sessionId]; From 78693439594204505d6cd8c74f3d0582cdfbcb06 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Tue, 8 Oct 2024 11:20:47 +0200 Subject: [PATCH 041/119] Update types --- types/context/ContextVariableType.d.ts | 4 +++- types/controllers/MatchController.d.ts | 3 +-- types/models/eft/common/tables/IQuest.d.ts | 4 ++++ types/models/enums/WildSpawnTypeNumber.d.ts | 4 +--- types/services/LocationLifecycleService.d.ts | 1 + types/services/RagfairLinkedItemService.d.ts | 4 +++- 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/types/context/ContextVariableType.d.ts b/types/context/ContextVariableType.d.ts index 0722a987..38facc60 100644 --- a/types/context/ContextVariableType.d.ts +++ b/types/context/ContextVariableType.d.ts @@ -7,5 +7,7 @@ export declare enum ContextVariableType { CLIENT_START_TIMESTAMP = 2, /** When player is loading into map and loot is requested */ REGISTER_PLAYER_REQUEST = 3, - RAID_ADJUSTMENTS = 4 + RAID_ADJUSTMENTS = 4, + /** Data returned from client request object from endLocalRaid() */ + TRANSIT_INFO = 5 } diff --git a/types/controllers/MatchController.d.ts b/types/controllers/MatchController.d.ts index f1488b08..7e6a34e7 100644 --- a/types/controllers/MatchController.d.ts +++ b/types/controllers/MatchController.d.ts @@ -25,8 +25,7 @@ export declare class MatchController { protected cloner: ICloner; protected matchConfig: IMatchConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, saveServer: SaveServer, matchLocationService: MatchLocationService, configServer: ConfigServer, - applicationContext: ApplicationContext, locationLifecycleService: LocationLifecycleService, cloner: ICloner); + constructor(logger: ILogger, saveServer: SaveServer, matchLocationService: MatchLocationService, configServer: ConfigServer, applicationContext: ApplicationContext, locationLifecycleService: LocationLifecycleService, cloner: ICloner); getEnabled(): boolean; /** Handle client/match/group/delete */ deleteGroup(info: any): void; diff --git a/types/models/eft/common/tables/IQuest.d.ts b/types/models/eft/common/tables/IQuest.d.ts index 68b263ea..e9568562 100644 --- a/types/models/eft/common/tables/IQuest.d.ts +++ b/types/models/eft/common/tables/IQuest.d.ts @@ -150,4 +150,8 @@ export interface IQuestReward { traderId?: string; unknown?: boolean; findInRaid?: boolean; + /** Game editions whitelisted to get reward */ + availableInGameEditions?: string[]; + /** Game editions blacklisted from getting reward */ + notAvailableInGameEditions?: string[]; } diff --git a/types/models/enums/WildSpawnTypeNumber.d.ts b/types/models/enums/WildSpawnTypeNumber.d.ts index 407fcb00..ab823cc6 100644 --- a/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/types/models/enums/WildSpawnTypeNumber.d.ts @@ -54,7 +54,5 @@ export declare enum WildSpawnTypeNumber { SKIER = 53, SECTANTPREDVESTNIK = 57, SECTANTPRIZRAK = 58, - SECTANTONI = 59, - SPTUSEC = 100, - SPTBEAR = 101 + SECTANTONI = 59 } diff --git a/types/services/LocationLifecycleService.d.ts b/types/services/LocationLifecycleService.d.ts index 77eef4f8..ba903027 100644 --- a/types/services/LocationLifecycleService.d.ts +++ b/types/services/LocationLifecycleService.d.ts @@ -90,6 +90,7 @@ export declare class LocationLifecycleService { * @returns ILocationBase */ protected generateLocationAndLoot(name: string, generateLoot?: boolean): ILocationBase; + /** Handle client/match/local/end */ endLocalRaid(sessionId: string, request: IEndLocalRaidRequestData): void; /** * Was extract by car diff --git a/types/services/RagfairLinkedItemService.d.ts b/types/services/RagfairLinkedItemService.d.ts index 0d03459c..c9509d0f 100644 --- a/types/services/RagfairLinkedItemService.d.ts +++ b/types/services/RagfairLinkedItemService.d.ts @@ -1,11 +1,13 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; import { DatabaseService } from "@spt/services/DatabaseService"; export declare class RagfairLinkedItemService { protected databaseService: DatabaseService; protected itemHelper: ItemHelper; + protected logger: ILogger; protected linkedItemsCache: Record>; - constructor(databaseService: DatabaseService, itemHelper: ItemHelper); + constructor(databaseService: DatabaseService, itemHelper: ItemHelper, logger: ILogger); getLinkedItems(linkedSearchId: string): Set; /** * Use ragfair linked item service to get an array of items that can fit on or in designated itemtpl From c87dafaecbd1d130cd0d0be981ca4838a58fb324 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Tue, 8 Oct 2024 11:23:51 +0200 Subject: [PATCH 042/119] Update LocationLifecycleServiceOverride --- .../services/LocationLifecycleService.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/overrides/services/LocationLifecycleService.ts b/src/overrides/services/LocationLifecycleService.ts index 9005ab07..ea173a24 100644 --- a/src/overrides/services/LocationLifecycleService.ts +++ b/src/overrides/services/LocationLifecycleService.ts @@ -3,8 +3,11 @@ import { DependencyContainer, inject, injectable } from "tsyringe"; import { LocationController } from "@spt/controllers/LocationController"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { ApplicationContext } from "@spt/context/ApplicationContext"; +import { ContextVariableType } from "@spt/context/ContextVariableType"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; +import { ILocationTransit } from "@spt/models/eft/match/IEndLocalRaidRequestData"; import { IStartLocalRaidRequestData } from "@spt/models/eft/match/IStartLocalRaidRequestData"; import { IStartLocalRaidResponseData } from "@spt/models/eft/match/IStartLocalRaidResponseData"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; @@ -24,6 +27,7 @@ export class LocationLifecycleServiceOverride extends Override { @inject("FikaMatchService") protected fikaMatchService: FikaMatchService, @inject("LocationLifecycleService") protected locationLifecycleService: LocationLifecycleService, @inject("BotGenerationCacheService") protected botGenerationCacheService: BotGenerationCacheService, + @inject("ApplicationContext") protected applicationContext: ApplicationContext, @inject("TimeUtil") protected timeUtil: TimeUtil ) { super(); @@ -68,6 +72,20 @@ export class LocationLifecycleServiceOverride extends Override { result.transition = request.transition; } + // Get data stored at end of previous raid (if any) + const transitionData = this.applicationContext + .getLatestValue(ContextVariableType.TRANSIT_INFO) + ?.getValue(); + if (transitionData) { + result.transition.isLocationTransition = true; + result.transition.transitionRaidId = transitionData.transitionRaidId; + result.transition.transitionCount += 1; + result.transition.visitedLocations.push(transitionData.location); // TODO - check doesnt exist before adding to prevent dupes + + // Complete, clean up + this.applicationContext.clearValues(ContextVariableType.TRANSIT_INFO); + } + if (typeof matchId === "undefined" || sessionId === matchId) { // Apply changes from pmcConfig to bot hostility values lifecycleService.adjustBotHostilitySettings(result.locationLoot); From 3522cc6eb0819e2a3f35b2e5051fb968e0a33c2e Mon Sep 17 00:00:00 2001 From: Archangel Date: Wed, 9 Oct 2024 16:50:04 +0200 Subject: [PATCH 043/119] Use new item interface --- src/controllers/FikaSendItemController.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controllers/FikaSendItemController.ts b/src/controllers/FikaSendItemController.ts index 5d28f0bf..0353552c 100644 --- a/src/controllers/FikaSendItemController.ts +++ b/src/controllers/FikaSendItemController.ts @@ -3,7 +3,7 @@ import { inject, injectable } from "tsyringe"; import { InventoryHelper } from "@spt/helpers/InventoryHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Item } from "@spt/models/eft/common/tables/IItem"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -60,8 +60,8 @@ export class FikaSendItemController { this.logger.info(`${body.id} is going to sessionID: ${body.target}`); - const senderItems: Item[] = senderProfile.characters.pmc.Inventory.items; - const itemsToSend: Item[] = this.itemHelper.findAndReturnChildrenAsItems(senderItems, body.id); + const senderItems: IItem[] = senderProfile.characters.pmc.Inventory.items; + const itemsToSend: IItem[] = this.itemHelper.findAndReturnChildrenAsItems(senderItems, body.id); if (!itemsToSend || itemsToSend.length === 0) { return this.httpResponse.appendErrorToOutput(output, "Item not found in inventory"); } From ecdefa58b68a8dada0b84c65931f84a8129bb74e Mon Sep 17 00:00:00 2001 From: Archangel Date: Tue, 8 Oct 2024 19:14:49 +0200 Subject: [PATCH 044/119] =?UTF-8?q?=EF=BB=BFInitial=20implementation=20Ser?= =?UTF-8?q?ver=20WS=20notifications?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/database/locales/global/en.json | 4 +- src/callbacks/FikaNotificationCallbacks.ts | 47 +++++++++ src/controllers/FikaRaidController.ts | 12 +++ src/di/Container.ts | 9 ++ src/models/enums/EFTNotificationIconType.ts | 17 ++++ src/models/enums/FikaNotifications.ts | 6 ++ .../fika/websocket/IFikaNotificationBase.ts | 5 + .../notifications/IPushNotification.ts | 7 ++ .../IReceivedSentItemNotification.ts | 7 ++ .../notifications/IStartRaidNotification.ts | 6 ++ .../static/FikaNotificationStaticRouter.ts | 17 ++++ src/websockets/FikaNotificationWebSocket.ts | 96 +++++++++++++++++++ 12 files changed, 232 insertions(+), 1 deletion(-) create mode 100644 src/callbacks/FikaNotificationCallbacks.ts create mode 100644 src/models/enums/EFTNotificationIconType.ts create mode 100644 src/models/enums/FikaNotifications.ts create mode 100644 src/models/fika/websocket/IFikaNotificationBase.ts create mode 100644 src/models/fika/websocket/notifications/IPushNotification.ts create mode 100644 src/models/fika/websocket/notifications/IReceivedSentItemNotification.ts create mode 100644 src/models/fika/websocket/notifications/IStartRaidNotification.ts create mode 100644 src/routers/static/FikaNotificationStaticRouter.ts create mode 100644 src/websockets/FikaNotificationWebSocket.ts diff --git a/assets/database/locales/global/en.json b/assets/database/locales/global/en.json index 0fc6f4f7..cd3baa2e 100644 --- a/assets/database/locales/global/en.json +++ b/assets/database/locales/global/en.json @@ -91,5 +91,7 @@ "F_UI_CoopRaidSettings": "Fika Co-op Raid Settings", "F_UI_FikaAlwaysCoop": "Co-op is always enabled in Fika", "F_UI_UpnpFailed": "UPnP mapping failed. Make sure the selected port is not already open!\nDisable UPnP if you are using a VPN.", - "F_UI_InitWeather": "Generating weather..." + "F_UI_InitWeather": "Generating weather...", + "F_Notification_RaidStarted": "{0} started a raid on {1}", + "F_Notification_ItemReceived": "You received a {0} from {1}" } \ No newline at end of file diff --git a/src/callbacks/FikaNotificationCallbacks.ts b/src/callbacks/FikaNotificationCallbacks.ts new file mode 100644 index 00000000..4794e4f8 --- /dev/null +++ b/src/callbacks/FikaNotificationCallbacks.ts @@ -0,0 +1,47 @@ +import { inject, injectable } from "tsyringe"; + +import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; + +import { IPushNotification } from "../models/fika/websocket/notifications/IPushNotification"; +import { FikaNotificationWebSocket } from "../websockets/FikaNotificationWebSocket"; +import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; +import { FikaNotifications } from "../models/enums/FikaNotifications"; +import { EFTNotificationIconType } from "../models/enums/EFTNotificationIconType"; + +@injectable() +export class FikaNotificationCallbacks { + constructor( + @inject("HttpResponseUtil") protected httpResponseUtil: HttpResponseUtil, + @inject("FikaNotificationWebSocket") protected fikaNotificationWebSocket: FikaNotificationWebSocket, + ) { + // empty + } + + /** Handle /fika/notification/push */ + public handlePushNotification(_url: string, info: IPushNotification, _sessionID: string): INullResponseData { + // Yes, technically this needs a controller to fit into this format. But I cant be bothered setting up a whole controller for a few checks. + if (!info.notification) + { + return this.httpResponseUtil.nullResponse(); + } + + + info.type = FikaNotifications.PushNotification; + + // Set default notification icon if data for this has not been correctly given. + if (!info.notificationIcon || typeof(info.notificationIcon) != 'number') + { + info.notificationIcon = EFTNotificationIconType.Default; + } + + //Do some exception handling for the client, icon 6 seems to cause an exception as well as going out of the enum's bounds. + if (info.notificationIcon == 6 || info.notificationIcon > 14) + { + info.notificationIcon = EFTNotificationIconType.Default; + } + + this.fikaNotificationWebSocket.broadcast(info); + + return this.httpResponseUtil.nullResponse(); + } +} diff --git a/src/controllers/FikaRaidController.ts b/src/controllers/FikaRaidController.ts index b9672c10..fc983938 100644 --- a/src/controllers/FikaRaidController.ts +++ b/src/controllers/FikaRaidController.ts @@ -25,6 +25,9 @@ import { IFikaRaidLeaveRequestData } from "../models/fika/routes/raid/leave/IFik import { FikaMatchService } from "../services/FikaMatchService"; import { FikaDedicatedRaidService } from "../services/dedicated/FikaDedicatedRaidService"; import { FikaDedicatedRaidWebSocket } from "../websockets/FikaDedicatedRaidWebSocket"; +import { FikaNotificationWebSocket } from "../websockets/FikaNotificationWebSocket"; +import { IStartRaidNotification } from "../models/fika/websocket/notifications/IStartRaidNotification"; +import { FikaNotifications } from "../models/enums/FikaNotifications"; @injectable() export class FikaRaidController { @@ -35,6 +38,7 @@ export class FikaRaidController { @inject("ProfileHelper") protected profileHelper: ProfileHelper, @inject("WinstonLogger") protected logger: ILogger, @inject("InraidController") protected inraidController: InraidController + @inject("FikaNotificationWebSocket") protected fikaNotificationWebSocket: FikaNotificationWebSocket, ) { // empty } @@ -44,6 +48,14 @@ export class FikaRaidController { * @param request */ public handleRaidCreate(request: IFikaRaidCreateRequestData): IFikaRaidCreateResponse { + const notification = { + type: FikaNotifications.StartedRaid, + nickname: request.hostUsername, + location: request.settings.location + } as IStartRaidNotification; + + this.fikaNotificationWebSocket.broadcast(notification); + return { success: this.fikaMatchService.createMatch(request), }; diff --git a/src/di/Container.ts b/src/di/Container.ts index a8f2c908..acb815f6 100644 --- a/src/di/Container.ts +++ b/src/di/Container.ts @@ -45,10 +45,13 @@ import { FikaSendItemStaticRouter } from "../routers/static/FikaSendItemStaticRo import { FikaUpdateStaticRouter } from "../routers/static/FikaUpdateStaticRouter"; import { FikaDedicatedRaidWebSocket } from "../websockets/FikaDedicatedRaidWebSocket"; +import { FikaNotificationWebSocket } from "../websockets/FikaNotificationWebSocket"; import { Fika } from "../Fika"; import { FikaDedicatedProfileService } from "../services/dedicated/FikaDedicatedProfileService"; import { FikaServerTools } from "../utils/FikaServerTools"; +import { FikaNotificationStaticRouter } from "../routers/static/FikaNotificationStaticRouter"; +import { FikaNotificationCallbacks } from "../callbacks/FikaNotificationCallbacks"; export class Container { public static register(container: DependencyContainer): void { @@ -89,9 +92,12 @@ export class Container { container.registerType("StaticRoutes", "FikaRaidStaticRouter"); container.registerType("StaticRoutes", "FikaSendItemStaticRouter"); container.registerType("StaticRoutes", "FikaUpdateStaticRouter"); + container.registerType("StaticRoutes", "FikaNotificationStaticRouter"); container.registerType("IERouters", "FikaItemEventRouter"); + container.registerType("WebSocketConnectionHandler", "FikaDedicatedRaidWebSocket"); + container.registerType("WebSocketConnectionHandler", "FikaNotificationWebSocket"); } private static registerUtils(container: DependencyContainer): void { @@ -143,6 +149,7 @@ export class Container { container.register("FikaRaidCallbacks", { useClass: FikaRaidCallbacks }); container.register("FikaSendItemCallbacks", { useClass: FikaSendItemCallbacks }); container.register("FikaUpdateCallbacks", { useClass: FikaUpdateCallbacks }); + container.register("FikaNotificationCallbacks", { useClass: FikaNotificationCallbacks }); } private static registerRouters(container: DependencyContainer): void { @@ -152,9 +159,11 @@ export class Container { container.register("FikaSendItemStaticRouter", { useClass: FikaSendItemStaticRouter }); container.register("FikaUpdateStaticRouter", { useClass: FikaUpdateStaticRouter }); container.register("FikaItemEventRouter", { useClass: FikaItemEventRouter }); + container.register("FikaNotificationStaticRouter", { useClass: FikaNotificationStaticRouter }); } private static registerWebSockets(container: DependencyContainer): void { container.register("FikaDedicatedRaidWebSocket", FikaDedicatedRaidWebSocket, { lifecycle: Lifecycle.Singleton }); + container.register("FikaNotificationWebSocket", FikaNotificationWebSocket, { lifecycle: Lifecycle.Singleton }); } } diff --git a/src/models/enums/EFTNotificationIconType.ts b/src/models/enums/EFTNotificationIconType.ts new file mode 100644 index 00000000..f348e4d0 --- /dev/null +++ b/src/models/enums/EFTNotificationIconType.ts @@ -0,0 +1,17 @@ +export enum EFTNotificationIconType { + Default = 0, + Alert = 1, + Friend = 2, + Mail = 3, + Note = 4, + Quest = 5, + Achievement = 6, // This one is broken. + EntryPoint = 7, + RagFair = 8, + Hideout = 9, + WishlistQuest = 10, + WishlistHideout = 11, + WishlistTrading = 12, + WishlistEquipment = 13, + WishlistOther = 14 +} diff --git a/src/models/enums/FikaNotifications.ts b/src/models/enums/FikaNotifications.ts new file mode 100644 index 00000000..5e19ea82 --- /dev/null +++ b/src/models/enums/FikaNotifications.ts @@ -0,0 +1,6 @@ +export enum FikaNotifications { + KeepAlive = 0, + StartedRaid = 1, + SentItem = 2, + PushNotification = 3 +} diff --git a/src/models/fika/websocket/IFikaNotificationBase.ts b/src/models/fika/websocket/IFikaNotificationBase.ts new file mode 100644 index 00000000..361eaf31 --- /dev/null +++ b/src/models/fika/websocket/IFikaNotificationBase.ts @@ -0,0 +1,5 @@ +import { FikaNotifications } from "../../enums/FikaNotifications"; + +export interface IFikaNotificationBase { + type: FikaNotifications; +} diff --git a/src/models/fika/websocket/notifications/IPushNotification.ts b/src/models/fika/websocket/notifications/IPushNotification.ts new file mode 100644 index 00000000..59fe53b6 --- /dev/null +++ b/src/models/fika/websocket/notifications/IPushNotification.ts @@ -0,0 +1,7 @@ +import { IFikaNotificationBase } from "../IFikaNotificationBase"; +import { EFTNotificationIconType } from "../../../enums/EFTNotificationIconType"; + +export interface IPushNotification extends IFikaNotificationBase { + notificationIcon : EFTNotificationIconType; + notification: string; +} diff --git a/src/models/fika/websocket/notifications/IReceivedSentItemNotification.ts b/src/models/fika/websocket/notifications/IReceivedSentItemNotification.ts new file mode 100644 index 00000000..f4b430f9 --- /dev/null +++ b/src/models/fika/websocket/notifications/IReceivedSentItemNotification.ts @@ -0,0 +1,7 @@ +import { IFikaNotificationBase } from "../IFikaNotificationBase"; + +export interface IReceivedSentItemNotification extends IFikaNotificationBase { + nickname: string; + targetId: string; + itemName: string; +} diff --git a/src/models/fika/websocket/notifications/IStartRaidNotification.ts b/src/models/fika/websocket/notifications/IStartRaidNotification.ts new file mode 100644 index 00000000..ef39b5d9 --- /dev/null +++ b/src/models/fika/websocket/notifications/IStartRaidNotification.ts @@ -0,0 +1,6 @@ +import { IFikaNotificationBase } from "../IFikaNotificationBase"; + +export interface IStartRaidNotification extends IFikaNotificationBase { + nickname: string; + location: string; +} diff --git a/src/routers/static/FikaNotificationStaticRouter.ts b/src/routers/static/FikaNotificationStaticRouter.ts new file mode 100644 index 00000000..e08643ee --- /dev/null +++ b/src/routers/static/FikaNotificationStaticRouter.ts @@ -0,0 +1,17 @@ +import { inject, injectable } from "tsyringe"; + +import { RouteAction, StaticRouter } from "@spt/di/Router"; + +import { FikaNotificationCallbacks } from "../../callbacks/FikaNotificationCallbacks"; +import { IPushNotification } from "../../models/fika/websocket/notifications/IPushNotification"; + +@injectable() +export class FikaNotificationStaticRouter extends StaticRouter { + constructor(@inject("FikaNotificationCallbacks") protected fikaNotificationCallbacks: FikaNotificationCallbacks) { + super([ + new RouteAction("/fika/notification/push", async (url: string, info: IPushNotification, sessionID: string, _output: string): Promise => { + return this.fikaNotificationCallbacks.handlePushNotification(url, info, sessionID); + }) + ]); + } +} diff --git a/src/websockets/FikaNotificationWebSocket.ts b/src/websockets/FikaNotificationWebSocket.ts new file mode 100644 index 00000000..38062d68 --- /dev/null +++ b/src/websockets/FikaNotificationWebSocket.ts @@ -0,0 +1,96 @@ +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { inject, injectable } from "tsyringe"; +import { IWebSocketConnectionHandler } from "@spt/servers/ws/IWebSocketConnectionHandler"; +import { IncomingMessage } from "http"; +import { WebSocket } from "ws"; +import { FikaNotifications } from "../models/enums/FikaNotifications"; +import { IFikaNotificationBase } from "../models/fika/websocket/IFikaNotificationBase"; +import { SaveServer } from "@spt/servers/SaveServer"; + +@injectable() +export class FikaNotificationWebSocket implements IWebSocketConnectionHandler { + public clientWebSockets: Record; + + constructor( + @inject("SaveServer") protected saveServer: SaveServer, + @inject("WinstonLogger") protected logger: ILogger, + ) { + this.clientWebSockets = {}; + + // Keep websocket connections alive + setInterval(() => { + this.keepWebSocketAlive(); + }, 30000); + } + + public getSocketId(): string { + return "Fika Notification Manager"; + } + + public getHookUrl(): string { + return "/fika/notification/"; + } + + public onConnection(ws: WebSocket, req: IncomingMessage): void { + const Authorization = Buffer.from(req.headers.authorization.split(" ")[1], 'base64').toString().split(":"); + const UserSessionID = Authorization[0]; + + this.logger.debug(`[${this.getSocketId()}] User is ${UserSessionID}`); + + if(!this.saveServer.getProfile(UserSessionID)) + { + this.logger.warning(`[${this.getSocketId()}] Invalid user ${UserSessionID} tried to authenticate!`); + return; + } + + this.clientWebSockets[UserSessionID] = ws; + + ws.on("message", (msg) => this.onMessage(UserSessionID, msg.toString())); + ws.on("close", (code, reason) => this.onClose(ws, UserSessionID, code, reason)); + } + + public onMessage(sessionID: string, msg: string): void { + // Do nothing + } + + public onClose(ws: WebSocket, sessionID: string, code: number, reason: Buffer): void { + const clientWebSocket = this.clientWebSockets[sessionID]; + + if (clientWebSocket === ws) + { + this.logger.debug(`[${this.getSocketId()}] Deleting client ${sessionID}`); + + delete this.clientWebSockets[sessionID]; + } + } + + public broadcast(message: IFikaNotificationBase): void { + for (const client in this.clientWebSockets) + { + const clientWebSocket = this.clientWebSockets[client]; + + if(clientWebSocket.readyState == WebSocket.CLOSED) { + continue; + } + + clientWebSocket.send(JSON.stringify(message)); + } + } + + public keepWebSocketAlive(): void { + for (const sessionId in this.clientWebSockets) { + const clientWebSocket = this.clientWebSockets[sessionId]; + + if(clientWebSocket.readyState == WebSocket.CLOSED) { + continue; + } + + // Send a keep alive message to clients. + clientWebSocket.send( + JSON.stringify({ + type: FikaNotifications.KeepAlive + }), + ); + } + } +} From e755faef17f0638961daad6873266c3f651e1b8e Mon Sep 17 00:00:00 2001 From: Archangel Date: Tue, 8 Oct 2024 19:32:37 +0200 Subject: [PATCH 045/119] Cleanup, add todo's --- src/callbacks/FikaNotificationCallbacks.ts | 1 - src/controllers/FikaRaidController.ts | 2 +- src/controllers/FikaSendItemController.ts | 13 +++++++++++++ src/websockets/FikaNotificationWebSocket.ts | 6 +++--- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/callbacks/FikaNotificationCallbacks.ts b/src/callbacks/FikaNotificationCallbacks.ts index 4794e4f8..d6b60e4a 100644 --- a/src/callbacks/FikaNotificationCallbacks.ts +++ b/src/callbacks/FikaNotificationCallbacks.ts @@ -25,7 +25,6 @@ export class FikaNotificationCallbacks { return this.httpResponseUtil.nullResponse(); } - info.type = FikaNotifications.PushNotification; // Set default notification icon if data for this has not been correctly given. diff --git a/src/controllers/FikaRaidController.ts b/src/controllers/FikaRaidController.ts index fc983938..15b876d1 100644 --- a/src/controllers/FikaRaidController.ts +++ b/src/controllers/FikaRaidController.ts @@ -51,7 +51,7 @@ export class FikaRaidController { const notification = { type: FikaNotifications.StartedRaid, nickname: request.hostUsername, - location: request.settings.location + location: request.settings.location // Todo: Location needs to be localized, currently it send the format as "bigmap" or "rezervbase" } as IStartRaidNotification; this.fikaNotificationWebSocket.broadcast(notification); diff --git a/src/controllers/FikaSendItemController.ts b/src/controllers/FikaSendItemController.ts index 0353552c..4a3a0648 100644 --- a/src/controllers/FikaSendItemController.ts +++ b/src/controllers/FikaSendItemController.ts @@ -15,6 +15,9 @@ import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { IFikaSendItemRequestData } from "../models/fika/routes/senditem/IFikaSendItemRequestData"; import { IFikaSenditemAvailablereceiversResponse } from "../models/fika/routes/senditem/availablereceivers/IFikaSenditemAvailablereceiversResponse"; import { FikaConfig } from "../utils/FikaConfig"; +import { FikaNotificationWebSocket } from "../websockets/FikaNotificationWebSocket"; +import { IReceivedSentItemNotification } from "../models/fika/websocket/notifications/IReceivedSentItemNotification"; +import { FikaNotifications } from "../models/enums/FikaNotifications"; @injectable() export class FikaSendItemController { @@ -27,6 +30,7 @@ export class FikaSendItemController { @inject("ItemHelper") protected itemHelper: ItemHelper, @inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil, @inject("FikaConfig") protected fikaConfig: FikaConfig, + @inject("FikaNotificationWebSocket") protected fikaNotificationWebSocket: FikaNotificationWebSocket ) { // empty } @@ -83,6 +87,15 @@ export class FikaSendItemController { this.inventoryHelper.removeItem(senderProfile.characters.pmc, body.id, sessionID, output); + const notification = { + type: FikaNotifications.SentItem, + nickname: senderProfile?.characters?.pmc?.Info?.Nickname, + targetId : body.target, + itemName: "An item" // Todo: This needs to have the item name localized. + } as IReceivedSentItemNotification; + + this.fikaNotificationWebSocket.broadcast(notification); + return output; } diff --git a/src/websockets/FikaNotificationWebSocket.ts b/src/websockets/FikaNotificationWebSocket.ts index 38062d68..7067f4fd 100644 --- a/src/websockets/FikaNotificationWebSocket.ts +++ b/src/websockets/FikaNotificationWebSocket.ts @@ -37,7 +37,7 @@ export class FikaNotificationWebSocket implements IWebSocketConnectionHandler { this.logger.debug(`[${this.getSocketId()}] User is ${UserSessionID}`); - if(!this.saveServer.getProfile(UserSessionID)) + if (!this.saveServer.getProfile(UserSessionID)) { this.logger.warning(`[${this.getSocketId()}] Invalid user ${UserSessionID} tried to authenticate!`); return; @@ -69,7 +69,7 @@ export class FikaNotificationWebSocket implements IWebSocketConnectionHandler { { const clientWebSocket = this.clientWebSockets[client]; - if(clientWebSocket.readyState == WebSocket.CLOSED) { + if (clientWebSocket.readyState == WebSocket.CLOSED) { continue; } @@ -81,7 +81,7 @@ export class FikaNotificationWebSocket implements IWebSocketConnectionHandler { for (const sessionId in this.clientWebSockets) { const clientWebSocket = this.clientWebSockets[sessionId]; - if(clientWebSocket.readyState == WebSocket.CLOSED) { + if (clientWebSocket.readyState == WebSocket.CLOSED) { continue; } From 2c7d3ec094c205503855f1dcc737811498c1a919 Mon Sep 17 00:00:00 2001 From: Archangel Date: Wed, 9 Oct 2024 15:53:05 +0200 Subject: [PATCH 046/119] Handle if websocket has no authorization header --- src/websockets/FikaNotificationWebSocket.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/websockets/FikaNotificationWebSocket.ts b/src/websockets/FikaNotificationWebSocket.ts index 7067f4fd..275fe7d5 100644 --- a/src/websockets/FikaNotificationWebSocket.ts +++ b/src/websockets/FikaNotificationWebSocket.ts @@ -32,6 +32,12 @@ export class FikaNotificationWebSocket implements IWebSocketConnectionHandler { } public onConnection(ws: WebSocket, req: IncomingMessage): void { + if (!req.headers.authorization) + { + ws.close(); + return; + } + const Authorization = Buffer.from(req.headers.authorization.split(" ")[1], 'base64').toString().split(":"); const UserSessionID = Authorization[0]; From 182af7d58670ea170a2b020488d6b8f026d2efe9 Mon Sep 17 00:00:00 2001 From: Archangel Date: Wed, 9 Oct 2024 16:49:03 +0200 Subject: [PATCH 047/119] Fixes --- src/controllers/FikaRaidController.ts | 8 ++++++-- src/websockets/FikaNotificationWebSocket.ts | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/controllers/FikaRaidController.ts b/src/controllers/FikaRaidController.ts index 15b876d1..a8568be2 100644 --- a/src/controllers/FikaRaidController.ts +++ b/src/controllers/FikaRaidController.ts @@ -1,6 +1,7 @@ import { inject, injectable } from "tsyringe"; import { WebSocket } from "ws"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { InraidController } from "@spt/controllers/InraidController"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; @@ -32,12 +33,13 @@ import { FikaNotifications } from "../models/enums/FikaNotifications"; @injectable() export class FikaRaidController { constructor( + @inject("DatabaseService") protected databaseService: DatabaseService, @inject("FikaMatchService") protected fikaMatchService: FikaMatchService, @inject("FikaDedicatedRaidService") protected fikaDedicatedRaidService: FikaDedicatedRaidService, @inject("FikaDedicatedRaidWebSocket") protected fikaDedicatedRaidWebSocket: FikaDedicatedRaidWebSocket, @inject("ProfileHelper") protected profileHelper: ProfileHelper, @inject("WinstonLogger") protected logger: ILogger, - @inject("InraidController") protected inraidController: InraidController + @inject("InraidController") protected inraidController: InraidController, @inject("FikaNotificationWebSocket") protected fikaNotificationWebSocket: FikaNotificationWebSocket, ) { // empty @@ -48,10 +50,12 @@ export class FikaRaidController { * @param request */ public handleRaidCreate(request: IFikaRaidCreateRequestData): IFikaRaidCreateResponse { + const globalLocales = this.databaseService.getLocales().global.en; + const notification = { type: FikaNotifications.StartedRaid, nickname: request.hostUsername, - location: request.settings.location // Todo: Location needs to be localized, currently it send the format as "bigmap" or "rezervbase" + location: globalLocales[request.settings.location] } as IStartRaidNotification; this.fikaNotificationWebSocket.broadcast(notification); diff --git a/src/websockets/FikaNotificationWebSocket.ts b/src/websockets/FikaNotificationWebSocket.ts index 275fe7d5..b0f242cb 100644 --- a/src/websockets/FikaNotificationWebSocket.ts +++ b/src/websockets/FikaNotificationWebSocket.ts @@ -32,7 +32,7 @@ export class FikaNotificationWebSocket implements IWebSocketConnectionHandler { } public onConnection(ws: WebSocket, req: IncomingMessage): void { - if (!req.headers.authorization) + if (req.headers.authorization === undefined) { ws.close(); return; From 6f09c2dd5a30cca96518e3183d1737c87c99f548 Mon Sep 17 00:00:00 2001 From: Archangel Date: Wed, 9 Oct 2024 17:00:57 +0200 Subject: [PATCH 048/119] Use locale for item --- src/controllers/FikaSendItemController.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/controllers/FikaSendItemController.ts b/src/controllers/FikaSendItemController.ts index 4a3a0648..dfaff51f 100644 --- a/src/controllers/FikaSendItemController.ts +++ b/src/controllers/FikaSendItemController.ts @@ -9,6 +9,7 @@ import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { SaveServer } from "@spt/servers/SaveServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { MailSendService } from "@spt/services/MailSendService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; @@ -24,6 +25,7 @@ export class FikaSendItemController { constructor( @inject("WinstonLogger") protected logger: ILogger, @inject("EventOutputHolder") protected eventOutputHolder: EventOutputHolder, + @inject("DatabaseService") protected databaseService: DatabaseService, @inject("MailSendService") protected mailSendService: MailSendService, @inject("InventoryHelper") protected inventoryHelper: InventoryHelper, @inject("SaveServer") protected saveServer: SaveServer, @@ -87,11 +89,13 @@ export class FikaSendItemController { this.inventoryHelper.removeItem(senderProfile.characters.pmc, body.id, sessionID, output); + const globalLocales = this.databaseService.getLocales().global.en; + const notification = { type: FikaNotifications.SentItem, nickname: senderProfile?.characters?.pmc?.Info?.Nickname, targetId : body.target, - itemName: "An item" // Todo: This needs to have the item name localized. + itemName: globalLocales[`${itemsToSend[0]._tpl} Name`] } as IReceivedSentItemNotification; this.fikaNotificationWebSocket.broadcast(notification); From c105db4a2f1422c917ec3395ac4514fbb6cc096f Mon Sep 17 00:00:00 2001 From: trippyone <137233897+trippyone@users.noreply.github.com> Date: Thu, 10 Oct 2024 21:48:25 -0400 Subject: [PATCH 049/119] Join as spectator concept --- src/controllers/FikaUpdateController.ts | 2 +- src/models/fika/IFikaPlayer.ts | 1 + .../raid/create/IFikaRaidCreateRequestData.ts | 1 + .../raid/join/IFikaRaidAddPlayerData.ts | 1 + .../services/LocationLifecycleService.ts | 49 +++++++++++++++++-- src/services/FikaMatchService.ts | 4 +- 6 files changed, 51 insertions(+), 7 deletions(-) diff --git a/src/controllers/FikaUpdateController.ts b/src/controllers/FikaUpdateController.ts index 932c00f2..a9db3412 100644 --- a/src/controllers/FikaUpdateController.ts +++ b/src/controllers/FikaUpdateController.ts @@ -51,7 +51,7 @@ export class FikaUpdateController { * @returns */ public handleRaidAddPlayer(request: IFikaUpdateRaidAddPlayerData): void { - this.fikaMatchService.addPlayerToMatch(request.serverId, request.profileId, { groupId: null, isDead: false }); + this.fikaMatchService.addPlayerToMatch(request.serverId, request.profileId, { groupId: null, isDead: false, isSpectator: request.isSpectator }); } /** diff --git a/src/models/fika/IFikaPlayer.ts b/src/models/fika/IFikaPlayer.ts index d2a2219a..456d4d06 100644 --- a/src/models/fika/IFikaPlayer.ts +++ b/src/models/fika/IFikaPlayer.ts @@ -1,4 +1,5 @@ export interface IFikaPlayer { groupId: string; isDead: boolean; + isSpectator: boolean; } diff --git a/src/models/fika/routes/raid/create/IFikaRaidCreateRequestData.ts b/src/models/fika/routes/raid/create/IFikaRaidCreateRequestData.ts index 7ca17490..1c860ea8 100644 --- a/src/models/fika/routes/raid/create/IFikaRaidCreateRequestData.ts +++ b/src/models/fika/routes/raid/create/IFikaRaidCreateRequestData.ts @@ -13,4 +13,5 @@ export interface IFikaRaidCreateRequestData { fikaVersion: string; side: FikaSide; time: FikaTime; + isSpectator: boolean; } diff --git a/src/models/fika/routes/raid/join/IFikaRaidAddPlayerData.ts b/src/models/fika/routes/raid/join/IFikaRaidAddPlayerData.ts index f16f8187..52396264 100644 --- a/src/models/fika/routes/raid/join/IFikaRaidAddPlayerData.ts +++ b/src/models/fika/routes/raid/join/IFikaRaidAddPlayerData.ts @@ -1,4 +1,5 @@ export interface IFikaUpdateRaidAddPlayerData { serverId: string; profileId: string; + isSpectator: boolean; } diff --git a/src/overrides/services/LocationLifecycleService.ts b/src/overrides/services/LocationLifecycleService.ts index ea173a24..bb189003 100644 --- a/src/overrides/services/LocationLifecycleService.ts +++ b/src/overrides/services/LocationLifecycleService.ts @@ -7,7 +7,7 @@ import { ApplicationContext } from "@spt/context/ApplicationContext"; import { ContextVariableType } from "@spt/context/ContextVariableType"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; -import { ILocationTransit } from "@spt/models/eft/match/IEndLocalRaidRequestData"; +import { IEndLocalRaidRequestData, ILocationTransit } from "@spt/models/eft/match/IEndLocalRaidRequestData"; import { IStartLocalRaidRequestData } from "@spt/models/eft/match/IStartLocalRaidRequestData"; import { IStartLocalRaidResponseData } from "@spt/models/eft/match/IStartLocalRaidResponseData"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; @@ -16,6 +16,15 @@ import { LocationLifecycleService } from "@spt/services/LocationLifecycleService import { TimeUtil } from "@spt/utils/TimeUtil"; import { Override } from "../../di/Override"; import { FikaMatchService } from "../../services/FikaMatchService"; +import { BotLootCacheService } from "@spt/services/BotLootCacheService"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt/servers/ConfigServer"; +import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; +import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; +import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; +import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; @injectable() export class LocationLifecycleServiceOverride extends Override { @@ -28,7 +37,9 @@ export class LocationLifecycleServiceOverride extends Override { @inject("LocationLifecycleService") protected locationLifecycleService: LocationLifecycleService, @inject("BotGenerationCacheService") protected botGenerationCacheService: BotGenerationCacheService, @inject("ApplicationContext") protected applicationContext: ApplicationContext, - @inject("TimeUtil") protected timeUtil: TimeUtil + @inject("TimeUtil") protected timeUtil: TimeUtil, + @inject("BotLootCacheService") protected botLootCacheService: BotLootCacheService, + @inject("PrimaryLogger") protected logger: ILogger, ) { super(); } @@ -40,7 +51,7 @@ export class LocationLifecycleServiceOverride extends Override { result.startLocalRaid = (sessionId: string, request: IStartLocalRaidRequestData): IStartLocalRaidResponseData => { let locationLoot: ILocationBase; const matchId = this.fikaMatchService.getMatchIdByProfile(sessionId); - // Stops TS from throwing a trantrum :) + // Stops TS from throwing a tantrum :) const lifecycleService = (this.locationLifecycleService as any); if (matchId === undefined) { @@ -98,7 +109,37 @@ export class LocationLifecycleServiceOverride extends Override { } return result; - }; + } + + result.endLocalRaid = (sessionId: string, request: IEndLocalRaidRequestData): void => { + var isSpectator: boolean = false; + + // Get match id from player session id + const matchId = this.fikaMatchService.getMatchIdByPlayer(sessionId); + + if(sessionId == matchId) + { + // Clear bot loot cache only if host ended raid + this.botLootCacheService.clearCache(); + } + + const match = this.fikaMatchService.getMatch(matchId); + + // Find player that exited the raid + match.players.forEach((player, playerId) => { + if(sessionId == playerId) { + if(player.isSpectator) { + isSpectator = true; + return; + } + } + }); + + // Execute original method if not spectator (clear inventory, etc.) + if(!isSpectator) { + LocationLifecycleService.prototype.endLocalRaid.call(result, sessionId, request); + } + } }, { frequency: "Always" }, ); diff --git a/src/services/FikaMatchService.ts b/src/services/FikaMatchService.ts index e610243a..8618f25b 100644 --- a/src/services/FikaMatchService.ts +++ b/src/services/FikaMatchService.ts @@ -17,7 +17,7 @@ import { FikaInsuranceService } from "./FikaInsuranceService"; @injectable() export class FikaMatchService { - protected matches: Map; + public matches: Map; protected timeoutIntervals: Map; constructor( @@ -208,7 +208,7 @@ export class FikaMatchService { this.addTimeoutInterval(data.serverId); - this.addPlayerToMatch(data.serverId, data.serverId, { groupId: null, isDead: false }); + this.addPlayerToMatch(data.serverId, data.serverId, { groupId: null, isDead: false, isSpectator: data.isSpectator }); return this.matches.has(data.serverId) && this.timeoutIntervals.has(data.serverId); } From 185c9e8b8c3cda2e9549ea2f8a50d5026da9eb5e Mon Sep 17 00:00:00 2001 From: trippyone <137233897+trippyone@users.noreply.github.com> Date: Thu, 10 Oct 2024 22:04:21 -0400 Subject: [PATCH 050/119] cleanup --- src/overrides/services/LocationLifecycleService.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/overrides/services/LocationLifecycleService.ts b/src/overrides/services/LocationLifecycleService.ts index bb189003..fec421d2 100644 --- a/src/overrides/services/LocationLifecycleService.ts +++ b/src/overrides/services/LocationLifecycleService.ts @@ -18,13 +18,6 @@ import { Override } from "../../di/Override"; import { FikaMatchService } from "../../services/FikaMatchService"; import { BotLootCacheService } from "@spt/services/BotLootCacheService"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { ConfigServer } from "@spt/servers/ConfigServer"; -import { IInRaidConfig } from "@spt/models/spt/config/IInRaidConfig"; -import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; -import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; -import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; -import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; -import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; @injectable() export class LocationLifecycleServiceOverride extends Override { From 5b4c8aeac455da5bf45cc3fcb172fab724c26543 Mon Sep 17 00:00:00 2001 From: trippyone <137233897+trippyone@users.noreply.github.com> Date: Fri, 11 Oct 2024 16:33:09 -0400 Subject: [PATCH 051/119] Improve logic of spectator player detection --- .../services/LocationLifecycleService.ts | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/overrides/services/LocationLifecycleService.ts b/src/overrides/services/LocationLifecycleService.ts index fec421d2..10e77933 100644 --- a/src/overrides/services/LocationLifecycleService.ts +++ b/src/overrides/services/LocationLifecycleService.ts @@ -105,8 +105,6 @@ export class LocationLifecycleServiceOverride extends Override { } result.endLocalRaid = (sessionId: string, request: IEndLocalRaidRequestData): void => { - var isSpectator: boolean = false; - // Get match id from player session id const matchId = this.fikaMatchService.getMatchIdByPlayer(sessionId); @@ -116,21 +114,13 @@ export class LocationLifecycleServiceOverride extends Override { this.botLootCacheService.clearCache(); } - const match = this.fikaMatchService.getMatch(matchId); - // Find player that exited the raid - match.players.forEach((player, playerId) => { - if(sessionId == playerId) { - if(player.isSpectator) { - isSpectator = true; - return; - } - } - }); + const player = this.fikaMatchService.getPlayerInMatch(matchId, sessionId); - // Execute original method if not spectator (clear inventory, etc.) - if(!isSpectator) { - LocationLifecycleService.prototype.endLocalRaid.call(result, sessionId, request); + if(player !== undefined) { + if(!player.isSpectator) { + LocationLifecycleService.prototype.endLocalRaid.call(result, sessionId, request); + } } } }, From 02b23c6da0da70a0eb93a7495db58e591eb5e138 Mon Sep 17 00:00:00 2001 From: trippyone <137233897+trippyone@users.noreply.github.com> Date: Fri, 11 Oct 2024 17:03:06 -0400 Subject: [PATCH 052/119] Update LocationLifecycleService.ts --- src/overrides/services/LocationLifecycleService.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/overrides/services/LocationLifecycleService.ts b/src/overrides/services/LocationLifecycleService.ts index 10e77933..d6580423 100644 --- a/src/overrides/services/LocationLifecycleService.ts +++ b/src/overrides/services/LocationLifecycleService.ts @@ -103,7 +103,6 @@ export class LocationLifecycleServiceOverride extends Override { return result; } - result.endLocalRaid = (sessionId: string, request: IEndLocalRaidRequestData): void => { // Get match id from player session id const matchId = this.fikaMatchService.getMatchIdByPlayer(sessionId); From 5b49d77a7cf8c991fadffbbca6ddf93a0e74d889 Mon Sep 17 00:00:00 2001 From: trippyone <137233897+trippyone@users.noreply.github.com> Date: Fri, 11 Oct 2024 17:23:43 -0400 Subject: [PATCH 053/119] Ensure to call the original method whether the player is found or not --- src/overrides/services/LocationLifecycleService.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/overrides/services/LocationLifecycleService.ts b/src/overrides/services/LocationLifecycleService.ts index d6580423..49a3f1bd 100644 --- a/src/overrides/services/LocationLifecycleService.ts +++ b/src/overrides/services/LocationLifecycleService.ts @@ -104,6 +104,8 @@ export class LocationLifecycleServiceOverride extends Override { return result; } result.endLocalRaid = (sessionId: string, request: IEndLocalRaidRequestData): void => { + var isSpectator: boolean = false; + // Get match id from player session id const matchId = this.fikaMatchService.getMatchIdByPlayer(sessionId); @@ -117,10 +119,15 @@ export class LocationLifecycleServiceOverride extends Override { const player = this.fikaMatchService.getPlayerInMatch(matchId, sessionId); if(player !== undefined) { - if(!player.isSpectator) { - LocationLifecycleService.prototype.endLocalRaid.call(result, sessionId, request); + if(player.isSpectator) { + isSpectator = true; } } + + // Execute the original method if not a spectator + if(!isSpectator) { + LocationLifecycleService.prototype.endLocalRaid.call(result, sessionId, request); + } } }, { frequency: "Always" }, From 46143be6d89864135370810b6c60820569e6ca3e Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Mon, 14 Oct 2024 09:52:44 +0200 Subject: [PATCH 054/119] Send raw data for local localization in client --- src/controllers/FikaRaidController.ts | 10 ++++------ src/controllers/FikaSendItemController.ts | 12 +++++------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/controllers/FikaRaidController.ts b/src/controllers/FikaRaidController.ts index a8568be2..eeea79d9 100644 --- a/src/controllers/FikaRaidController.ts +++ b/src/controllers/FikaRaidController.ts @@ -1,15 +1,16 @@ import { inject, injectable } from "tsyringe"; import { WebSocket } from "ws"; -import { DatabaseService } from "@spt/services/DatabaseService"; import { InraidController } from "@spt/controllers/InraidController"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IRegisterPlayerRequestData } from "@spt/models/eft/inRaid/IRegisterPlayerRequestData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseService } from "@spt/services/DatabaseService"; import { DedicatedStatus } from "../models/enums/DedicatedStatus"; import { FikaMatchEndSessionMessage } from "../models/enums/FikaMatchEndSessionMessages"; +import { FikaNotifications } from "../models/enums/FikaNotifications"; import { IFikaRaidServerIdRequestData } from "../models/fika/routes/raid/IFikaRaidServerIdRequestData"; import { IFikaRaidCreateRequestData } from "../models/fika/routes/raid/create/IFikaRaidCreateRequestData"; import { IFikaRaidCreateResponse } from "../models/fika/routes/raid/create/IFikaRaidCreateResponse"; @@ -23,12 +24,11 @@ import { IFikaRaidSettingsResponse } from "../models/fika/routes/raid/getsetting import { IFikaRaidJoinRequestData } from "../models/fika/routes/raid/join/IFikaRaidJoinRequestData"; import { IFikaRaidJoinResponse } from "../models/fika/routes/raid/join/IFikaRaidJoinResponse"; import { IFikaRaidLeaveRequestData } from "../models/fika/routes/raid/leave/IFikaRaidLeaveRequestData"; +import { IStartRaidNotification } from "../models/fika/websocket/notifications/IStartRaidNotification"; import { FikaMatchService } from "../services/FikaMatchService"; import { FikaDedicatedRaidService } from "../services/dedicated/FikaDedicatedRaidService"; import { FikaDedicatedRaidWebSocket } from "../websockets/FikaDedicatedRaidWebSocket"; import { FikaNotificationWebSocket } from "../websockets/FikaNotificationWebSocket"; -import { IStartRaidNotification } from "../models/fika/websocket/notifications/IStartRaidNotification"; -import { FikaNotifications } from "../models/enums/FikaNotifications"; @injectable() export class FikaRaidController { @@ -50,12 +50,10 @@ export class FikaRaidController { * @param request */ public handleRaidCreate(request: IFikaRaidCreateRequestData): IFikaRaidCreateResponse { - const globalLocales = this.databaseService.getLocales().global.en; - const notification = { type: FikaNotifications.StartedRaid, nickname: request.hostUsername, - location: globalLocales[request.settings.location] + location: request.settings.location } as IStartRaidNotification; this.fikaNotificationWebSocket.broadcast(notification); diff --git a/src/controllers/FikaSendItemController.ts b/src/controllers/FikaSendItemController.ts index dfaff51f..c25d4b96 100644 --- a/src/controllers/FikaSendItemController.ts +++ b/src/controllers/FikaSendItemController.ts @@ -13,12 +13,12 @@ import { DatabaseService } from "@spt/services/DatabaseService"; import { MailSendService } from "@spt/services/MailSendService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { FikaNotifications } from "../models/enums/FikaNotifications"; import { IFikaSendItemRequestData } from "../models/fika/routes/senditem/IFikaSendItemRequestData"; import { IFikaSenditemAvailablereceiversResponse } from "../models/fika/routes/senditem/availablereceivers/IFikaSenditemAvailablereceiversResponse"; +import { IReceivedSentItemNotification } from "../models/fika/websocket/notifications/IReceivedSentItemNotification"; import { FikaConfig } from "../utils/FikaConfig"; import { FikaNotificationWebSocket } from "../websockets/FikaNotificationWebSocket"; -import { IReceivedSentItemNotification } from "../models/fika/websocket/notifications/IReceivedSentItemNotification"; -import { FikaNotifications } from "../models/enums/FikaNotifications"; @injectable() export class FikaSendItemController { @@ -89,13 +89,11 @@ export class FikaSendItemController { this.inventoryHelper.removeItem(senderProfile.characters.pmc, body.id, sessionID, output); - const globalLocales = this.databaseService.getLocales().global.en; - const notification = { type: FikaNotifications.SentItem, nickname: senderProfile?.characters?.pmc?.Info?.Nickname, - targetId : body.target, - itemName: globalLocales[`${itemsToSend[0]._tpl} Name`] + targetId: body.target, + itemName: `${itemsToSend[0]._tpl} ShortName` } as IReceivedSentItemNotification; this.fikaNotificationWebSocket.broadcast(notification); @@ -124,7 +122,7 @@ export class FikaSendItemController { if (profile.info.password === "fika-dedicated") continue; - + const nickname = profile.characters.pmc.Info.Nickname; if (!(nickname in result) && nickname !== sender.characters.pmc.Info.Nickname) { result[nickname] = profile.info.id; From ce1266b41f7910b4d3535b3c845128569fdbe1c9 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Mon, 14 Oct 2024 09:54:38 +0200 Subject: [PATCH 055/119] Formatting --- src/websockets/FikaNotificationWebSocket.ts | 24 ++++++++++----------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/websockets/FikaNotificationWebSocket.ts b/src/websockets/FikaNotificationWebSocket.ts index b0f242cb..b8556cf3 100644 --- a/src/websockets/FikaNotificationWebSocket.ts +++ b/src/websockets/FikaNotificationWebSocket.ts @@ -1,11 +1,13 @@ -import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { inject, injectable } from "tsyringe"; -import { IWebSocketConnectionHandler } from "@spt/servers/ws/IWebSocketConnectionHandler"; import { IncomingMessage } from "http"; +import { inject, injectable } from "tsyringe"; import { WebSocket } from "ws"; + +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { SaveServer } from "@spt/servers/SaveServer"; +import { IWebSocketConnectionHandler } from "@spt/servers/ws/IWebSocketConnectionHandler"; + import { FikaNotifications } from "../models/enums/FikaNotifications"; import { IFikaNotificationBase } from "../models/fika/websocket/IFikaNotificationBase"; -import { SaveServer } from "@spt/servers/SaveServer"; @injectable() export class FikaNotificationWebSocket implements IWebSocketConnectionHandler { @@ -32,8 +34,7 @@ export class FikaNotificationWebSocket implements IWebSocketConnectionHandler { } public onConnection(ws: WebSocket, req: IncomingMessage): void { - if (req.headers.authorization === undefined) - { + if (req.headers.authorization === undefined) { ws.close(); return; } @@ -43,8 +44,7 @@ export class FikaNotificationWebSocket implements IWebSocketConnectionHandler { this.logger.debug(`[${this.getSocketId()}] User is ${UserSessionID}`); - if (!this.saveServer.getProfile(UserSessionID)) - { + if (!this.saveServer.getProfile(UserSessionID)) { this.logger.warning(`[${this.getSocketId()}] Invalid user ${UserSessionID} tried to authenticate!`); return; } @@ -59,11 +59,10 @@ export class FikaNotificationWebSocket implements IWebSocketConnectionHandler { // Do nothing } - public onClose(ws: WebSocket, sessionID: string, code: number, reason: Buffer): void { + public onClose(ws: WebSocket, sessionID: string, code: number, reason: Buffer): void { const clientWebSocket = this.clientWebSockets[sessionID]; - if (clientWebSocket === ws) - { + if (clientWebSocket === ws) { this.logger.debug(`[${this.getSocketId()}] Deleting client ${sessionID}`); delete this.clientWebSockets[sessionID]; @@ -71,8 +70,7 @@ export class FikaNotificationWebSocket implements IWebSocketConnectionHandler { } public broadcast(message: IFikaNotificationBase): void { - for (const client in this.clientWebSockets) - { + for (const client in this.clientWebSockets) { const clientWebSocket = this.clientWebSockets[client]; if (clientWebSocket.readyState == WebSocket.CLOSED) { From 090309ccf44f47eda7a2f6f2542f0389426bfc2c Mon Sep 17 00:00:00 2001 From: Archangel Date: Mon, 14 Oct 2024 15:11:37 +0200 Subject: [PATCH 056/119] Biome cleanup --- src/callbacks/FikaNotificationCallbacks.ts | 11 ++++------- src/controllers/FikaAchievementController.ts | 1 + src/controllers/FikaClientController.ts | 3 +-- src/controllers/FikaRaidController.ts | 7 +++---- src/di/Container.ts | 2 +- .../client/check/IFikaCheckModResponse copy.ts | 3 --- .../client/check/IFikaCheckModResponse.ts | 4 ++++ .../controllers/DialogueController.ts | 2 +- .../controllers/LauncherController.ts | 10 +++++----- src/websockets/FikaDedicatedRaidWebSocket.ts | 18 +++++++----------- src/websockets/FikaNotificationWebSocket.ts | 6 ++++-- 11 files changed, 31 insertions(+), 36 deletions(-) delete mode 100644 src/models/fika/routes/client/check/IFikaCheckModResponse copy.ts diff --git a/src/callbacks/FikaNotificationCallbacks.ts b/src/callbacks/FikaNotificationCallbacks.ts index d6b60e4a..b9cdb848 100644 --- a/src/callbacks/FikaNotificationCallbacks.ts +++ b/src/callbacks/FikaNotificationCallbacks.ts @@ -20,22 +20,19 @@ export class FikaNotificationCallbacks { /** Handle /fika/notification/push */ public handlePushNotification(_url: string, info: IPushNotification, _sessionID: string): INullResponseData { // Yes, technically this needs a controller to fit into this format. But I cant be bothered setting up a whole controller for a few checks. - if (!info.notification) - { + if (!info.notification) { return this.httpResponseUtil.nullResponse(); } - + info.type = FikaNotifications.PushNotification; // Set default notification icon if data for this has not been correctly given. - if (!info.notificationIcon || typeof(info.notificationIcon) != 'number') - { + if (!info.notificationIcon || typeof info.notificationIcon != "number") { info.notificationIcon = EFTNotificationIconType.Default; } //Do some exception handling for the client, icon 6 seems to cause an exception as well as going out of the enum's bounds. - if (info.notificationIcon == 6 || info.notificationIcon > 14) - { + if (info.notificationIcon == 6 || info.notificationIcon > 14) { info.notificationIcon = EFTNotificationIconType.Default; } diff --git a/src/controllers/FikaAchievementController.ts b/src/controllers/FikaAchievementController.ts index 5ba6caad..34302994 100644 --- a/src/controllers/FikaAchievementController.ts +++ b/src/controllers/FikaAchievementController.ts @@ -12,6 +12,7 @@ export class FikaAchievementController { ) { // empty } + // biome-ignore lint/correctness/noUnusedVariables: Can be ignored for now, could be useful in the future. getAchievementStatistics(sessionID: string): ICompletedAchievementsResponse { const achievements = this.databaseService.getAchievements(); const stats: Record = {}; diff --git a/src/controllers/FikaClientController.ts b/src/controllers/FikaClientController.ts index f7e9caf3..d8c4255d 100644 --- a/src/controllers/FikaClientController.ts +++ b/src/controllers/FikaClientController.ts @@ -8,8 +8,7 @@ import { SaveServer } from "@spt/servers/SaveServer"; import { FikaClientModHashesHelper } from "../helpers/FikaClientModHashesHelper"; import { IFikaConfigNatPunchServer } from "../models/fika/config/IFikaConfigNatPunchServer"; import { IFikaCheckModRequestData } from "../models/fika/routes/client/check/IFikaCheckModRequestData"; -import { IFikaCheckModResponse } from "../models/fika/routes/client/check/IFikaCheckModResponse"; -import { IVersionCheckResponse } from "../models/fika/routes/client/check/IFikaCheckModResponse copy"; +import { IFikaCheckModResponse, IVersionCheckResponse } from "../models/fika/routes/client/check/IFikaCheckModResponse"; import { FikaConfig } from "../utils/FikaConfig"; @injectable() diff --git a/src/controllers/FikaRaidController.ts b/src/controllers/FikaRaidController.ts index eeea79d9..14704ca2 100644 --- a/src/controllers/FikaRaidController.ts +++ b/src/controllers/FikaRaidController.ts @@ -53,7 +53,7 @@ export class FikaRaidController { const notification = { type: FikaNotifications.StartedRaid, nickname: request.hostUsername, - location: request.settings.location + location: request.settings.location, } as IStartRaidNotification; this.fikaNotificationWebSocket.broadcast(notification); @@ -76,7 +76,7 @@ export class FikaRaidController { expectedNumberOfPlayers: match.expectedNumberOfPlayers, gameVersion: match.gameVersion, fikaVersion: match.fikaVersion, - raidCode: match.raidCode + raidCode: match.raidCode, }; } @@ -125,7 +125,7 @@ export class FikaRaidController { metabolismDisabled: match.raidConfig.metabolismDisabled, playersSpawnPlace: match.raidConfig.playersSpawnPlace, hourOfDay: match.raidConfig.timeAndWeatherSettings.hourOfDay, - timeFlowType: match.raidConfig.timeAndWeatherSettings.timeFlowType + timeFlowType: match.raidConfig.timeAndWeatherSettings.timeFlowType, }; } @@ -201,7 +201,6 @@ export class FikaRaidController { /** Handle /fika/raid/dedicated/status */ public handleRaidStatusDedicated(sessionId: string, info: IStatusDedicatedRequest): IStatusDedicatedResponse { - // Temp fix because the enum gets deserialized as a string instead of an integer switch (info.status.toString()) { case "READY": diff --git a/src/di/Container.ts b/src/di/Container.ts index acb815f6..7b61f0d5 100644 --- a/src/di/Container.ts +++ b/src/di/Container.ts @@ -95,7 +95,7 @@ export class Container { container.registerType("StaticRoutes", "FikaNotificationStaticRouter"); container.registerType("IERouters", "FikaItemEventRouter"); - + container.registerType("WebSocketConnectionHandler", "FikaDedicatedRaidWebSocket"); container.registerType("WebSocketConnectionHandler", "FikaNotificationWebSocket"); } diff --git a/src/models/fika/routes/client/check/IFikaCheckModResponse copy.ts b/src/models/fika/routes/client/check/IFikaCheckModResponse copy.ts deleted file mode 100644 index 5788ff44..00000000 --- a/src/models/fika/routes/client/check/IFikaCheckModResponse copy.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface IVersionCheckResponse { - version: string; -} diff --git a/src/models/fika/routes/client/check/IFikaCheckModResponse.ts b/src/models/fika/routes/client/check/IFikaCheckModResponse.ts index 240a9c5c..b98e141f 100644 --- a/src/models/fika/routes/client/check/IFikaCheckModResponse.ts +++ b/src/models/fika/routes/client/check/IFikaCheckModResponse.ts @@ -3,3 +3,7 @@ export interface IFikaCheckModResponse { missingRequired: string[]; hashMismatch: string[]; } + +export interface IVersionCheckResponse { + version: string; +} diff --git a/src/overrides/controllers/DialogueController.ts b/src/overrides/controllers/DialogueController.ts index 471959d0..33a7f316 100644 --- a/src/overrides/controllers/DialogueController.ts +++ b/src/overrides/controllers/DialogueController.ts @@ -23,7 +23,7 @@ export class DialogueControllerOverride extends Override { result.sendMessage = (sessionId: string, request: ISendMessageRequest): string => { return this.fikaDialogueController.sendMessage(sessionId, request); - } + }; }, { frequency: "Always" }, ); diff --git a/src/overrides/controllers/LauncherController.ts b/src/overrides/controllers/LauncherController.ts index 3ce24d6c..bf252674 100644 --- a/src/overrides/controllers/LauncherController.ts +++ b/src/overrides/controllers/LauncherController.ts @@ -33,22 +33,22 @@ export class LauncherControllerOverride extends Override { (_t, result: LauncherController) => { result.connect = (): IConnectResponse => { let editions = this.databaseService.getProfiles(); - + if (!this.fikaConfig.getConfig().server.showDevProfile) { - delete editions["SPT Developer"] + delete editions["SPT Developer"]; } if (!this.fikaConfig.getConfig().server.showNonStandardProfile) { for (const id of ["Tournament", "SPT Easy start", "SPT Zero to hero"]) { - delete editions[id] + delete editions[id]; } } - + return { backendUrl: this.httpServerHelper.getBackendUrl(), name: this.coreConfig.serverName, editions: Object.keys(editions), - profileDescriptions: this.launcherController.getProfileDescriptions() + profileDescriptions: this.launcherController.getProfileDescriptions(), }; }; }, diff --git a/src/websockets/FikaDedicatedRaidWebSocket.ts b/src/websockets/FikaDedicatedRaidWebSocket.ts index 9ff7842f..46300fc5 100644 --- a/src/websockets/FikaDedicatedRaidWebSocket.ts +++ b/src/websockets/FikaDedicatedRaidWebSocket.ts @@ -8,9 +8,7 @@ import { WebSocket } from "ws"; export class FikaDedicatedRaidWebSocket implements IWebSocketConnectionHandler { public clientWebSockets: Record; - constructor( - @inject("WinstonLogger") protected logger: ILogger, - ) { + constructor(@inject("WinstonLogger") protected logger: ILogger) { this.clientWebSockets = {}; // Keep websocket connections alive @@ -19,18 +17,15 @@ export class FikaDedicatedRaidWebSocket implements IWebSocketConnectionHandler { }, 30000); } - public getSocketId(): string - { + public getSocketId(): string { return "Fika Dedicated Raid Service"; } - public getHookUrl(): string - { + public getHookUrl(): string { return "/fika/dedicatedraidservice/"; } - public onConnection(ws: WebSocket, req: IncomingMessage): void - { + public onConnection(ws: WebSocket, req: IncomingMessage): void { // Strip request and break it into sections const splitUrl = req.url.substring(0, req.url.indexOf("?")).split("/"); const sessionID = splitUrl.pop(); @@ -40,6 +35,7 @@ export class FikaDedicatedRaidWebSocket implements IWebSocketConnectionHandler { ws.on("message", (msg) => this.onMessage(sessionID, msg.toString())); } + // biome-ignore lint/correctness/noUnusedVariables: Currently unused, but might be implemented in the future. public onMessage(sessionID: string, msg: string): void { // Do nothing } @@ -48,7 +44,7 @@ export class FikaDedicatedRaidWebSocket implements IWebSocketConnectionHandler { for (const sessionId in this.clientWebSockets) { const clientWebSocket = this.clientWebSockets[sessionId]; - if(clientWebSocket.readyState == WebSocket.CLOSED) { + if (clientWebSocket.readyState == WebSocket.CLOSED) { delete this.clientWebSockets[sessionId]; return; } @@ -56,7 +52,7 @@ export class FikaDedicatedRaidWebSocket implements IWebSocketConnectionHandler { // Send a keep alive message to the dedicated client clientWebSocket.send( JSON.stringify({ - type: "fikaDedicatedKeepAlive" + type: "fikaDedicatedKeepAlive", }), ); } diff --git a/src/websockets/FikaNotificationWebSocket.ts b/src/websockets/FikaNotificationWebSocket.ts index b8556cf3..dbae64b0 100644 --- a/src/websockets/FikaNotificationWebSocket.ts +++ b/src/websockets/FikaNotificationWebSocket.ts @@ -39,7 +39,7 @@ export class FikaNotificationWebSocket implements IWebSocketConnectionHandler { return; } - const Authorization = Buffer.from(req.headers.authorization.split(" ")[1], 'base64').toString().split(":"); + const Authorization = Buffer.from(req.headers.authorization.split(" ")[1], "base64").toString().split(":"); const UserSessionID = Authorization[0]; this.logger.debug(`[${this.getSocketId()}] User is ${UserSessionID}`); @@ -55,10 +55,12 @@ export class FikaNotificationWebSocket implements IWebSocketConnectionHandler { ws.on("close", (code, reason) => this.onClose(ws, UserSessionID, code, reason)); } + // biome-ignore lint/correctness/noUnusedVariables: Currently unused, but might be implemented in the future. public onMessage(sessionID: string, msg: string): void { // Do nothing } + // biome-ignore lint/correctness/noUnusedVariables: Currently unused, but might be implemented in the future. public onClose(ws: WebSocket, sessionID: string, code: number, reason: Buffer): void { const clientWebSocket = this.clientWebSockets[sessionID]; @@ -92,7 +94,7 @@ export class FikaNotificationWebSocket implements IWebSocketConnectionHandler { // Send a keep alive message to clients. clientWebSocket.send( JSON.stringify({ - type: FikaNotifications.KeepAlive + type: FikaNotifications.KeepAlive, }), ); } From 09a22f04c8c3ed1aecdd012638590eaa2ece565c Mon Sep 17 00:00:00 2001 From: Archangel Date: Mon, 14 Oct 2024 17:42:13 +0200 Subject: [PATCH 057/119] Implement player presence for main menu UI --- src/callbacks/FikaPresenceCallbacks.ts | 21 ++++ src/di/Container.ts | 7 ++ .../static/FikaPresenceStaticRouter.ts | 19 ++++ src/services/FikaMatchService.ts | 10 ++ src/services/FikaPresenceService.ts | 100 ++++++++++++++++++ src/websockets/FikaNotificationWebSocket.ts | 6 ++ 6 files changed, 163 insertions(+) create mode 100644 src/callbacks/FikaPresenceCallbacks.ts create mode 100644 src/routers/static/FikaPresenceStaticRouter.ts create mode 100644 src/services/FikaPresenceService.ts diff --git a/src/callbacks/FikaPresenceCallbacks.ts b/src/callbacks/FikaPresenceCallbacks.ts new file mode 100644 index 00000000..437d988e --- /dev/null +++ b/src/callbacks/FikaPresenceCallbacks.ts @@ -0,0 +1,21 @@ +import { inject, injectable } from "tsyringe"; + +import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; + +import { FikaPresenceService, IFikaPlayerPresence } from "../services/FikaPresenceService"; +import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; + +@injectable() +export class FikaPresenceCallbacks { + constructor( + @inject("HttpResponseUtil") protected httpResponseUtil: HttpResponseUtil, + @inject("FikaPresenceService") protected fikaPresenceService: FikaPresenceService, + ) { + // empty + } + + /** Handle /fika/presence/get */ + public handlePushNotification(): IGetBodyResponseData { + return this.httpResponseUtil.getBody(this.fikaPresenceService.getAllPlayersPresence()); + } +} diff --git a/src/di/Container.ts b/src/di/Container.ts index 7b61f0d5..ecda774b 100644 --- a/src/di/Container.ts +++ b/src/di/Container.ts @@ -18,6 +18,7 @@ import { FikaFriendRequestsCacheService } from "../services/cache/FikaFriendRequ import { FikaPlayerRelationsCacheService } from "../services/cache/FikaPlayerRelationsCacheService"; import { FikaDedicatedRaidService } from "../services/dedicated/FikaDedicatedRaidService"; import { FikaInsuranceService } from "../services/FikaInsuranceService"; +import { FikaPresenceService } from "../services/FikaPresenceService"; import { FikaClientModHashesHelper } from "../helpers/FikaClientModHashesHelper"; import { FikaFriendRequestsHelper } from "../helpers/FikaFriendRequestsHelper"; @@ -36,6 +37,7 @@ import { FikaLocationCallbacks } from "../callbacks/FikaLocationCallbacks"; import { FikaRaidCallbacks } from "../callbacks/FikaRaidCallbacks"; import { FikaSendItemCallbacks } from "../callbacks/FikaSendItemCallbacks"; import { FikaUpdateCallbacks } from "../callbacks/FikaUpdateCallbacks"; +import { FikaPresenceCallbacks } from "../callbacks/FikaPresenceCallbacks"; import { FikaItemEventRouter } from "../routers/item_events/FikaItemEventRouter"; import { FikaClientStaticRouter } from "../routers/static/FikaClientStaticRouter"; @@ -43,6 +45,7 @@ import { FikaLocationStaticRouter } from "../routers/static/FikaLocationStaticRo import { FikaRaidStaticRouter } from "../routers/static/FikaRaidStaticRouter"; import { FikaSendItemStaticRouter } from "../routers/static/FikaSendItemStaticRouter"; import { FikaUpdateStaticRouter } from "../routers/static/FikaUpdateStaticRouter"; +import { FikaPresenceStaticRouter } from "../routers/static/FikaPresenceStaticRouter"; import { FikaDedicatedRaidWebSocket } from "../websockets/FikaDedicatedRaidWebSocket"; import { FikaNotificationWebSocket } from "../websockets/FikaNotificationWebSocket"; @@ -93,6 +96,7 @@ export class Container { container.registerType("StaticRoutes", "FikaSendItemStaticRouter"); container.registerType("StaticRoutes", "FikaUpdateStaticRouter"); container.registerType("StaticRoutes", "FikaNotificationStaticRouter"); + container.registerType("StaticRoutes", "FikaPresenceStaticRouter"); container.registerType("IERouters", "FikaItemEventRouter"); @@ -125,6 +129,7 @@ export class Container { container.register("FikaDedicatedRaidService", FikaDedicatedRaidService, { lifecycle: Lifecycle.Singleton }); container.register("FikaDedicatedProfileService", FikaDedicatedProfileService, { lifecycle: Lifecycle.Singleton }); container.register("FikaInsuranceService", FikaInsuranceService, { lifecycle: Lifecycle.Singleton }); + container.register("FikaPresenceService", FikaPresenceService, { lifecycle: Lifecycle.Singleton }); } private static registerHelpers(container: DependencyContainer): void { @@ -150,6 +155,7 @@ export class Container { container.register("FikaSendItemCallbacks", { useClass: FikaSendItemCallbacks }); container.register("FikaUpdateCallbacks", { useClass: FikaUpdateCallbacks }); container.register("FikaNotificationCallbacks", { useClass: FikaNotificationCallbacks }); + container.register("FikaPresenceCallbacks", { useClass: FikaPresenceCallbacks }); } private static registerRouters(container: DependencyContainer): void { @@ -160,6 +166,7 @@ export class Container { container.register("FikaUpdateStaticRouter", { useClass: FikaUpdateStaticRouter }); container.register("FikaItemEventRouter", { useClass: FikaItemEventRouter }); container.register("FikaNotificationStaticRouter", { useClass: FikaNotificationStaticRouter }); + container.register("FikaPresenceStaticRouter", { useClass: FikaPresenceStaticRouter }); } private static registerWebSockets(container: DependencyContainer): void { diff --git a/src/routers/static/FikaPresenceStaticRouter.ts b/src/routers/static/FikaPresenceStaticRouter.ts new file mode 100644 index 00000000..60f8510f --- /dev/null +++ b/src/routers/static/FikaPresenceStaticRouter.ts @@ -0,0 +1,19 @@ +import { inject, injectable } from "tsyringe"; + +import { RouteAction, StaticRouter } from "@spt/di/Router"; + +import { IFikaPlayerPresence } from "../../services/FikaPresenceService"; +import { FikaPresenceCallbacks } from "../../callbacks/FikaPresenceCallbacks"; +import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; + +@injectable() +export class FikaPresenceStaticRouter extends StaticRouter { + constructor(@inject("FikaPresenceCallbacks") protected fikaPresenceCallbacks: FikaPresenceCallbacks) { + super([ + // biome-ignore lint/correctness/noUnusedVariables: Not necessary for this endpoint, but keep it as it is standard. + new RouteAction("/fika/presence/get", async (url: string, info: any, sessionID: string, _output: string): Promise> => { + return this.fikaPresenceCallbacks.handlePushNotification(); + }), + ]); + } +} diff --git a/src/services/FikaMatchService.ts b/src/services/FikaMatchService.ts index 8618f25b..6f9ecff0 100644 --- a/src/services/FikaMatchService.ts +++ b/src/services/FikaMatchService.ts @@ -14,6 +14,7 @@ import { IFikaRaidCreateRequestData } from "../models/fika/routes/raid/create/IF import { FikaConfig } from "../utils/FikaConfig"; import { FikaDedicatedRaidService } from "./dedicated/FikaDedicatedRaidService"; import { FikaInsuranceService } from "./FikaInsuranceService"; +import { FikaPresenceService, IFikaRaidPresence } from "./FikaPresenceService"; @injectable() export class FikaMatchService { @@ -27,6 +28,7 @@ export class FikaMatchService { @inject("FikaConfig") protected fikaConfig: FikaConfig, @inject("FikaDedicatedRaidService") protected fikaDedicatedRaidService: FikaDedicatedRaidService, @inject("FikaInsuranceService") protected fikaInsuranceService: FikaInsuranceService, + @inject("FikaPresenceService") protected fikaPresenceService: FikaPresenceService, ) { this.matches = new Map(); this.timeoutIntervals = new Map(); @@ -306,6 +308,12 @@ export class FikaMatchService { match.players.set(playerId, data); this.fikaInsuranceService.addPlayerToMatchId(matchId, playerId); + + const raidInformation = {} as IFikaRaidPresence; + raidInformation.location = match.locationData.Id; + raidInformation.side = match.side; + + this.fikaPresenceService.updatePlayerPresence(playerId, raidInformation); } /** @@ -355,5 +363,7 @@ export class FikaMatchService { } this.matches.get(matchId).players.delete(playerId); + + this.fikaPresenceService.updatePlayerPresence(playerId, null); } } diff --git a/src/services/FikaPresenceService.ts b/src/services/FikaPresenceService.ts new file mode 100644 index 00000000..64a8a433 --- /dev/null +++ b/src/services/FikaPresenceService.ts @@ -0,0 +1,100 @@ +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { SaveServer } from "@spt/servers/SaveServer"; +import { inject, injectable } from "tsyringe"; +import { FikaSide } from "../models/enums/FikaSide"; + +export interface IFikaPlayerPresence { + sessionID: string; + nickname: string; + level: number; + inRaid: boolean; + raidInformation: IFikaRaidPresence; +} +export interface IFikaRaidPresence { + location: string; + side: FikaSide; +} + +@injectable() +export class FikaPresenceService { + private onlinePlayers: Record; + + constructor( + @inject("SaveServer") protected saveServer: SaveServer, + @inject("WinstonLogger") protected logger: ILogger, + ) { + this.onlinePlayers = {}; + } + + public addPlayerPresence(sessionID: string): void { + const profile = this.saveServer.getProfile(sessionID); + + if (!profile) { + return; + } + + let data = {} as IFikaPlayerPresence; + data.sessionID = sessionID; + data.nickname = profile.characters.pmc.Info.Nickname; + data.level = profile.characters.pmc.Info.Level; + data.inRaid = false; + data.raidInformation = null; + + this.logger.debug(`[Fika Presence] Adding player: ${data.nickname}`); + + this.onlinePlayers[sessionID] = data; + } + + public getAllPlayersPresence(): IFikaPlayerPresence[] { + let playerList: IFikaPlayerPresence[] = []; + + for (const sessionID in this.onlinePlayers) { + let player = this.onlinePlayers[sessionID]; + + playerList.push(player); + } + + return playerList; + } + + public getPlayerPresence(sessionID: string): IFikaPlayerPresence { + const presence = this.onlinePlayers[sessionID]; + + if (!presence) { + throw new Error("This player does not exist in Fika presence!"); + } + + return presence; + } + + public updatePlayerPresence(sessionID: string, raidInformation: IFikaRaidPresence = null): void { + if (!this.onlinePlayers[sessionID]) { + throw new Error("This player does not exist in Fika presence!"); + } + + const profile = this.saveServer.getProfile(sessionID); + + let data = {} as IFikaPlayerPresence; + data.sessionID = sessionID; + data.nickname = profile.characters.pmc.Info.Nickname; + data.level = profile.characters.pmc.Info.Level; + + if (raidInformation) { + data.inRaid = true; + } else { + data.inRaid = false; + } + + data.raidInformation = raidInformation; + + this.onlinePlayers[sessionID] = data; + } + + public removePlayerPresence(sessionID: string): void { + if (!this.onlinePlayers[sessionID]) { + return; + } + + delete this.onlinePlayers[sessionID]; + } +} diff --git a/src/websockets/FikaNotificationWebSocket.ts b/src/websockets/FikaNotificationWebSocket.ts index dbae64b0..56dcee16 100644 --- a/src/websockets/FikaNotificationWebSocket.ts +++ b/src/websockets/FikaNotificationWebSocket.ts @@ -8,6 +8,7 @@ import { IWebSocketConnectionHandler } from "@spt/servers/ws/IWebSocketConnectio import { FikaNotifications } from "../models/enums/FikaNotifications"; import { IFikaNotificationBase } from "../models/fika/websocket/IFikaNotificationBase"; +import { FikaPresenceService } from "../services/FikaPresenceService"; @injectable() export class FikaNotificationWebSocket implements IWebSocketConnectionHandler { @@ -16,6 +17,7 @@ export class FikaNotificationWebSocket implements IWebSocketConnectionHandler { constructor( @inject("SaveServer") protected saveServer: SaveServer, @inject("WinstonLogger") protected logger: ILogger, + @inject("FikaPresenceService") protected fikaPresenceService: FikaPresenceService, ) { this.clientWebSockets = {}; @@ -53,6 +55,8 @@ export class FikaNotificationWebSocket implements IWebSocketConnectionHandler { ws.on("message", (msg) => this.onMessage(UserSessionID, msg.toString())); ws.on("close", (code, reason) => this.onClose(ws, UserSessionID, code, reason)); + + this.fikaPresenceService.addPlayerPresence(UserSessionID); } // biome-ignore lint/correctness/noUnusedVariables: Currently unused, but might be implemented in the future. @@ -69,6 +73,8 @@ export class FikaNotificationWebSocket implements IWebSocketConnectionHandler { delete this.clientWebSockets[sessionID]; } + + this.fikaPresenceService.removePlayerPresence(sessionID); } public broadcast(message: IFikaNotificationBase): void { From cb1375f5798851d12f545f04c817a99f44143140 Mon Sep 17 00:00:00 2001 From: Archangel Date: Mon, 14 Oct 2024 17:52:50 +0200 Subject: [PATCH 058/119] handlePushNotification -> handleGetPresence --- src/callbacks/FikaPresenceCallbacks.ts | 2 +- src/routers/static/FikaPresenceStaticRouter.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/callbacks/FikaPresenceCallbacks.ts b/src/callbacks/FikaPresenceCallbacks.ts index 437d988e..3bc35eb4 100644 --- a/src/callbacks/FikaPresenceCallbacks.ts +++ b/src/callbacks/FikaPresenceCallbacks.ts @@ -15,7 +15,7 @@ export class FikaPresenceCallbacks { } /** Handle /fika/presence/get */ - public handlePushNotification(): IGetBodyResponseData { + public handleGetPresence(): IGetBodyResponseData { return this.httpResponseUtil.getBody(this.fikaPresenceService.getAllPlayersPresence()); } } diff --git a/src/routers/static/FikaPresenceStaticRouter.ts b/src/routers/static/FikaPresenceStaticRouter.ts index 60f8510f..7924b129 100644 --- a/src/routers/static/FikaPresenceStaticRouter.ts +++ b/src/routers/static/FikaPresenceStaticRouter.ts @@ -12,7 +12,7 @@ export class FikaPresenceStaticRouter extends StaticRouter { super([ // biome-ignore lint/correctness/noUnusedVariables: Not necessary for this endpoint, but keep it as it is standard. new RouteAction("/fika/presence/get", async (url: string, info: any, sessionID: string, _output: string): Promise> => { - return this.fikaPresenceCallbacks.handlePushNotification(); + return this.fikaPresenceCallbacks.handleGetPresence(); }), ]); } From 3df218e7be1dd4462a7e1935f94853d857c7b2b8 Mon Sep 17 00:00:00 2001 From: Archangel Date: Mon, 14 Oct 2024 19:05:16 +0200 Subject: [PATCH 059/119] Delete sessionID out of Presence interface --- src/services/FikaPresenceService.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/services/FikaPresenceService.ts b/src/services/FikaPresenceService.ts index 64a8a433..27435401 100644 --- a/src/services/FikaPresenceService.ts +++ b/src/services/FikaPresenceService.ts @@ -4,7 +4,6 @@ import { inject, injectable } from "tsyringe"; import { FikaSide } from "../models/enums/FikaSide"; export interface IFikaPlayerPresence { - sessionID: string; nickname: string; level: number; inRaid: boolean; @@ -34,7 +33,6 @@ export class FikaPresenceService { } let data = {} as IFikaPlayerPresence; - data.sessionID = sessionID; data.nickname = profile.characters.pmc.Info.Nickname; data.level = profile.characters.pmc.Info.Level; data.inRaid = false; @@ -75,7 +73,6 @@ export class FikaPresenceService { const profile = this.saveServer.getProfile(sessionID); let data = {} as IFikaPlayerPresence; - data.sessionID = sessionID; data.nickname = profile.characters.pmc.Info.Nickname; data.level = profile.characters.pmc.Info.Level; From 5ad5c00559485f5dd0121c0f735d8c1a3458300f Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Mon, 14 Oct 2024 19:53:44 +0200 Subject: [PATCH 060/119] Update response and interface --- src/callbacks/FikaPresenceCallbacks.ts | 6 +++--- src/routers/static/FikaPresenceStaticRouter.ts | 6 +++--- src/services/FikaPresenceService.ts | 14 +++++++++----- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/callbacks/FikaPresenceCallbacks.ts b/src/callbacks/FikaPresenceCallbacks.ts index 3bc35eb4..7b0c0ff2 100644 --- a/src/callbacks/FikaPresenceCallbacks.ts +++ b/src/callbacks/FikaPresenceCallbacks.ts @@ -2,8 +2,8 @@ import { inject, injectable } from "tsyringe"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; -import { FikaPresenceService, IFikaPlayerPresence } from "../services/FikaPresenceService"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; +import { FikaPresenceService, IFikaPlayerPresenceResponse } from "../services/FikaPresenceService"; @injectable() export class FikaPresenceCallbacks { @@ -15,7 +15,7 @@ export class FikaPresenceCallbacks { } /** Handle /fika/presence/get */ - public handleGetPresence(): IGetBodyResponseData { - return this.httpResponseUtil.getBody(this.fikaPresenceService.getAllPlayersPresence()); + public handleGetPresence(): string { + return this.httpResponseUtil.noBody(this.fikaPresenceService.getAllPlayersPresence()); } } diff --git a/src/routers/static/FikaPresenceStaticRouter.ts b/src/routers/static/FikaPresenceStaticRouter.ts index 7924b129..23eae7b5 100644 --- a/src/routers/static/FikaPresenceStaticRouter.ts +++ b/src/routers/static/FikaPresenceStaticRouter.ts @@ -2,16 +2,16 @@ import { inject, injectable } from "tsyringe"; import { RouteAction, StaticRouter } from "@spt/di/Router"; -import { IFikaPlayerPresence } from "../../services/FikaPresenceService"; -import { FikaPresenceCallbacks } from "../../callbacks/FikaPresenceCallbacks"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; +import { FikaPresenceCallbacks } from "../../callbacks/FikaPresenceCallbacks"; +import { IFikaPlayerPresenceResponse } from "../../services/FikaPresenceService"; @injectable() export class FikaPresenceStaticRouter extends StaticRouter { constructor(@inject("FikaPresenceCallbacks") protected fikaPresenceCallbacks: FikaPresenceCallbacks) { super([ // biome-ignore lint/correctness/noUnusedVariables: Not necessary for this endpoint, but keep it as it is standard. - new RouteAction("/fika/presence/get", async (url: string, info: any, sessionID: string, _output: string): Promise> => { + new RouteAction("/fika/presence/get", async (url: string, info: any, sessionID: string, _output: string): Promise => { return this.fikaPresenceCallbacks.handleGetPresence(); }), ]); diff --git a/src/services/FikaPresenceService.ts b/src/services/FikaPresenceService.ts index 64a8a433..f8e0ca44 100644 --- a/src/services/FikaPresenceService.ts +++ b/src/services/FikaPresenceService.ts @@ -1,15 +1,18 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { SaveServer } from "@spt/servers/SaveServer"; +import { json } from "stream/consumers"; import { inject, injectable } from "tsyringe"; import { FikaSide } from "../models/enums/FikaSide"; export interface IFikaPlayerPresence { - sessionID: string; nickname: string; level: number; inRaid: boolean; raidInformation: IFikaRaidPresence; } + +export type IFikaPlayerPresenceResponse = IFikaPlayerPresence[] + export interface IFikaRaidPresence { location: string; side: FikaSide; @@ -34,18 +37,20 @@ export class FikaPresenceService { } let data = {} as IFikaPlayerPresence; - data.sessionID = sessionID; data.nickname = profile.characters.pmc.Info.Nickname; data.level = profile.characters.pmc.Info.Level; data.inRaid = false; - data.raidInformation = null; + data.raidInformation = { + location: "", + side: 0 + }; this.logger.debug(`[Fika Presence] Adding player: ${data.nickname}`); this.onlinePlayers[sessionID] = data; } - public getAllPlayersPresence(): IFikaPlayerPresence[] { + public getAllPlayersPresence(): IFikaPlayerPresenceResponse { let playerList: IFikaPlayerPresence[] = []; for (const sessionID in this.onlinePlayers) { @@ -75,7 +80,6 @@ export class FikaPresenceService { const profile = this.saveServer.getProfile(sessionID); let data = {} as IFikaPlayerPresence; - data.sessionID = sessionID; data.nickname = profile.characters.pmc.Info.Nickname; data.level = profile.characters.pmc.Info.Level; From 9cb85f05a26ce2f296e018e13a4a144e4c927ffe Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Mon, 14 Oct 2024 20:24:55 +0200 Subject: [PATCH 061/119] Update service --- src/services/FikaPresenceService.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/services/FikaPresenceService.ts b/src/services/FikaPresenceService.ts index f8e0ca44..d02e4254 100644 --- a/src/services/FikaPresenceService.ts +++ b/src/services/FikaPresenceService.ts @@ -1,7 +1,8 @@ +import { inject, injectable } from "tsyringe"; + import { ILogger } from "@spt/models/spt/utils/ILogger"; import { SaveServer } from "@spt/servers/SaveServer"; -import { json } from "stream/consumers"; -import { inject, injectable } from "tsyringe"; + import { FikaSide } from "../models/enums/FikaSide"; export interface IFikaPlayerPresence { From b1eeceb8ba751e08b804547401fb2e8c0dcd91b5 Mon Sep 17 00:00:00 2001 From: Archangel Date: Mon, 14 Oct 2024 20:45:29 +0200 Subject: [PATCH 062/119] Put new interfaces in models --- src/callbacks/FikaPresenceCallbacks.ts | 4 +-- .../fika/presence/IFikaPlayerPresence.ts | 8 +++++ src/models/fika/presence/IFikaRaidPresence.ts | 6 ++++ .../static/FikaPresenceStaticRouter.ts | 5 ++-- src/services/FikaMatchService.ts | 4 +-- src/services/FikaPresenceService.ts | 30 +++++-------------- 6 files changed, 28 insertions(+), 29 deletions(-) create mode 100644 src/models/fika/presence/IFikaPlayerPresence.ts create mode 100644 src/models/fika/presence/IFikaRaidPresence.ts diff --git a/src/callbacks/FikaPresenceCallbacks.ts b/src/callbacks/FikaPresenceCallbacks.ts index 7b0c0ff2..b0194597 100644 --- a/src/callbacks/FikaPresenceCallbacks.ts +++ b/src/callbacks/FikaPresenceCallbacks.ts @@ -3,7 +3,7 @@ import { inject, injectable } from "tsyringe"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; -import { FikaPresenceService, IFikaPlayerPresenceResponse } from "../services/FikaPresenceService"; +import { FikaPresenceService, IFikaPlayerPresence } from "../services/FikaPresenceService"; @injectable() export class FikaPresenceCallbacks { @@ -15,7 +15,7 @@ export class FikaPresenceCallbacks { } /** Handle /fika/presence/get */ - public handleGetPresence(): string { + public handleGetPresence(): IFikaPlayerPresence { return this.httpResponseUtil.noBody(this.fikaPresenceService.getAllPlayersPresence()); } } diff --git a/src/models/fika/presence/IFikaPlayerPresence.ts b/src/models/fika/presence/IFikaPlayerPresence.ts new file mode 100644 index 00000000..c566f090 --- /dev/null +++ b/src/models/fika/presence/IFikaPlayerPresence.ts @@ -0,0 +1,8 @@ +import { IFikaRaidPresence } from "./IFikaRaidPresence"; + +export interface IFikaPlayerPresence { + nickname: string; + level: number; + inRaid: boolean; + raidInformation: IFikaRaidPresence; +} \ No newline at end of file diff --git a/src/models/fika/presence/IFikaRaidPresence.ts b/src/models/fika/presence/IFikaRaidPresence.ts new file mode 100644 index 00000000..f4576f2f --- /dev/null +++ b/src/models/fika/presence/IFikaRaidPresence.ts @@ -0,0 +1,6 @@ +import { FikaSide } from "../../enums/FikaSide"; + +export interface IFikaRaidPresence { + location: string; + side: FikaSide; +} \ No newline at end of file diff --git a/src/routers/static/FikaPresenceStaticRouter.ts b/src/routers/static/FikaPresenceStaticRouter.ts index 23eae7b5..d06ec585 100644 --- a/src/routers/static/FikaPresenceStaticRouter.ts +++ b/src/routers/static/FikaPresenceStaticRouter.ts @@ -2,16 +2,15 @@ import { inject, injectable } from "tsyringe"; import { RouteAction, StaticRouter } from "@spt/di/Router"; -import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { FikaPresenceCallbacks } from "../../callbacks/FikaPresenceCallbacks"; -import { IFikaPlayerPresenceResponse } from "../../services/FikaPresenceService"; +import { IFikaPlayerPresence } from "../../models/fika/presence/IFikaPlayerPresence"; @injectable() export class FikaPresenceStaticRouter extends StaticRouter { constructor(@inject("FikaPresenceCallbacks") protected fikaPresenceCallbacks: FikaPresenceCallbacks) { super([ // biome-ignore lint/correctness/noUnusedVariables: Not necessary for this endpoint, but keep it as it is standard. - new RouteAction("/fika/presence/get", async (url: string, info: any, sessionID: string, _output: string): Promise => { + new RouteAction("/fika/presence/get", async (url: string, info: any, sessionID: string, _output: string): Promise => { return this.fikaPresenceCallbacks.handleGetPresence(); }), ]); diff --git a/src/services/FikaMatchService.ts b/src/services/FikaMatchService.ts index 6f9ecff0..b9a20e77 100644 --- a/src/services/FikaMatchService.ts +++ b/src/services/FikaMatchService.ts @@ -6,15 +6,15 @@ import { SaveServer } from "@spt/servers/SaveServer"; import { FikaMatchEndSessionMessage } from "../models/enums/FikaMatchEndSessionMessages"; import { FikaMatchStatus } from "../models/enums/FikaMatchStatus"; -import { FikaSide } from "../models/enums/FikaSide"; import { IFikaMatch } from "../models/fika/IFikaMatch"; import { IFikaPlayer } from "../models/fika/IFikaPlayer"; import { IFikaRaidCreateRequestData } from "../models/fika/routes/raid/create/IFikaRaidCreateRequestData"; +import { IFikaRaidPresence } from "../models/fika/presence/IFikaRaidPresence"; import { FikaConfig } from "../utils/FikaConfig"; import { FikaDedicatedRaidService } from "./dedicated/FikaDedicatedRaidService"; import { FikaInsuranceService } from "./FikaInsuranceService"; -import { FikaPresenceService, IFikaRaidPresence } from "./FikaPresenceService"; +import { FikaPresenceService } from "./FikaPresenceService"; @injectable() export class FikaMatchService { diff --git a/src/services/FikaPresenceService.ts b/src/services/FikaPresenceService.ts index d02e4254..bddc6bbe 100644 --- a/src/services/FikaPresenceService.ts +++ b/src/services/FikaPresenceService.ts @@ -3,21 +3,9 @@ import { inject, injectable } from "tsyringe"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { SaveServer } from "@spt/servers/SaveServer"; -import { FikaSide } from "../models/enums/FikaSide"; +import { IFikaPlayerPresence } from "../models/fika/presence/IFikaPlayerPresence"; +import { IFikaRaidPresence } from "../models/fika/presence/IFikaRaidPresence"; -export interface IFikaPlayerPresence { - nickname: string; - level: number; - inRaid: boolean; - raidInformation: IFikaRaidPresence; -} - -export type IFikaPlayerPresenceResponse = IFikaPlayerPresence[] - -export interface IFikaRaidPresence { - location: string; - side: FikaSide; -} @injectable() export class FikaPresenceService { @@ -37,13 +25,11 @@ export class FikaPresenceService { return; } - let data = {} as IFikaPlayerPresence; - data.nickname = profile.characters.pmc.Info.Nickname; - data.level = profile.characters.pmc.Info.Level; - data.inRaid = false; - data.raidInformation = { - location: "", - side: 0 + let data: IFikaPlayerPresence = { + nickname: profile.characters.pmc.Info.Nickname, + level: profile.characters.pmc.Info.Level, + inRaid: false, + raidInformation: {} as IFikaRaidPresence }; this.logger.debug(`[Fika Presence] Adding player: ${data.nickname}`); @@ -51,7 +37,7 @@ export class FikaPresenceService { this.onlinePlayers[sessionID] = data; } - public getAllPlayersPresence(): IFikaPlayerPresenceResponse { + public getAllPlayersPresence(): IFikaPlayerPresence[] { let playerList: IFikaPlayerPresence[] = []; for (const sessionID in this.onlinePlayers) { From 3d8fd4b9263c51670e9b658f63737289a7ab202f Mon Sep 17 00:00:00 2001 From: Archangel Date: Mon, 14 Oct 2024 20:48:20 +0200 Subject: [PATCH 063/119] Update types --- src/callbacks/FikaPresenceCallbacks.ts | 3 ++- src/services/FikaPresenceService.ts | 12 +----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/callbacks/FikaPresenceCallbacks.ts b/src/callbacks/FikaPresenceCallbacks.ts index b0194597..55dae8cd 100644 --- a/src/callbacks/FikaPresenceCallbacks.ts +++ b/src/callbacks/FikaPresenceCallbacks.ts @@ -3,7 +3,8 @@ import { inject, injectable } from "tsyringe"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; -import { FikaPresenceService, IFikaPlayerPresence } from "../services/FikaPresenceService"; +import { FikaPresenceService } from "../services/FikaPresenceService"; +import { IFikaPlayerPresence } from "../models/fika/presence/IFikaPlayerPresence"; @injectable() export class FikaPresenceCallbacks { diff --git a/src/services/FikaPresenceService.ts b/src/services/FikaPresenceService.ts index bddc6bbe..194724b1 100644 --- a/src/services/FikaPresenceService.ts +++ b/src/services/FikaPresenceService.ts @@ -49,19 +49,9 @@ export class FikaPresenceService { return playerList; } - public getPlayerPresence(sessionID: string): IFikaPlayerPresence { - const presence = this.onlinePlayers[sessionID]; - - if (!presence) { - throw new Error("This player does not exist in Fika presence!"); - } - - return presence; - } - public updatePlayerPresence(sessionID: string, raidInformation: IFikaRaidPresence = null): void { if (!this.onlinePlayers[sessionID]) { - throw new Error("This player does not exist in Fika presence!"); + return; } const profile = this.saveServer.getProfile(sessionID); From 7aef004c6784b8cd9905c7bdf58b823317c783da Mon Sep 17 00:00:00 2001 From: Archangel Date: Mon, 14 Oct 2024 21:00:46 +0200 Subject: [PATCH 064/119] Pass UNIX timestamp when user starts raid in Raid presence --- src/models/fika/presence/IFikaRaidPresence.ts | 3 ++- src/services/FikaMatchService.ts | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/models/fika/presence/IFikaRaidPresence.ts b/src/models/fika/presence/IFikaRaidPresence.ts index f4576f2f..4cb0bda5 100644 --- a/src/models/fika/presence/IFikaRaidPresence.ts +++ b/src/models/fika/presence/IFikaRaidPresence.ts @@ -3,4 +3,5 @@ import { FikaSide } from "../../enums/FikaSide"; export interface IFikaRaidPresence { location: string; side: FikaSide; -} \ No newline at end of file + timeStarted: number; +} diff --git a/src/services/FikaMatchService.ts b/src/services/FikaMatchService.ts index b9a20e77..89a7234d 100644 --- a/src/services/FikaMatchService.ts +++ b/src/services/FikaMatchService.ts @@ -2,6 +2,7 @@ import { inject, injectable } from "tsyringe"; import { LocationLifecycleService } from "@spt/services/LocationLifecycleService"; import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { TimeUtil } from "@spt/utils/TimeUtil"; import { SaveServer } from "@spt/servers/SaveServer"; import { FikaMatchEndSessionMessage } from "../models/enums/FikaMatchEndSessionMessages"; @@ -23,6 +24,7 @@ export class FikaMatchService { constructor( @inject("WinstonLogger") protected logger: ILogger, + @inject("TimeUtil") protected timeUtil: TimeUtil, @inject("LocationLifecycleService") protected locationLifecycleService: LocationLifecycleService, @inject("SaveServer") protected saveServer: SaveServer, @inject("FikaConfig") protected fikaConfig: FikaConfig, @@ -309,10 +311,12 @@ export class FikaMatchService { this.fikaInsuranceService.addPlayerToMatchId(matchId, playerId); - const raidInformation = {} as IFikaRaidPresence; - raidInformation.location = match.locationData.Id; - raidInformation.side = match.side; - + const raidInformation: IFikaRaidPresence = { + location: match.locationData.Id, + side: match.side, + timeStarted: this.timeUtil.getTimestamp(), + }; + this.fikaPresenceService.updatePlayerPresence(playerId, raidInformation); } From e2b140a2b5683f987fd4b81838afbe33394ece29 Mon Sep 17 00:00:00 2001 From: Archangel Date: Mon, 14 Oct 2024 21:09:11 +0200 Subject: [PATCH 065/119] Set default values for raidInformation --- src/services/FikaPresenceService.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/services/FikaPresenceService.ts b/src/services/FikaPresenceService.ts index 194724b1..6a8dbbde 100644 --- a/src/services/FikaPresenceService.ts +++ b/src/services/FikaPresenceService.ts @@ -6,7 +6,6 @@ import { SaveServer } from "@spt/servers/SaveServer"; import { IFikaPlayerPresence } from "../models/fika/presence/IFikaPlayerPresence"; import { IFikaRaidPresence } from "../models/fika/presence/IFikaRaidPresence"; - @injectable() export class FikaPresenceService { private onlinePlayers: Record; @@ -25,11 +24,15 @@ export class FikaPresenceService { return; } - let data: IFikaPlayerPresence = { + let data: IFikaPlayerPresence = { nickname: profile.characters.pmc.Info.Nickname, level: profile.characters.pmc.Info.Level, inRaid: false, - raidInformation: {} as IFikaRaidPresence + raidInformation: { + location: "", + side: 0, + timeStarted: 0, + } as IFikaRaidPresence, }; this.logger.debug(`[Fika Presence] Adding player: ${data.nickname}`); @@ -49,7 +52,7 @@ export class FikaPresenceService { return playerList; } - public updatePlayerPresence(sessionID: string, raidInformation: IFikaRaidPresence = null): void { + public updatePlayerPresence(sessionID: string, raidInformation: IFikaRaidPresence = { location: "", side: 0, timeStarted: 0 } as IFikaRaidPresence): void { if (!this.onlinePlayers[sessionID]) { return; } @@ -60,7 +63,7 @@ export class FikaPresenceService { data.nickname = profile.characters.pmc.Info.Nickname; data.level = profile.characters.pmc.Info.Level; - if (raidInformation) { + if (raidInformation.location) { data.inRaid = true; } else { data.inRaid = false; From f6fc3f75257825e8387981379545d8696c7adbeb Mon Sep 17 00:00:00 2001 From: Archangel Date: Mon, 14 Oct 2024 21:10:12 +0200 Subject: [PATCH 066/119] Dont set null as a secondary parameter --- src/services/FikaMatchService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/FikaMatchService.ts b/src/services/FikaMatchService.ts index 89a7234d..266dc318 100644 --- a/src/services/FikaMatchService.ts +++ b/src/services/FikaMatchService.ts @@ -368,6 +368,6 @@ export class FikaMatchService { this.matches.get(matchId).players.delete(playerId); - this.fikaPresenceService.updatePlayerPresence(playerId, null); + this.fikaPresenceService.updatePlayerPresence(playerId); } } From 8a46463eb0130c1ea6bc12001db82730bf23053f Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Mon, 14 Oct 2024 22:33:54 +0200 Subject: [PATCH 067/119] Use null --- src/services/FikaPresenceService.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/services/FikaPresenceService.ts b/src/services/FikaPresenceService.ts index 6a8dbbde..b28fedbe 100644 --- a/src/services/FikaPresenceService.ts +++ b/src/services/FikaPresenceService.ts @@ -28,11 +28,7 @@ export class FikaPresenceService { nickname: profile.characters.pmc.Info.Nickname, level: profile.characters.pmc.Info.Level, inRaid: false, - raidInformation: { - location: "", - side: 0, - timeStarted: 0, - } as IFikaRaidPresence, + raidInformation: null }; this.logger.debug(`[Fika Presence] Adding player: ${data.nickname}`); @@ -52,7 +48,7 @@ export class FikaPresenceService { return playerList; } - public updatePlayerPresence(sessionID: string, raidInformation: IFikaRaidPresence = { location: "", side: 0, timeStarted: 0 } as IFikaRaidPresence): void { + public updatePlayerPresence(sessionID: string, raidInformation: IFikaRaidPresence = null): void { if (!this.onlinePlayers[sessionID]) { return; } From 6ba4da0d1810d6bf5cdf5b2de449c5523d81d55f Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Tue, 15 Oct 2024 14:00:13 +0200 Subject: [PATCH 068/119] Fix nullref exception --- src/services/FikaPresenceService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/FikaPresenceService.ts b/src/services/FikaPresenceService.ts index b28fedbe..6956f1b9 100644 --- a/src/services/FikaPresenceService.ts +++ b/src/services/FikaPresenceService.ts @@ -59,7 +59,7 @@ export class FikaPresenceService { data.nickname = profile.characters.pmc.Info.Nickname; data.level = profile.characters.pmc.Info.Level; - if (raidInformation.location) { + if (raidInformation?.location) { data.inRaid = true; } else { data.inRaid = false; From aaa36f07cdd6ed4a27fbcb5a7b8569ea46988890 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Tue, 15 Oct 2024 14:19:52 +0200 Subject: [PATCH 069/119] Update bool check --- src/services/FikaPresenceService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/FikaPresenceService.ts b/src/services/FikaPresenceService.ts index 6956f1b9..8e9bf159 100644 --- a/src/services/FikaPresenceService.ts +++ b/src/services/FikaPresenceService.ts @@ -59,7 +59,7 @@ export class FikaPresenceService { data.nickname = profile.characters.pmc.Info.Nickname; data.level = profile.characters.pmc.Info.Level; - if (raidInformation?.location) { + if (raidInformation) { data.inRaid = true; } else { data.inRaid = false; From fec28701e8c04007c7fbda4a9746d054c6e0536f Mon Sep 17 00:00:00 2001 From: Archangel Date: Tue, 15 Oct 2024 19:04:38 +0200 Subject: [PATCH 070/119] Make changes to the Fika presence models --- src/models/enums/FikaPlayerPresences.ts | 5 ++++ .../fika/presence/IFikaPlayerPresence.ts | 4 ++- src/models/fika/presence/IFikaRaidPresence.ts | 5 ++-- src/services/FikaMatchService.ts | 11 ++++--- src/services/FikaPresenceService.ts | 30 +++++++++---------- 5 files changed, 31 insertions(+), 24 deletions(-) create mode 100644 src/models/enums/FikaPlayerPresences.ts diff --git a/src/models/enums/FikaPlayerPresences.ts b/src/models/enums/FikaPlayerPresences.ts new file mode 100644 index 00000000..d9a124a0 --- /dev/null +++ b/src/models/enums/FikaPlayerPresences.ts @@ -0,0 +1,5 @@ +export enum FikaPlayerPresences { + IN_MENU = 0, + IN_RAID = 1, + IN_STASH = 2, +} diff --git a/src/models/fika/presence/IFikaPlayerPresence.ts b/src/models/fika/presence/IFikaPlayerPresence.ts index c566f090..21bd1364 100644 --- a/src/models/fika/presence/IFikaPlayerPresence.ts +++ b/src/models/fika/presence/IFikaPlayerPresence.ts @@ -1,8 +1,10 @@ +import { FikaPlayerPresences } from "../../enums/FikaPlayerPresences"; import { IFikaRaidPresence } from "./IFikaRaidPresence"; export interface IFikaPlayerPresence { nickname: string; level: number; - inRaid: boolean; + activity: FikaPlayerPresences; + activityStarted: number; raidInformation: IFikaRaidPresence; } \ No newline at end of file diff --git a/src/models/fika/presence/IFikaRaidPresence.ts b/src/models/fika/presence/IFikaRaidPresence.ts index 4cb0bda5..b81cc846 100644 --- a/src/models/fika/presence/IFikaRaidPresence.ts +++ b/src/models/fika/presence/IFikaRaidPresence.ts @@ -1,7 +1,8 @@ import { FikaSide } from "../../enums/FikaSide"; +import { FikaTime } from "../../enums/FikaTime"; export interface IFikaRaidPresence { location: string; side: FikaSide; - timeStarted: number; -} + time: FikaTime; +} \ No newline at end of file diff --git a/src/services/FikaMatchService.ts b/src/services/FikaMatchService.ts index 266dc318..77bf61c5 100644 --- a/src/services/FikaMatchService.ts +++ b/src/services/FikaMatchService.ts @@ -2,7 +2,6 @@ import { inject, injectable } from "tsyringe"; import { LocationLifecycleService } from "@spt/services/LocationLifecycleService"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { TimeUtil } from "@spt/utils/TimeUtil"; import { SaveServer } from "@spt/servers/SaveServer"; import { FikaMatchEndSessionMessage } from "../models/enums/FikaMatchEndSessionMessages"; @@ -11,6 +10,7 @@ import { IFikaMatch } from "../models/fika/IFikaMatch"; import { IFikaPlayer } from "../models/fika/IFikaPlayer"; import { IFikaRaidCreateRequestData } from "../models/fika/routes/raid/create/IFikaRaidCreateRequestData"; import { IFikaRaidPresence } from "../models/fika/presence/IFikaRaidPresence"; +import { FikaPlayerPresences } from "../models/enums/FikaPlayerPresences"; import { FikaConfig } from "../utils/FikaConfig"; import { FikaDedicatedRaidService } from "./dedicated/FikaDedicatedRaidService"; @@ -24,7 +24,6 @@ export class FikaMatchService { constructor( @inject("WinstonLogger") protected logger: ILogger, - @inject("TimeUtil") protected timeUtil: TimeUtil, @inject("LocationLifecycleService") protected locationLifecycleService: LocationLifecycleService, @inject("SaveServer") protected saveServer: SaveServer, @inject("FikaConfig") protected fikaConfig: FikaConfig, @@ -314,10 +313,10 @@ export class FikaMatchService { const raidInformation: IFikaRaidPresence = { location: match.locationData.Id, side: match.side, - timeStarted: this.timeUtil.getTimestamp(), + time: match.time }; - - this.fikaPresenceService.updatePlayerPresence(playerId, raidInformation); + + this.fikaPresenceService.updatePlayerPresence(playerId, FikaPlayerPresences.IN_RAID, raidInformation); } /** @@ -368,6 +367,6 @@ export class FikaMatchService { this.matches.get(matchId).players.delete(playerId); - this.fikaPresenceService.updatePlayerPresence(playerId); + this.fikaPresenceService.updatePlayerPresence(playerId, FikaPlayerPresences.IN_MENU); } } diff --git a/src/services/FikaPresenceService.ts b/src/services/FikaPresenceService.ts index 8e9bf159..7a1af6a9 100644 --- a/src/services/FikaPresenceService.ts +++ b/src/services/FikaPresenceService.ts @@ -1,8 +1,10 @@ import { inject, injectable } from "tsyringe"; -import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { TimeUtil } from "@spt/utils/TimeUtil"; import { SaveServer } from "@spt/servers/SaveServer"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { FikaPlayerPresences } from "../models/enums/FikaPlayerPresences"; import { IFikaPlayerPresence } from "../models/fika/presence/IFikaPlayerPresence"; import { IFikaRaidPresence } from "../models/fika/presence/IFikaRaidPresence"; @@ -12,6 +14,7 @@ export class FikaPresenceService { constructor( @inject("SaveServer") protected saveServer: SaveServer, + @inject("TimeUtil") protected timeUtil: TimeUtil, @inject("WinstonLogger") protected logger: ILogger, ) { this.onlinePlayers = {}; @@ -27,7 +30,8 @@ export class FikaPresenceService { let data: IFikaPlayerPresence = { nickname: profile.characters.pmc.Info.Nickname, level: profile.characters.pmc.Info.Level, - inRaid: false, + activity: FikaPlayerPresences.IN_MENU, + activityStarted: this.timeUtil.getTimestamp(), raidInformation: null }; @@ -48,25 +52,21 @@ export class FikaPresenceService { return playerList; } - public updatePlayerPresence(sessionID: string, raidInformation: IFikaRaidPresence = null): void { + public updatePlayerPresence(sessionID: string, activity: FikaPlayerPresences, raidInformation: IFikaRaidPresence = null): void { if (!this.onlinePlayers[sessionID]) { return; } const profile = this.saveServer.getProfile(sessionID); - let data = {} as IFikaPlayerPresence; - data.nickname = profile.characters.pmc.Info.Nickname; - data.level = profile.characters.pmc.Info.Level; - - if (raidInformation) { - data.inRaid = true; - } else { - data.inRaid = false; - } - - data.raidInformation = raidInformation; - + let data: IFikaPlayerPresence = { + nickname: profile.characters.pmc.Info.Nickname, + level: profile.characters.pmc.Info.Level, + activity: activity, + activityStarted: this.timeUtil.getTimestamp(), + raidInformation: raidInformation + }; + this.onlinePlayers[sessionID] = data; } From 567bea0c01d66a05b6cea4522aa2275a95397727 Mon Sep 17 00:00:00 2001 From: Archangel Date: Tue, 15 Oct 2024 19:12:42 +0200 Subject: [PATCH 071/119] activityStarted -> activityStartedTimestamp --- src/models/fika/presence/IFikaPlayerPresence.ts | 2 +- src/services/FikaPresenceService.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/models/fika/presence/IFikaPlayerPresence.ts b/src/models/fika/presence/IFikaPlayerPresence.ts index 21bd1364..26b14816 100644 --- a/src/models/fika/presence/IFikaPlayerPresence.ts +++ b/src/models/fika/presence/IFikaPlayerPresence.ts @@ -5,6 +5,6 @@ export interface IFikaPlayerPresence { nickname: string; level: number; activity: FikaPlayerPresences; - activityStarted: number; + activityStartedTimestamp: number; raidInformation: IFikaRaidPresence; } \ No newline at end of file diff --git a/src/services/FikaPresenceService.ts b/src/services/FikaPresenceService.ts index 7a1af6a9..fab28338 100644 --- a/src/services/FikaPresenceService.ts +++ b/src/services/FikaPresenceService.ts @@ -31,7 +31,7 @@ export class FikaPresenceService { nickname: profile.characters.pmc.Info.Nickname, level: profile.characters.pmc.Info.Level, activity: FikaPlayerPresences.IN_MENU, - activityStarted: this.timeUtil.getTimestamp(), + activityStartedTimestamp: this.timeUtil.getTimestamp(), raidInformation: null }; @@ -63,7 +63,7 @@ export class FikaPresenceService { nickname: profile.characters.pmc.Info.Nickname, level: profile.characters.pmc.Info.Level, activity: activity, - activityStarted: this.timeUtil.getTimestamp(), + activityStartedTimestamp: this.timeUtil.getTimestamp(), raidInformation: raidInformation }; From 4adfd4829c631be01107a731604d6bbddaa08351 Mon Sep 17 00:00:00 2001 From: Archangel Date: Tue, 15 Oct 2024 19:33:18 +0200 Subject: [PATCH 072/119] Push new endpoints --- src/callbacks/FikaPresenceCallbacks.ts | 17 +++++++++++++++-- src/models/fika/presence/IFikaSetPresence.ts | 7 +++++++ src/routers/static/FikaPresenceStaticRouter.ts | 11 +++++++++-- 3 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 src/models/fika/presence/IFikaSetPresence.ts diff --git a/src/callbacks/FikaPresenceCallbacks.ts b/src/callbacks/FikaPresenceCallbacks.ts index 55dae8cd..b1ede7cd 100644 --- a/src/callbacks/FikaPresenceCallbacks.ts +++ b/src/callbacks/FikaPresenceCallbacks.ts @@ -2,9 +2,10 @@ import { inject, injectable } from "tsyringe"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; -import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; +import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; import { FikaPresenceService } from "../services/FikaPresenceService"; import { IFikaPlayerPresence } from "../models/fika/presence/IFikaPlayerPresence"; +import { IFikaSetPresence } from "../models/fika/presence/IFikaSetPresence"; @injectable() export class FikaPresenceCallbacks { @@ -16,7 +17,19 @@ export class FikaPresenceCallbacks { } /** Handle /fika/presence/get */ - public handleGetPresence(): IFikaPlayerPresence { + public handleGetPresence(_url: string, _info: any, _sessionID: string): IFikaPlayerPresence { + return this.httpResponseUtil.noBody(this.fikaPresenceService.getAllPlayersPresence()); + } + + /** Handle /fika/presence/set */ + public handleSetPresence(_url: string, data: IFikaSetPresence, sessionID: string): INullResponseData { + return this.httpResponseUtil.noBody(this.fikaPresenceService.updatePlayerPresence(sessionID, data.activity, data.raidInformation)); + } + + /** Handle /fika/presence/setget */ + public handleSetGetPresence(_url: string, data: IFikaSetPresence, sessionID: string): IFikaPlayerPresence { + this.fikaPresenceService.updatePlayerPresence(sessionID, data.activity, data.raidInformation); + return this.httpResponseUtil.noBody(this.fikaPresenceService.getAllPlayersPresence()); } } diff --git a/src/models/fika/presence/IFikaSetPresence.ts b/src/models/fika/presence/IFikaSetPresence.ts new file mode 100644 index 00000000..994e08e7 --- /dev/null +++ b/src/models/fika/presence/IFikaSetPresence.ts @@ -0,0 +1,7 @@ +import { FikaPlayerPresences } from "../../enums/FikaPlayerPresences"; +import { IFikaRaidPresence } from "./IFikaRaidPresence"; + +export interface IFikaSetPresence { + activity: FikaPlayerPresences; + raidInformation: IFikaRaidPresence; +} \ No newline at end of file diff --git a/src/routers/static/FikaPresenceStaticRouter.ts b/src/routers/static/FikaPresenceStaticRouter.ts index d06ec585..824ffd95 100644 --- a/src/routers/static/FikaPresenceStaticRouter.ts +++ b/src/routers/static/FikaPresenceStaticRouter.ts @@ -1,17 +1,24 @@ import { inject, injectable } from "tsyringe"; import { RouteAction, StaticRouter } from "@spt/di/Router"; +import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; import { FikaPresenceCallbacks } from "../../callbacks/FikaPresenceCallbacks"; import { IFikaPlayerPresence } from "../../models/fika/presence/IFikaPlayerPresence"; +import { IFikaSetPresence } from "../../models/fika/presence/IFikaSetPresence"; @injectable() export class FikaPresenceStaticRouter extends StaticRouter { constructor(@inject("FikaPresenceCallbacks") protected fikaPresenceCallbacks: FikaPresenceCallbacks) { super([ - // biome-ignore lint/correctness/noUnusedVariables: Not necessary for this endpoint, but keep it as it is standard. new RouteAction("/fika/presence/get", async (url: string, info: any, sessionID: string, _output: string): Promise => { - return this.fikaPresenceCallbacks.handleGetPresence(); + return this.fikaPresenceCallbacks.handleGetPresence(url, info, sessionID); + }), + new RouteAction("/fika/presence/set", async (url: string, info: IFikaSetPresence, sessionID: string, _output: string): Promise => { + return this.fikaPresenceCallbacks.handleSetPresence(url, info, sessionID); + }), + new RouteAction("/fika/presence/setget", async (url: string, info: IFikaSetPresence, sessionID: string, _output: string): Promise => { + return this.fikaPresenceCallbacks.handleSetGetPresence(url, info, sessionID); }), ]); } From a50d9bd99f9d653a0d15f1e4d99290d51be5a190 Mon Sep 17 00:00:00 2001 From: Archangel Date: Tue, 15 Oct 2024 19:41:04 +0200 Subject: [PATCH 073/119] Set E prefix to all enums --- src/callbacks/FikaNotificationCallbacks.ts | 10 +++++----- src/controllers/FikaRaidController.ts | 18 +++++++++--------- src/controllers/FikaSendItemController.ts | 4 ++-- ...{DedicatedStatus.ts => EDedicatedStatus.ts} | 2 +- ...IconType.ts => EEFTNotificationIconType.ts} | 2 +- ...ages.ts => EFikaMatchEndSessionMessages.ts} | 2 +- ...{FikaMatchStatus.ts => EFikaMatchStatus.ts} | 2 +- ...aNotifications.ts => EFikaNotifications.ts} | 2 +- ...yerPresences.ts => EFikaPlayerPresences.ts} | 2 +- src/models/enums/{FikaSide.ts => EFikaSide.ts} | 2 +- src/models/enums/{FikaTime.ts => EFikaTime.ts} | 2 +- src/models/fika/IFikaMatch.ts | 12 ++++++------ .../fika/dedicated/IDedicatedClientInfo.ts | 4 ++-- .../fika/presence/IFikaPlayerPresence.ts | 4 ++-- src/models/fika/presence/IFikaRaidPresence.ts | 8 ++++---- src/models/fika/presence/IFikaSetPresence.ts | 4 ++-- .../fika/routes/location/IFikaRaidsResponse.ts | 12 ++++++------ .../raid/create/IFikaRaidCreateRequestData.ts | 8 ++++---- .../raid/dedicated/IStatusDedicatedRequest.ts | 4 ++-- .../raid/dedicated/IStatusDedicatedResponse.ts | 4 ++-- .../update/IFikaUpdateSetStatusRequestData.ts | 4 ++-- .../fika/websocket/IFikaNotificationBase.ts | 4 ++-- .../notifications/IPushNotification.ts | 4 ++-- src/routers/static/FikaLocationStaticRouter.ts | 3 ++- src/services/FikaMatchService.ts | 18 +++++++++--------- src/services/FikaPresenceService.ts | 6 +++--- src/websockets/FikaNotificationWebSocket.ts | 4 ++-- 27 files changed, 76 insertions(+), 75 deletions(-) rename src/models/enums/{DedicatedStatus.ts => EDedicatedStatus.ts} (52%) rename src/models/enums/{EFTNotificationIconType.ts => EEFTNotificationIconType.ts} (89%) rename src/models/enums/{FikaMatchEndSessionMessages.ts => EFikaMatchEndSessionMessages.ts} (75%) rename src/models/enums/{FikaMatchStatus.ts => EFikaMatchStatus.ts} (63%) rename src/models/enums/{FikaNotifications.ts => EFikaNotifications.ts} (72%) rename src/models/enums/{FikaPlayerPresences.ts => EFikaPlayerPresences.ts} (60%) rename src/models/enums/{FikaSide.ts => EFikaSide.ts} (56%) rename src/models/enums/{FikaTime.ts => EFikaTime.ts} (55%) diff --git a/src/callbacks/FikaNotificationCallbacks.ts b/src/callbacks/FikaNotificationCallbacks.ts index b9cdb848..ac97d2f5 100644 --- a/src/callbacks/FikaNotificationCallbacks.ts +++ b/src/callbacks/FikaNotificationCallbacks.ts @@ -5,8 +5,8 @@ import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { IPushNotification } from "../models/fika/websocket/notifications/IPushNotification"; import { FikaNotificationWebSocket } from "../websockets/FikaNotificationWebSocket"; import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; -import { FikaNotifications } from "../models/enums/FikaNotifications"; -import { EFTNotificationIconType } from "../models/enums/EFTNotificationIconType"; +import { EFikaNotifications } from "../models/enums/EFikaNotifications"; +import { EEFTNotificationIconType } from "../models/enums/EEFTNotificationIconType"; @injectable() export class FikaNotificationCallbacks { @@ -24,16 +24,16 @@ export class FikaNotificationCallbacks { return this.httpResponseUtil.nullResponse(); } - info.type = FikaNotifications.PushNotification; + info.type = EFikaNotifications.PushNotification; // Set default notification icon if data for this has not been correctly given. if (!info.notificationIcon || typeof info.notificationIcon != "number") { - info.notificationIcon = EFTNotificationIconType.Default; + info.notificationIcon = EEFTNotificationIconType.Default; } //Do some exception handling for the client, icon 6 seems to cause an exception as well as going out of the enum's bounds. if (info.notificationIcon == 6 || info.notificationIcon > 14) { - info.notificationIcon = EFTNotificationIconType.Default; + info.notificationIcon = EEFTNotificationIconType.Default; } this.fikaNotificationWebSocket.broadcast(info); diff --git a/src/controllers/FikaRaidController.ts b/src/controllers/FikaRaidController.ts index 14704ca2..cc45c13d 100644 --- a/src/controllers/FikaRaidController.ts +++ b/src/controllers/FikaRaidController.ts @@ -8,9 +8,9 @@ import { IRegisterPlayerRequestData } from "@spt/models/eft/inRaid/IRegisterPlay import { ILogger } from "@spt/models/spt/utils/ILogger"; import { DatabaseService } from "@spt/services/DatabaseService"; -import { DedicatedStatus } from "../models/enums/DedicatedStatus"; -import { FikaMatchEndSessionMessage } from "../models/enums/FikaMatchEndSessionMessages"; -import { FikaNotifications } from "../models/enums/FikaNotifications"; +import { EDedicatedStatus } from "../models/enums/EDedicatedStatus"; +import { EFikaMatchEndSessionMessage } from "../models/enums/EFikaMatchEndSessionMessages"; +import { EFikaNotifications } from "../models/enums/EFikaNotifications"; import { IFikaRaidServerIdRequestData } from "../models/fika/routes/raid/IFikaRaidServerIdRequestData"; import { IFikaRaidCreateRequestData } from "../models/fika/routes/raid/create/IFikaRaidCreateRequestData"; import { IFikaRaidCreateResponse } from "../models/fika/routes/raid/create/IFikaRaidCreateResponse"; @@ -51,7 +51,7 @@ export class FikaRaidController { */ public handleRaidCreate(request: IFikaRaidCreateRequestData): IFikaRaidCreateResponse { const notification = { - type: FikaNotifications.StartedRaid, + type: EFikaNotifications.StartedRaid, nickname: request.hostUsername, location: request.settings.location, } as IStartRaidNotification; @@ -86,7 +86,7 @@ export class FikaRaidController { */ public handleRaidLeave(request: IFikaRaidLeaveRequestData): void { if (request.serverId === request.profileId) { - this.fikaMatchService.endMatch(request.serverId, FikaMatchEndSessionMessage.HOST_SHUTDOWN_MESSAGE); + this.fikaMatchService.endMatch(request.serverId, EFikaMatchEndSessionMessage.HOST_SHUTDOWN_MESSAGE); return; } @@ -151,7 +151,7 @@ export class FikaRaidController { for (const dedicatedSessionId in this.fikaDedicatedRaidService.dedicatedClients) { const dedicatedClientInfo = this.fikaDedicatedRaidService.dedicatedClients[dedicatedSessionId]; - if (dedicatedClientInfo.state != DedicatedStatus.READY) { + if (dedicatedClientInfo.state != EDedicatedStatus.READY) { continue; } @@ -204,14 +204,14 @@ export class FikaRaidController { // Temp fix because the enum gets deserialized as a string instead of an integer switch (info.status.toString()) { case "READY": - info.status = DedicatedStatus.READY; + info.status = EDedicatedStatus.READY; break; case "IN_RAID": - info.status = DedicatedStatus.IN_RAID; + info.status = EDedicatedStatus.IN_RAID; break; } - if (info.status == DedicatedStatus.READY && !this.fikaDedicatedRaidService.isDedicatedClientAvailable()) { + if (info.status == EDedicatedStatus.READY && !this.fikaDedicatedRaidService.isDedicatedClientAvailable()) { if (this.fikaDedicatedRaidService.onDedicatedClientAvailable) { this.fikaDedicatedRaidService.onDedicatedClientAvailable(); } diff --git a/src/controllers/FikaSendItemController.ts b/src/controllers/FikaSendItemController.ts index c25d4b96..69014858 100644 --- a/src/controllers/FikaSendItemController.ts +++ b/src/controllers/FikaSendItemController.ts @@ -13,7 +13,7 @@ import { DatabaseService } from "@spt/services/DatabaseService"; import { MailSendService } from "@spt/services/MailSendService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; -import { FikaNotifications } from "../models/enums/FikaNotifications"; +import { EFikaNotifications } from "../models/enums/EFikaNotifications"; import { IFikaSendItemRequestData } from "../models/fika/routes/senditem/IFikaSendItemRequestData"; import { IFikaSenditemAvailablereceiversResponse } from "../models/fika/routes/senditem/availablereceivers/IFikaSenditemAvailablereceiversResponse"; import { IReceivedSentItemNotification } from "../models/fika/websocket/notifications/IReceivedSentItemNotification"; @@ -90,7 +90,7 @@ export class FikaSendItemController { this.inventoryHelper.removeItem(senderProfile.characters.pmc, body.id, sessionID, output); const notification = { - type: FikaNotifications.SentItem, + type: EFikaNotifications.SentItem, nickname: senderProfile?.characters?.pmc?.Info?.Nickname, targetId: body.target, itemName: `${itemsToSend[0]._tpl} ShortName` diff --git a/src/models/enums/DedicatedStatus.ts b/src/models/enums/EDedicatedStatus.ts similarity index 52% rename from src/models/enums/DedicatedStatus.ts rename to src/models/enums/EDedicatedStatus.ts index aef9a0be..cf94e596 100644 --- a/src/models/enums/DedicatedStatus.ts +++ b/src/models/enums/EDedicatedStatus.ts @@ -1,4 +1,4 @@ -export enum DedicatedStatus { +export enum EDedicatedStatus { READY = 1, IN_RAID = 2, } diff --git a/src/models/enums/EFTNotificationIconType.ts b/src/models/enums/EEFTNotificationIconType.ts similarity index 89% rename from src/models/enums/EFTNotificationIconType.ts rename to src/models/enums/EEFTNotificationIconType.ts index f348e4d0..e8a0877f 100644 --- a/src/models/enums/EFTNotificationIconType.ts +++ b/src/models/enums/EEFTNotificationIconType.ts @@ -1,4 +1,4 @@ -export enum EFTNotificationIconType { +export enum EEFTNotificationIconType { Default = 0, Alert = 1, Friend = 2, diff --git a/src/models/enums/FikaMatchEndSessionMessages.ts b/src/models/enums/EFikaMatchEndSessionMessages.ts similarity index 75% rename from src/models/enums/FikaMatchEndSessionMessages.ts rename to src/models/enums/EFikaMatchEndSessionMessages.ts index d182f0f4..ab74f51a 100644 --- a/src/models/enums/FikaMatchEndSessionMessages.ts +++ b/src/models/enums/EFikaMatchEndSessionMessages.ts @@ -1,4 +1,4 @@ -export enum FikaMatchEndSessionMessage { +export enum EFikaMatchEndSessionMessage { HOST_SHUTDOWN_MESSAGE = "host-shutdown", PING_TIMEOUT_MESSAGE = "ping-timeout", NO_PLAYERS_MESSAGE = "no-players", diff --git a/src/models/enums/FikaMatchStatus.ts b/src/models/enums/EFikaMatchStatus.ts similarity index 63% rename from src/models/enums/FikaMatchStatus.ts rename to src/models/enums/EFikaMatchStatus.ts index 7f0941da..c38f923f 100644 --- a/src/models/enums/FikaMatchStatus.ts +++ b/src/models/enums/EFikaMatchStatus.ts @@ -1,4 +1,4 @@ -export enum FikaMatchStatus { +export enum EFikaMatchStatus { LOADING = 0, IN_GAME = 1, COMPLETE = 2, diff --git a/src/models/enums/FikaNotifications.ts b/src/models/enums/EFikaNotifications.ts similarity index 72% rename from src/models/enums/FikaNotifications.ts rename to src/models/enums/EFikaNotifications.ts index 5e19ea82..74ed80fe 100644 --- a/src/models/enums/FikaNotifications.ts +++ b/src/models/enums/EFikaNotifications.ts @@ -1,4 +1,4 @@ -export enum FikaNotifications { +export enum EFikaNotifications { KeepAlive = 0, StartedRaid = 1, SentItem = 2, diff --git a/src/models/enums/FikaPlayerPresences.ts b/src/models/enums/EFikaPlayerPresences.ts similarity index 60% rename from src/models/enums/FikaPlayerPresences.ts rename to src/models/enums/EFikaPlayerPresences.ts index d9a124a0..22ee6d6f 100644 --- a/src/models/enums/FikaPlayerPresences.ts +++ b/src/models/enums/EFikaPlayerPresences.ts @@ -1,4 +1,4 @@ -export enum FikaPlayerPresences { +export enum EFikaPlayerPresences { IN_MENU = 0, IN_RAID = 1, IN_STASH = 2, diff --git a/src/models/enums/FikaSide.ts b/src/models/enums/EFikaSide.ts similarity index 56% rename from src/models/enums/FikaSide.ts rename to src/models/enums/EFikaSide.ts index 1ec48116..11c356f2 100644 --- a/src/models/enums/FikaSide.ts +++ b/src/models/enums/EFikaSide.ts @@ -1,4 +1,4 @@ -export enum FikaSide { +export enum EFikaSide { PMC = 0, Savage = 1, } diff --git a/src/models/enums/FikaTime.ts b/src/models/enums/EFikaTime.ts similarity index 55% rename from src/models/enums/FikaTime.ts rename to src/models/enums/EFikaTime.ts index 20e8d63d..791e8b4b 100644 --- a/src/models/enums/FikaTime.ts +++ b/src/models/enums/EFikaTime.ts @@ -1,4 +1,4 @@ -export enum FikaTime { +export enum EFikaTime { CURR = 0, PAST = 1, } diff --git a/src/models/fika/IFikaMatch.ts b/src/models/fika/IFikaMatch.ts index b13bae12..05843446 100644 --- a/src/models/fika/IFikaMatch.ts +++ b/src/models/fika/IFikaMatch.ts @@ -1,9 +1,9 @@ import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; import { IGetRaidConfigurationRequestData } from "@spt/models/eft/match/IGetRaidConfigurationRequestData"; -import { FikaMatchStatus } from "../enums/FikaMatchStatus"; -import { FikaSide } from "../enums/FikaSide"; -import { FikaTime } from "../enums/FikaTime"; +import { EFikaMatchStatus } from "../enums/EFikaMatchStatus"; +import { EFikaSide } from "../enums/EFikaSide"; +import { EFikaTime } from "../enums/EFikaTime"; import { IFikaPlayer } from "./IFikaPlayer"; export interface IFikaMatch { @@ -16,11 +16,11 @@ export interface IFikaMatch { gameVersion: string; raidConfig: IGetRaidConfigurationRequestData; locationData: ILocationBase; - status: FikaMatchStatus; + status: EFikaMatchStatus; timeout: number; players: Map; - side: FikaSide; - time: FikaTime; + side: EFikaSide; + time: EFikaTime; raidCode: string; natPunch: boolean; isDedicated: boolean; diff --git a/src/models/fika/dedicated/IDedicatedClientInfo.ts b/src/models/fika/dedicated/IDedicatedClientInfo.ts index d619f7bc..0577069d 100644 --- a/src/models/fika/dedicated/IDedicatedClientInfo.ts +++ b/src/models/fika/dedicated/IDedicatedClientInfo.ts @@ -1,6 +1,6 @@ -import { DedicatedStatus } from "../../enums/DedicatedStatus"; +import { EDedicatedStatus } from "../../enums/EDedicatedStatus"; export interface IDedicatedClientInfo { - state: DedicatedStatus; + state: EDedicatedStatus; lastPing: number; } diff --git a/src/models/fika/presence/IFikaPlayerPresence.ts b/src/models/fika/presence/IFikaPlayerPresence.ts index 26b14816..c30159d3 100644 --- a/src/models/fika/presence/IFikaPlayerPresence.ts +++ b/src/models/fika/presence/IFikaPlayerPresence.ts @@ -1,10 +1,10 @@ -import { FikaPlayerPresences } from "../../enums/FikaPlayerPresences"; +import { EFikaPlayerPresences } from "../../enums/EFikaPlayerPresences"; import { IFikaRaidPresence } from "./IFikaRaidPresence"; export interface IFikaPlayerPresence { nickname: string; level: number; - activity: FikaPlayerPresences; + activity: EFikaPlayerPresences; activityStartedTimestamp: number; raidInformation: IFikaRaidPresence; } \ No newline at end of file diff --git a/src/models/fika/presence/IFikaRaidPresence.ts b/src/models/fika/presence/IFikaRaidPresence.ts index b81cc846..7d9bd3cd 100644 --- a/src/models/fika/presence/IFikaRaidPresence.ts +++ b/src/models/fika/presence/IFikaRaidPresence.ts @@ -1,8 +1,8 @@ -import { FikaSide } from "../../enums/FikaSide"; -import { FikaTime } from "../../enums/FikaTime"; +import { EFikaSide } from "../../enums/EFikaSide"; +import { EFikaTime } from "../../enums/EFikaTime"; export interface IFikaRaidPresence { location: string; - side: FikaSide; - time: FikaTime; + side: EFikaSide; + time: EFikaTime; } \ No newline at end of file diff --git a/src/models/fika/presence/IFikaSetPresence.ts b/src/models/fika/presence/IFikaSetPresence.ts index 994e08e7..7f474eff 100644 --- a/src/models/fika/presence/IFikaSetPresence.ts +++ b/src/models/fika/presence/IFikaSetPresence.ts @@ -1,7 +1,7 @@ -import { FikaPlayerPresences } from "../../enums/FikaPlayerPresences"; +import { EFikaPlayerPresences } from "../../enums/EFikaPlayerPresences"; import { IFikaRaidPresence } from "./IFikaRaidPresence"; export interface IFikaSetPresence { - activity: FikaPlayerPresences; + activity: EFikaPlayerPresences; raidInformation: IFikaRaidPresence; } \ No newline at end of file diff --git a/src/models/fika/routes/location/IFikaRaidsResponse.ts b/src/models/fika/routes/location/IFikaRaidsResponse.ts index 44450bc7..d520af75 100644 --- a/src/models/fika/routes/location/IFikaRaidsResponse.ts +++ b/src/models/fika/routes/location/IFikaRaidsResponse.ts @@ -1,15 +1,15 @@ -import { FikaMatchStatus } from "../../../enums/FikaMatchStatus"; -import { FikaSide } from "../../../enums/FikaSide"; -import { FikaTime } from "../../../enums/FikaTime"; +import { EFikaMatchStatus } from "../../../enums/EFikaMatchStatus"; +import { EFikaSide } from "../../../enums/EFikaSide"; +import { EFikaTime } from "../../../enums/EFikaTime"; export interface IFikaRaidResponse { serverId: string; hostUsername: string; playerCount: number; - status: FikaMatchStatus; + status: EFikaMatchStatus; location: string; - side: FikaSide; - time: FikaTime; + side: EFikaSide; + time: EFikaTime; players: Record; } diff --git a/src/models/fika/routes/raid/create/IFikaRaidCreateRequestData.ts b/src/models/fika/routes/raid/create/IFikaRaidCreateRequestData.ts index 1c860ea8..af1a9d5e 100644 --- a/src/models/fika/routes/raid/create/IFikaRaidCreateRequestData.ts +++ b/src/models/fika/routes/raid/create/IFikaRaidCreateRequestData.ts @@ -1,6 +1,6 @@ import { IGetRaidConfigurationRequestData } from "@spt/models/eft/match/IGetRaidConfigurationRequestData"; -import { FikaSide } from "../../../../enums/FikaSide"; -import { FikaTime } from "../../../../enums/FikaTime"; +import { EFikaSide } from "../../../../enums/EFikaSide"; +import { EFikaTime } from "../../../../enums/EFikaTime"; export interface IFikaRaidCreateRequestData { raidCode: string; @@ -11,7 +11,7 @@ export interface IFikaRaidCreateRequestData { expectedNumberOfPlayers: number; gameVersion: string; fikaVersion: string; - side: FikaSide; - time: FikaTime; + side: EFikaSide; + time: EFikaTime; isSpectator: boolean; } diff --git a/src/models/fika/routes/raid/dedicated/IStatusDedicatedRequest.ts b/src/models/fika/routes/raid/dedicated/IStatusDedicatedRequest.ts index b7348f6f..ea184553 100644 --- a/src/models/fika/routes/raid/dedicated/IStatusDedicatedRequest.ts +++ b/src/models/fika/routes/raid/dedicated/IStatusDedicatedRequest.ts @@ -1,6 +1,6 @@ -import { DedicatedStatus } from "../../../../enums/DedicatedStatus"; +import { EDedicatedStatus } from "../../../../enums/EDedicatedStatus"; export interface IStatusDedicatedRequest { sessionId: string; - status: DedicatedStatus; + status: EDedicatedStatus; } diff --git a/src/models/fika/routes/raid/dedicated/IStatusDedicatedResponse.ts b/src/models/fika/routes/raid/dedicated/IStatusDedicatedResponse.ts index 00d1cd39..aa4a09d2 100644 --- a/src/models/fika/routes/raid/dedicated/IStatusDedicatedResponse.ts +++ b/src/models/fika/routes/raid/dedicated/IStatusDedicatedResponse.ts @@ -1,6 +1,6 @@ -import { DedicatedStatus } from "../../../../enums/DedicatedStatus"; +import { EDedicatedStatus } from "../../../../enums/EDedicatedStatus"; export interface IStatusDedicatedResponse { sessionId: string; - status: DedicatedStatus; + status: EDedicatedStatus; } diff --git a/src/models/fika/routes/update/IFikaUpdateSetStatusRequestData.ts b/src/models/fika/routes/update/IFikaUpdateSetStatusRequestData.ts index e033c17e..9150b186 100644 --- a/src/models/fika/routes/update/IFikaUpdateSetStatusRequestData.ts +++ b/src/models/fika/routes/update/IFikaUpdateSetStatusRequestData.ts @@ -1,6 +1,6 @@ -import { FikaMatchStatus } from "../../../enums/FikaMatchStatus"; +import { EFikaMatchStatus } from "../../../enums/EFikaMatchStatus"; export interface IFikaUpdateSetStatusRequestData { serverId: string; - status: FikaMatchStatus; + status: EFikaMatchStatus; } diff --git a/src/models/fika/websocket/IFikaNotificationBase.ts b/src/models/fika/websocket/IFikaNotificationBase.ts index 361eaf31..d723b325 100644 --- a/src/models/fika/websocket/IFikaNotificationBase.ts +++ b/src/models/fika/websocket/IFikaNotificationBase.ts @@ -1,5 +1,5 @@ -import { FikaNotifications } from "../../enums/FikaNotifications"; +import { EFikaNotifications } from "../../enums/EFikaNotifications"; export interface IFikaNotificationBase { - type: FikaNotifications; + type: EFikaNotifications; } diff --git a/src/models/fika/websocket/notifications/IPushNotification.ts b/src/models/fika/websocket/notifications/IPushNotification.ts index 59fe53b6..b4702063 100644 --- a/src/models/fika/websocket/notifications/IPushNotification.ts +++ b/src/models/fika/websocket/notifications/IPushNotification.ts @@ -1,7 +1,7 @@ import { IFikaNotificationBase } from "../IFikaNotificationBase"; -import { EFTNotificationIconType } from "../../../enums/EFTNotificationIconType"; +import { EEFTNotificationIconType } from "../../../enums/EEFTNotificationIconType"; export interface IPushNotification extends IFikaNotificationBase { - notificationIcon : EFTNotificationIconType; + notificationIcon : EEFTNotificationIconType; notification: string; } diff --git a/src/routers/static/FikaLocationStaticRouter.ts b/src/routers/static/FikaLocationStaticRouter.ts index 72aabbed..9d30a415 100644 --- a/src/routers/static/FikaLocationStaticRouter.ts +++ b/src/routers/static/FikaLocationStaticRouter.ts @@ -4,12 +4,13 @@ import { RouteAction, StaticRouter } from "@spt/di/Router"; import { IGetRaidConfigurationRequestData } from "@spt/models/eft/match/IGetRaidConfigurationRequestData"; import { FikaLocationCallbacks } from "../../callbacks/FikaLocationCallbacks"; +import { IFikaRaidsResponse } from "../../models/fika/routes/location/IFikaRaidsResponse"; @injectable() export class FikaLocationStaticRouter extends StaticRouter { constructor(@inject("FikaLocationCallbacks") protected fikaLocationCallbacks: FikaLocationCallbacks) { super([ - new RouteAction("/fika/location/raids", async (url: string, info: IGetRaidConfigurationRequestData, sessionID: string, _output: string): Promise => { + new RouteAction("/fika/location/raids", async (url: string, info: IGetRaidConfigurationRequestData, sessionID: string, _output: string): Promise => { return this.fikaLocationCallbacks.handleGetRaids(url, info, sessionID); }), ]); diff --git a/src/services/FikaMatchService.ts b/src/services/FikaMatchService.ts index 77bf61c5..e5311b09 100644 --- a/src/services/FikaMatchService.ts +++ b/src/services/FikaMatchService.ts @@ -4,13 +4,13 @@ import { LocationLifecycleService } from "@spt/services/LocationLifecycleService import { ILogger } from "@spt/models/spt/utils/ILogger"; import { SaveServer } from "@spt/servers/SaveServer"; -import { FikaMatchEndSessionMessage } from "../models/enums/FikaMatchEndSessionMessages"; -import { FikaMatchStatus } from "../models/enums/FikaMatchStatus"; +import { EFikaMatchEndSessionMessage } from "../models/enums/EFikaMatchEndSessionMessages"; +import { EFikaMatchStatus } from "../models/enums/EFikaMatchStatus"; import { IFikaMatch } from "../models/fika/IFikaMatch"; import { IFikaPlayer } from "../models/fika/IFikaPlayer"; import { IFikaRaidCreateRequestData } from "../models/fika/routes/raid/create/IFikaRaidCreateRequestData"; import { IFikaRaidPresence } from "../models/fika/presence/IFikaRaidPresence"; -import { FikaPlayerPresences } from "../models/enums/FikaPlayerPresences"; +import { EFikaPlayerPresences } from "../models/enums/EFikaPlayerPresences"; import { FikaConfig } from "../utils/FikaConfig"; import { FikaDedicatedRaidService } from "./dedicated/FikaDedicatedRaidService"; @@ -55,7 +55,7 @@ export class FikaMatchService { // if it timed out 'sessionTimeout' times or more, end the match if (match.timeout >= fikaConfig.server.sessionTimeout) { - this.endMatch(matchId, FikaMatchEndSessionMessage.PING_TIMEOUT_MESSAGE); + this.endMatch(matchId, EFikaMatchEndSessionMessage.PING_TIMEOUT_MESSAGE); } }, 60 * 1000), ); @@ -197,7 +197,7 @@ export class FikaMatchService { expectedNumberOfPlayers: data.expectedNumberOfPlayers, raidConfig: data.settings, locationData: locationData, - status: FikaMatchStatus.LOADING, + status: EFikaMatchStatus.LOADING, timeout: 0, players: new Map(), gameVersion: data.gameVersion, @@ -235,7 +235,7 @@ export class FikaMatchService { * @param matchId * @param reason */ - public endMatch(matchId: string, reason: FikaMatchEndSessionMessage): void { + public endMatch(matchId: string, reason: EFikaMatchEndSessionMessage): void { this.logger.info(`Coop session ${matchId} has ended: ${reason}`); if (this.fikaDedicatedRaidService.requestedSessions.hasOwnProperty(matchId)) { @@ -251,7 +251,7 @@ export class FikaMatchService { * @param matchId * @param status */ - public setMatchStatus(matchId: string, status: FikaMatchStatus): void { + public setMatchStatus(matchId: string, status: EFikaMatchStatus): void { if (!this.matches.has(matchId)) { return; } @@ -316,7 +316,7 @@ export class FikaMatchService { time: match.time }; - this.fikaPresenceService.updatePlayerPresence(playerId, FikaPlayerPresences.IN_RAID, raidInformation); + this.fikaPresenceService.updatePlayerPresence(playerId, EFikaPlayerPresences.IN_RAID, raidInformation); } /** @@ -367,6 +367,6 @@ export class FikaMatchService { this.matches.get(matchId).players.delete(playerId); - this.fikaPresenceService.updatePlayerPresence(playerId, FikaPlayerPresences.IN_MENU); + this.fikaPresenceService.updatePlayerPresence(playerId, EFikaPlayerPresences.IN_MENU); } } diff --git a/src/services/FikaPresenceService.ts b/src/services/FikaPresenceService.ts index fab28338..8246f4ab 100644 --- a/src/services/FikaPresenceService.ts +++ b/src/services/FikaPresenceService.ts @@ -4,7 +4,7 @@ import { TimeUtil } from "@spt/utils/TimeUtil"; import { SaveServer } from "@spt/servers/SaveServer"; import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { FikaPlayerPresences } from "../models/enums/FikaPlayerPresences"; +import { EFikaPlayerPresences } from "../models/enums/EFikaPlayerPresences"; import { IFikaPlayerPresence } from "../models/fika/presence/IFikaPlayerPresence"; import { IFikaRaidPresence } from "../models/fika/presence/IFikaRaidPresence"; @@ -30,7 +30,7 @@ export class FikaPresenceService { let data: IFikaPlayerPresence = { nickname: profile.characters.pmc.Info.Nickname, level: profile.characters.pmc.Info.Level, - activity: FikaPlayerPresences.IN_MENU, + activity: EFikaPlayerPresences.IN_MENU, activityStartedTimestamp: this.timeUtil.getTimestamp(), raidInformation: null }; @@ -52,7 +52,7 @@ export class FikaPresenceService { return playerList; } - public updatePlayerPresence(sessionID: string, activity: FikaPlayerPresences, raidInformation: IFikaRaidPresence = null): void { + public updatePlayerPresence(sessionID: string, activity: EFikaPlayerPresences, raidInformation: IFikaRaidPresence = null): void { if (!this.onlinePlayers[sessionID]) { return; } diff --git a/src/websockets/FikaNotificationWebSocket.ts b/src/websockets/FikaNotificationWebSocket.ts index 56dcee16..d8e8aea1 100644 --- a/src/websockets/FikaNotificationWebSocket.ts +++ b/src/websockets/FikaNotificationWebSocket.ts @@ -6,7 +6,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { SaveServer } from "@spt/servers/SaveServer"; import { IWebSocketConnectionHandler } from "@spt/servers/ws/IWebSocketConnectionHandler"; -import { FikaNotifications } from "../models/enums/FikaNotifications"; +import { EFikaNotifications } from "../models/enums/EFikaNotifications"; import { IFikaNotificationBase } from "../models/fika/websocket/IFikaNotificationBase"; import { FikaPresenceService } from "../services/FikaPresenceService"; @@ -100,7 +100,7 @@ export class FikaNotificationWebSocket implements IWebSocketConnectionHandler { // Send a keep alive message to clients. clientWebSocket.send( JSON.stringify({ - type: FikaNotifications.KeepAlive, + type: EFikaNotifications.KeepAlive, }), ); } From 0a020cb8d0b07096e0ba3d79f4875947a489ca1f Mon Sep 17 00:00:00 2001 From: Archangel Date: Tue, 15 Oct 2024 19:43:19 +0200 Subject: [PATCH 074/119] Revert this file --- src/routers/static/FikaLocationStaticRouter.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/routers/static/FikaLocationStaticRouter.ts b/src/routers/static/FikaLocationStaticRouter.ts index 9d30a415..72aabbed 100644 --- a/src/routers/static/FikaLocationStaticRouter.ts +++ b/src/routers/static/FikaLocationStaticRouter.ts @@ -4,13 +4,12 @@ import { RouteAction, StaticRouter } from "@spt/di/Router"; import { IGetRaidConfigurationRequestData } from "@spt/models/eft/match/IGetRaidConfigurationRequestData"; import { FikaLocationCallbacks } from "../../callbacks/FikaLocationCallbacks"; -import { IFikaRaidsResponse } from "../../models/fika/routes/location/IFikaRaidsResponse"; @injectable() export class FikaLocationStaticRouter extends StaticRouter { constructor(@inject("FikaLocationCallbacks") protected fikaLocationCallbacks: FikaLocationCallbacks) { super([ - new RouteAction("/fika/location/raids", async (url: string, info: IGetRaidConfigurationRequestData, sessionID: string, _output: string): Promise => { + new RouteAction("/fika/location/raids", async (url: string, info: IGetRaidConfigurationRequestData, sessionID: string, _output: string): Promise => { return this.fikaLocationCallbacks.handleGetRaids(url, info, sessionID); }), ]); From 84d0cb165d9d78b59046ae0a283c854ed753fe65 Mon Sep 17 00:00:00 2001 From: Archangel Date: Tue, 15 Oct 2024 19:55:07 +0200 Subject: [PATCH 075/119] Formatting fixes --- src/controllers/FikaSendItemController.ts | 10 ++-- src/helpers/FikaFriendRequestsHelper.ts | 27 +++++---- src/helpers/FikaPlayerRelationsHelper.ts | 18 +++--- .../controllers/ProfileController.ts | 3 +- .../services/LocationLifecycleService.ts | 17 +++--- .../static/FikaNotificationStaticRouter.ts | 2 +- src/routers/static/FikaRaidStaticRouter.ts | 2 +- src/services/FikaInsuranceService.ts | 57 +++++++++---------- src/services/FikaMatchService.ts | 2 +- src/services/FikaPresenceService.ts | 6 +- src/utils/FikaServerTools.ts | 33 ++++++----- 11 files changed, 85 insertions(+), 92 deletions(-) diff --git a/src/controllers/FikaSendItemController.ts b/src/controllers/FikaSendItemController.ts index 69014858..8fda325f 100644 --- a/src/controllers/FikaSendItemController.ts +++ b/src/controllers/FikaSendItemController.ts @@ -32,7 +32,7 @@ export class FikaSendItemController { @inject("ItemHelper") protected itemHelper: ItemHelper, @inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil, @inject("FikaConfig") protected fikaConfig: FikaConfig, - @inject("FikaNotificationWebSocket") protected fikaNotificationWebSocket: FikaNotificationWebSocket + @inject("FikaNotificationWebSocket") protected fikaNotificationWebSocket: FikaNotificationWebSocket, ) { // empty } @@ -93,7 +93,7 @@ export class FikaSendItemController { type: EFikaNotifications.SentItem, nickname: senderProfile?.characters?.pmc?.Info?.Nickname, targetId: body.target, - itemName: `${itemsToSend[0]._tpl} ShortName` + itemName: `${itemsToSend[0]._tpl} ShortName`, } as IReceivedSentItemNotification; this.fikaNotificationWebSocket.broadcast(notification); @@ -117,11 +117,9 @@ export class FikaSendItemController { for (const profile of Object.values(profiles)) { //Uninitialized profiles can cause this to error out, skip these. - if (!profile.characters?.pmc?.Info) - continue; + if (!profile.characters?.pmc?.Info) continue; - if (profile.info.password === "fika-dedicated") - continue; + if (profile.info.password === "fika-dedicated") continue; const nickname = profile.characters.pmc.Info.Nickname; if (!(nickname in result) && nickname !== sender.characters.pmc.Info.Nickname) { diff --git a/src/helpers/FikaFriendRequestsHelper.ts b/src/helpers/FikaFriendRequestsHelper.ts index 2bfcd182..ba3a3b57 100644 --- a/src/helpers/FikaFriendRequestsHelper.ts +++ b/src/helpers/FikaFriendRequestsHelper.ts @@ -77,12 +77,11 @@ export class FikaFriendRequestsHelper { MemberCategory: profile.characters.pmc.Info.MemberCategory, SelectedMemberCategory: profile.characters.pmc.Info.MemberCategory, Ignored: false, - Banned: profile.characters.pmc.Info.BannedState - } - } + Banned: profile.characters.pmc.Info.BannedState, + }, + }, } as any); - } - else { + } else { this.logger.logWithColor(`Could not find profile for ${fromProfileId}`, LogTextColor.RED); } } @@ -117,9 +116,9 @@ export class FikaFriendRequestsHelper { MemberCategory: profile.characters.pmc.Info.MemberCategory, SelectedMemberCategory: profile.characters.pmc.Info.MemberCategory, Ignored: false, - Banned: profile.characters.pmc.Info.BannedState - } - } + Banned: profile.characters.pmc.Info.BannedState, + }, + }, } as any); break; @@ -139,9 +138,9 @@ export class FikaFriendRequestsHelper { MemberCategory: profile.characters.pmc.Info.MemberCategory, SelectedMemberCategory: profile.characters.pmc.Info.MemberCategory, Ignored: false, - Banned: profile.characters.pmc.Info.BannedState - } - } + Banned: profile.characters.pmc.Info.BannedState, + }, + }, } as any); break; @@ -161,9 +160,9 @@ export class FikaFriendRequestsHelper { MemberCategory: profile.characters.pmc.Info.MemberCategory, SelectedMemberCategory: profile.characters.pmc.Info.MemberCategory, Ignored: false, - Banned: profile.characters.pmc.Info.BannedState - } - } + Banned: profile.characters.pmc.Info.BannedState, + }, + }, } as any); break; diff --git a/src/helpers/FikaPlayerRelationsHelper.ts b/src/helpers/FikaPlayerRelationsHelper.ts index de6345ee..6035ecf4 100644 --- a/src/helpers/FikaPlayerRelationsHelper.ts +++ b/src/helpers/FikaPlayerRelationsHelper.ts @@ -104,9 +104,9 @@ export class FikaPlayerRelationsHelper { MemberCategory: profile.characters.pmc.Info.MemberCategory, SelectedMemberCategory: profile.characters.pmc.Info.MemberCategory, Ignored: false, - Banned: profile.characters.pmc.Info.BannedState - } - } + Banned: profile.characters.pmc.Info.BannedState, + }, + }, } as any); } @@ -140,9 +140,9 @@ export class FikaPlayerRelationsHelper { MemberCategory: profile.characters.pmc.Info.MemberCategory, SelectedMemberCategory: profile.characters.pmc.Info.MemberCategory, Ignored: false, - Banned: profile.characters.pmc.Info.BannedState - } - } + Banned: profile.characters.pmc.Info.BannedState, + }, + }, } as any); } @@ -176,9 +176,9 @@ export class FikaPlayerRelationsHelper { MemberCategory: profile.characters.pmc.Info.MemberCategory, SelectedMemberCategory: profile.characters.pmc.Info.MemberCategory, Ignored: false, - Banned: profile.characters.pmc.Info.BannedState - } - } + Banned: profile.characters.pmc.Info.BannedState, + }, + }, } as any); } } diff --git a/src/overrides/controllers/ProfileController.ts b/src/overrides/controllers/ProfileController.ts index 2768dcad..16599493 100644 --- a/src/overrides/controllers/ProfileController.ts +++ b/src/overrides/controllers/ProfileController.ts @@ -40,8 +40,7 @@ export class ProfileControllerOverride extends Override { const matches: ISearchFriendResponse[] = []; for (const profile of Object.values(profiles)) { - if (profile.info?.password === "fika-dedicated") - continue; + if (profile.info?.password === "fika-dedicated") continue; if (profile.characters?.pmc?.Info) { if (profile.characters.pmc.Info.Nickname.toLowerCase().startsWith(searchNicknameLowerCase)) { diff --git a/src/overrides/services/LocationLifecycleService.ts b/src/overrides/services/LocationLifecycleService.ts index 49a3f1bd..4c1e2dbb 100644 --- a/src/overrides/services/LocationLifecycleService.ts +++ b/src/overrides/services/LocationLifecycleService.ts @@ -45,7 +45,7 @@ export class LocationLifecycleServiceOverride extends Override { let locationLoot: ILocationBase; const matchId = this.fikaMatchService.getMatchIdByProfile(sessionId); // Stops TS from throwing a tantrum :) - const lifecycleService = (this.locationLifecycleService as any); + const lifecycleService = this.locationLifecycleService as any; if (matchId === undefined) { // player isn't in a Fika match, generate new loot @@ -68,7 +68,7 @@ export class LocationLifecycleServiceOverride extends Override { transitionRaidId: "66f5750951530ca5ae09876d", transitionCount: 0, visitedLocations: [], - } + }, }; // Only has value when transitioning into map from previous one @@ -102,15 +102,14 @@ export class LocationLifecycleServiceOverride extends Override { } return result; - } + }; result.endLocalRaid = (sessionId: string, request: IEndLocalRaidRequestData): void => { var isSpectator: boolean = false; // Get match id from player session id const matchId = this.fikaMatchService.getMatchIdByPlayer(sessionId); - if(sessionId == matchId) - { + if (sessionId == matchId) { // Clear bot loot cache only if host ended raid this.botLootCacheService.clearCache(); } @@ -118,17 +117,17 @@ export class LocationLifecycleServiceOverride extends Override { // Find player that exited the raid const player = this.fikaMatchService.getPlayerInMatch(matchId, sessionId); - if(player !== undefined) { - if(player.isSpectator) { + if (player !== undefined) { + if (player.isSpectator) { isSpectator = true; } } // Execute the original method if not a spectator - if(!isSpectator) { + if (!isSpectator) { LocationLifecycleService.prototype.endLocalRaid.call(result, sessionId, request); } - } + }; }, { frequency: "Always" }, ); diff --git a/src/routers/static/FikaNotificationStaticRouter.ts b/src/routers/static/FikaNotificationStaticRouter.ts index e08643ee..5af2fee7 100644 --- a/src/routers/static/FikaNotificationStaticRouter.ts +++ b/src/routers/static/FikaNotificationStaticRouter.ts @@ -11,7 +11,7 @@ export class FikaNotificationStaticRouter extends StaticRouter { super([ new RouteAction("/fika/notification/push", async (url: string, info: IPushNotification, sessionID: string, _output: string): Promise => { return this.fikaNotificationCallbacks.handlePushNotification(url, info, sessionID); - }) + }), ]); } } diff --git a/src/routers/static/FikaRaidStaticRouter.ts b/src/routers/static/FikaRaidStaticRouter.ts index 3bf50a37..ab29e508 100644 --- a/src/routers/static/FikaRaidStaticRouter.ts +++ b/src/routers/static/FikaRaidStaticRouter.ts @@ -21,7 +21,7 @@ export class FikaRaidStaticRouter extends StaticRouter { }), new RouteAction("/fika/raid/join", async (url: string, info: IFikaRaidJoinRequestData, sessionID: string, _output: string): Promise => { return this.fikaRaidCallbacks.handleRaidJoin(url, info, sessionID); - }), + }), new RouteAction("/fika/raid/leave", async (url: string, info: IFikaRaidLeaveRequestData, sessionID: string, _output: string): Promise => { return this.fikaRaidCallbacks.handleRaidLeave(url, info, sessionID); }), diff --git a/src/services/FikaInsuranceService.ts b/src/services/FikaInsuranceService.ts index 0f779abe..195887b3 100644 --- a/src/services/FikaInsuranceService.ts +++ b/src/services/FikaInsuranceService.ts @@ -7,38 +7,38 @@ import { SaveServer } from "@spt/servers/SaveServer"; import { inject, injectable } from "tsyringe"; export interface IFikaInsurancePlayer { - sessionID: string, - endedRaid: boolean, - lostItems: string[], - foundItems: string[], - inventory: string[] + sessionID: string; + endedRaid: boolean; + lostItems: string[]; + foundItems: string[]; + inventory: string[]; } @injectable() export class FikaInsuranceService { - private matchInsuranceInfo: Record; + private matchInsuranceInfo: Record; constructor( @inject("SaveServer") protected saveServer: SaveServer, - @inject("ItemHelper") protected itemHelper : ItemHelper, + @inject("ItemHelper") protected itemHelper: ItemHelper, @inject("MatchController") protected matchController: MatchController, @inject("WinstonLogger") protected logger: ILogger, ) { this.matchInsuranceInfo = {}; } - public getMatchId(sessionID: string) : string { + public getMatchId(sessionID: string): string { for (const matchId in this.matchInsuranceInfo) { const match = this.matchInsuranceInfo[matchId]; - if (match.find(player => player.sessionID == sessionID)) { + if (match.find((player) => player.sessionID == sessionID)) { return matchId; } } } - public addPlayerToMatchId(matchId: string, sessionID: string) : void { - if (!(matchId in this.matchInsuranceInfo)) { + public addPlayerToMatchId(matchId: string, sessionID: string): void { + if (!(matchId in this.matchInsuranceInfo)) { this.matchInsuranceInfo[matchId] = []; } @@ -50,9 +50,9 @@ export class FikaInsuranceService { this.matchInsuranceInfo[matchId].push(Data); } - public onEndLocalRaidRequest(sessionID: string, matchId: string, endLocalRaidRequest: IEndLocalRaidRequestData) : void { + public onEndLocalRaidRequest(sessionID: string, matchId: string, endLocalRaidRequest: IEndLocalRaidRequestData): void { if (!(matchId in this.matchInsuranceInfo)) { - this.logger.error("[Fika Insurance] onEndLocalRaidRequest: matchId not found!") + this.logger.error("[Fika Insurance] onEndLocalRaidRequest: matchId not found!"); // Pass back to SPT so that the player can save. MatchController.prototype.endLocalRaid.call(this.matchController, sessionID, endLocalRaidRequest); @@ -62,13 +62,13 @@ export class FikaInsuranceService { const match = this.matchInsuranceInfo[matchId]; for (const player of match) { - if(player.sessionID != sessionID) { + if (player.sessionID != sessionID) { continue; } // Map both the lost items and the current inventory - player.lostItems = endLocalRaidRequest.lostInsuredItems.map(i => i._id); - player.inventory = endLocalRaidRequest.results.profile.Inventory.items.map(i => i._id); + player.lostItems = endLocalRaidRequest.lostInsuredItems.map((i) => i._id); + player.inventory = endLocalRaidRequest.results.profile.Inventory.items.map((i) => i._id); player.endedRaid = true; } @@ -76,13 +76,13 @@ export class FikaInsuranceService { MatchController.prototype.endLocalRaid.call(this.matchController, sessionID, endLocalRaidRequest); } - public onMatchEnd(matchId: string) : void { + public onMatchEnd(matchId: string): void { if (!(matchId in this.matchInsuranceInfo)) { return; } const match = this.matchInsuranceInfo[matchId]; - + match.forEach((player) => { // This player either crashed or the raid ended prematurely, eitherway we skip him. if (!player.endedRaid) { @@ -101,7 +101,7 @@ export class FikaInsuranceService { } // Find overlap between players other than the initial player we're looping over, if it contains the lost item id of the initial player we add it to foundItems - const overlap = nextPlayer.inventory.filter(i => player.lostItems.includes(i)); + const overlap = nextPlayer.inventory.filter((i) => player.lostItems.includes(i)); // Add said overlap to player's found items player.foundItems = player.foundItems.concat(overlap); @@ -116,15 +116,15 @@ export class FikaInsuranceService { delete this.matchInsuranceInfo[matchId]; } - private removeItemsFromInsurance(sessionID: string, ids: string[]) : void { + private removeItemsFromInsurance(sessionID: string, ids: string[]): void { const profile = this.saveServer.getProfile(sessionID); for (let insuranceIndex = 0; insuranceIndex < profile.insurance.length; insuranceIndex++) { let insurance = profile.insurance[insuranceIndex]; - for (const idToRemove of ids) { - const insuredItemIndex = insurance.items.findIndex(i => i._id == idToRemove); - + for (const idToRemove of ids) { + const insuredItemIndex = insurance.items.findIndex((i) => i._id == idToRemove); + if (insuredItemIndex != -1) { const item = insurance.items[insuredItemIndex]; this.logger.debug(`[Fika Insurance] Found ${item._id} which will be removed`); @@ -139,12 +139,12 @@ export class FikaInsuranceService { insuranceItems.forEach((innerItem) => { this.logger.debug(`[Fika Insurance] Inner item: ${innerItem._id}`); - if(innerItem.parentId == item._id && this.itemHelper.isOfBaseclass(innerItem._tpl, BaseClasses.BUILT_IN_INSERTS)) { + if (innerItem.parentId == item._id && this.itemHelper.isOfBaseclass(innerItem._tpl, BaseClasses.BUILT_IN_INSERTS)) { // There's mods that allow you to take soft inserts out and those will most likely have insurance set, dont need to remove those here. - if(!ids.includes(innerItem._id)) { + if (!ids.includes(innerItem._id)) { this.logger.debug(`[Fika Insurance] Removing soft insert ${innerItem._id} of item ${item._id}`); - const innerItemIndex = insurance.items.findIndex(i => i._id == innerItem._id); + const innerItemIndex = insurance.items.findIndex((i) => i._id == innerItem._id); insurance.items.splice(innerItemIndex, 1); } @@ -156,13 +156,12 @@ export class FikaInsuranceService { insurance.items.splice(insuredItemIndex, 1); } } - + if (insurance.items.length == 0) { this.logger.debug("No more insured items left, deleting this entry"); profile.insurance.splice(insuranceIndex, 1); insuranceIndex--; - } - else { + } else { // Update existing insured item list profile.insurance[insuranceIndex] = insurance; } diff --git a/src/services/FikaMatchService.ts b/src/services/FikaMatchService.ts index e5311b09..a07b3d50 100644 --- a/src/services/FikaMatchService.ts +++ b/src/services/FikaMatchService.ts @@ -313,7 +313,7 @@ export class FikaMatchService { const raidInformation: IFikaRaidPresence = { location: match.locationData.Id, side: match.side, - time: match.time + time: match.time, }; this.fikaPresenceService.updatePlayerPresence(playerId, EFikaPlayerPresences.IN_RAID, raidInformation); diff --git a/src/services/FikaPresenceService.ts b/src/services/FikaPresenceService.ts index 8246f4ab..3e09ec99 100644 --- a/src/services/FikaPresenceService.ts +++ b/src/services/FikaPresenceService.ts @@ -32,7 +32,7 @@ export class FikaPresenceService { level: profile.characters.pmc.Info.Level, activity: EFikaPlayerPresences.IN_MENU, activityStartedTimestamp: this.timeUtil.getTimestamp(), - raidInformation: null + raidInformation: null, }; this.logger.debug(`[Fika Presence] Adding player: ${data.nickname}`); @@ -64,9 +64,9 @@ export class FikaPresenceService { level: profile.characters.pmc.Info.Level, activity: activity, activityStartedTimestamp: this.timeUtil.getTimestamp(), - raidInformation: raidInformation + raidInformation: raidInformation, }; - + this.onlinePlayers[sessionID] = data; } diff --git a/src/utils/FikaServerTools.ts b/src/utils/FikaServerTools.ts index 3e72ae89..ed815ce9 100644 --- a/src/utils/FikaServerTools.ts +++ b/src/utils/FikaServerTools.ts @@ -7,8 +7,8 @@ import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; import { IHttpConfig } from "@spt/models/spt/config/IHttpConfig"; import { ChildProcessWithoutNullStreams, spawn } from "child_process"; import path from "node:path"; -import fs from 'fs'; -import os from 'os'; +import fs from "fs"; +import os from "os"; @injectable() export class FikaServerTools { @@ -24,16 +24,16 @@ export class FikaServerTools { @inject("FikaConfig") protected fikaConfig: FikaConfig, @inject("ConfigServer") protected configServer: ConfigServer, ) { - switch(os.platform()) { - case 'linux': { + switch (os.platform()) { + case "linux": { this.exePath = path.join(path.join(__dirname, "../../"), "FikaServerTools"); - break; - } + break; + } default: { this.exePath = path.join(path.join(__dirname, "../../"), "FikaServerTools.exe"); break; } - } + } this.natPunchServerConfig = fikaConfig.getConfig().natPunchServer; this.httpConfig = this.configServer.getConfig(ConfigTypes.HTTP); } @@ -41,8 +41,7 @@ export class FikaServerTools { public startService(serviceName: string): void { var exeArgs: string[]; - switch(serviceName) - { + switch (serviceName) { case "NatPunchServer": const ip = this.httpConfig.ip; const port = this.natPunchServerConfig.port; @@ -54,32 +53,32 @@ export class FikaServerTools { return; } - if(!fs.existsSync(this.exePath)) { + if (!fs.existsSync(this.exePath)) { this.logError(this.name, `File not found: ${this.exePath}`); return; } - if(serviceName in this.processes) { + if (serviceName in this.processes) { this.stopService(serviceName); } const process = spawn(this.exePath, exeArgs); - process.stdout.on("data", data => { + process.stdout.on("data", (data) => { var dataStr = data.toString(); dataStr = dataStr.substring(0, dataStr.length - 1); this.logInfo(serviceName, dataStr); }); - process.stderr.on("data", data => { + process.stderr.on("data", (data) => { var dataStr = data.toString(); dataStr = dataStr.substring(0, dataStr.length - 1); this.logError(serviceName, dataStr); }); - process.on("exit", code => { + process.on("exit", (code) => { this.logError(this.name, `FikaServerTools ended with code ${code}`); }); @@ -89,10 +88,10 @@ export class FikaServerTools { } public stopService(serviceName: string): void { - if(serviceName in this.processes) { + if (serviceName in this.processes) { const process = this.processes[serviceName]; - if(process != null) { - if(!process.killed) { + if (process != null) { + if (!process.killed) { process.kill(); } } From b1e5785c7d5e623bd2acb83071f7e21ec95ba561 Mon Sep 17 00:00:00 2001 From: Archangel Date: Tue, 15 Oct 2024 19:59:13 +0200 Subject: [PATCH 076/119] Move IFikaInsurancePlayer to it's own model --- src/models/fika/insurance/IFikaInsurancePlayer.ts | 7 +++++++ src/services/FikaInsuranceService.ts | 13 ++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 src/models/fika/insurance/IFikaInsurancePlayer.ts diff --git a/src/models/fika/insurance/IFikaInsurancePlayer.ts b/src/models/fika/insurance/IFikaInsurancePlayer.ts new file mode 100644 index 00000000..1f3fe033 --- /dev/null +++ b/src/models/fika/insurance/IFikaInsurancePlayer.ts @@ -0,0 +1,7 @@ +export interface IFikaInsurancePlayer { + sessionID: string; + endedRaid: boolean; + lostItems: string[]; + foundItems: string[]; + inventory: string[]; +} diff --git a/src/services/FikaInsuranceService.ts b/src/services/FikaInsuranceService.ts index 195887b3..4ed725f3 100644 --- a/src/services/FikaInsuranceService.ts +++ b/src/services/FikaInsuranceService.ts @@ -1,18 +1,13 @@ +import { inject, injectable } from "tsyringe"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; + import { MatchController } from "@spt/controllers/MatchController"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { IEndLocalRaidRequestData } from "@spt/models/eft/match/IEndLocalRaidRequestData"; import { BaseClasses } from "@spt/models/enums/BaseClasses"; -import { ILogger } from "@spt/models/spt/utils/ILogger"; import { SaveServer } from "@spt/servers/SaveServer"; -import { inject, injectable } from "tsyringe"; -export interface IFikaInsurancePlayer { - sessionID: string; - endedRaid: boolean; - lostItems: string[]; - foundItems: string[]; - inventory: string[]; -} +import { IFikaInsurancePlayer } from "../models/fika/insurance/IFikaInsurancePlayer"; @injectable() export class FikaInsuranceService { From 90c517ae58fb2b7a143445abca0f205ed25f0484 Mon Sep 17 00:00:00 2001 From: Archangel Date: Tue, 15 Oct 2024 20:03:05 +0200 Subject: [PATCH 077/119] Stop people from sending friend requests to bots --- src/helpers/FikaFriendRequestsHelper.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/helpers/FikaFriendRequestsHelper.ts b/src/helpers/FikaFriendRequestsHelper.ts index ba3a3b57..822518ec 100644 --- a/src/helpers/FikaFriendRequestsHelper.ts +++ b/src/helpers/FikaFriendRequestsHelper.ts @@ -52,6 +52,13 @@ export class FikaFriendRequestsHelper { return; } + if (!this.saveServer.getProfile(toProfileId)) + { + this.logger.logWithColor(`Friend request: ${toProfileId} doesn't exist! ${fromProfileId} tried to add an invalid user!`, LogTextColor.YELLOW); + + return; + } + this.fikaFriendRequestsCacheService.storeFriendRequest({ _id: this.hashUtil.generate(), from: fromProfileId, From d75ecb8490152f3a9864a8b4c9e7ef5b7d577ba3 Mon Sep 17 00:00:00 2001 From: Archangel Date: Tue, 15 Oct 2024 20:04:18 +0200 Subject: [PATCH 078/119] getProfile -> profileExists --- src/helpers/FikaFriendRequestsHelper.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/helpers/FikaFriendRequestsHelper.ts b/src/helpers/FikaFriendRequestsHelper.ts index 822518ec..13f06b8c 100644 --- a/src/helpers/FikaFriendRequestsHelper.ts +++ b/src/helpers/FikaFriendRequestsHelper.ts @@ -52,8 +52,7 @@ export class FikaFriendRequestsHelper { return; } - if (!this.saveServer.getProfile(toProfileId)) - { + if (!this.saveServer.profileExists(toProfileId)) { this.logger.logWithColor(`Friend request: ${toProfileId} doesn't exist! ${fromProfileId} tried to add an invalid user!`, LogTextColor.YELLOW); return; From 65ebb5d58108e33ac63ffa26ad6665a98089d685 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Tue, 15 Oct 2024 20:21:42 +0200 Subject: [PATCH 079/119] Add nullable --- src/models/fika/presence/IFikaSetPresence.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/fika/presence/IFikaSetPresence.ts b/src/models/fika/presence/IFikaSetPresence.ts index 7f474eff..af1f147c 100644 --- a/src/models/fika/presence/IFikaSetPresence.ts +++ b/src/models/fika/presence/IFikaSetPresence.ts @@ -3,5 +3,5 @@ import { IFikaRaidPresence } from "./IFikaRaidPresence"; export interface IFikaSetPresence { activity: EFikaPlayerPresences; - raidInformation: IFikaRaidPresence; + raidInformation?: IFikaRaidPresence; } \ No newline at end of file From 8d89441c65ca56d65b6462203bd12baa24ab9e79 Mon Sep 17 00:00:00 2001 From: Archangel Date: Tue, 15 Oct 2024 20:22:51 +0200 Subject: [PATCH 080/119] Add more nullable --- src/models/fika/presence/IFikaPlayerPresence.ts | 2 +- src/services/FikaPresenceService.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/models/fika/presence/IFikaPlayerPresence.ts b/src/models/fika/presence/IFikaPlayerPresence.ts index c30159d3..887b17fb 100644 --- a/src/models/fika/presence/IFikaPlayerPresence.ts +++ b/src/models/fika/presence/IFikaPlayerPresence.ts @@ -6,5 +6,5 @@ export interface IFikaPlayerPresence { level: number; activity: EFikaPlayerPresences; activityStartedTimestamp: number; - raidInformation: IFikaRaidPresence; + raidInformation?: IFikaRaidPresence; } \ No newline at end of file diff --git a/src/services/FikaPresenceService.ts b/src/services/FikaPresenceService.ts index 3e09ec99..0350aabb 100644 --- a/src/services/FikaPresenceService.ts +++ b/src/services/FikaPresenceService.ts @@ -52,7 +52,7 @@ export class FikaPresenceService { return playerList; } - public updatePlayerPresence(sessionID: string, activity: EFikaPlayerPresences, raidInformation: IFikaRaidPresence = null): void { + public updatePlayerPresence(sessionID: string, activity: EFikaPlayerPresences, raidInformation?: IFikaRaidPresence): void { if (!this.onlinePlayers[sessionID]) { return; } From 716c7fe9d05175e6d9dee466606fa88d54a7a83f Mon Sep 17 00:00:00 2001 From: Archangel Date: Tue, 15 Oct 2024 20:51:42 +0200 Subject: [PATCH 081/119] Add IN_HIDEOUT --- src/models/enums/EFikaPlayerPresences.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/models/enums/EFikaPlayerPresences.ts b/src/models/enums/EFikaPlayerPresences.ts index 22ee6d6f..837113a0 100644 --- a/src/models/enums/EFikaPlayerPresences.ts +++ b/src/models/enums/EFikaPlayerPresences.ts @@ -2,4 +2,5 @@ export enum EFikaPlayerPresences { IN_MENU = 0, IN_RAID = 1, IN_STASH = 2, + IN_HIDEOUT = 3, } From ddd721154c6d0e67d79684a2aa109ba622a2e520 Mon Sep 17 00:00:00 2001 From: Archangel Date: Tue, 15 Oct 2024 21:16:20 +0200 Subject: [PATCH 082/119] Do correct response --- src/callbacks/FikaPresenceCallbacks.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/callbacks/FikaPresenceCallbacks.ts b/src/callbacks/FikaPresenceCallbacks.ts index b1ede7cd..db3c549d 100644 --- a/src/callbacks/FikaPresenceCallbacks.ts +++ b/src/callbacks/FikaPresenceCallbacks.ts @@ -23,7 +23,9 @@ export class FikaPresenceCallbacks { /** Handle /fika/presence/set */ public handleSetPresence(_url: string, data: IFikaSetPresence, sessionID: string): INullResponseData { - return this.httpResponseUtil.noBody(this.fikaPresenceService.updatePlayerPresence(sessionID, data.activity, data.raidInformation)); + this.fikaPresenceService.updatePlayerPresence(sessionID, data.activity, data.raidInformation); + + return this.httpResponseUtil.nullResponse(); } /** Handle /fika/presence/setget */ From 23677e4bea0ade6b265982b03e8ab96212b0278d Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Tue, 15 Oct 2024 21:17:03 +0200 Subject: [PATCH 083/119] Update methods --- src/callbacks/FikaPresenceCallbacks.ts | 6 +++--- src/services/FikaPresenceService.ts | 27 +++++++++++++++++++++++--- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/callbacks/FikaPresenceCallbacks.ts b/src/callbacks/FikaPresenceCallbacks.ts index b1ede7cd..5f4f0792 100644 --- a/src/callbacks/FikaPresenceCallbacks.ts +++ b/src/callbacks/FikaPresenceCallbacks.ts @@ -3,9 +3,9 @@ import { inject, injectable } from "tsyringe"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; -import { FikaPresenceService } from "../services/FikaPresenceService"; import { IFikaPlayerPresence } from "../models/fika/presence/IFikaPlayerPresence"; import { IFikaSetPresence } from "../models/fika/presence/IFikaSetPresence"; +import { FikaPresenceService } from "../services/FikaPresenceService"; @injectable() export class FikaPresenceCallbacks { @@ -23,12 +23,12 @@ export class FikaPresenceCallbacks { /** Handle /fika/presence/set */ public handleSetPresence(_url: string, data: IFikaSetPresence, sessionID: string): INullResponseData { - return this.httpResponseUtil.noBody(this.fikaPresenceService.updatePlayerPresence(sessionID, data.activity, data.raidInformation)); + return this.httpResponseUtil.noBody(this.fikaPresenceService.setPlayerPresence(sessionID, data)); } /** Handle /fika/presence/setget */ public handleSetGetPresence(_url: string, data: IFikaSetPresence, sessionID: string): IFikaPlayerPresence { - this.fikaPresenceService.updatePlayerPresence(sessionID, data.activity, data.raidInformation); + this.fikaPresenceService.setPlayerPresence(sessionID, data); return this.httpResponseUtil.noBody(this.fikaPresenceService.getAllPlayersPresence()); } diff --git a/src/services/FikaPresenceService.ts b/src/services/FikaPresenceService.ts index 3e09ec99..bd895a9b 100644 --- a/src/services/FikaPresenceService.ts +++ b/src/services/FikaPresenceService.ts @@ -1,12 +1,13 @@ import { inject, injectable } from "tsyringe"; -import { TimeUtil } from "@spt/utils/TimeUtil"; -import { SaveServer } from "@spt/servers/SaveServer"; import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { SaveServer } from "@spt/servers/SaveServer"; +import { TimeUtil } from "@spt/utils/TimeUtil"; import { EFikaPlayerPresences } from "../models/enums/EFikaPlayerPresences"; import { IFikaPlayerPresence } from "../models/fika/presence/IFikaPlayerPresence"; import { IFikaRaidPresence } from "../models/fika/presence/IFikaRaidPresence"; +import { IFikaSetPresence } from "../models/fika/presence/IFikaSetPresence"; @injectable() export class FikaPresenceService { @@ -64,7 +65,27 @@ export class FikaPresenceService { level: profile.characters.pmc.Info.Level, activity: activity, activityStartedTimestamp: this.timeUtil.getTimestamp(), - raidInformation: raidInformation, + raidInformation: raidInformation + }; + + this.onlinePlayers[sessionID] = data; + } + + public setPlayerPresence(sessionID: string, request: IFikaSetPresence): void { + if (!this.onlinePlayers[sessionID]) { + return; + } + + console.log(JSON.stringify(request)); + + const profile = this.saveServer.getProfile(sessionID); + + let data: IFikaPlayerPresence = { + nickname: profile.characters.pmc.Info.Nickname, + level: profile.characters.pmc.Info.Level, + activity: request.activity, + activityStartedTimestamp: this.timeUtil.getTimestamp(), + raidInformation: request?.raidInformation }; this.onlinePlayers[sessionID] = data; From c1aef1438f27f259274fd404fa4b5269e79f1fb1 Mon Sep 17 00:00:00 2001 From: Archangel Date: Tue, 15 Oct 2024 21:23:55 +0200 Subject: [PATCH 084/119] Revert 'Update methods' --- src/callbacks/FikaPresenceCallbacks.ts | 6 +++--- src/services/FikaPresenceService.ts | 27 +++----------------------- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/src/callbacks/FikaPresenceCallbacks.ts b/src/callbacks/FikaPresenceCallbacks.ts index 04dfad05..db3c549d 100644 --- a/src/callbacks/FikaPresenceCallbacks.ts +++ b/src/callbacks/FikaPresenceCallbacks.ts @@ -3,9 +3,9 @@ import { inject, injectable } from "tsyringe"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; +import { FikaPresenceService } from "../services/FikaPresenceService"; import { IFikaPlayerPresence } from "../models/fika/presence/IFikaPlayerPresence"; import { IFikaSetPresence } from "../models/fika/presence/IFikaSetPresence"; -import { FikaPresenceService } from "../services/FikaPresenceService"; @injectable() export class FikaPresenceCallbacks { @@ -23,14 +23,14 @@ export class FikaPresenceCallbacks { /** Handle /fika/presence/set */ public handleSetPresence(_url: string, data: IFikaSetPresence, sessionID: string): INullResponseData { - this.fikaPresenceService.setPlayerPresence(sessionID, data); + this.fikaPresenceService.updatePlayerPresence(sessionID, data.activity, data.raidInformation); return this.httpResponseUtil.nullResponse(); } /** Handle /fika/presence/setget */ public handleSetGetPresence(_url: string, data: IFikaSetPresence, sessionID: string): IFikaPlayerPresence { - this.fikaPresenceService.setPlayerPresence(sessionID, data); + this.fikaPresenceService.updatePlayerPresence(sessionID, data.activity, data.raidInformation); return this.httpResponseUtil.noBody(this.fikaPresenceService.getAllPlayersPresence()); } diff --git a/src/services/FikaPresenceService.ts b/src/services/FikaPresenceService.ts index 067a7e3c..0350aabb 100644 --- a/src/services/FikaPresenceService.ts +++ b/src/services/FikaPresenceService.ts @@ -1,13 +1,12 @@ import { inject, injectable } from "tsyringe"; -import { ILogger } from "@spt/models/spt/utils/ILogger"; -import { SaveServer } from "@spt/servers/SaveServer"; import { TimeUtil } from "@spt/utils/TimeUtil"; +import { SaveServer } from "@spt/servers/SaveServer"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EFikaPlayerPresences } from "../models/enums/EFikaPlayerPresences"; import { IFikaPlayerPresence } from "../models/fika/presence/IFikaPlayerPresence"; import { IFikaRaidPresence } from "../models/fika/presence/IFikaRaidPresence"; -import { IFikaSetPresence } from "../models/fika/presence/IFikaSetPresence"; @injectable() export class FikaPresenceService { @@ -65,27 +64,7 @@ export class FikaPresenceService { level: profile.characters.pmc.Info.Level, activity: activity, activityStartedTimestamp: this.timeUtil.getTimestamp(), - raidInformation: raidInformation - }; - - this.onlinePlayers[sessionID] = data; - } - - public setPlayerPresence(sessionID: string, request: IFikaSetPresence): void { - if (!this.onlinePlayers[sessionID]) { - return; - } - - console.log(JSON.stringify(request)); - - const profile = this.saveServer.getProfile(sessionID); - - let data: IFikaPlayerPresence = { - nickname: profile.characters.pmc.Info.Nickname, - level: profile.characters.pmc.Info.Level, - activity: request.activity, - activityStartedTimestamp: this.timeUtil.getTimestamp(), - raidInformation: request?.raidInformation + raidInformation: raidInformation, }; this.onlinePlayers[sessionID] = data; From e0d5992b942874640982a8e5dfc70bea5d2d7933 Mon Sep 17 00:00:00 2001 From: Archangel Date: Tue, 15 Oct 2024 21:45:30 +0200 Subject: [PATCH 085/119] Pass IFikaSetPresence to updatePlayerPresence --- src/callbacks/FikaPresenceCallbacks.ts | 4 ++-- src/models/fika/presence/IFikaSetPresence.ts | 2 +- src/services/FikaMatchService.ts | 14 ++++-------- src/services/FikaPresenceService.ts | 24 +++++++++++++++++--- 4 files changed, 29 insertions(+), 15 deletions(-) diff --git a/src/callbacks/FikaPresenceCallbacks.ts b/src/callbacks/FikaPresenceCallbacks.ts index db3c549d..1a44e21f 100644 --- a/src/callbacks/FikaPresenceCallbacks.ts +++ b/src/callbacks/FikaPresenceCallbacks.ts @@ -23,14 +23,14 @@ export class FikaPresenceCallbacks { /** Handle /fika/presence/set */ public handleSetPresence(_url: string, data: IFikaSetPresence, sessionID: string): INullResponseData { - this.fikaPresenceService.updatePlayerPresence(sessionID, data.activity, data.raidInformation); + this.fikaPresenceService.updatePlayerPresence(sessionID, data); return this.httpResponseUtil.nullResponse(); } /** Handle /fika/presence/setget */ public handleSetGetPresence(_url: string, data: IFikaSetPresence, sessionID: string): IFikaPlayerPresence { - this.fikaPresenceService.updatePlayerPresence(sessionID, data.activity, data.raidInformation); + this.fikaPresenceService.updatePlayerPresence(sessionID, data); return this.httpResponseUtil.noBody(this.fikaPresenceService.getAllPlayersPresence()); } diff --git a/src/models/fika/presence/IFikaSetPresence.ts b/src/models/fika/presence/IFikaSetPresence.ts index af1f147c..27629fef 100644 --- a/src/models/fika/presence/IFikaSetPresence.ts +++ b/src/models/fika/presence/IFikaSetPresence.ts @@ -1,7 +1,7 @@ import { EFikaPlayerPresences } from "../../enums/EFikaPlayerPresences"; import { IFikaRaidPresence } from "./IFikaRaidPresence"; -export interface IFikaSetPresence { +export interface IFikaSetPresence{ activity: EFikaPlayerPresences; raidInformation?: IFikaRaidPresence; } \ No newline at end of file diff --git a/src/services/FikaMatchService.ts b/src/services/FikaMatchService.ts index a07b3d50..3d6d1941 100644 --- a/src/services/FikaMatchService.ts +++ b/src/services/FikaMatchService.ts @@ -9,13 +9,13 @@ import { EFikaMatchStatus } from "../models/enums/EFikaMatchStatus"; import { IFikaMatch } from "../models/fika/IFikaMatch"; import { IFikaPlayer } from "../models/fika/IFikaPlayer"; import { IFikaRaidCreateRequestData } from "../models/fika/routes/raid/create/IFikaRaidCreateRequestData"; -import { IFikaRaidPresence } from "../models/fika/presence/IFikaRaidPresence"; import { EFikaPlayerPresences } from "../models/enums/EFikaPlayerPresences"; import { FikaConfig } from "../utils/FikaConfig"; import { FikaDedicatedRaidService } from "./dedicated/FikaDedicatedRaidService"; import { FikaInsuranceService } from "./FikaInsuranceService"; import { FikaPresenceService } from "./FikaPresenceService"; +import { IFikaSetPresence } from "../models/fika/presence/IFikaSetPresence"; @injectable() export class FikaMatchService { @@ -310,13 +310,9 @@ export class FikaMatchService { this.fikaInsuranceService.addPlayerToMatchId(matchId, playerId); - const raidInformation: IFikaRaidPresence = { - location: match.locationData.Id, - side: match.side, - time: match.time, - }; - - this.fikaPresenceService.updatePlayerPresence(playerId, EFikaPlayerPresences.IN_RAID, raidInformation); + this.fikaPresenceService.updatePlayerPresence(playerId, this.fikaPresenceService.generateSetPresence( + EFikaPlayerPresences.IN_RAID, + this.fikaPresenceService.generateRaidPresence(match.locationData.Id, match.side, match.time))); } /** @@ -367,6 +363,6 @@ export class FikaMatchService { this.matches.get(matchId).players.delete(playerId); - this.fikaPresenceService.updatePlayerPresence(playerId, EFikaPlayerPresences.IN_MENU); + this.fikaPresenceService.updatePlayerPresence(playerId, this.fikaPresenceService.generateSetPresence(EFikaPlayerPresences.IN_MENU)); } } diff --git a/src/services/FikaPresenceService.ts b/src/services/FikaPresenceService.ts index 0350aabb..dcef92b1 100644 --- a/src/services/FikaPresenceService.ts +++ b/src/services/FikaPresenceService.ts @@ -7,6 +7,9 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EFikaPlayerPresences } from "../models/enums/EFikaPlayerPresences"; import { IFikaPlayerPresence } from "../models/fika/presence/IFikaPlayerPresence"; import { IFikaRaidPresence } from "../models/fika/presence/IFikaRaidPresence"; +import { IFikaSetPresence } from "../models/fika/presence/IFikaSetPresence"; +import { EFikaSide } from "../models/enums/EFikaSide"; +import { EFikaTime } from "../models/enums/EFikaTime"; @injectable() export class FikaPresenceService { @@ -52,7 +55,22 @@ export class FikaPresenceService { return playerList; } - public updatePlayerPresence(sessionID: string, activity: EFikaPlayerPresences, raidInformation?: IFikaRaidPresence): void { + public generateSetPresence(activity: EFikaPlayerPresences, raidInformation?: IFikaRaidPresence): IFikaSetPresence { + return { + activity: activity, + raidInformation: raidInformation, + }; + } + + public generateRaidPresence(location: string, side: EFikaSide, time: EFikaTime): IFikaRaidPresence { + return { + location: location, + side: side, + time: time, + }; + } + + public updatePlayerPresence(sessionID: string, newPresence: IFikaSetPresence): void { if (!this.onlinePlayers[sessionID]) { return; } @@ -62,9 +80,9 @@ export class FikaPresenceService { let data: IFikaPlayerPresence = { nickname: profile.characters.pmc.Info.Nickname, level: profile.characters.pmc.Info.Level, - activity: activity, + activity: newPresence.activity, activityStartedTimestamp: this.timeUtil.getTimestamp(), - raidInformation: raidInformation, + raidInformation: newPresence.raidInformation, }; this.onlinePlayers[sessionID] = data; From 2dfa43822f3b6f23158b9f8c744e68d1894ffc9d Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Tue, 15 Oct 2024 23:00:02 +0200 Subject: [PATCH 086/119] Update method name --- src/Fika.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Fika.ts b/src/Fika.ts index 210e1b18..eebb4851 100644 --- a/src/Fika.ts +++ b/src/Fika.ts @@ -49,7 +49,7 @@ export class Fika { this.fikaDedicatedProfileService.init(); } - this.AddFikaClientLocales(); + this.addFikaClientLocales(); if (this.backgroundConfig.enable) { const image = this.backgroundConfig.easteregg ? "assets/images/launcher/bg-senko.png" : "assets/images/launcher/bg.png"; @@ -57,7 +57,7 @@ export class Fika { } } - private async AddFikaClientLocales() { + private async addFikaClientLocales() { const database = this.databaseServer.getTables(); const databasePath = path.join(this.fikaConfig.getModPath(), "assets/database/"); From 879499df657e78b747fe44a260d331c0a3dd1b4a Mon Sep 17 00:00:00 2001 From: Archangel Date: Wed, 16 Oct 2024 10:10:12 +0200 Subject: [PATCH 087/119] Cleanup --- src/controllers/FikaRaidController.ts | 4 ++-- src/controllers/FikaSendItemController.ts | 4 ++-- src/services/FikaInsuranceService.ts | 15 +++++++++------ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/controllers/FikaRaidController.ts b/src/controllers/FikaRaidController.ts index cc45c13d..d8f6fee9 100644 --- a/src/controllers/FikaRaidController.ts +++ b/src/controllers/FikaRaidController.ts @@ -50,11 +50,11 @@ export class FikaRaidController { * @param request */ public handleRaidCreate(request: IFikaRaidCreateRequestData): IFikaRaidCreateResponse { - const notification = { + const notification: IStartRaidNotification = { type: EFikaNotifications.StartedRaid, nickname: request.hostUsername, location: request.settings.location, - } as IStartRaidNotification; + }; this.fikaNotificationWebSocket.broadcast(notification); diff --git a/src/controllers/FikaSendItemController.ts b/src/controllers/FikaSendItemController.ts index 8fda325f..00f996f4 100644 --- a/src/controllers/FikaSendItemController.ts +++ b/src/controllers/FikaSendItemController.ts @@ -89,12 +89,12 @@ export class FikaSendItemController { this.inventoryHelper.removeItem(senderProfile.characters.pmc, body.id, sessionID, output); - const notification = { + const notification: IReceivedSentItemNotification = { type: EFikaNotifications.SentItem, nickname: senderProfile?.characters?.pmc?.Info?.Nickname, targetId: body.target, itemName: `${itemsToSend[0]._tpl} ShortName`, - } as IReceivedSentItemNotification; + }; this.fikaNotificationWebSocket.broadcast(notification); diff --git a/src/services/FikaInsuranceService.ts b/src/services/FikaInsuranceService.ts index 4ed725f3..0b7eba82 100644 --- a/src/services/FikaInsuranceService.ts +++ b/src/services/FikaInsuranceService.ts @@ -37,12 +37,15 @@ export class FikaInsuranceService { this.matchInsuranceInfo[matchId] = []; } - let Data = {} as IFikaInsurancePlayer; - Data.sessionID = sessionID; - Data.endedRaid = false; - Data.foundItems = []; - - this.matchInsuranceInfo[matchId].push(Data); + let player: IFikaInsurancePlayer = { + sessionID: sessionID, + endedRaid: false, + lostItems: [], + foundItems: [], + inventory: [], + }; + + this.matchInsuranceInfo[matchId].push(player); } public onEndLocalRaidRequest(sessionID: string, matchId: string, endLocalRaidRequest: IEndLocalRaidRequestData): void { From c52342c41040098a4824be1e27405ede7be9ee50 Mon Sep 17 00:00:00 2001 From: Archangel Date: Wed, 16 Oct 2024 11:04:52 +0200 Subject: [PATCH 088/119] Small refactor to the Notification websocket --- src/websockets/FikaNotificationWebSocket.ts | 44 +++++++++++---------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/src/websockets/FikaNotificationWebSocket.ts b/src/websockets/FikaNotificationWebSocket.ts index d8e8aea1..13dfabaf 100644 --- a/src/websockets/FikaNotificationWebSocket.ts +++ b/src/websockets/FikaNotificationWebSocket.ts @@ -77,32 +77,36 @@ export class FikaNotificationWebSocket implements IWebSocketConnectionHandler { this.fikaPresenceService.removePlayerPresence(sessionID); } - public broadcast(message: IFikaNotificationBase): void { - for (const client in this.clientWebSockets) { - const clientWebSocket = this.clientWebSockets[client]; + // Send functionality for sending to a single client. + public send(sessionID: string, message: IFikaNotificationBase): void { + const client = this.clientWebSockets[sessionID]; + + // Client is not online or not currently connected to the websocket. + if (!client) { + return; + } + + // Client was formerly connected to the websocket, but may have connection issues as it didn't run onClose + if (client.readyState === WebSocket.CLOSED) { + return; + } - if (clientWebSocket.readyState == WebSocket.CLOSED) { - continue; - } + client.send(JSON.stringify(message)); + } - clientWebSocket.send(JSON.stringify(message)); + public broadcast(message: IFikaNotificationBase): void { + for (const sessionID in this.clientWebSockets) { + this.send(sessionID, message); } } public keepWebSocketAlive(): void { - for (const sessionId in this.clientWebSockets) { - const clientWebSocket = this.clientWebSockets[sessionId]; - - if (clientWebSocket.readyState == WebSocket.CLOSED) { - continue; - } - - // Send a keep alive message to clients. - clientWebSocket.send( - JSON.stringify({ - type: EFikaNotifications.KeepAlive, - }), - ); + for (const sessionID in this.clientWebSockets) { + let message: IFikaNotificationBase = { + type: EFikaNotifications.KeepAlive, + }; + + this.send(sessionID, message) } } } From 12bf752f040fc5323e26e8b0bf4f5be914d0ea94 Mon Sep 17 00:00:00 2001 From: Archangel Date: Wed, 16 Oct 2024 11:05:19 +0200 Subject: [PATCH 089/119] Send received item notification to individual rather than broadcast --- src/controllers/FikaSendItemController.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/FikaSendItemController.ts b/src/controllers/FikaSendItemController.ts index 00f996f4..974d509e 100644 --- a/src/controllers/FikaSendItemController.ts +++ b/src/controllers/FikaSendItemController.ts @@ -96,7 +96,7 @@ export class FikaSendItemController { itemName: `${itemsToSend[0]._tpl} ShortName`, }; - this.fikaNotificationWebSocket.broadcast(notification); + this.fikaNotificationWebSocket.send(body.target, notification); return output; } From 0cd1ba4a324d148b6b9177dc45b711d84e46ac7b Mon Sep 17 00:00:00 2001 From: Archangel Date: Wed, 16 Oct 2024 11:24:26 +0200 Subject: [PATCH 090/119] Get rid of errors due to protected methods --- src/overrides/controllers/LauncherController.ts | 5 ++++- src/services/FikaMatchService.ts | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/overrides/controllers/LauncherController.ts b/src/overrides/controllers/LauncherController.ts index bf252674..a7b52b7c 100644 --- a/src/overrides/controllers/LauncherController.ts +++ b/src/overrides/controllers/LauncherController.ts @@ -44,11 +44,14 @@ export class LauncherControllerOverride extends Override { } } + // Stop TS from throwing a tantrum over protected methods + const launchController = this.launcherController as any; + return { backendUrl: this.httpServerHelper.getBackendUrl(), name: this.coreConfig.serverName, editions: Object.keys(editions), - profileDescriptions: this.launcherController.getProfileDescriptions(), + profileDescriptions: launchController.getProfileDescriptions(), }; }; }, diff --git a/src/services/FikaMatchService.ts b/src/services/FikaMatchService.ts index 3d6d1941..e6f058d2 100644 --- a/src/services/FikaMatchService.ts +++ b/src/services/FikaMatchService.ts @@ -187,7 +187,10 @@ export class FikaMatchService { this.deleteMatch(data.serverId); } - const locationData = this.locationLifecycleService.generateLocationAndLoot(data.settings.location); + // Stop TS from throwing a tantrum over protected methods + const lifecycleService = this.locationLifecycleService as any; + + const locationData = lifecycleService.generateLocationAndLoot(data.settings.location); this.matches.set(data.serverId, { ips: null, From 8cb174d4ee7c70347a1e76efba83164aa89def5f Mon Sep 17 00:00:00 2001 From: Archangel Date: Wed, 16 Oct 2024 11:26:08 +0200 Subject: [PATCH 091/119] Update biome ignore --- src/overrides/controllers/LauncherController.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/overrides/controllers/LauncherController.ts b/src/overrides/controllers/LauncherController.ts index a7b52b7c..230c949a 100644 --- a/src/overrides/controllers/LauncherController.ts +++ b/src/overrides/controllers/LauncherController.ts @@ -35,6 +35,7 @@ export class LauncherControllerOverride extends Override { let editions = this.databaseService.getProfiles(); if (!this.fikaConfig.getConfig().server.showDevProfile) { + // biome-ignore lint/performance/noDelete: Only ran once. delete editions["SPT Developer"]; } From 981f40b42b4a24a0da792d9f9d2093e2081e7041 Mon Sep 17 00:00:00 2001 From: Archangel Date: Wed, 16 Oct 2024 14:00:15 +0200 Subject: [PATCH 092/119] Change accessability --- src/websockets/FikaNotificationWebSocket.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/websockets/FikaNotificationWebSocket.ts b/src/websockets/FikaNotificationWebSocket.ts index 13dfabaf..d06ed8c9 100644 --- a/src/websockets/FikaNotificationWebSocket.ts +++ b/src/websockets/FikaNotificationWebSocket.ts @@ -12,7 +12,7 @@ import { FikaPresenceService } from "../services/FikaPresenceService"; @injectable() export class FikaNotificationWebSocket implements IWebSocketConnectionHandler { - public clientWebSockets: Record; + private clientWebSockets: Record; constructor( @inject("SaveServer") protected saveServer: SaveServer, @@ -100,13 +100,13 @@ export class FikaNotificationWebSocket implements IWebSocketConnectionHandler { } } - public keepWebSocketAlive(): void { + private keepWebSocketAlive(): void { for (const sessionID in this.clientWebSockets) { let message: IFikaNotificationBase = { type: EFikaNotifications.KeepAlive, }; - this.send(sessionID, message) + this.send(sessionID, message); } } } From 0e04054e896ecb0db9ea7143c25fb3c216510831 Mon Sep 17 00:00:00 2001 From: Archangel Date: Wed, 16 Oct 2024 15:46:48 +0200 Subject: [PATCH 093/119] Use same authentication for dedicated as the Notification Manager --- src/websockets/FikaDedicatedRaidWebSocket.ts | 44 ++++++++++++++++---- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/src/websockets/FikaDedicatedRaidWebSocket.ts b/src/websockets/FikaDedicatedRaidWebSocket.ts index 46300fc5..a4c9a7a6 100644 --- a/src/websockets/FikaDedicatedRaidWebSocket.ts +++ b/src/websockets/FikaDedicatedRaidWebSocket.ts @@ -1,5 +1,7 @@ -import { ILogger } from "@spt/models/spt/utils/ILogger"; import { inject, injectable } from "tsyringe"; + +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { SaveServer } from "@spt/servers/SaveServer"; import { IWebSocketConnectionHandler } from "@spt/servers/ws/IWebSocketConnectionHandler"; import { IncomingMessage } from "http"; import { WebSocket } from "ws"; @@ -8,7 +10,10 @@ import { WebSocket } from "ws"; export class FikaDedicatedRaidWebSocket implements IWebSocketConnectionHandler { public clientWebSockets: Record; - constructor(@inject("WinstonLogger") protected logger: ILogger) { + constructor( + @inject("SaveServer") protected saveServer: SaveServer, + @inject("WinstonLogger") protected logger: ILogger, + ) { this.clientWebSockets = {}; // Keep websocket connections alive @@ -26,13 +31,25 @@ export class FikaDedicatedRaidWebSocket implements IWebSocketConnectionHandler { } public onConnection(ws: WebSocket, req: IncomingMessage): void { - // Strip request and break it into sections - const splitUrl = req.url.substring(0, req.url.indexOf("?")).split("/"); - const sessionID = splitUrl.pop(); + if (req.headers.authorization === undefined) { + ws.close(); + return; + } + + const Authorization = Buffer.from(req.headers.authorization.split(" ")[1], "base64").toString().split(":"); + const UserSessionID = Authorization[0]; + + this.logger.debug(`[${this.getSocketId()}] User is ${UserSessionID}`); + + if (!this.saveServer.getProfile(UserSessionID)) { + this.logger.warning(`[${this.getSocketId()}] Invalid user ${UserSessionID} tried to authenticate!`); + return; + } - this.clientWebSockets[sessionID] = ws; + this.clientWebSockets[UserSessionID] = ws; - ws.on("message", (msg) => this.onMessage(sessionID, msg.toString())); + ws.on("message", (msg) => this.onMessage(UserSessionID, msg.toString())); + ws.on("close", (code, reason) => this.onClose(ws, UserSessionID, code, reason)); } // biome-ignore lint/correctness/noUnusedVariables: Currently unused, but might be implemented in the future. @@ -40,7 +57,18 @@ export class FikaDedicatedRaidWebSocket implements IWebSocketConnectionHandler { // Do nothing } - public keepWebSocketAlive(): void { + // biome-ignore lint/correctness/noUnusedVariables: Currently unused, but might be implemented in the future. + public onClose(ws: WebSocket, sessionID: string, code: number, reason: Buffer): void { + const clientWebSocket = this.clientWebSockets[sessionID]; + + if (clientWebSocket === ws) { + this.logger.debug(`[${this.getSocketId()}] Deleting client ${sessionID}`); + + delete this.clientWebSockets[sessionID]; + } + } + + private keepWebSocketAlive(): void { for (const sessionId in this.clientWebSockets) { const clientWebSocket = this.clientWebSockets[sessionId]; From e37b08c07a0680309de214396abb01e67a012402 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Wed, 16 Oct 2024 16:39:23 +0200 Subject: [PATCH 094/119] Add new presence --- src/models/enums/EFikaPlayerPresences.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/models/enums/EFikaPlayerPresences.ts b/src/models/enums/EFikaPlayerPresences.ts index 837113a0..0753e970 100644 --- a/src/models/enums/EFikaPlayerPresences.ts +++ b/src/models/enums/EFikaPlayerPresences.ts @@ -3,4 +3,5 @@ export enum EFikaPlayerPresences { IN_RAID = 1, IN_STASH = 2, IN_HIDEOUT = 3, + IN_FLEA = 4, } From 3860fc14cb90410a9189ad8375a7db4932e0479c Mon Sep 17 00:00:00 2001 From: Dyze Date: Sat, 19 Oct 2024 10:54:25 +0200 Subject: [PATCH 095/119] chore: Cleanup duplicate call to the configHandler --- src/controllers/FikaClientController.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/FikaClientController.ts b/src/controllers/FikaClientController.ts index f7e9caf3..f474eb7f 100644 --- a/src/controllers/FikaClientController.ts +++ b/src/controllers/FikaClientController.ts @@ -56,7 +56,7 @@ export class FikaClientController { }; // if no configuration was made, allow all mods - if (config.client.mods.required.length === 0 && config.client.mods.optional.length === 0) { + if (this.allowedMods.size === 0) { return mismatchedMods; } From 3580009c7f36c660d5c98a6eb06a7dc8a297d797 Mon Sep 17 00:00:00 2001 From: Dyze Date: Sat, 19 Oct 2024 11:02:04 +0200 Subject: [PATCH 096/119] fix: Prevent listing an empty mod in the lists --- src/controllers/FikaClientController.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/controllers/FikaClientController.ts b/src/controllers/FikaClientController.ts index f474eb7f..d4133a2c 100644 --- a/src/controllers/FikaClientController.ts +++ b/src/controllers/FikaClientController.ts @@ -25,8 +25,10 @@ export class FikaClientController { ) { const config = this.fikaConfig.getConfig(); - this.requiredMods = new Set([...config.client.mods.required, "com.fika.core", "com.SPT.custom", "com.SPT.singleplayer", "com.SPT.core", "com.SPT.debugging"]); - this.allowedMods = new Set([...this.requiredMods, ...config.client.mods.optional, "com.bepis.bepinex.configurationmanager"]); + const sanitizeModList = (modList: string[]): string[] => modList.filter(mod => mod !== ""); + + this.requiredMods = new Set([...(sanitizeModList(config.client.mods.required)), "com.fika.core", "com.SPT.custom", "com.SPT.singleplayer", "com.SPT.core", "com.SPT.debugging"]); + this.allowedMods = new Set([...this.requiredMods, ...sanitizeModList(config.client.mods.optional), "com.bepis.bepinex.configurationmanager"]); } /** From e671badfea4c944069bf10b21fb24bc4a372f402 Mon Sep 17 00:00:00 2001 From: Dyze Date: Sat, 19 Oct 2024 11:05:25 +0200 Subject: [PATCH 097/119] fix: Prevent listing an empty mod in the lists --- src/controllers/FikaClientController.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/FikaClientController.ts b/src/controllers/FikaClientController.ts index d4133a2c..4b5b02e3 100644 --- a/src/controllers/FikaClientController.ts +++ b/src/controllers/FikaClientController.ts @@ -25,9 +25,9 @@ export class FikaClientController { ) { const config = this.fikaConfig.getConfig(); - const sanitizeModList = (modList: string[]): string[] => modList.filter(mod => mod !== ""); + const sanitizeModList = (strArr: string[]): string[] => strArr.filter(str => str !== ""); - this.requiredMods = new Set([...(sanitizeModList(config.client.mods.required)), "com.fika.core", "com.SPT.custom", "com.SPT.singleplayer", "com.SPT.core", "com.SPT.debugging"]); + this.requiredMods = new Set([...sanitizeModList(config.client.mods.required), "com.fika.core", "com.SPT.custom", "com.SPT.singleplayer", "com.SPT.core", "com.SPT.debugging"]); this.allowedMods = new Set([...this.requiredMods, ...sanitizeModList(config.client.mods.optional), "com.bepis.bepinex.configurationmanager"]); } From 68e949ab05a497eabd9b749bf7017335013ffac3 Mon Sep 17 00:00:00 2001 From: Dyze Date: Sat, 19 Oct 2024 11:10:19 +0200 Subject: [PATCH 098/119] fix: Prevent whitespace in the modlists --- src/controllers/FikaClientController.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/FikaClientController.ts b/src/controllers/FikaClientController.ts index 4b5b02e3..893120b0 100644 --- a/src/controllers/FikaClientController.ts +++ b/src/controllers/FikaClientController.ts @@ -25,7 +25,7 @@ export class FikaClientController { ) { const config = this.fikaConfig.getConfig(); - const sanitizeModList = (strArr: string[]): string[] => strArr.filter(str => str !== ""); + const sanitizeModList = (strArr: string[]): string[] => strArr.filter(str => str.trim() !== ""); this.requiredMods = new Set([...sanitizeModList(config.client.mods.required), "com.fika.core", "com.SPT.custom", "com.SPT.singleplayer", "com.SPT.core", "com.SPT.debugging"]); this.allowedMods = new Set([...this.requiredMods, ...sanitizeModList(config.client.mods.optional), "com.bepis.bepinex.configurationmanager"]); From 2a6e7920e793cf0dd574c8d6c58c98072af77aff Mon Sep 17 00:00:00 2001 From: Dyze Date: Sat, 19 Oct 2024 13:37:31 +0200 Subject: [PATCH 099/119] fix: Removed the inline method --- src/controllers/FikaClientController.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/controllers/FikaClientController.ts b/src/controllers/FikaClientController.ts index 893120b0..a8affbf4 100644 --- a/src/controllers/FikaClientController.ts +++ b/src/controllers/FikaClientController.ts @@ -25,10 +25,15 @@ export class FikaClientController { ) { const config = this.fikaConfig.getConfig(); - const sanitizeModList = (strArr: string[]): string[] => strArr.filter(str => str.trim() !== ""); + const sanitizedRequiredMods = this.filterEmptyMods(config.client.mods.required); + const sanitizedOptionalMods = this.filterEmptyMods(config.client.mods.optional); - this.requiredMods = new Set([...sanitizeModList(config.client.mods.required), "com.fika.core", "com.SPT.custom", "com.SPT.singleplayer", "com.SPT.core", "com.SPT.debugging"]); - this.allowedMods = new Set([...this.requiredMods, ...sanitizeModList(config.client.mods.optional), "com.bepis.bepinex.configurationmanager"]); + this.requiredMods = new Set([...sanitizedRequiredMods, "com.fika.core", "com.SPT.custom", "com.SPT.singleplayer", "com.SPT.core", "com.SPT.debugging"]); + this.allowedMods = new Set([...this.requiredMods, ...sanitizedOptionalMods, "com.bepis.bepinex.configurationmanager"]); + } + + protected filterEmptyMods(array: string[]): string[] { + return array.filter(str => str.trim() !== ""); } /** From 92a311122c480a2bd52d6474ee57722c054ae464 Mon Sep 17 00:00:00 2001 From: Archangel Date: Sat, 19 Oct 2024 14:06:29 +0200 Subject: [PATCH 100/119] update SPT types --- types/callbacks/DialogueCallbacks.d.ts | 6 +- types/callbacks/TraderCallbacks.d.ts | 4 +- types/callbacks/WeatherCallbacks.d.ts | 1 + types/controllers/BotController.d.ts | 10 +- types/controllers/DialogueController.d.ts | 18 ++-- types/controllers/HideoutController.d.ts | 22 +++-- types/controllers/InsuranceController.d.ts | 20 ++-- types/controllers/LauncherController.d.ts | 4 +- types/controllers/RagfairController.d.ts | 11 ++- types/controllers/WeatherController.d.ts | 7 +- .../generators/BotEquipmentModGenerator.d.ts | 19 ++-- types/generators/BotGenerator.d.ts | 8 +- types/generators/BotInventoryGenerator.d.ts | 16 +++- types/generators/BotLevelGenerator.d.ts | 6 +- types/generators/BotWeaponGenerator.d.ts | 10 +- types/generators/LootGenerator.d.ts | 33 +++++-- types/generators/PlayerScavGenerator.d.ts | 4 +- types/generators/RagfairOfferGenerator.d.ts | 19 ++-- .../RepeatableQuestRewardGenerator.d.ts | 22 +++-- types/generators/ScavCaseRewardGenerator.d.ts | 8 +- types/generators/WeatherGenerator.d.ts | 15 ++- types/helpers/BotHelper.d.ts | 12 ++- types/helpers/DialogueHelper.d.ts | 6 +- types/helpers/HealthHelper.d.ts | 4 +- types/helpers/HideoutHelper.d.ts | 22 ++++- types/helpers/InventoryHelper.d.ts | 4 +- types/helpers/NotificationSendHelper.d.ts | 4 +- types/helpers/NotifierHelper.d.ts | 6 +- types/helpers/RagfairOfferHelper.d.ts | 2 + types/helpers/RepairHelper.d.ts | 4 +- types/helpers/WeatherHelper.d.ts | 3 +- types/loaders/PreSptModLoader.d.ts | 4 +- types/models/eft/common/tables/IBotBase.d.ts | 6 +- .../eft/common/tables/ICustomizationItem.d.ts | 4 +- .../eft/common/tables/IProfileTemplate.d.ts | 4 +- .../eft/common/tables/ITemplateItem.d.ts | 8 +- .../dialog/IGetAllAttachmentsResponse.d.ts | 4 +- .../IGetMailDialogViewResponseData.d.ts | 4 +- .../eft/game/IVersionValidateRequestData.d.ts | 4 +- types/models/eft/health/IWorkoutData.d.ts | 36 ++++++- types/models/eft/hideout/IHideoutArea.d.ts | 8 +- .../IHideoutImproveAreaRequestData.d.ts | 4 +- .../eft/hideout/IHideoutProduction.d.ts | 6 +- .../models/eft/hideout/IHideoutScavCase.d.ts | 8 +- .../IHideoutScavCaseStartRequestData.d.ts | 8 +- .../hideout/IHideoutUpgradeRequestData.d.ts | 4 +- .../inventory/IInventoryAddRequestData.d.ts | 4 +- .../IInventoryBaseActionRequestData.d.ts | 8 +- .../IInventoryCreateMarkerRequestData.d.ts | 4 +- .../IInventoryEditMarkerRequestData.d.ts | 4 +- .../inventory/IInventoryMoveRequestData.d.ts | 4 +- .../inventory/IInventorySplitRequestData.d.ts | 4 +- .../inventory/IInventorySwapRequestData.d.ts | 6 +- .../IOpenRandomLootContainerRequestData.d.ts | 4 +- .../eft/itemEvent/IItemEventRouterBase.d.ts | 4 +- .../itemEvent/IItemEventRouterRequest.d.ts | 12 +-- types/models/eft/launcher/IMiniProfile.d.ts | 4 +- .../eft/location/IAirdropLootResult.d.ts | 4 +- types/models/eft/match/IRaidSettings.d.ts | 12 +-- types/models/eft/profile/ISptProfile.d.ts | 94 +++++++++---------- .../eft/ragfair/IAddOfferRequestData.d.ts | 4 +- types/models/eft/ragfair/IRagfairOffer.d.ts | 5 +- .../eft/repair/IRepairActionDataRequest.d.ts | 4 +- .../ITraderRepairActionDataRequest.d.ts | 4 +- types/models/eft/weather/IWeatherData.d.ts | 1 + .../models/eft/ws/IWsChatMessageReceived.d.ts | 4 +- types/models/enums/AirdropType.d.ts | 6 ++ types/models/enums/hideout/QteEffectType.d.ts | 6 +- .../models/spt/bots/BotGenerationDetails.d.ts | 2 +- .../models/spt/bots/GenerateWeaponResult.d.ts | 8 +- .../bots/IGenerateEquipmentProperties.d.ts | 12 +-- .../spt/bots/IGenerateWeaponResult.d.ts | 10 ++ types/models/spt/bots/IModToSpawnRequest.d.ts | 4 +- .../spt/callbacks/IDialogueCallbacks.d.ts | 4 +- types/models/spt/config/IAirdropConfig.d.ts | 6 +- types/models/spt/config/IBotConfig.d.ts | 28 +++--- types/models/spt/config/IBotDurability.d.ts | 4 +- types/models/spt/config/IHealthConfig.d.ts | 8 +- types/models/spt/config/IHideoutConfig.d.ts | 8 +- types/models/spt/config/IInRaidConfig.d.ts | 10 +- types/models/spt/config/IInventoryConfig.d.ts | 4 +- .../models/spt/config/IPlayerScavConfig.d.ts | 8 +- types/models/spt/config/IPmcConfig.d.ts | 14 +-- types/models/spt/config/IRagfairConfig.d.ts | 16 ++-- types/models/spt/config/IRepairConfig.d.ts | 16 ++-- types/models/spt/config/ITraderConfig.d.ts | 22 ++--- types/models/spt/config/IWeatherConfig.d.ts | 14 ++- .../spt/dialog/ISendMessageDetails.d.ts | 4 +- .../ScavCaseRewardCountsAndPrices.d.ts | 10 +- types/models/spt/mod/NewItemDetails.d.ts | 4 +- .../models/spt/ragfair/ITplWithFleaPrice.d.ts | 5 + types/models/spt/server/ISettingsBase.d.ts | 16 ++-- types/models/spt/services/ILootRequest.d.ts | 33 +++++++ types/models/spt/services/LootItem.d.ts | 2 +- types/models/spt/services/LootRequest.d.ts | 6 -- types/models/spt/utils/ILogger.d.ts | 4 +- types/routers/EventOutputHolder.d.ts | 4 +- types/servers/http/SptHttpListener.d.ts | 16 +++- types/services/AirdropService.d.ts | 9 +- types/services/BotEquipmentFilterService.d.ts | 18 ++-- types/services/BotLootCacheService.d.ts | 10 +- types/services/BotNameService.d.ts | 12 ++- types/services/CircleOfCultistService.d.ts | 12 +-- types/services/MailSendService.d.ts | 14 +-- types/services/ProfileFixerService.d.ts | 4 +- types/services/RaidWeatherService.d.ts | 43 +++++++++ types/services/RepairService.d.ts | 12 +-- types/services/SeasonalEventService.d.ts | 16 ++++ .../TraderPurchasePersisterService.d.ts | 6 +- types/services/mod/CustomItemService.d.ts | 4 +- types/utils/TimeUtil.d.ts | 12 +++ .../utils/logging/AbstractWinstonLogger.d.ts | 4 +- 112 files changed, 686 insertions(+), 436 deletions(-) create mode 100644 types/models/spt/bots/IGenerateWeaponResult.d.ts create mode 100644 types/models/spt/ragfair/ITplWithFleaPrice.d.ts create mode 100644 types/models/spt/services/ILootRequest.d.ts create mode 100644 types/services/RaidWeatherService.d.ts diff --git a/types/callbacks/DialogueCallbacks.d.ts b/types/callbacks/DialogueCallbacks.d.ts index baee279d..e65749ff 100644 --- a/types/callbacks/DialogueCallbacks.d.ts +++ b/types/callbacks/DialogueCallbacks.d.ts @@ -27,7 +27,7 @@ import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest" import { ISetDialogReadRequestData } from "@spt/models/eft/dialog/ISetDialogReadRequestData"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; -import { DialogueInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IDialogueInfo } from "@spt/models/eft/profile/ISptProfile"; import { HashUtil } from "@spt/utils/HashUtil"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; @@ -48,11 +48,11 @@ export declare class DialogueCallbacks implements OnUpdate { */ getChatServerList(url: string, info: IGetChatServerListRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/dialog/list */ - getMailDialogList(url: string, info: IGetMailDialogListRequestData, sessionID: string): IGetBodyResponseData; + getMailDialogList(url: string, info: IGetMailDialogListRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/dialog/view */ getMailDialogView(url: string, info: IGetMailDialogViewRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/dialog/info */ - getMailDialogInfo(url: string, info: IGetMailDialogInfoRequestData, sessionID: string): IGetBodyResponseData; + getMailDialogInfo(url: string, info: IGetMailDialogInfoRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/dialog/remove */ removeDialog(url: string, info: IRemoveDialogRequestData, sessionID: string): IGetBodyResponseData; /** Handle client/mail/dialog/pin */ diff --git a/types/callbacks/TraderCallbacks.d.ts b/types/callbacks/TraderCallbacks.d.ts index 5177d99e..7bebe559 100644 --- a/types/callbacks/TraderCallbacks.d.ts +++ b/types/callbacks/TraderCallbacks.d.ts @@ -4,7 +4,7 @@ import { OnUpdate } from "@spt/di/OnUpdate"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { ITraderAssort, ITraderBase } from "@spt/models/eft/common/tables/ITrader"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; -import { ModdedTraders } from "@spt/models/spt/config/ITraderConfig"; +import { IModdedTraders } from "@spt/models/spt/config/ITraderConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; export declare class TraderCallbacks implements OnLoad, OnUpdate { @@ -23,5 +23,5 @@ export declare class TraderCallbacks implements OnLoad, OnUpdate { /** Handle client/trading/api/getTraderAssort */ getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; /** Handle /singleplayer/moddedTraders */ - getModdedTraderData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + getModdedTraderData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/types/callbacks/WeatherCallbacks.d.ts b/types/callbacks/WeatherCallbacks.d.ts index 8229592c..ef5808fa 100644 --- a/types/callbacks/WeatherCallbacks.d.ts +++ b/types/callbacks/WeatherCallbacks.d.ts @@ -13,5 +13,6 @@ export declare class WeatherCallbacks { * @returns IWeatherData */ getWeather(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; + /** Handle client/localGame/weather */ getLocalWeather(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/types/controllers/BotController.d.ts b/types/controllers/BotController.d.ts index 36477a21..a7cb6ae7 100644 --- a/types/controllers/BotController.d.ts +++ b/types/controllers/BotController.d.ts @@ -11,7 +11,7 @@ import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; import { IBotCore } from "@spt/models/eft/common/tables/IBotCore"; import { IDifficultyCategories } from "@spt/models/eft/common/tables/IBotType"; import { IGetRaidConfigurationRequestData } from "@spt/models/eft/match/IGetRaidConfigurationRequestData"; -import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; +import { IBotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -97,7 +97,7 @@ export declare class BotController { * @param generateAsPmc Force bot being generated a PMC * @returns BotGenerationDetails */ - protected getBotGenerationDetailsForWave(condition: ICondition, pmcProfile: IPmcData, allPmcsHaveSameNameAsPlayer: boolean, raidSettings: IGetRaidConfigurationRequestData, botCountToGenerate: number, generateAsPmc: boolean): BotGenerationDetails; + protected getBotGenerationDetailsForWave(condition: ICondition, pmcProfile: IPmcData, allPmcsHaveSameNameAsPlayer: boolean, raidSettings: IGetRaidConfigurationRequestData, botCountToGenerate: number, generateAsPmc: boolean): IBotGenerationDetails; /** * Get players profile level * @param pmcProfile Profile to get level from @@ -111,7 +111,7 @@ export declare class BotController { * @param sessionId Session id * @returns A promise for the bots to be done generating */ - protected generateWithBotDetails(condition: ICondition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; + protected generateWithBotDetails(condition: ICondition, botGenerationDetails: IBotGenerationDetails, sessionId: string): Promise; /** * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with @@ -119,7 +119,7 @@ export declare class BotController { * @param cacheKey the cache key to store the bot with * @returns A promise for the bot to be stored */ - protected generateSingleBotAndStoreInCache(botGenerationDetails: BotGenerationDetails, sessionId: string, cacheKey: string): Promise; + protected generateSingleBotAndStoreInCache(botGenerationDetails: IBotGenerationDetails, sessionId: string, cacheKey: string): Promise; /** * Pull a single bot out of cache and return, if cache is empty add bots to it and then return * @param sessionId Session id @@ -128,7 +128,7 @@ export declare class BotController { */ protected returnSingleBotFromCache(sessionId: string, request: IGenerateBotsRequestData): Promise; protected getPmcConversionMinMaxForLocation(requestedBotRole: string, location: string): MinMax; - protected updateBotGenerationDetailsToRandomBoss(botGenerationDetails: BotGenerationDetails, possibleBossTypeWeights: Record): void; + protected updateBotGenerationDetailsToRandomBoss(botGenerationDetails: IBotGenerationDetails, possibleBossTypeWeights: Record): void; /** * Get the difficulty passed in, if its not "asonline", get selected difficulty from config * @param requestedDifficulty diff --git a/types/controllers/DialogueController.d.ts b/types/controllers/DialogueController.d.ts index c15d724d..2f00b131 100644 --- a/types/controllers/DialogueController.d.ts +++ b/types/controllers/DialogueController.d.ts @@ -7,7 +7,7 @@ import { IGetFriendListDataResponse } from "@spt/models/eft/dialog/IGetFriendLis import { IGetMailDialogViewRequestData } from "@spt/models/eft/dialog/IGetMailDialogViewRequestData"; import { IGetMailDialogViewResponseData } from "@spt/models/eft/dialog/IGetMailDialogViewResponseData"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; -import { Dialogue, DialogueInfo, ISptProfile, IUserDialogInfo, Message } from "@spt/models/eft/profile/ISptProfile"; +import { IDialogue, IDialogueInfo, IMessage, ISptProfile, IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -40,14 +40,14 @@ export declare class DialogueController { * @param sessionID Session Id * @returns array of dialogs */ - generateDialogueList(sessionID: string): DialogueInfo[]; + generateDialogueList(sessionID: string): IDialogueInfo[]; /** * Get the content of a dialogue * @param dialogueID Dialog id * @param sessionID Session Id * @returns DialogueInfo */ - getDialogueInfo(dialogueID: string, sessionID: string): DialogueInfo; + getDialogueInfo(dialogueID: string, sessionID: string): IDialogueInfo; /** * Get the users involved in a dialog (player + other party) * @param dialog The dialog to check for users @@ -55,7 +55,7 @@ export declare class DialogueController { * @param sessionID Player id * @returns IUserDialogInfo array */ - getDialogueUsers(dialog: Dialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; + getDialogueUsers(dialog: IDialogue, messageType: MessageType, sessionID: string): IUserDialogInfo[] | undefined; /** * Handle client/mail/dialog/view * Handle player clicking 'messenger' and seeing all the messages they've recieved @@ -72,7 +72,7 @@ export declare class DialogueController { * @param request get dialog request (params used when dialog doesnt exist in profile) * @returns Dialogue */ - protected getDialogByIdFromProfile(profile: ISptProfile, request: IGetMailDialogViewRequestData): Dialogue; + protected getDialogByIdFromProfile(profile: ISptProfile, request: IGetMailDialogViewRequestData): IDialogue; /** * Get the users involved in a mail between two entities * @param fullProfile Player profile @@ -92,7 +92,7 @@ export declare class DialogueController { * @param messages Messages to check * @returns true if uncollected rewards found */ - protected messagesHaveUncollectedRewards(messages: Message[]): boolean; + protected messagesHaveUncollectedRewards(messages: IMessage[]): boolean; /** * Handle client/mail/dialog/remove * Remove an entire dialog with an entity (trader/user) @@ -125,13 +125,13 @@ export declare class DialogueController { * @param dialogueId Dialog to get mail attachments from * @returns Message array */ - protected getActiveMessagesFromDialog(sessionId: string, dialogueId: string): Message[]; + protected getActiveMessagesFromDialog(sessionId: string, dialogueId: string): IMessage[]; /** * Return array of messages with uncollected items (includes expired) * @param messages Messages to parse * @returns messages with items to collect */ - protected getMessagesWithAttachments(messages: Message[]): Message[]; + protected getMessagesWithAttachments(messages: IMessage[]): IMessage[]; /** * Delete expired items from all messages in player profile. triggers when updating traders. * @param sessionId Session id @@ -148,7 +148,7 @@ export declare class DialogueController { * @param message Message to check expiry of * @returns true or false */ - protected messageHasExpired(message: Message): boolean; + protected messageHasExpired(message: IMessage): boolean; /** Handle client/friend/request/send */ sendFriendRequest(sessionID: string, request: IFriendRequestData): IFriendRequestSendResponse; } diff --git a/types/controllers/HideoutController.d.ts b/types/controllers/HideoutController.d.ts index f65df697..4a925049 100644 --- a/types/controllers/HideoutController.d.ts +++ b/types/controllers/HideoutController.d.ts @@ -7,9 +7,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IBotHideoutArea, IProduct, ITaskConditionCounter } from "@spt/models/eft/common/tables/IBotBase"; -import { HideoutUpgradeCompleteRequestData } from "@spt/models/eft/hideout/HideoutUpgradeCompleteRequestData"; import { IHandleQTEEventRequestData } from "@spt/models/eft/hideout/IHandleQTEEventRequestData"; -import { IHideoutArea, Stage } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutArea, IStage } from "@spt/models/eft/hideout/IHideoutArea"; import { IHideoutCancelProductionRequestData } from "@spt/models/eft/hideout/IHideoutCancelProductionRequestData"; import { IHideoutCircleOfCultistProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData"; import { IHideoutContinuousProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; @@ -22,8 +21,9 @@ import { IHideoutSingleProductionStartRequestData } from "@spt/models/eft/hideou import { IHideoutTakeItemOutRequestData } from "@spt/models/eft/hideout/IHideoutTakeItemOutRequestData"; import { IHideoutTakeProductionRequestData } from "@spt/models/eft/hideout/IHideoutTakeProductionRequestData"; import { IHideoutToggleAreaRequestData } from "@spt/models/eft/hideout/IHideoutToggleAreaRequestData"; +import { IHideoutUpgradeCompleteRequestData } from "@spt/models/eft/hideout/IHideoutUpgradeCompleteRequestData"; import { IHideoutUpgradeRequestData } from "@spt/models/eft/hideout/IHideoutUpgradeRequestData"; -import { IQteData } from "@spt/models/eft/hideout/IQteData"; +import { IQteData, IQteResult } from "@spt/models/eft/hideout/IQteData"; import { IRecordShootingRangePoints } from "@spt/models/eft/hideout/IRecordShootingRangePoints"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { HideoutAreas } from "@spt/models/enums/HideoutAreas"; @@ -87,7 +87,7 @@ export declare class HideoutController { * @param sessionID Session id * @param output Client response */ - upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string, output: IItemEventRouterResponse): void; + upgradeComplete(pmcData: IPmcData, request: IHideoutUpgradeCompleteRequestData, sessionID: string, output: IItemEventRouterResponse): void; /** * Upgrade wall status to visible in profile if medstation/water collector are both level 1 * @param pmcData Player profile @@ -101,7 +101,7 @@ export declare class HideoutController { * @param dbHideoutArea Hideout area being upgraded * @param hideoutStage Stage hideout area is being upgraded to */ - protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileParentHideoutArea: IBotHideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; + protected addContainerImprovementToProfile(output: IItemEventRouterResponse, sessionID: string, pmcData: IPmcData, profileParentHideoutArea: IBotHideoutArea, dbHideoutArea: IHideoutArea, hideoutStage: IStage): void; /** * Add stand1/stand2/stand3 inventory items to profile, depending on passed in hideout stage * @param sessionId Session id @@ -110,14 +110,14 @@ export declare class HideoutController { * @param equipmentPresetHideoutArea * @param output Response to send back to client */ - protected addMissingPresetStandItemsToProfile(sessionId: string, equipmentPresetStage: Stage, pmcData: IPmcData, equipmentPresetHideoutArea: IHideoutArea, output: IItemEventRouterResponse): void; + protected addMissingPresetStandItemsToProfile(sessionId: string, equipmentPresetStage: IStage, pmcData: IPmcData, equipmentPresetHideoutArea: IHideoutArea, output: IItemEventRouterResponse): void; /** * Add an inventory item to profile from a hideout area stage data * @param pmcData Profile to update * @param dbHideoutArea Hideout area from db being upgraded * @param hideoutStage Stage area upgraded to */ - protected addUpdateInventoryItemToProfile(sessionId: string, pmcData: IPmcData, dbHideoutArea: IHideoutArea, hideoutStage: Stage): void; + protected addUpdateInventoryItemToProfile(sessionId: string, pmcData: IPmcData, dbHideoutArea: IHideoutArea, hideoutStage: IStage): void; /** * @param output Object to send to client * @param sessionID Session/player id @@ -125,7 +125,7 @@ export declare class HideoutController { * @param hideoutDbData Hideout area that caused addition of stash * @param hideoutStage Hideout area upgraded to this */ - protected addContainerUpgradeToClientOutput(sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: Stage, output: IItemEventRouterResponse): void; + protected addContainerUpgradeToClientOutput(sessionID: string, areaType: HideoutAreas, hideoutDbData: IHideoutArea, hideoutStage: IStage, output: IItemEventRouterResponse): void; /** * Handle HideoutPutItemsInAreaSlots * Create item in hideout slot item array, remove item from player inventory @@ -252,6 +252,12 @@ export declare class HideoutController { * @param request QTE result object */ handleQTEEventOutcome(sessionId: string, pmcData: IPmcData, request: IHandleQTEEventRequestData, output: IItemEventRouterResponse): void; + /** + * Apply mild/severe muscle pain after gym use + * @param pmcData Profile to apply effect to + * @param finishEffect Effect data to apply after completing QTE gym event + */ + protected handleMusclePain(pmcData: IPmcData, finishEffect: IQteResult): void; /** * Record a high score from the shooting range into a player profiles overallcounters * @param sessionId Session id diff --git a/types/controllers/InsuranceController.d.ts b/types/controllers/InsuranceController.d.ts index 2f45da6a..2701622e 100644 --- a/types/controllers/InsuranceController.d.ts +++ b/types/controllers/InsuranceController.d.ts @@ -9,7 +9,7 @@ import { IGetInsuranceCostRequestData } from "@spt/models/eft/insurance/IGetInsu import { IGetInsuranceCostResponseData } from "@spt/models/eft/insurance/IGetInsuranceCostResponseData"; import { IInsureRequestData } from "@spt/models/eft/insurance/IInsureRequestData"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; -import { Insurance } from "@spt/models/eft/profile/ISptProfile"; +import { IInsurance } from "@spt/models/eft/profile/ISptProfile"; import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; @@ -68,7 +68,7 @@ export declare class InsuranceController { * @param time The time to check ready status against. Current time by default. * @returns All insured items that are ready to be processed. */ - protected filterInsuredItems(sessionID: string, time?: number): Insurance[]; + protected filterInsuredItems(sessionID: string, time?: number): IInsurance[]; /** * This method orchestrates the processing of insured items in a profile. * @@ -76,13 +76,13 @@ export declare class InsuranceController { * @param sessionID The session ID that should receive the processed items. * @returns void */ - protected processInsuredItems(insuranceDetails: Insurance[], sessionID: string): void; + protected processInsuredItems(insuranceDetails: IInsurance[], sessionID: string): void; /** * Count all items in all insurance packages. * @param insurance * @returns */ - protected countAllInsuranceItems(insurance: Insurance[]): number; + protected countAllInsuranceItems(insurance: IInsurance[]): number; /** * Remove an insurance package from a profile using the package's system data information. * @@ -90,7 +90,7 @@ export declare class InsuranceController { * @param index The array index of the insurance package to remove. * @returns void */ - protected removeInsurancePackageFromProfile(sessionID: string, insPackage: Insurance): void; + protected removeInsurancePackageFromProfile(sessionID: string, insPackage: IInsurance): void; /** * Finds the items that should be deleted based on the given Insurance object. * @@ -98,7 +98,7 @@ export declare class InsuranceController { * @param insured - The insurance object containing the items to evaluate for deletion. * @returns A Set containing the IDs of items that should be deleted. */ - protected findItemsToDelete(rootItemParentID: string, insured: Insurance): Set; + protected findItemsToDelete(rootItemParentID: string, insured: IInsurance): Set; /** * Initialize a Map object that holds main-parents to all of their attachments. Note that "main-parent" in this * context refers to the parent item that an attachment is attached to. For example, a suppressor attached to a gun, @@ -109,7 +109,7 @@ export declare class InsuranceController { * @param itemsMap - A Map object for quick item look-up by item ID. * @returns A Map object containing parent item IDs to arrays of their attachment items. */ - protected populateParentAttachmentsMap(rootItemParentID: string, insured: Insurance, itemsMap: Map): Map; + protected populateParentAttachmentsMap(rootItemParentID: string, insured: IInsurance, itemsMap: Map): Map; /** * Remove attachments that can not be moddable in-raid from the parentAttachmentsMap. If no moddable attachments * remain, the parent is removed from the map as well. @@ -129,7 +129,7 @@ export declare class InsuranceController { * @param parentAttachmentsMap A Map object containing parent item IDs to arrays of their attachment items. * @returns void */ - protected processRegularItems(insured: Insurance, toDelete: Set, parentAttachmentsMap: Map): void; + protected processRegularItems(insured: IInsurance, toDelete: Set, parentAttachmentsMap: Map): void; /** * Process parent items and their attachments, updating the toDelete Set accordingly. * @@ -167,7 +167,7 @@ export declare class InsuranceController { * @param toDelete The items that should be deleted. * @returns void */ - protected removeItemsFromInsurance(insured: Insurance, toDelete: Set): void; + protected removeItemsFromInsurance(insured: IInsurance, toDelete: Set): void; /** * Handle sending the insurance message to the user that potentially contains the valid insurance items. * @@ -175,7 +175,7 @@ export declare class InsuranceController { * @param insurance The context of insurance to use. * @returns void */ - protected sendMail(sessionID: string, insurance: Insurance): void; + protected sendMail(sessionID: string, insurance: IInsurance): void; /** * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. diff --git a/types/controllers/LauncherController.d.ts b/types/controllers/LauncherController.d.ts index 789fc004..3a715dad 100644 --- a/types/controllers/LauncherController.d.ts +++ b/types/controllers/LauncherController.d.ts @@ -5,7 +5,7 @@ import { IChangeRequestData } from "@spt/models/eft/launcher/IChangeRequestData" import { ILoginRequestData } from "@spt/models/eft/launcher/ILoginRequestData"; import { IRegisterData } from "@spt/models/eft/launcher/IRegisterData"; import { IConnectResponse } from "@spt/models/eft/profile/IConnectResponse"; -import { Info, ModDetails } from "@spt/models/eft/profile/ISptProfile"; +import { IModDetails, Info } from "@spt/models/eft/profile/ISptProfile"; import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -61,5 +61,5 @@ export declare class LauncherController { * @param sessionId Player id * @returns Array of mod details */ - getServerModsProfileUsed(sessionId: string): ModDetails[]; + getServerModsProfileUsed(sessionId: string): IModDetails[]; } diff --git a/types/controllers/RagfairController.d.ts b/types/controllers/RagfairController.d.ts index 463ea293..978558bc 100644 --- a/types/controllers/RagfairController.d.ts +++ b/types/controllers/RagfairController.d.ts @@ -14,7 +14,7 @@ import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; -import { IAddOfferRequestData, Requirement } from "@spt/models/eft/ragfair/IAddOfferRequestData"; +import { IAddOfferRequestData, IRequirement } from "@spt/models/eft/ragfair/IAddOfferRequestData"; import { IExtendOfferRequestData } from "@spt/models/eft/ragfair/IExtendOfferRequestData"; import { IGetItemPriceResult } from "@spt/models/eft/ragfair/IGetItemPriceResult"; import { IGetMarketPriceRequestData } from "@spt/models/eft/ragfair/IGetMarketPriceRequestData"; @@ -137,10 +137,11 @@ export declare class RagfairController { update(): void; /** * Called when creating an offer on flea, fills values in top right corner - * @param getPriceRequest + * @param getPriceRequest Client request object + * @param ignoreTraderOffers Should trader offers be ignored in the calcualtion * @returns min/avg/max values for an item based on flea offers available */ - getItemMinAvgMaxFleaPriceValues(getPriceRequest: IGetMarketPriceRequestData): IGetItemPriceResult; + getItemMinAvgMaxFleaPriceValues(getPriceRequest: IGetMarketPriceRequestData, ignoreTraderOffers?: boolean): IGetItemPriceResult; /** * List item(s) on flea for sale * @param pmcData Player profile @@ -212,7 +213,7 @@ export declare class RagfairController { * @param requirements * @returns Rouble price */ - protected calculateRequirementsPriceInRub(requirements: Requirement[]): number; + protected calculateRequirementsPriceInRub(requirements: IRequirement[]): number; /** * Using item ids from flea offer request, find corresponding items from player inventory and return as array * @param pmcData Player profile @@ -223,7 +224,7 @@ export declare class RagfairController { items: IItem[][] | undefined; errorMessage: string | undefined; }; - createPlayerOffer(sessionId: string, requirements: Requirement[], items: IItem[], sellInOnePiece: boolean): IRagfairOffer; + createPlayerOffer(sessionId: string, requirements: IRequirement[], items: IItem[], sellInOnePiece: boolean): IRagfairOffer; getAllFleaPrices(): Record; getStaticPrices(): Record; /** diff --git a/types/controllers/WeatherController.d.ts b/types/controllers/WeatherController.d.ts index 2717e6a8..493cb8f9 100644 --- a/types/controllers/WeatherController.d.ts +++ b/types/controllers/WeatherController.d.ts @@ -5,15 +5,17 @@ import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { IGetLocalWeatherResponseData } from "@spt/models/spt/weather/IGetLocalWeatherResponseData"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { RaidWeatherService } from "@spt/services/RaidWeatherService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; export declare class WeatherController { protected weatherGenerator: WeatherGenerator; protected logger: ILogger; protected configServer: ConfigServer; protected seasonalEventService: SeasonalEventService; + protected raidWeatherService: RaidWeatherService; protected weatherHelper: WeatherHelper; protected weatherConfig: IWeatherConfig; - constructor(weatherGenerator: WeatherGenerator, logger: ILogger, configServer: ConfigServer, seasonalEventService: SeasonalEventService, weatherHelper: WeatherHelper); + constructor(weatherGenerator: WeatherGenerator, logger: ILogger, configServer: ConfigServer, seasonalEventService: SeasonalEventService, raidWeatherService: RaidWeatherService, weatherHelper: WeatherHelper); /** Handle client/weather */ generate(): IWeatherData; /** @@ -21,5 +23,6 @@ export declare class WeatherController { * @returns Date object */ getCurrentInRaidTime(): Date; - generateLocal(sesssionID: string): IGetLocalWeatherResponseData; + /** Handle client/localGame/weather */ + generateLocal(sesssionId: string): IGetLocalWeatherResponseData; } diff --git a/types/generators/BotEquipmentModGenerator.d.ts b/types/generators/BotEquipmentModGenerator.d.ts index 04639ed3..c2b531c3 100644 --- a/types/generators/BotEquipmentModGenerator.d.ts +++ b/types/generators/BotEquipmentModGenerator.d.ts @@ -16,7 +16,7 @@ import { IFilterPlateModsForSlotByLevelResult } from "@spt/models/spt/bots/IFilt import { IGenerateEquipmentProperties } from "@spt/models/spt/bots/IGenerateEquipmentProperties"; import { IGenerateWeaponRequest } from "@spt/models/spt/bots/IGenerateWeaponRequest"; import { IModToSpawnRequest } from "@spt/models/spt/bots/IModToSpawnRequest"; -import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt/models/spt/config/IBotConfig"; +import { EquipmentFilters, IBotConfig, IEquipmentFilterDetails } from "@spt/models/spt/config/IBotConfig"; import { ExhaustableArray } from "@spt/models/spt/server/ExhaustableArray"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -56,11 +56,12 @@ export declare class BotEquipmentModGenerator { * @param equipment Equipment item to add mods to * @param modPool Mod list to choose frm * @param parentId parentid of item to add mod to - * @param parentTemplate template objet of item to add mods to + * @param parentTemplate Template object of item to add mods to + * @param specificBlacklist The relevant blacklist from bot.json equipment dictionary * @param forceSpawn should this mod be forced to spawn * @returns Item + compatible mods as an array */ - generateModsForEquipment(equipment: IItem[], parentId: string, parentTemplate: ITemplateItem, settings: IGenerateEquipmentProperties, shouldForceSpawn?: boolean): IItem[]; + generateModsForEquipment(equipment: IItem[], parentId: string, parentTemplate: ITemplateItem, settings: IGenerateEquipmentProperties, specificBlacklist: IEquipmentFilterDetails, shouldForceSpawn?: boolean): IItem[]; /** * Filter a bots plate pool based on its current level * @param settings Bot equipment generation settings @@ -125,13 +126,13 @@ export declare class BotEquipmentModGenerator { protected getModItemSlotFromDb(modSlot: string, parentTemplate: ITemplateItem): ISlot; /** * Randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot - * @param itemSlot slot the item sits in - * @param modSlot slot the mod sits in + * @param itemSlot slot the item sits in from db + * @param modSlotName Name of slot the mod sits in * @param modSpawnChances Chances for various mod spawns * @param botEquipConfig Various config settings for generating this type of bot * @returns ModSpawn.SPAWN when mod should be spawned, ModSpawn.DEFAULT_MOD when default mod should spawn, ModSpawn.SKIP when mod is skipped */ - protected shouldModBeSpawned(itemSlot: ISlot, modSlot: string, modSpawnChances: IModsChances, botEquipConfig: EquipmentFilters): ModSpawn; + protected shouldModBeSpawned(itemSlot: ISlot, modSlotName: string, modSpawnChances: IModsChances, botEquipConfig: EquipmentFilters): ModSpawn; /** * Choose a mod to fit into the desired slot * @param request Data used to choose an appropriate mod with @@ -235,7 +236,7 @@ export declare class BotEquipmentModGenerator { * @param modPool Pool of mods we are adding to * @param botEquipBlacklist A blacklist of items that cannot be picked */ - protected addCompatibleModsForProvidedMod(desiredSlotName: string, modTemplate: ITemplateItem, modPool: IMods, botEquipBlacklist: EquipmentFilterDetails): void; + protected addCompatibleModsForProvidedMod(desiredSlotName: string, modTemplate: ITemplateItem, modPool: IMods, botEquipBlacklist: IEquipmentFilterDetails): void; /** * Get the possible items that fit a slot * @param parentItemId item tpl to get compatible items for @@ -243,7 +244,7 @@ export declare class BotEquipmentModGenerator { * @param botEquipBlacklist Equipment that should not be picked * @returns Array of compatible items for that slot */ - protected getDynamicModPool(parentItemId: string, modSlot: string, botEquipBlacklist: EquipmentFilterDetails): string[]; + protected getDynamicModPool(parentItemId: string, modSlot: string, botEquipBlacklist: IEquipmentFilterDetails): string[]; /** * Take a list of tpls and filter out blacklisted values using itemFilterService + botEquipmentBlacklist * @param allowedMods Base mods to filter @@ -251,7 +252,7 @@ export declare class BotEquipmentModGenerator { * @param modSlot Slot mods belong to * @returns Filtered array of mod tpls */ - protected filterWeaponModsByBlacklist(allowedMods: string[], botEquipBlacklist: EquipmentFilterDetails, modSlot: string): string[]; + protected filterModsByBlacklist(allowedMods: string[], botEquipBlacklist: IEquipmentFilterDetails, modSlot: string): string[]; /** * With the shotgun revolver (60db29ce99594040e04c4a27) 12.12 introduced CylinderMagazines. * Those magazines (e.g. 60dc519adf4c47305f6d410d) have a "Cartridges" entry with a _max_count=0. diff --git a/types/generators/BotGenerator.d.ts b/types/generators/BotGenerator.d.ts index bff2b497..6f76b378 100644 --- a/types/generators/BotGenerator.d.ts +++ b/types/generators/BotGenerator.d.ts @@ -5,7 +5,7 @@ import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IBaseJsonSkills, IBaseSkill, IBotBase, IInfo, IHealth as PmcHealth, ISkills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; import { IAppearance, IBodyPart, IBotType, IHealth, IInventory } from "@spt/models/eft/common/tables/IBotType"; -import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; +import { IBotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -53,7 +53,7 @@ export declare class BotGenerator { * @param botGenerationDetails details on how to generate bots * @returns constructed bot */ - prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase; + prepareAndGenerateBot(sessionId: string, botGenerationDetails: IBotGenerationDetails): IBotBase; /** * Get a clone of the default bot base object and adjust its role/side/difficulty values * @param botRole Role bot should have @@ -75,7 +75,7 @@ export declare class BotGenerator { * @param botGenerationDetails details on how to generate the bot * @returns IBotBase object */ - protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase; + protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: IBotGenerationDetails): IBotBase; protected addAdditionalPocketLootWeightsForUnheardBot(botJsonTemplate: IBotType): void; /** * Remove items from item.json/lootableItemBlacklist from bots inventory @@ -88,7 +88,7 @@ export declare class BotGenerator { * @param appearance Appearance settings to choose from * @param botGenerationDetails Generation details */ - protected setBotAppearance(bot: IBotBase, appearance: IAppearance, botGenerationDetails: BotGenerationDetails): void; + protected setBotAppearance(bot: IBotBase, appearance: IAppearance, botGenerationDetails: IBotGenerationDetails): void; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client diff --git a/types/generators/BotInventoryGenerator.d.ts b/types/generators/BotInventoryGenerator.d.ts index 22bfe6ce..163c6519 100644 --- a/types/generators/BotInventoryGenerator.d.ts +++ b/types/generators/BotInventoryGenerator.d.ts @@ -5,6 +5,7 @@ import { BotWeaponGenerator } from "@spt/generators/BotWeaponGenerator"; import { BotGeneratorHelper } from "@spt/helpers/BotGeneratorHelper"; import { BotHelper } from "@spt/helpers/BotHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; +import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeatherHelper } from "@spt/helpers/WeatherHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IInventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase"; @@ -12,9 +13,10 @@ import { IBotType, IChances, IEquipment, IGeneration, IInventory } from "@spt/mo import { IGetRaidConfigurationRequestData } from "@spt/models/eft/match/IGetRaidConfigurationRequestData"; import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots"; import { IGenerateEquipmentProperties } from "@spt/models/spt/bots/IGenerateEquipmentProperties"; -import { EquipmentFilterDetails, IBotConfig } from "@spt/models/spt/config/IBotConfig"; +import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "@spt/services/BotEquipmentModPoolService"; import { DatabaseService } from "@spt/services/DatabaseService"; import { LocalisationService } from "@spt/services/LocalisationService"; @@ -29,16 +31,18 @@ export declare class BotInventoryGenerator { protected botWeaponGenerator: BotWeaponGenerator; protected botLootGenerator: BotLootGenerator; protected botGeneratorHelper: BotGeneratorHelper; + protected profileHelper: ProfileHelper; protected botHelper: BotHelper; protected weightedRandomHelper: WeightedRandomHelper; protected itemHelper: ItemHelper; protected weatherHelper: WeatherHelper; protected localisationService: LocalisationService; + protected botEquipmentFilterService: BotEquipmentFilterService; protected botEquipmentModPoolService: BotEquipmentModPoolService; protected botEquipmentModGenerator: BotEquipmentModGenerator; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, applicationContext: ApplicationContext, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, weatherHelper: WeatherHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseService: DatabaseService, applicationContext: ApplicationContext, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, profileHelper: ProfileHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, itemHelper: ItemHelper, weatherHelper: WeatherHelper, localisationService: LocalisationService, botEquipmentFilterService: BotEquipmentFilterService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer); /** * Add equipment/weapons/loot to bot * @param sessionId Session id @@ -57,6 +61,7 @@ export declare class BotInventoryGenerator { protected generateInventoryBase(): PmcInventory; /** * Add equipment to a bot + * @param sessionId Session id * @param templateInventory bot/x.json data from db * @param wornItemChances Chances items will be added to bot * @param botRole Role bot has (assault/pmcBot) @@ -64,7 +69,7 @@ export declare class BotInventoryGenerator { * @param botLevel Level of bot * @param chosenGameVersion Game version for bot, only really applies for PMCs */ - protected generateAndAddEquipmentToBot(templateInventory: IInventory, wornItemChances: IChances, botRole: string, botInventory: PmcInventory, botLevel: number, chosenGameVersion: string, raidConfig: IGetRaidConfigurationRequestData): void; + protected generateAndAddEquipmentToBot(sessionId: string, templateInventory: IInventory, wornItemChances: IChances, botRole: string, botInventory: PmcInventory, botLevel: number, chosenGameVersion: string, raidConfig: IGetRaidConfigurationRequestData): void; /** * Remove non-armored rigs from parameter data * @param templateEquipment Equpiment to filter TacticalVest of @@ -80,6 +85,7 @@ export declare class BotInventoryGenerator { protected filterRigsToThoseWithoutProtection(templateEquipment: IEquipment, botRole: string, allowEmptyResult?: boolean): void; /** * Add a piece of equipment with mods to inventory from the provided pools + * @param sessionId Session id * @param settings Values to adjust how item is chosen and added to bot * @returns true when item added */ @@ -87,10 +93,10 @@ export declare class BotInventoryGenerator { /** * Get all possible mods for item and filter down based on equipment blacklist from bot.json config * @param itemTpl Item mod pool is being retrieved and filtered - * @param equipmentBlacklist blacklist to filter mod pool with + * @param equipmentBlacklist Blacklist to filter mod pool with * @returns Filtered pool of mods */ - protected getFilteredDynamicModsForItem(itemTpl: string, equipmentBlacklist: EquipmentFilterDetails[]): Record; + protected getFilteredDynamicModsForItem(itemTpl: string, equipmentBlacklist: Record): Record; /** * Work out what weapons bot should have equipped and add them to bot inventory * @param templateInventory bot/x.json data from db diff --git a/types/generators/BotLevelGenerator.d.ts b/types/generators/BotLevelGenerator.d.ts index 855b0dbd..0dada8f4 100644 --- a/types/generators/BotLevelGenerator.d.ts +++ b/types/generators/BotLevelGenerator.d.ts @@ -1,7 +1,7 @@ import { MinMax } from "@spt/models/common/MinMax"; import { IRandomisedBotLevelResult } from "@spt/models/eft/bot/IRandomisedBotLevelResult"; import { IBotBase } from "@spt/models/eft/common/tables/IBotBase"; -import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; +import { IBotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { DatabaseService } from "@spt/services/DatabaseService"; import { MathUtil } from "@spt/utils/MathUtil"; @@ -19,7 +19,7 @@ export declare class BotLevelGenerator { * @param bot Bot the level is being generated for * @returns IRandomisedBotLevelResult object */ - generateBotLevel(levelDetails: MinMax, botGenerationDetails: BotGenerationDetails, bot: IBotBase): IRandomisedBotLevelResult; + generateBotLevel(levelDetails: MinMax, botGenerationDetails: IBotGenerationDetails, bot: IBotBase): IRandomisedBotLevelResult; protected chooseBotLevel(min: number, max: number, shift: number, number: number): number; /** * Return the min and max bot level based on a relative delta from the PMC level @@ -28,5 +28,5 @@ export declare class BotLevelGenerator { * @param maxlevel Max level allowed * @returns A MinMax of the lowest and highest level to generate the bots */ - protected getRelativeBotLevelRange(botGenerationDetails: BotGenerationDetails, levelDetails: MinMax, maxAvailableLevel: number): MinMax; + protected getRelativeBotLevelRange(botGenerationDetails: IBotGenerationDetails, levelDetails: MinMax, maxAvailableLevel: number): MinMax; } diff --git a/types/generators/BotWeaponGenerator.d.ts b/types/generators/BotWeaponGenerator.d.ts index 273e9814..c5c871fb 100644 --- a/types/generators/BotWeaponGenerator.d.ts +++ b/types/generators/BotWeaponGenerator.d.ts @@ -8,7 +8,7 @@ import { IInventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBa import { IGenerationData, IInventory, IModsChances } from "@spt/models/eft/common/tables/IBotType"; import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { GenerateWeaponResult } from "@spt/models/spt/bots/GenerateWeaponResult"; +import { IGenerateWeaponResult } from "@spt/models/spt/bots/IGenerateWeaponResult"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; @@ -52,7 +52,7 @@ export declare class BotWeaponGenerator { * @param isPmc Is weapon generated for a pmc * @returns GenerateWeaponResult object */ - generateRandomWeapon(sessionId: string, equipmentSlot: string, botTemplateInventory: IInventory, weaponParentId: string, modChances: IModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; + generateRandomWeapon(sessionId: string, equipmentSlot: string, botTemplateInventory: IInventory, weaponParentId: string, modChances: IModsChances, botRole: string, isPmc: boolean, botLevel: number): IGenerateWeaponResult; /** * Get a random weighted weapon from a bots pool of weapons * @param equipmentSlot Primary/secondary/holster @@ -71,7 +71,7 @@ export declare class BotWeaponGenerator { * @param isPmc Is weapon being generated for a pmc * @returns GenerateWeaponResult object */ - generateWeaponByTpl(sessionId: string, weaponTpl: string, slotName: string, botTemplateInventory: IInventory, weaponParentId: string, modChances: IModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult; + generateWeaponByTpl(sessionId: string, weaponTpl: string, slotName: string, botTemplateInventory: IInventory, weaponParentId: string, modChances: IModsChances, botRole: string, isPmc: boolean, botLevel: number): IGenerateWeaponResult; /** * Insert a cartridge(s) into a weapon * Handles all chambers - patron_in_weapon, patron_in_weapon_000 etc @@ -114,14 +114,14 @@ export declare class BotWeaponGenerator { * @param inventory Inventory to add magazines to * @param botRole The bot type we're getting generating extra mags for */ - addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magWeights: IGenerationData, inventory: PmcInventory, botRole: string): void; + addExtraMagazinesToInventory(generatedWeaponResult: IGenerateWeaponResult, magWeights: IGenerationData, inventory: PmcInventory, botRole: string): void; /** * Add Grendaes for UBGL to bots vest and secure container * @param weaponMods Weapon array with mods * @param generatedWeaponResult result of weapon generation * @param inventory bot inventory to add grenades to */ - protected addUbglGrenadesToBotInventory(weaponMods: IItem[], generatedWeaponResult: GenerateWeaponResult, inventory: PmcInventory): void; + protected addUbglGrenadesToBotInventory(weaponMods: IItem[], generatedWeaponResult: IGenerateWeaponResult, inventory: PmcInventory): void; /** * Add ammo to the secure container * @param stackCount How many stacks of ammo to add diff --git a/types/generators/LootGenerator.d.ts b/types/generators/LootGenerator.d.ts index be1c58bf..a82f24f1 100644 --- a/types/generators/LootGenerator.d.ts +++ b/types/generators/LootGenerator.d.ts @@ -2,11 +2,12 @@ import { InventoryHelper } from "@spt/helpers/InventoryHelper"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { PresetHelper } from "@spt/helpers/PresetHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; +import { MinMax } from "@spt/models/common/MinMax"; import { IPreset } from "@spt/models/eft/common/IGlobals"; import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { ISealedAirdropContainerSettings, RewardDetails } from "@spt/models/spt/config/IInventoryConfig"; -import { LootRequest } from "@spt/models/spt/services/LootRequest"; +import { IRewardDetails, ISealedAirdropContainerSettings } from "@spt/models/spt/config/IInventoryConfig"; +import { ILootRequest } from "@spt/models/spt/services/ILootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { DatabaseService } from "@spt/services/DatabaseService"; import { ItemFilterService } from "@spt/services/ItemFilterService"; @@ -36,8 +37,22 @@ export declare class LootGenerator { * @param options parameters to adjust how loot is generated * @returns An array of loot items */ - createRandomLoot(options: LootRequest): IItem[]; - createForcedLoot(airdropConfig: LootRequest): IItem[]; + createRandomLoot(options: ILootRequest): IItem[]; + /** + * Generate An array of items + * TODO - handle weapon presets/ammo packs + * @param forcedLootDict Dictionary of item tpls with minmax values + * @returns Array of IItem + */ + createForcedLoot(forcedLootDict: Record): IItem[]; + /** + * Get pool of items from item db that fit passed in param criteria + * @param itemTplBlacklist Prevent these items + * @param itemTypeWhitelist Only allow these items + * @param useRewardItemBlacklist Should item.json reward item config be used + * @param allowBossItems Should boss items be allowed in result + * @returns results of filtering + blacklist used + */ protected getItemRewardPool(itemTplBlacklist: string[], itemTypeWhitelist: string[], useRewardItemBlacklist: boolean, allowBossItems: boolean): { itemPool: [string, ITemplateItem][]; blacklist: Set; @@ -48,7 +63,7 @@ export declare class LootGenerator { * @param options Loot request options - armor level etc * @returns True if item has desired armor level */ - protected isArmorOfDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; + protected isArmorOfDesiredProtectionLevel(armor: IPreset, options: ILootRequest): boolean; /** * Construct item limit record to hold max and current item count for each item type * @param limits limits as defined in config @@ -66,14 +81,14 @@ export declare class LootGenerator { protected findAndAddRandomItemToLoot(items: [string, ITemplateItem][], itemTypeCounts: Record, options: LootRequest, result: IItem[]): boolean; + }>, options: ILootRequest, result: IItem[]): boolean; /** * Get a randomised stack count for an item between its StackMinRandom and StackMaxSize values * @param item item to get stack count of * @param options loot options * @returns stack count */ - protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; + protected getRandomisedStackCount(item: ITemplateItem, options: ILootRequest): number; /** * Find a random item in items.json and add to result array * @param presetPool Presets to choose from @@ -112,12 +127,12 @@ export declare class LootGenerator { * @param rewardContainerDetails * @returns Array of item with children arrays */ - getRandomLootContainerLoot(rewardContainerDetails: RewardDetails): IItem[][]; + getRandomLootContainerLoot(rewardContainerDetails: IRewardDetails): IItem[][]; /** * Pick a reward item based on the reward details data * @param rewardContainerDetails * @returns Single tpl */ - protected pickRewardItem(rewardContainerDetails: RewardDetails): string; + protected pickRewardItem(rewardContainerDetails: IRewardDetails): string; } export {}; diff --git a/types/generators/PlayerScavGenerator.d.ts b/types/generators/PlayerScavGenerator.d.ts index 86255294..7a8e0e76 100644 --- a/types/generators/PlayerScavGenerator.d.ts +++ b/types/generators/PlayerScavGenerator.d.ts @@ -6,7 +6,7 @@ import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IBotBase, ISkills, IStats } from "@spt/models/eft/common/tables/IBotBase"; import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { IPlayerScavConfig, KarmaLevel } from "@spt/models/spt/config/IPlayerScavConfig"; +import { IKarmaLevel, IPlayerScavConfig } from "@spt/models/spt/config/IPlayerScavConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { SaveServer } from "@spt/servers/SaveServer"; @@ -67,7 +67,7 @@ export declare class PlayerScavGenerator { * @param karmaSettings Values to modify the bot template with * @param baseBotNode bot template to modify according to karama level settings */ - protected adjustBotTemplateWithKarmaSpecificSettings(karmaSettings: KarmaLevel, baseBotNode: IBotType): void; + protected adjustBotTemplateWithKarmaSpecificSettings(karmaSettings: IKarmaLevel, baseBotNode: IBotType): void; protected getScavSkills(scavProfile: IPmcData): ISkills; protected getDefaultScavSkills(): ISkills; protected getScavStats(scavProfile: IPmcData): IStats; diff --git a/types/generators/RagfairOfferGenerator.d.ts b/types/generators/RagfairOfferGenerator.d.ts index 02e5cea4..3c88984b 100644 --- a/types/generators/RagfairOfferGenerator.d.ts +++ b/types/generators/RagfairOfferGenerator.d.ts @@ -9,8 +9,10 @@ import { RagfairServerHelper } from "@spt/helpers/RagfairServerHelper"; import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBarterScheme } from "@spt/models/eft/common/tables/ITrader"; -import { IRagfairOffer, IRagfairOfferUser, OfferRequirement } from "@spt/models/eft/ragfair/IRagfairOffer"; -import { Dynamic, IArmorPlateBlacklistSettings, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; +import { IOfferRequirement, IRagfairOffer, IRagfairOfferUser } from "@spt/models/eft/ragfair/IRagfairOffer"; +import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; +import { IArmorPlateBlacklistSettings, IBarterDetails, IDynamic, IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; +import { ITplWithFleaPrice } from "@spt/models/spt/ragfair/ITplWithFleaPrice"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { SaveServer } from "@spt/servers/SaveServer"; @@ -45,6 +47,7 @@ export declare class RagfairOfferGenerator { protected configServer: ConfigServer; protected cloner: ICloner; protected ragfairConfig: IRagfairConfig; + protected botConfig: IBotConfig; protected allowedFleaPriceItemsForBarter: { tpl: string; price: number; @@ -86,7 +89,7 @@ export declare class RagfairOfferGenerator { * @param offerRequirements barter requirements for offer * @returns rouble cost of offer */ - protected convertOfferRequirementsIntoRoubles(offerRequirements: OfferRequirement[]): number; + protected convertOfferRequirementsIntoRoubles(offerRequirements: IOfferRequirement[]): number; /** * Get avatar url from trader table in db * @param isTrader Is user we're getting avatar for a trader @@ -136,7 +139,7 @@ export declare class RagfairOfferGenerator { * @param isExpiredOffer is an expired offer * @param config Ragfair dynamic config */ - protected createOffersFromAssort(assortItemWithChildren: IItem[], isExpiredOffer: boolean, config: Dynamic): Promise; + protected createOffersFromAssort(assortItemWithChildren: IItem[], isExpiredOffer: boolean, config: IDynamic): Promise; /** * iterate over an items chidren and look for plates above desired level and remove them * @param presetWithChildren preset to check for plates @@ -203,17 +206,15 @@ export declare class RagfairOfferGenerator { /** * Create a barter-based barter scheme, if not possible, fall back to making barter scheme currency based * @param offerItems Items for sale in offer + * @param barterConfig Barter config from ragfairConfig.dynamic.barter * @returns Barter scheme */ - protected createBarterBarterScheme(offerItems: IItem[]): IBarterScheme[]; + protected createBarterBarterScheme(offerItems: IItem[], barterConfig: IBarterDetails): IBarterScheme[]; /** * Get an array of flea prices + item tpl, cached in generator class inside `allowedFleaPriceItemsForBarter` * @returns array with tpl/price values */ - protected getFleaPricesAsArray(): { - tpl: string; - price: number; - }[]; + protected getFleaPricesAsArray(): ITplWithFleaPrice[]; /** * Create a random currency-based barter scheme for an array of items * @param offerWithChildren Items on offer diff --git a/types/generators/RepeatableQuestRewardGenerator.d.ts b/types/generators/RepeatableQuestRewardGenerator.d.ts index 17f4fd4f..bc78ccad 100644 --- a/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -33,26 +33,30 @@ export declare class RepeatableQuestRewardGenerator { protected questConfig: IQuestConfig; constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, databaseService: DatabaseService, itemHelper: ItemHelper, presetHelper: PresetHelper, handbookHelper: HandbookHelper, localisationService: LocalisationService, objectId: ObjectId, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, cloner: ICloner); /** - * Generate the reward for a mission. A reward can consist of + * Generate the reward for a mission. A reward can consist of: * - Experience * - Money + * - GP coins + * - Weapon preset * - Items * - Trader Reputation + * - Skill level experience * * The reward is dependent on the player level as given by the wiki. The exact mapping of pmcLevel to * experience / money / items / trader reputation can be defined in QuestConfig.js * - * There's also a random variation of the reward the spread of which can be also defined in the config. + * There's also a random variation of the reward the spread of which can be also defined in the config * * Additionally, a scaling factor w.r.t. quest difficulty going from 0.2...1 can be used - * - * @param {integer} pmcLevel player's level - * @param {number} difficulty a reward scaling factor from 0.2 to 1 - * @param {string} traderId the trader for reputation gain (and possible in the future filtering of reward item type based on trader) - * @param {object} repeatableConfig The configuration for the repeatable kind (daily, weekly) as configured in QuestConfig for the requested quest - * @returns {object} object of "Reward"-type that can be given for a repeatable mission + * @param pmcLevel Level of player reward is being generated for + * @param difficulty Reward scaling factor from 0.2 to 1 + * @param traderId Trader reward will be given by + * @param repeatableConfig Config for quest type (daily, weekly) + * @param questConfig + * @param rewardTplBlacklist OPTIONAL: list of tpls to NOT use when picking a reward + * @returns IQuestRewards */ - generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards; + generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig, rewardTplBlacklist?: string[]): IQuestRewards; protected getQuestRewardValues(rewardScaling: IRewardScaling, difficulty: number, pmcLevel: number): IQuestRewardValues; /** * Get an array of items + stack size to give to player as reward that fit inside of a rouble budget diff --git a/types/generators/ScavCaseRewardGenerator.d.ts b/types/generators/ScavCaseRewardGenerator.d.ts index 194b705c..28ec2b6d 100644 --- a/types/generators/ScavCaseRewardGenerator.d.ts +++ b/types/generators/ScavCaseRewardGenerator.d.ts @@ -4,7 +4,7 @@ import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IHideoutScavCase } from "@spt/models/eft/hideout/IHideoutScavCase"; import { IScavCaseConfig } from "@spt/models/spt/config/IScavCaseConfig"; -import { RewardCountAndPriceDetails, ScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; +import { IRewardCountAndPriceDetails, IScavCaseRewardCountsAndPrices } from "@spt/models/spt/hideout/ScavCaseRewardCountsAndPrices"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -48,7 +48,7 @@ export declare class ScavCaseRewardGenerator { * @param itemFilters how the rewards should be filtered down (by item count) * @returns */ - protected pickRandomRewards(items: ITemplateItem[], itemFilters: RewardCountAndPriceDetails, rarity: string): ITemplateItem[]; + protected pickRandomRewards(items: ITemplateItem[], itemFilters: IRewardCountAndPriceDetails, rarity: string): ITemplateItem[]; /** * Choose if money should be a reward based on the moneyRewardChancePercent config chance in scavCaseConfig * @returns true if reward should be money @@ -81,13 +81,13 @@ export declare class ScavCaseRewardGenerator { * @param itemFilters controls how the dbItems will be filtered and returned (handbook price) * @returns filtered dbItems array */ - protected getFilteredItemsByPrice(dbItems: ITemplateItem[], itemFilters: RewardCountAndPriceDetails): ITemplateItem[]; + protected getFilteredItemsByPrice(dbItems: ITemplateItem[], itemFilters: IRewardCountAndPriceDetails): ITemplateItem[]; /** * Gathers the reward min and max count params for each reward quality level from config and scavcase.json into a single object * @param scavCaseDetails scavcase.json values * @returns ScavCaseRewardCountsAndPrices object */ - protected getScavCaseRewardCountsAndPrices(scavCaseDetails: IHideoutScavCase): ScavCaseRewardCountsAndPrices; + protected getScavCaseRewardCountsAndPrices(scavCaseDetails: IHideoutScavCase): IScavCaseRewardCountsAndPrices; /** * Randomises the size of ammo and money stacks * @param itemToCalculate ammo or money item diff --git a/types/generators/WeatherGenerator.d.ts b/types/generators/WeatherGenerator.d.ts index 4b349105..476f29cf 100644 --- a/types/generators/WeatherGenerator.d.ts +++ b/types/generators/WeatherGenerator.d.ts @@ -2,6 +2,7 @@ import { ApplicationContext } from "@spt/context/ApplicationContext"; import { WeatherHelper } from "@spt/helpers/WeatherHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IWeather, IWeatherData } from "@spt/models/eft/weather/IWeatherData"; +import { Season } from "@spt/models/enums/Season"; import { WindDirection } from "@spt/models/enums/WindDirection"; import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -42,14 +43,24 @@ export declare class WeatherGenerator { protected getBSGFormattedTime(date: Date): string; /** * Return randomised Weather data with help of config/weather.json + * @param currentSeason the currently active season + * @param timestamp OPTIONAL what timestamp to generate the weather data at, defaults to now when not supplied * @returns Randomised weather data */ - generateWeather(): IWeather; + generateWeather(currentSeason: Season, timestamp?: number): IWeather; + /** + * Choose a temprature for the raid based on time of day and current season + * @param currentSeason What season tarkov is currently in + * @param inRaidTimestamp What time is the raid running at + * @returns Timestamp + */ + protected getRaidTemperature(currentSeason: Season, inRaidTimestamp: number): number; /** * Set IWeather date/time/timestamp values to now * @param weather Object to update + * @param timestamp OPTIONAL, define timestamp used */ - protected setCurrentDateTime(weather: IWeather): void; + protected setCurrentDateTime(weather: IWeather, timestamp?: number): void; protected getWeightedWindDirection(): WindDirection; protected getWeightedClouds(): number; protected getWeightedWindSpeed(): number; diff --git a/types/helpers/BotHelper.d.ts b/types/helpers/BotHelper.d.ts index 1058942b..7dc9b59a 100644 --- a/types/helpers/BotHelper.d.ts +++ b/types/helpers/BotHelper.d.ts @@ -1,6 +1,6 @@ import { MinMax } from "@spt/models/common/MinMax"; import { IBotType, IDifficultyCategories } from "@spt/models/eft/common/tables/IBotType"; -import { EquipmentFilters, IBotConfig, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; +import { EquipmentFilters, IBotConfig, IRandomisationDetails } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -54,7 +54,7 @@ export declare class BotHelper { * @param botEquipConfig bot equipment json * @returns RandomisationDetails */ - getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; + getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): IRandomisationDetails | undefined; /** * Choose between pmcBEAR and pmcUSEC at random based on the % defined in pmcConfig.isUsec * @returns pmc role @@ -71,5 +71,11 @@ export declare class BotHelper { * @returns pmc side as string */ protected getRandomizedPmcSide(): string; - getPmcNicknameOfMaxLength(userId: string, maxLength: number): string; + /** + * Get a name from a PMC that fits the desired length + * @param maxLength Max length of name, inclusive + * @param side OPTIONAL - what side PMC to get name from (usec/bear) + * @returns name of PMC + */ + getPmcNicknameOfMaxLength(maxLength: number, side?: string): string; } diff --git a/types/helpers/DialogueHelper.d.ts b/types/helpers/DialogueHelper.d.ts index 4f0a2cbc..7e1f9db8 100644 --- a/types/helpers/DialogueHelper.d.ts +++ b/types/helpers/DialogueHelper.d.ts @@ -2,7 +2,7 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { IItem } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, MessagePreview } from "@spt/models/eft/profile/ISptProfile"; +import { IDialogue, IMessagePreview } from "@spt/models/eft/profile/ISptProfile"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; import { SaveServer } from "@spt/servers/SaveServer"; @@ -23,7 +23,7 @@ export declare class DialogueHelper { * @param dialogue * @returns MessagePreview */ - getMessagePreview(dialogue: Dialogue): MessagePreview; + getMessagePreview(dialogue: IDialogue): IMessagePreview; /** * Get the item contents for a particular message. * @param messageID @@ -37,5 +37,5 @@ export declare class DialogueHelper { * @param sessionId Session/player id * @returns Dialog dictionary */ - getDialogsForProfile(sessionId: string): Record; + getDialogsForProfile(sessionId: string): Record; } diff --git a/types/helpers/HealthHelper.d.ts b/types/helpers/HealthHelper.d.ts index 73ce2b82..b05d0089 100644 --- a/types/helpers/HealthHelper.d.ts +++ b/types/helpers/HealthHelper.d.ts @@ -1,7 +1,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IBodyPartsHealth, IHealth } from "@spt/models/eft/common/tables/IBotBase"; import { ISyncHealthRequestData } from "@spt/models/eft/health/ISyncHealthRequestData"; -import { Effects, ISptProfile } from "@spt/models/eft/profile/ISptProfile"; +import { IEffects, ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IHealthConfig } from "@spt/models/spt/config/IHealthConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -63,7 +63,7 @@ export declare class HealthHelper { * @param bodyPartsWithEffects dict of body parts with effects that should be added to profile * @param addEffects Should effects be added back to profile */ - protected saveEffects(pmcData: IPmcData, sessionId: string, bodyPartsWithEffects: Effects, deleteExistingEffects?: boolean): void; + protected saveEffects(pmcData: IPmcData, sessionId: string, bodyPartsWithEffects: IEffects, deleteExistingEffects?: boolean): void; /** * Add effect to body part in profile * @param pmcData Player profile diff --git a/types/helpers/HideoutHelper.d.ts b/types/helpers/HideoutHelper.d.ts index 5917927b..21672c65 100644 --- a/types/helpers/HideoutHelper.d.ts +++ b/types/helpers/HideoutHelper.d.ts @@ -4,12 +4,13 @@ import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IBotHideoutArea, IHideoutImprovement, IProduction, IProductive } from "@spt/models/eft/common/tables/IBotBase"; import { IItem, IUpd } from "@spt/models/eft/common/tables/IItem"; -import { IHideoutArea, StageBonus } from "@spt/models/eft/hideout/IHideoutArea"; +import { IHideoutArea, IStageBonus } from "@spt/models/eft/hideout/IHideoutArea"; import { IHideoutContinuousProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutContinuousProductionStartRequestData"; import { IHideoutProduction } from "@spt/models/eft/hideout/IHideoutProduction"; import { IHideoutSingleProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutSingleProductionStartRequestData"; import { IHideoutTakeProductionRequestData } from "@spt/models/eft/hideout/IHideoutTakeProductionRequestData"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; +import { HideoutAreas } from "@spt/models/enums/HideoutAreas"; import { SkillTypes } from "@spt/models/enums/SkillTypes"; import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -55,7 +56,7 @@ export declare class HideoutHelper { * This convenience function initializes new Production Object * with all the constants. */ - initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean, isCultistCircle?: boolean): IProduction; + initProduction(recipeId: string, productionTime: number, needFuelForAllProductionTime: boolean): IProduction; /** * Is the provided object a Production type * @param productive @@ -67,7 +68,7 @@ export declare class HideoutHelper { * @param pmcData Profile to add bonus to * @param bonus Bonus to add to profile */ - applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: StageBonus): void; + applyPlayerUpgradesBonuses(pmcData: IPmcData, bonus: IStageBonus): void; /** * Process a players hideout, update areas that use resources + increment production timers * @param sessionID Session id @@ -94,6 +95,21 @@ export declare class HideoutHelper { isGeneratorOn: boolean; waterCollectorHasFilter: boolean; }): void; + /** + * Is a craft from a particular hideout area + * @param craft Craft to check + * @param hideoutType Type to check craft against + * @returns True it is from that area + */ + protected isCraftOfType(craft: IProduction, hideoutType: HideoutAreas): boolean; + /** + * Has the craft completed + * Ignores bitcoin farm/cultist circle as they're continuous crafts + * @param craft Craft to check + + * @returns True when craft is compelte + */ + protected isCraftComplete(craft: IProduction): boolean; /** * Update progress timer for water collector * @param pmcData profile to update diff --git a/types/helpers/InventoryHelper.d.ts b/types/helpers/InventoryHelper.d.ts index e95f340d..c6bc6fe6 100644 --- a/types/helpers/InventoryHelper.d.ts +++ b/types/helpers/InventoryHelper.d.ts @@ -16,7 +16,7 @@ import { IInventoryRemoveRequestData } from "@spt/models/eft/inventory/IInventor import { IInventorySplitRequestData } from "@spt/models/eft/inventory/IInventorySplitRequestData"; import { IInventoryTransferRequestData } from "@spt/models/eft/inventory/IInventoryTransferRequestData"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; -import { IInventoryConfig, RewardDetails } from "@spt/models/spt/config/IInventoryConfig"; +import { IInventoryConfig, IRewardDetails } from "@spt/models/spt/config/IInventoryConfig"; import { IOwnerInventoryItems } from "@spt/models/spt/inventory/IOwnerInventoryItems"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -246,7 +246,7 @@ export declare class InventoryHelper { * @param itemTpl Container being opened * @returns Reward details */ - getRandomLootContainerRewardDetails(itemTpl: string): RewardDetails; + getRandomLootContainerRewardDetails(itemTpl: string): IRewardDetails; getInventoryConfig(): IInventoryConfig; /** * Recursively checks if the given item is diff --git a/types/helpers/NotificationSendHelper.d.ts b/types/helpers/NotificationSendHelper.d.ts index 3a74563e..80beb77f 100644 --- a/types/helpers/NotificationSendHelper.d.ts +++ b/types/helpers/NotificationSendHelper.d.ts @@ -1,4 +1,4 @@ -import { Dialogue, IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IDialogue, IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { IWsNotificationEvent } from "@spt/models/eft/ws/IWsNotificationEvent"; import { MessageType } from "@spt/models/enums/MessageType"; import { SaveServer } from "@spt/servers/SaveServer"; @@ -32,5 +32,5 @@ export declare class NotificationSendHelper { * @param senderDetails Who is sending the message * @returns Dialogue */ - protected getDialog(sessionId: string, messageType: MessageType, senderDetails: IUserDialogInfo): Dialogue; + protected getDialog(sessionId: string, messageType: MessageType, senderDetails: IUserDialogInfo): IDialogue; } diff --git a/types/helpers/NotifierHelper.d.ts b/types/helpers/NotifierHelper.d.ts index b947f1be..2732631c 100644 --- a/types/helpers/NotifierHelper.d.ts +++ b/types/helpers/NotifierHelper.d.ts @@ -1,5 +1,5 @@ import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; -import { Message, MessageContentRagfair } from "@spt/models/eft/profile/ISptProfile"; +import { IMessage, IMessageContentRagfair } from "@spt/models/eft/profile/ISptProfile"; import { IWsChatMessageReceived } from "@spt/models/eft/ws/IWsChatMessageReceived"; import { IWsNotificationEvent } from "@spt/models/eft/ws/IWsNotificationEvent"; import { IWsRagfairOfferSold } from "@spt/models/eft/ws/IWsRagfairOfferSold"; @@ -17,12 +17,12 @@ export declare class NotifierHelper { * @param ragfairData Ragfair data to attach to notification * @returns */ - createRagfairOfferSoldNotification(dialogueMessage: Message, ragfairData: MessageContentRagfair): IWsRagfairOfferSold; + createRagfairOfferSoldNotification(dialogueMessage: IMessage, ragfairData: IMessageContentRagfair): IWsRagfairOfferSold; /** * Create a new notification with the specified dialogueMessage object * @param dialogueMessage * @returns */ - createNewMessageNotification(dialogueMessage: Message): IWsChatMessageReceived; + createNewMessageNotification(dialogueMessage: IMessage): IWsChatMessageReceived; getWebSocketServer(sessionID: string): string; } diff --git a/types/helpers/RagfairOfferHelper.d.ts b/types/helpers/RagfairOfferHelper.d.ts index 45b29815..66a146d1 100644 --- a/types/helpers/RagfairOfferHelper.d.ts +++ b/types/helpers/RagfairOfferHelper.d.ts @@ -15,6 +15,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IRagfairOffer } from "@spt/models/eft/ragfair/IRagfairOffer"; import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; +import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IRagfairConfig, ITieredFlea } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -55,6 +56,7 @@ export declare class RagfairOfferHelper { protected static goodSoldTemplate: string; protected ragfairConfig: IRagfairConfig; protected questConfig: IQuestConfig; + protected botConfig: IBotConfig; constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseService: DatabaseService, traderHelper: TraderHelper, saveServer: SaveServer, itemHelper: ItemHelper, botHelper: BotHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, localeService: LocaleService, localisationService: LocalisationService, mailSendService: MailSendService, configServer: ConfigServer); /** * Passthrough to ragfairOfferService.getOffers(), get flea offers a player should see diff --git a/types/helpers/RepairHelper.d.ts b/types/helpers/RepairHelper.d.ts index 538347e2..67da4ef9 100644 --- a/types/helpers/RepairHelper.d.ts +++ b/types/helpers/RepairHelper.d.ts @@ -1,5 +1,5 @@ import { IItem } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IProps, ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -42,5 +42,5 @@ export declare class RepairHelper { * @param traderQualityMultipler Different traders produce different loss values * @returns Amount to reduce max durability by */ - protected getRandomisedWeaponRepairDegradationValue(itemProps: Props, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; + protected getRandomisedWeaponRepairDegradationValue(itemProps: IProps, isRepairKit: boolean, weaponMax: number, traderQualityMultipler: number): number; } diff --git a/types/helpers/WeatherHelper.d.ts b/types/helpers/WeatherHelper.d.ts index e5aa6bea..928017f8 100644 --- a/types/helpers/WeatherHelper.d.ts +++ b/types/helpers/WeatherHelper.d.ts @@ -14,11 +14,12 @@ export declare class WeatherHelper { * @param currentDate (new Date()) * @returns Date object of current in-raid time */ - getInRaidTime(): Date; + getInRaidTime(timestamp?: number): Date; /** * Is the current raid at nighttime * @param timeVariant PASS OR CURR (from raid settings) * @returns True when nighttime */ isNightTime(timeVariant: DateTime): boolean; + isHourAtNightTime(currentHour: number): boolean; } diff --git a/types/loaders/PreSptModLoader.d.ts b/types/loaders/PreSptModLoader.d.ts index 88145256..e8166f13 100644 --- a/types/loaders/PreSptModLoader.d.ts +++ b/types/loaders/PreSptModLoader.d.ts @@ -1,6 +1,6 @@ import { ModLoadOrder } from "@spt/loaders/ModLoadOrder"; import { ModTypeCheck } from "@spt/loaders/ModTypeCheck"; -import { ModDetails } from "@spt/models/eft/profile/ISptProfile"; +import { IModDetails } from "@spt/models/eft/profile/ISptProfile"; import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IModLoader } from "@spt/models/spt/mod/IModLoader"; import { IPackageJsonData } from "@spt/models/spt/mod/IPackageJsonData"; @@ -36,7 +36,7 @@ export declare class PreSptModLoader implements IModLoader { */ getImportedModsNames(): string[]; getImportedModDetails(): Record; - getProfileModsGroupedByModName(profileMods: ModDetails[]): ModDetails[]; + getProfileModsGroupedByModName(profileMods: IModDetails[]): IModDetails[]; getModPath(mod: string): string; protected importModsAsync(): Promise; protected sortMods(prev: string, next: string, missingFromOrderJSON: Record): number; diff --git a/types/models/eft/common/tables/IBotBase.d.ts b/types/models/eft/common/tables/IBotBase.d.ts index 4def148c..307277c8 100644 --- a/types/models/eft/common/tables/IBotBase.d.ts +++ b/types/models/eft/common/tables/IBotBase.d.ts @@ -299,7 +299,7 @@ export interface IInsuredItem { itemId: string; } export interface IHideout { - Production: Record; + Production: Record; Areas: IBotHideoutArea[]; Improvements: Record; HideoutCounters: IHideoutCounters; @@ -347,8 +347,8 @@ export interface IProductive { } export interface IProduction extends IProductive { RecipeId: string; - SkipTime: number; - ProductionTime: number; + SkipTime?: number; + ProductionTime?: number; } export interface IScavCase extends IProductive { RecipeId: string; diff --git a/types/models/eft/common/tables/ICustomizationItem.d.ts b/types/models/eft/common/tables/ICustomizationItem.d.ts index 97dc7081..abf82d9d 100644 --- a/types/models/eft/common/tables/ICustomizationItem.d.ts +++ b/types/models/eft/common/tables/ICustomizationItem.d.ts @@ -4,10 +4,10 @@ export interface ICustomizationItem { _name: string; _parent: string; _type: string; - _props: Props; + _props: IProps; _proto: string; } -export interface Props { +export interface IProps { Name: string; ShortName: string; Description: string; diff --git a/types/models/eft/common/tables/IProfileTemplate.d.ts b/types/models/eft/common/tables/IProfileTemplate.d.ts index a1c9c111..0eb800a0 100644 --- a/types/models/eft/common/tables/IProfileTemplate.d.ts +++ b/types/models/eft/common/tables/IProfileTemplate.d.ts @@ -1,5 +1,5 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { Dialogue, IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; +import { IDialogue, IUserBuilds } from "@spt/models/eft/profile/ISptProfile"; export interface IProfileTemplates { Standard: IProfileSides; "Left Behind": IProfileSides; @@ -19,7 +19,7 @@ export interface IProfileSides { export interface ITemplateSide { character: IPmcData; suits: string[]; - dialogues: Record; + dialogues: Record; userbuilds: IUserBuilds; trader: IProfileTraderTemplate; } diff --git a/types/models/eft/common/tables/ITemplateItem.d.ts b/types/models/eft/common/tables/ITemplateItem.d.ts index 145e013f..41b4d1dd 100644 --- a/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/types/models/eft/common/tables/ITemplateItem.d.ts @@ -4,11 +4,11 @@ export interface ITemplateItem { _name: string; _parent: string; _type: ItemType; - _props: Props; + _props: IProps; _proto?: string; } -export interface Props { - AllowSpawnOnLocations?: any[]; +export interface IProps { + AllowSpawnOnLocations?: string[]; BeltMagazineRefreshCount?: number; ChangePriceCoef?: number; FixedPrice?: boolean; @@ -175,7 +175,7 @@ export interface Props { spawnRarity?: string; minCountSpawn?: number; maxCountSpawn?: number; - openedByKeyID?: any[]; + openedByKeyID?: string[]; RigLayoutName?: string; MaxDurability?: number; armorZone?: string[]; diff --git a/types/models/eft/dialog/IGetAllAttachmentsResponse.d.ts b/types/models/eft/dialog/IGetAllAttachmentsResponse.d.ts index 9bcfead6..845d92cf 100644 --- a/types/models/eft/dialog/IGetAllAttachmentsResponse.d.ts +++ b/types/models/eft/dialog/IGetAllAttachmentsResponse.d.ts @@ -1,6 +1,6 @@ -import { Message } from "@spt/models/eft/profile/ISptProfile"; +import { IMessage } from "@spt/models/eft/profile/ISptProfile"; export interface IGetAllAttachmentsResponse { - messages: Message[]; + messages: IMessage[]; profiles: any[]; hasMessagesWithRewards: boolean; } diff --git a/types/models/eft/dialog/IGetMailDialogViewResponseData.d.ts b/types/models/eft/dialog/IGetMailDialogViewResponseData.d.ts index ba289104..0eaacf80 100644 --- a/types/models/eft/dialog/IGetMailDialogViewResponseData.d.ts +++ b/types/models/eft/dialog/IGetMailDialogViewResponseData.d.ts @@ -1,6 +1,6 @@ -import { IUserDialogInfo, Message } from "@spt/models/eft/profile/ISptProfile"; +import { IMessage, IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; export interface IGetMailDialogViewResponseData { - messages: Message[]; + messages: IMessage[]; profiles: IUserDialogInfo[]; hasMessagesWithRewards: boolean; } diff --git a/types/models/eft/game/IVersionValidateRequestData.d.ts b/types/models/eft/game/IVersionValidateRequestData.d.ts index 0aa0fed3..18213d9f 100644 --- a/types/models/eft/game/IVersionValidateRequestData.d.ts +++ b/types/models/eft/game/IVersionValidateRequestData.d.ts @@ -1,8 +1,8 @@ export interface IVersionValidateRequestData { - version: Version; + version: IVersion; develop: boolean; } -export interface Version { +export interface IVersion { major: string; minor: string; game: string; diff --git a/types/models/eft/health/IWorkoutData.d.ts b/types/models/eft/health/IWorkoutData.d.ts index ba629d2f..d958b743 100644 --- a/types/models/eft/health/IWorkoutData.d.ts +++ b/types/models/eft/health/IWorkoutData.d.ts @@ -1,4 +1,36 @@ export interface IWorkoutData extends Record { - skills: any; - effects: any; + skills: IWorkoutSkills; + effects: IWorkoutEffects; +} +export interface IWorkoutSkills { + Common: IWorkoutSkillCommon[]; + Mastering: any[]; + Bonuses: any; + Points: number; +} +export interface IWorkoutSkillCommon { + Id: string; + Progress: number; + PointsEarnedDuringSession: number; + LastAccess: number; +} +export interface IWorkoutEffects { + Effects: IWorkoutEffectsParts; + Hydration: number; + Energy: number; +} +export interface IWorkoutEffectsParts { + Head: IWorkoutBodyPart; + Chest: IWorkoutBodyPart; + Stomach: IWorkoutBodyPart; + LeftArm: IWorkoutBodyPart; + RightArm: IWorkoutBodyPart; + LeftLeg: IWorkoutBodyPart; + RightLeg: IWorkoutBodyPart; + Common: IWorkoutBodyPart; +} +export interface IWorkoutBodyPart { + Regeneration: number; + Fracture: number; + MildMusclePain: number; } diff --git a/types/models/eft/hideout/IHideoutArea.d.ts b/types/models/eft/hideout/IHideoutArea.d.ts index 0159c1d5..ce4d7794 100644 --- a/types/models/eft/hideout/IHideoutArea.d.ts +++ b/types/models/eft/hideout/IHideoutArea.d.ts @@ -12,16 +12,16 @@ export interface IHideoutArea { displayLevel: boolean; enableAreaRequirements: boolean; parentArea?: string; - stages: Record; + stages: Record; } export interface IAreaRequirement { areaType: number; requiredlevel: number; type: string; } -export interface Stage { +export interface IStage { autoUpgrade: boolean; - bonuses: StageBonus[]; + bonuses: IStageBonus[]; constructionTime: number; /** Containers inventory tpl */ container?: string; @@ -63,7 +63,7 @@ export interface IStageRequirement extends IRequirementBase { skillName?: string; skillLevel?: number; } -export interface StageBonus { +export interface IStageBonus { value: number; passive: boolean; production: boolean; diff --git a/types/models/eft/hideout/IHideoutImproveAreaRequestData.d.ts b/types/models/eft/hideout/IHideoutImproveAreaRequestData.d.ts index 7e927bf3..f963c13c 100644 --- a/types/models/eft/hideout/IHideoutImproveAreaRequestData.d.ts +++ b/types/models/eft/hideout/IHideoutImproveAreaRequestData.d.ts @@ -3,10 +3,10 @@ export interface IHideoutImproveAreaRequestData { /** Hideout area id from areas.json */ id: string; areaType: number; - items: HideoutItem[]; + items: IHideoutItem[]; timestamp: number; } -export interface HideoutItem { +export interface IHideoutItem { /** Hideout inventory id that was used by improvement action */ id: string; count: number; diff --git a/types/models/eft/hideout/IHideoutProduction.d.ts b/types/models/eft/hideout/IHideoutProduction.d.ts index a773daa7..19263118 100644 --- a/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/types/models/eft/hideout/IHideoutProduction.d.ts @@ -7,7 +7,7 @@ export interface IHideoutProductionData { export interface IHideoutProduction { _id: string; areaType: number; - requirements: Requirement[]; + requirements: IRequirement[]; productionTime: number; /** Tpl of item being crafted */ endProduct: string; @@ -18,7 +18,7 @@ export interface IHideoutProduction { count: number; productionLimitCount: number; } -export interface Requirement extends IRequirementBase { +export interface IRequirement extends IRequirementBase { templateId?: string; count?: number; isEncoded?: boolean; @@ -33,7 +33,7 @@ export interface IRequirementBase { } export type IScavRecipe = { _id: string; - requirements: Requirement[]; + requirements: IRequirement[]; productionTime: number; endProducts: IEndProducts; }; diff --git a/types/models/eft/hideout/IHideoutScavCase.d.ts b/types/models/eft/hideout/IHideoutScavCase.d.ts index d081d422..b420d2d6 100644 --- a/types/models/eft/hideout/IHideoutScavCase.d.ts +++ b/types/models/eft/hideout/IHideoutScavCase.d.ts @@ -2,16 +2,16 @@ import { MinMax } from "@spt/models/common/MinMax"; export interface IHideoutScavCase { _id: string; ProductionTime: number; - Requirements: Requirement[]; - EndProducts: EndProducts; + Requirements: IRequirement[]; + EndProducts: IEndProducts; } -export interface Requirement { +export interface IRequirement { templateId: string; count: number; isFunctional: boolean; type: string; } -export interface EndProducts { +export interface IEndProducts { Common: MinMax; Rare: MinMax; Superrare: MinMax; diff --git a/types/models/eft/hideout/IHideoutScavCaseStartRequestData.d.ts b/types/models/eft/hideout/IHideoutScavCaseStartRequestData.d.ts index 72fda86f..198d7786 100644 --- a/types/models/eft/hideout/IHideoutScavCaseStartRequestData.d.ts +++ b/types/models/eft/hideout/IHideoutScavCaseStartRequestData.d.ts @@ -1,15 +1,15 @@ export interface IHideoutScavCaseStartRequestData { Action: "HideoutScavCaseProductionStart"; recipeId: string; - items: HideoutItem[]; - tools: Tool[]; + items: IHideoutItem[]; + tools: ITool[]; timestamp: number; } -export interface HideoutItem { +export interface IHideoutItem { id: string; count: number; } -export interface Tool { +export interface ITool { id: string; count: number; } diff --git a/types/models/eft/hideout/IHideoutUpgradeRequestData.d.ts b/types/models/eft/hideout/IHideoutUpgradeRequestData.d.ts index dfbfdcab..59b61419 100644 --- a/types/models/eft/hideout/IHideoutUpgradeRequestData.d.ts +++ b/types/models/eft/hideout/IHideoutUpgradeRequestData.d.ts @@ -1,10 +1,10 @@ export interface IHideoutUpgradeRequestData { Action: "HideoutUpgrade"; areaType: number; - items: HideoutItem[]; + items: IHideoutItem[]; timestamp: number; } -export interface HideoutItem { +export interface IHideoutItem { count: number; id: string; } diff --git a/types/models/eft/inventory/IInventoryAddRequestData.d.ts b/types/models/eft/inventory/IInventoryAddRequestData.d.ts index 63c53894..e1ac7ece 100644 --- a/types/models/eft/inventory/IInventoryAddRequestData.d.ts +++ b/types/models/eft/inventory/IInventoryAddRequestData.d.ts @@ -1,6 +1,6 @@ -import { Container, IInventoryBaseActionRequestData } from "@spt/models/eft/inventory/IInventoryBaseActionRequestData"; +import { IContainer, IInventoryBaseActionRequestData } from "@spt/models/eft/inventory/IInventoryBaseActionRequestData"; export interface IInventoryAddRequestData extends IInventoryBaseActionRequestData { Action: "Add"; item: string; - container: Container; + container: IContainer; } diff --git a/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts b/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts index b133bff8..64b1a3ed 100644 --- a/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts +++ b/types/models/eft/inventory/IInventoryBaseActionRequestData.d.ts @@ -2,18 +2,18 @@ import { IBaseInteractionRequestData } from "@spt/models/eft/common/request/IBas import { IItemLocation } from "@spt/models/eft/common/tables/IItem"; export interface IInventoryBaseActionRequestData extends IBaseInteractionRequestData { } -export interface To { +export interface ITo { id: string; container: string; location?: IItemLocation | number; isSearched?: boolean; } -export interface Container { +export interface IContainer { id: string; container: string; - location?: Location | number; + location?: ILocation | number; } -export interface Location { +export interface ILocation { x: number; y: number; r: string; diff --git a/types/models/eft/inventory/IInventoryCreateMarkerRequestData.d.ts b/types/models/eft/inventory/IInventoryCreateMarkerRequestData.d.ts index 14691364..11d6ebde 100644 --- a/types/models/eft/inventory/IInventoryCreateMarkerRequestData.d.ts +++ b/types/models/eft/inventory/IInventoryCreateMarkerRequestData.d.ts @@ -2,9 +2,9 @@ import { IInventoryBaseActionRequestData } from "@spt/models/eft/inventory/IInve export interface IInventoryCreateMarkerRequestData extends IInventoryBaseActionRequestData { Action: "CreateMapMarker"; item: string; - mapMarker: MapMarker; + mapMarker: IMapMarker; } -export interface MapMarker { +export interface IMapMarker { Type: string; X: number; Y: number; diff --git a/types/models/eft/inventory/IInventoryEditMarkerRequestData.d.ts b/types/models/eft/inventory/IInventoryEditMarkerRequestData.d.ts index 87dcf861..9d7c6754 100644 --- a/types/models/eft/inventory/IInventoryEditMarkerRequestData.d.ts +++ b/types/models/eft/inventory/IInventoryEditMarkerRequestData.d.ts @@ -4,9 +4,9 @@ export interface IInventoryEditMarkerRequestData extends IInventoryBaseActionReq item: string; X: number; Y: number; - mapMarker: MapMarker; + mapMarker: IMapMarker; } -export interface MapMarker { +export interface IMapMarker { Type: string; X: number; Y: number; diff --git a/types/models/eft/inventory/IInventoryMoveRequestData.d.ts b/types/models/eft/inventory/IInventoryMoveRequestData.d.ts index afb6fd02..e5c2a8b9 100644 --- a/types/models/eft/inventory/IInventoryMoveRequestData.d.ts +++ b/types/models/eft/inventory/IInventoryMoveRequestData.d.ts @@ -1,6 +1,6 @@ -import { IInventoryBaseActionRequestData, To } from "@spt/models/eft/inventory/IInventoryBaseActionRequestData"; +import { IInventoryBaseActionRequestData, ITo } from "@spt/models/eft/inventory/IInventoryBaseActionRequestData"; export interface IInventoryMoveRequestData extends IInventoryBaseActionRequestData { Action: "Move"; item: string; - to: To; + to: ITo; } diff --git a/types/models/eft/inventory/IInventorySplitRequestData.d.ts b/types/models/eft/inventory/IInventorySplitRequestData.d.ts index a4bb8a40..5667f0a9 100644 --- a/types/models/eft/inventory/IInventorySplitRequestData.d.ts +++ b/types/models/eft/inventory/IInventorySplitRequestData.d.ts @@ -1,4 +1,4 @@ -import { Container, IInventoryBaseActionRequestData } from "@spt/models/eft/inventory/IInventoryBaseActionRequestData"; +import { IContainer, IInventoryBaseActionRequestData } from "@spt/models/eft/inventory/IInventoryBaseActionRequestData"; export interface IInventorySplitRequestData extends IInventoryBaseActionRequestData { Action: "Split"; /** Id of item to split */ @@ -6,6 +6,6 @@ export interface IInventorySplitRequestData extends IInventoryBaseActionRequestD /** Id of new item stack */ newItem: string; /** Destination new item will be placed in */ - container: Container; + container: IContainer; count: number; } diff --git a/types/models/eft/inventory/IInventorySwapRequestData.d.ts b/types/models/eft/inventory/IInventorySwapRequestData.d.ts index ccf47966..abd3adb0 100644 --- a/types/models/eft/inventory/IInventorySwapRequestData.d.ts +++ b/types/models/eft/inventory/IInventorySwapRequestData.d.ts @@ -1,11 +1,11 @@ import { OwnerInfo } from "@spt/models/eft/common/request/IBaseInteractionRequestData"; -import { IInventoryBaseActionRequestData, To } from "@spt/models/eft/inventory/IInventoryBaseActionRequestData"; +import { IInventoryBaseActionRequestData, ITo } from "@spt/models/eft/inventory/IInventoryBaseActionRequestData"; export interface IInventorySwapRequestData extends IInventoryBaseActionRequestData { Action: "Swap"; item: string; - to: To; + to: ITo; item2: string; - to2: To; + to2: ITo; fromOwner2: OwnerInfo; toOwner2: OwnerInfo; } diff --git a/types/models/eft/inventory/IOpenRandomLootContainerRequestData.d.ts b/types/models/eft/inventory/IOpenRandomLootContainerRequestData.d.ts index c9b97e0b..f9bc284b 100644 --- a/types/models/eft/inventory/IOpenRandomLootContainerRequestData.d.ts +++ b/types/models/eft/inventory/IOpenRandomLootContainerRequestData.d.ts @@ -3,9 +3,9 @@ export interface IOpenRandomLootContainerRequestData extends IInventoryBaseActio Action: "OpenRandomLootContainer"; /** Container item id being opened */ item: string; - to: To[]; + to: ITo[]; } -export interface To { +export interface ITo { /** Player character (pmc/scav) id items will be sent to */ id: string; } diff --git a/types/models/eft/itemEvent/IItemEventRouterBase.d.ts b/types/models/eft/itemEvent/IItemEventRouterBase.d.ts index 9d8a7407..b66fc03b 100644 --- a/types/models/eft/itemEvent/IItemEventRouterBase.d.ts +++ b/types/models/eft/itemEvent/IItemEventRouterBase.d.ts @@ -28,7 +28,7 @@ export interface IProfileChange { improvements: Record; skills: ISkills; health: IHealth; - traderRelations: Record; + traderRelations: Record; moneyTransferLimitData: IMoneyTransferLimits; repeatableQuests?: IPmcDataRepeatableQuest[]; recipeUnlocked: Record; @@ -60,7 +60,7 @@ export interface IItemChanges { del: IProduct[]; } /** Related to TraderInfo */ -export interface TraderData { +export interface ITraderData { salesSum: number; standing: number; loyalty: number; diff --git a/types/models/eft/itemEvent/IItemEventRouterRequest.d.ts b/types/models/eft/itemEvent/IItemEventRouterRequest.d.ts index 515b49a8..5b39fb4e 100644 --- a/types/models/eft/itemEvent/IItemEventRouterRequest.d.ts +++ b/types/models/eft/itemEvent/IItemEventRouterRequest.d.ts @@ -1,19 +1,19 @@ export interface IItemEventRouterRequest { - data: Daum[]; + data: IDaum[]; tm: number; reload: number; } -export interface Daum { +export interface IDaum { Action: string; item: string; - to: To; + to: ITo; } -export interface To { +export interface ITo { id: string; container: string; - location?: Location; + location?: ILocation; } -export interface Location { +export interface ILocation { x: number; y: number; r: string; diff --git a/types/models/eft/launcher/IMiniProfile.d.ts b/types/models/eft/launcher/IMiniProfile.d.ts index 0ea27932..856920f1 100644 --- a/types/models/eft/launcher/IMiniProfile.d.ts +++ b/types/models/eft/launcher/IMiniProfile.d.ts @@ -1,4 +1,4 @@ -import { Spt } from "../profile/ISptProfile"; +import { ISpt } from "../profile/ISptProfile"; export interface IMiniProfile { username: string; nickname: string; @@ -10,5 +10,5 @@ export interface IMiniProfile { maxlvl: number; edition: string; profileId: string; - sptData: Spt; + sptData: ISpt; } diff --git a/types/models/eft/location/IAirdropLootResult.d.ts b/types/models/eft/location/IAirdropLootResult.d.ts index cacc805e..963e43cc 100644 --- a/types/models/eft/location/IAirdropLootResult.d.ts +++ b/types/models/eft/location/IAirdropLootResult.d.ts @@ -1,5 +1,5 @@ -import { LootItem } from "@spt/models/spt/services/LootItem"; +import { ILootItem } from "@spt/models/spt/services/LootItem"; export interface IAirdropLootResult { dropType: string; - loot: LootItem[]; + loot: ILootItem[]; } diff --git a/types/models/eft/match/IRaidSettings.d.ts b/types/models/eft/match/IRaidSettings.d.ts index 2e4587bb..a4b74501 100644 --- a/types/models/eft/match/IRaidSettings.d.ts +++ b/types/models/eft/match/IRaidSettings.d.ts @@ -15,15 +15,15 @@ export interface IRaidSettings { isLocationTransition: boolean; timeVariant: DateTime; metabolismDisabled: boolean; - timeAndWeatherSettings: TimeAndWeatherSettings; - botSettings: BotSettings; - wavesSettings: WavesSettings; + timeAndWeatherSettings: ITimeAndWeatherSettings; + botSettings: IBotSettings; + wavesSettings: IWavesSettings; side: SideType; raidMode: RaidMode; playersSpawnPlace: PlayersSpawnPlace; CanShowGroupPreview: boolean; } -export interface TimeAndWeatherSettings { +export interface ITimeAndWeatherSettings { isRandomTime: boolean; isRandomWeather: boolean; cloudinessType: CloudinessType; @@ -33,11 +33,11 @@ export interface TimeAndWeatherSettings { timeFlowType: TimeFlowType; hourOfDay: number; } -export interface BotSettings { +export interface IBotSettings { isScavWars: boolean; botAmount: BotAmount; } -export interface WavesSettings { +export interface IWavesSettings { botAmount: BotAmount; botDifficulty: BotDifficulty; isBosses: boolean; diff --git a/types/models/eft/profile/ISptProfile.d.ts b/types/models/eft/profile/ISptProfile.d.ts index cc3be39e..8290b1c4 100644 --- a/types/models/eft/profile/ISptProfile.d.ts +++ b/types/models/eft/profile/ISptProfile.d.ts @@ -6,21 +6,21 @@ import { MessageType } from "@spt/models/enums/MessageType"; import { IProfileChangeEvent } from "@spt/models/spt/dialog/ISendMessageDetails"; export interface ISptProfile { info: Info; - characters: Characters; + characters: ICharacters; /** Clothing purchases */ suits: string[]; userbuilds: IUserBuilds; - dialogues: Record; - spt: Spt; - vitality: Vitality; - inraid: Inraid; - insurance: Insurance[]; + dialogues: Record; + spt: ISpt; + vitality: IVitality; + inraid: IInraid; + insurance: IInsurance[]; /** Assort purchases made by player since last trader refresh */ - traderPurchases?: Record>; + traderPurchases?: Record>; /** Achievements earned by player */ achievements: Record; } -export declare class TraderPurchaseData { +export declare class ITraderPurchaseData { count: number; purchaseTimestamp: number; } @@ -34,7 +34,7 @@ export interface Info { wipe: boolean; edition: string; } -export interface Characters { +export interface ICharacters { pmc: IPmcData; scav: IPmcData; } @@ -74,13 +74,13 @@ export interface IDefaultEquipmentPreset extends IUserBuild { BuildType: EquipmentBuildType; type: string; } -export interface Dialogue { +export interface IDialogue { attachmentsNew: number; new: number; type: MessageType; Users?: IUserDialogInfo[]; pinned: boolean; - messages: Message[]; + messages: IMessage[]; _id: string; } export interface IUserDialogInfo { @@ -95,16 +95,16 @@ export interface IUserDialogDetails { MemberCategory: MemberCategory; SelectedMemberCategory: MemberCategory; } -export interface DialogueInfo { +export interface IDialogueInfo { attachmentsNew: number; new: number; _id: string; type: MessageType; pinned: boolean; Users?: IUserDialogInfo[]; - message: MessagePreview; + message: IMessagePreview; } -export interface Message { +export interface IMessage { _id: string; uid: string; type: MessageType; @@ -116,7 +116,7 @@ export interface Message { replyTo?: IReplyTo; hasRewards?: boolean; rewardCollected: boolean; - items?: MessageItems; + items?: IMessageItems; maxStorageTime?: number; systemData?: ISystemData; profileChangeEvents?: IProfileChangeEvent[]; @@ -128,7 +128,7 @@ export interface IReplyTo { dt: number; text?: string; } -export interface MessagePreview { +export interface IMessagePreview { uid: string; type: MessageType; dt: number; @@ -136,7 +136,7 @@ export interface MessagePreview { text?: string; systemData?: ISystemData; } -export interface MessageItems { +export interface IMessageItems { stash?: string; data?: IItem[]; } @@ -156,17 +156,13 @@ export interface IUpdatableChatMember { Ignored: boolean; Banned: boolean; } -export interface DateTime { - date: string; - time: string; -} -export interface Spt { +export interface ISpt { /** What version of SPT was this profile made with */ version: string; /** What mods has this profile loaded at any point in time */ - mods?: ModDetails[]; + mods?: IModDetails[]; /** What gifts has this profile received and how many */ - receivedGifts?: ReceivedGift[]; + receivedGifts?: IReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; /** key: daily type */ @@ -174,23 +170,23 @@ export interface Spt { /** When was a profile migrated, value is timestamp */ migrations?: Record; } -export interface ModDetails { +export interface IModDetails { name: string; version: string; author: string; dateAdded: number; url: string; } -export interface ReceivedGift { +export interface IReceivedGift { giftId: string; timestampLastAccepted: number; current: number; } -export interface Vitality { - health: Health; - effects: Effects; +export interface IVitality { + health: IHealth; + effects: IEffects; } -export interface Health { +export interface IHealth { Hydration: number; Energy: number; Temperature: number; @@ -202,35 +198,35 @@ export interface Health { LeftLeg: number; RightLeg: number; } -export interface Effects { - Head: Head; - Chest: Chest; - Stomach: Stomach; - LeftArm: LeftArm; - RightArm: RightArm; - LeftLeg: LeftLeg; - RightLeg: RightLeg; -} -export type Head = {}; -export type Chest = {}; -export type Stomach = {}; -export interface LeftArm { +export interface IEffects { + Head: IHead; + Chest: IChest; + Stomach: IStomach; + LeftArm: ILeftArm; + RightArm: IRightArm; + LeftLeg: ILeftLeg; + RightLeg: IRightLeg; +} +export type IHead = {}; +export type IChest = {}; +export type IStomach = {}; +export interface ILeftArm { Fracture?: number; } -export interface RightArm { +export interface IRightArm { Fracture?: number; } -export interface LeftLeg { +export interface ILeftLeg { Fracture?: number; } -export interface RightLeg { +export interface IRightLeg { Fracture?: number; } -export interface Inraid { +export interface IInraid { location: string; character: string; } -export interface Insurance { +export interface IInsurance { scheduledTime: number; traderId: string; maxStorageTime: number; @@ -239,7 +235,7 @@ export interface Insurance { messageTemplateId: string; items: IItem[]; } -export interface MessageContentRagfair { +export interface IMessageContentRagfair { offerId: string; count: number; handbookId: string; diff --git a/types/models/eft/ragfair/IAddOfferRequestData.d.ts b/types/models/eft/ragfair/IAddOfferRequestData.d.ts index 465ee029..b87040a7 100644 --- a/types/models/eft/ragfair/IAddOfferRequestData.d.ts +++ b/types/models/eft/ragfair/IAddOfferRequestData.d.ts @@ -2,9 +2,9 @@ export interface IAddOfferRequestData { Action: string; sellInOnePiece: boolean; items: string[]; - requirements: Requirement[]; + requirements: IRequirement[]; } -export interface Requirement { +export interface IRequirement { _tpl: string; count: number; level: number; diff --git a/types/models/eft/ragfair/IRagfairOffer.d.ts b/types/models/eft/ragfair/IRagfairOffer.d.ts index b6b1ed88..77c56056 100644 --- a/types/models/eft/ragfair/IRagfairOffer.d.ts +++ b/types/models/eft/ragfair/IRagfairOffer.d.ts @@ -5,7 +5,7 @@ export interface IRagfairOffer { sellResult?: ISellResult[]; _id: string; items: IItem[]; - requirements: OfferRequirement[]; + requirements: IOfferRequirement[]; root: string; intId: number; /** Handbook price */ @@ -14,6 +14,7 @@ export interface IRagfairOffer { requirementsCost: number; startTime: number; endTime: number; + /** True when offer is sold as pack */ sellInOnePiece: boolean; /** Rouble price - same as requirementsCost */ summaryCost: number; @@ -25,7 +26,7 @@ export interface IRagfairOffer { buyRestrictionCurrent?: number; locked?: boolean; } -export interface OfferRequirement { +export interface IOfferRequirement { _tpl: string; count: number; onlyFunctional: boolean; diff --git a/types/models/eft/repair/IRepairActionDataRequest.d.ts b/types/models/eft/repair/IRepairActionDataRequest.d.ts index d51c1b9c..58773dff 100644 --- a/types/models/eft/repair/IRepairActionDataRequest.d.ts +++ b/types/models/eft/repair/IRepairActionDataRequest.d.ts @@ -1,10 +1,10 @@ import { IBaseRepairActionDataRequest } from "@spt/models/eft/repair/IBaseRepairActionDataRequest"; export interface IRepairActionDataRequest extends IBaseRepairActionDataRequest { Action: "Repair"; - repairKitsInfo: RepairKitsInfo[]; + repairKitsInfo: IRepairKitsInfo[]; target: string; } -export interface RepairKitsInfo { +export interface IRepairKitsInfo { _id: string; count: number; } diff --git a/types/models/eft/repair/ITraderRepairActionDataRequest.d.ts b/types/models/eft/repair/ITraderRepairActionDataRequest.d.ts index 50f308e1..c55a1d92 100644 --- a/types/models/eft/repair/ITraderRepairActionDataRequest.d.ts +++ b/types/models/eft/repair/ITraderRepairActionDataRequest.d.ts @@ -2,9 +2,9 @@ import { IBaseRepairActionDataRequest } from "@spt/models/eft/repair/IBaseRepair export interface ITraderRepairActionDataRequest extends IBaseRepairActionDataRequest { Action: "TraderRepair"; tid: string; - repairItems: RepairItem[]; + repairItems: IRepairItem[]; } -export interface RepairItem { +export interface IRepairItem { _id: string; count: number; } diff --git a/types/models/eft/weather/IWeatherData.d.ts b/types/models/eft/weather/IWeatherData.d.ts index 771e7009..2246b86e 100644 --- a/types/models/eft/weather/IWeatherData.d.ts +++ b/types/models/eft/weather/IWeatherData.d.ts @@ -22,4 +22,5 @@ export interface IWeather { time: string; date: string; timestamp: number; + sptInRaidTimestamp: number; } diff --git a/types/models/eft/ws/IWsChatMessageReceived.d.ts b/types/models/eft/ws/IWsChatMessageReceived.d.ts index 302d8f19..cc73cf3c 100644 --- a/types/models/eft/ws/IWsChatMessageReceived.d.ts +++ b/types/models/eft/ws/IWsChatMessageReceived.d.ts @@ -1,8 +1,8 @@ import { IGroupCharacter } from "@spt/models/eft/match/IGroupCharacter"; -import { Message } from "@spt/models/eft/profile/ISptProfile"; +import { IMessage } from "@spt/models/eft/profile/ISptProfile"; import { IWsNotificationEvent } from "@spt/models/eft/ws/IWsNotificationEvent"; export interface IWsChatMessageReceived extends IWsNotificationEvent { dialogId: string; - message: Message; + message: IMessage; profiles?: IGroupCharacter[]; } diff --git a/types/models/enums/AirdropType.d.ts b/types/models/enums/AirdropType.d.ts index 98c13cfa..103c204b 100644 --- a/types/models/enums/AirdropType.d.ts +++ b/types/models/enums/AirdropType.d.ts @@ -1,4 +1,10 @@ export declare enum AirdropTypeEnum { + COMMON = "Common", + SUPPLY = "Supply", + MEDICAL = "Medical", + WEAPON_ARMOR = "Weapon" +} +export declare enum SptAirdropTypeEnum { COMMON = "mixed", SUPPLY = "barter", FOOD_MEDICAL = "foodMedical", diff --git a/types/models/enums/hideout/QteEffectType.d.ts b/types/models/enums/hideout/QteEffectType.d.ts index 9ecd1a2e..08aa9c6a 100644 --- a/types/models/enums/hideout/QteEffectType.d.ts +++ b/types/models/enums/hideout/QteEffectType.d.ts @@ -1,5 +1,5 @@ export declare enum QteEffectType { - FINISH_EFFECT = "FinishEffect", - SINGLE_SUCCESS_EFFECT = "SingleSuccessEffect", - SINGLE_FAIL_EFFECT = "SingleFailEffect" + FINISH_EFFECT = "finishEffect", + SINGLE_SUCCESS_EFFECT = "singleSuccessEffect", + SINGLE_FAIL_EFFECT = "singleFailEffect" } diff --git a/types/models/spt/bots/BotGenerationDetails.d.ts b/types/models/spt/bots/BotGenerationDetails.d.ts index 3977ee57..81acc7df 100644 --- a/types/models/spt/bots/BotGenerationDetails.d.ts +++ b/types/models/spt/bots/BotGenerationDetails.d.ts @@ -1,5 +1,5 @@ import { MinMax } from "@spt/models/common/MinMax"; -export interface BotGenerationDetails { +export interface IBotGenerationDetails { /** Should the bot be generated as a PMC */ isPmc: boolean; /** assault/pmcBot etc */ diff --git a/types/models/spt/bots/GenerateWeaponResult.d.ts b/types/models/spt/bots/GenerateWeaponResult.d.ts index 73209ac8..d4a25267 100644 --- a/types/models/spt/bots/GenerateWeaponResult.d.ts +++ b/types/models/spt/bots/GenerateWeaponResult.d.ts @@ -1,10 +1,10 @@ -import { IMods } from "@spt/models/eft/common/tables/IBotType"; -import { IItem } from "@spt/models/eft/common/tables/IItem"; +import { Mods } from "@spt/models/eft/common/tables/IBotType"; +import { Item } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; export declare class GenerateWeaponResult { - weapon: IItem[]; + weapon: Item[]; chosenAmmoTpl: string; chosenUbglAmmoTpl: string; - weaponMods: IMods; + weaponMods: Mods; weaponTemplate: ITemplateItem; } diff --git a/types/models/spt/bots/IGenerateEquipmentProperties.d.ts b/types/models/spt/bots/IGenerateEquipmentProperties.d.ts index 5381cdfc..e19a9e07 100644 --- a/types/models/spt/bots/IGenerateEquipmentProperties.d.ts +++ b/types/models/spt/bots/IGenerateEquipmentProperties.d.ts @@ -1,6 +1,7 @@ import { IInventory as PmcInventory } from "@spt/models/eft/common/tables/IBotBase"; import { IChances, IMods } from "@spt/models/eft/common/tables/IBotType"; -import { EquipmentFilters, RandomisationDetails } from "@spt/models/spt/config/IBotConfig"; +import { EquipmentFilters, IRandomisationDetails } from "@spt/models/spt/config/IBotConfig"; +import { IBotData } from "./IGenerateWeaponRequest"; export interface IGenerateEquipmentProperties { /** Root Slot being generated */ rootEquipmentSlot: string; @@ -9,14 +10,13 @@ export interface IGenerateEquipmentProperties { modPool: IMods; /** Dictionary of mod items and their chance to spawn for this bot type */ spawnChances: IChances; - /** Role being generated for */ - botRole: string; - /** Level of bot being generated */ - botLevel: number; + /** Bot-specific properties */ + botData: IBotData; inventory: PmcInventory; botEquipmentConfig: EquipmentFilters; /** Settings from bot.json to adjust how item is generated */ - randomisationDetails: RandomisationDetails; + randomisationDetails: IRandomisationDetails; /** OPTIONAL - Do not generate mods for tpls in this array */ generateModsBlacklist?: string[]; + generatingPlayerLevel: number; } diff --git a/types/models/spt/bots/IGenerateWeaponResult.d.ts b/types/models/spt/bots/IGenerateWeaponResult.d.ts new file mode 100644 index 00000000..8e1e318e --- /dev/null +++ b/types/models/spt/bots/IGenerateWeaponResult.d.ts @@ -0,0 +1,10 @@ +import { IMods } from "@spt/models/eft/common/tables/IBotType"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +export interface IGenerateWeaponResult { + weapon: IItem[]; + chosenAmmoTpl: string; + chosenUbglAmmoTpl: string; + weaponMods: IMods; + weaponTemplate: ITemplateItem; +} diff --git a/types/models/spt/bots/IModToSpawnRequest.d.ts b/types/models/spt/bots/IModToSpawnRequest.d.ts index d92eea63..b34bda8a 100644 --- a/types/models/spt/bots/IModToSpawnRequest.d.ts +++ b/types/models/spt/bots/IModToSpawnRequest.d.ts @@ -2,7 +2,7 @@ import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ModSpawn } from "@spt/models/enums/ModSpawn"; import { IBotData, IWeaponStats } from "@spt/models/spt/bots/IGenerateWeaponRequest"; -import { EquipmentFilterDetails } from "@spt/models/spt/config/IBotConfig"; +import { IEquipmentFilterDetails } from "@spt/models/spt/config/IBotConfig"; export interface IModToSpawnRequest { /** Slot mod will fit into */ modSlot: string; @@ -11,7 +11,7 @@ export interface IModToSpawnRequest { /** Parent slot the item will be a part of */ botWeaponSightWhitelist: Record; /** Blacklist to prevent mods from being picked */ - botEquipBlacklist: EquipmentFilterDetails; + botEquipBlacklist: IEquipmentFilterDetails; /** Pool of items to pick from */ itemModPool: Record; /** Array with only weapon tpl in it, ready for mods to be added */ diff --git a/types/models/spt/callbacks/IDialogueCallbacks.d.ts b/types/models/spt/callbacks/IDialogueCallbacks.d.ts index b30c042f..2ff36dca 100644 --- a/types/models/spt/callbacks/IDialogueCallbacks.d.ts +++ b/types/models/spt/callbacks/IDialogueCallbacks.d.ts @@ -14,11 +14,11 @@ import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest" import { ISetDialogReadRequestData } from "@spt/models/eft/dialog/ISetDialogReadRequestData"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; -import { DialogueInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IDialogueInfo } from "@spt/models/eft/profile/ISptProfile"; export interface IDialogueCallbacks { getFriendList(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getChatServerList(url: string, info: IGetChatServerListRequestData, sessionID: string): IGetBodyResponseData; - getMailDialogList(url: string, info: IGetMailDialogListRequestData, sessionID: string): IGetBodyResponseData; + getMailDialogList(url: string, info: IGetMailDialogListRequestData, sessionID: string): IGetBodyResponseData; getMailDialogView(url: string, info: IGetMailDialogViewRequestData, sessionID: string): IGetBodyResponseData; getMailDialogInfo(url: string, info: IGetMailDialogInfoRequestData, sessionID: string): IGetBodyResponseData; removeDialog(url: string, info: IRemoveDialogRequestData, sessionID: string): IGetBodyResponseData; diff --git a/types/models/spt/config/IAirdropConfig.d.ts b/types/models/spt/config/IAirdropConfig.d.ts index c1b04c70..ceca3cc6 100644 --- a/types/models/spt/config/IAirdropConfig.d.ts +++ b/types/models/spt/config/IAirdropConfig.d.ts @@ -1,12 +1,12 @@ import { MinMax } from "@spt/models/common/MinMax"; -import { AirdropTypeEnum } from "@spt/models/enums/AirdropType"; +import { AirdropTypeEnum, SptAirdropTypeEnum } from "@spt/models/enums/AirdropType"; import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IAirdropConfig extends IBaseConfig { kind: "spt-airdrop"; - airdropTypeWeightings: Record; + airdropTypeWeightings: Record; /** What rewards will the loot crate contain, keyed by drop type e.g. mixed/weaponArmor/foodMedical/barter */ loot: Record; - customAirdropMapping: Record; + customAirdropMapping: Record; } /** Chance map will have an airdrop occur out of 100 - locations not included count as 0% */ export interface IAirdropChancePercent { diff --git a/types/models/spt/config/IBotConfig.d.ts b/types/models/spt/config/IBotConfig.d.ts index 2c2d822a..51a82b32 100644 --- a/types/models/spt/config/IBotConfig.d.ts +++ b/types/models/spt/config/IBotConfig.d.ts @@ -5,7 +5,7 @@ import { IBotDurability } from "@spt/models/spt/config/IBotDurability"; export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ - presetBatch: PresetBatch; + presetBatch: IPresetBatch; /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ @@ -44,6 +44,10 @@ export interface IBotConfig extends IBaseConfig { /** What bottypes should be excluded from having loot generated on them (backpack/pocket/vest) does not disable food/drink/special/ */ disableLootOnBotTypes: string[]; assaultToBossConversion: IAssaultToBossConversion; + /** Max length a bots name can be */ + botNameLengthLimit: number; + /** Bot roles that must have a unique name when generated vs other bots in raid */ + botRolesThatMustHaveUniqueName: string[]; } export interface IAssaultToBossConversion { bossConvertEnabled: boolean; @@ -51,7 +55,7 @@ export interface IAssaultToBossConversion { bossConvertMinMax: Record; } /** Number of bots to generate and store in cache on raid start per bot type */ -export interface PresetBatch { +export interface IPresetBatch { assault: number; bossBully: number; bossGluhar: number; @@ -100,7 +104,7 @@ export interface IWalletLootSettings { } export interface EquipmentFilters { /** Limits for mod types per weapon .e.g. scopes */ - weaponModLimits: ModLimits; + weaponModLimits: IModLimits; /** Whitelist for weapon sight types allowed per gun */ weaponSightWhitelist: Record; /** Chance face shield is down/active */ @@ -121,27 +125,27 @@ export interface EquipmentFilters { /** What additional slot ids should be seen as required when choosing a mod to add to a weapon */ weaponSlotIdsToMakeRequired?: string[]; /** Adjust weighting/chances of items on bot by level of bot */ - randomisation: RandomisationDetails[]; + randomisation: IRandomisationDetails[]; /** Blacklist equipment by level of bot */ - blacklist: EquipmentFilterDetails[]; + blacklist: IEquipmentFilterDetails[]; /** Whitelist equipment by level of bot */ - whitelist: EquipmentFilterDetails[]; + whitelist: IEquipmentFilterDetails[]; /** Adjust equipment/ammo */ - weightingAdjustmentsByBotLevel: WeightingAdjustmentDetails[]; + weightingAdjustmentsByBotLevel: IWeightingAdjustmentDetails[]; /** Same as weightingAdjustments but based on player level instead of bot level */ - weightingAdjustmentsByPlayerLevel?: WeightingAdjustmentDetails[]; + weightingAdjustmentsByPlayerLevel?: IWeightingAdjustmentDetails[]; /** Should the stock mod be forced to spawn on bot */ forceStock?: boolean; armorPlateWeighting?: IArmorPlateWeights[]; forceRigWhenNoVest?: boolean; } -export interface ModLimits { +export interface IModLimits { /** How many scopes are allowed on a weapon - hard coded to work with OPTIC_SCOPE, ASSAULT_SCOPE, COLLIMATOR, COMPACT_COLLIMATOR */ scopeLimit?: number; /** How many lasers or lights are allowed on a weapon - hard coded to work with TACTICAL_COMBO, and FLASHLIGHT */ lightLaserLimit?: number; } -export interface RandomisationDetails { +export interface IRandomisationDetails { /** Between what levels do these randomisation setting apply to */ levelRange: MinMax; generation?: Record; @@ -161,7 +165,7 @@ export interface INighttimeChanges { /** Applies changes to values stored in equipmentMods */ equipmentModsModifiers: Record; } -export interface EquipmentFilterDetails { +export interface IEquipmentFilterDetails { /** Between what levels do these equipment filter setting apply to */ levelRange: MinMax; /** Key: mod slot name e.g. mod_magazine, value: item tpls */ @@ -169,7 +173,7 @@ export interface EquipmentFilterDetails { /** Key: cartridge type e.g. Caliber23x75, value: item tpls */ cartridge: Record; } -export interface WeightingAdjustmentDetails { +export interface IWeightingAdjustmentDetails { /** Between what levels do these weight settings apply to */ levelRange: MinMax; /** Key: ammo type e.g. Caliber556x45NATO, value: item tpl + weight */ diff --git a/types/models/spt/config/IBotDurability.d.ts b/types/models/spt/config/IBotDurability.d.ts index 8dc9d028..b7103e18 100644 --- a/types/models/spt/config/IBotDurability.d.ts +++ b/types/models/spt/config/IBotDurability.d.ts @@ -1,6 +1,6 @@ export interface IBotDurability { default: IDefaultDurability; - pmc: PmcDurability; + pmc: IPmcDurability; boss: IBotDurability; follower: IBotDurability; assault: IBotDurability; @@ -20,7 +20,7 @@ export interface IDefaultDurability { armor: IArmorDurability; weapon: IWeaponDurability; } -export interface PmcDurability { +export interface IPmcDurability { armor: IPmcDurabilityArmor; weapon: IWeaponDurability; } diff --git a/types/models/spt/config/IHealthConfig.d.ts b/types/models/spt/config/IHealthConfig.d.ts index b86c208c..f7521ca5 100644 --- a/types/models/spt/config/IHealthConfig.d.ts +++ b/types/models/spt/config/IHealthConfig.d.ts @@ -1,14 +1,14 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IHealthConfig extends IBaseConfig { kind: "spt-health"; - healthMultipliers: HealthMultipliers; - save: Save; + healthMultipliers: IHealthMultipliers; + save: ISave; } -export interface HealthMultipliers { +export interface IHealthMultipliers { death: number; blacked: number; } -export interface Save { +export interface ISave { health: boolean; effects: boolean; } diff --git a/types/models/spt/config/IHideoutConfig.d.ts b/types/models/spt/config/IHideoutConfig.d.ts index ec0c181b..52577772 100644 --- a/types/models/spt/config/IHideoutConfig.d.ts +++ b/types/models/spt/config/IHideoutConfig.d.ts @@ -18,11 +18,11 @@ export interface ICultistCircleSettings { maxRewardItemCount: number; maxAttemptsToPickRewardsWithinBudget: number; rewardPriceMultiplerMinMax: MinMax; - craftTimeThreshholds: CraftTimeThreshhold[]; + craftTimeThreshholds: ICraftTimeThreshhold[]; /** -1 means no override */ craftTimeOverride: number; /** Specific reward pool when player sacrificed one specific item */ - directRewards: Record; + directRewards: Record; directRewardStackSize: Record; /** Item tpls to exclude from the reward pool */ rewardItemBlacklist: string[]; @@ -30,10 +30,10 @@ export interface ICultistCircleSettings { additionalRewardItemPool: string[]; currencyRewards: Record; } -export interface CraftTimeThreshhold extends MinMax { +export interface ICraftTimeThreshhold extends MinMax { craftTimeSeconds: number; } -export interface DirectRewardSettings { +export interface IDirectRewardSettings { rewardTpls: string[]; craftTimeSeconds: number; } diff --git a/types/models/spt/config/IInRaidConfig.d.ts b/types/models/spt/config/IInRaidConfig.d.ts index d5fe8f67..d70f6380 100644 --- a/types/models/spt/config/IInRaidConfig.d.ts +++ b/types/models/spt/config/IInRaidConfig.d.ts @@ -2,9 +2,9 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IInRaidConfig extends IBaseConfig { kind: "spt-inraid"; /** Overrides to apply to the pre-raid settings screen */ - raidMenuSettings: RaidMenuSettings; + raidMenuSettings: IRaidMenuSettings; /** What effects should be saved post-raid */ - save: Save; + save: ISave; /** Names of car extracts */ carExtracts: string[]; /** Names of coop extracts */ @@ -14,7 +14,7 @@ export interface IInRaidConfig extends IBaseConfig { /** Fence rep gain from a single coop extract */ coopExtractBaseStandingGain: number; /** Fence rep gain when successfully extracting as pscav */ - scavExtractGain: number; + scavExtractStandingGain: number; /** The likelihood of PMC eliminating a minimum of 2 scavs while you engage them as a pscav. */ pmcKillProbabilityForScavGain: number; /** On death should items in your secure keep their Find in raid status regardless of how you finished the raid */ @@ -24,7 +24,7 @@ export interface IInRaidConfig extends IBaseConfig { /** Percentage chance a player scav hot is hostile to the player when scavving */ playerScavHostileChancePercent: number; } -export interface RaidMenuSettings { +export interface IRaidMenuSettings { aiAmount: string; aiDifficulty: string; bossEnabled: boolean; @@ -34,7 +34,7 @@ export interface RaidMenuSettings { randomWeather: boolean; randomTime: boolean; } -export interface Save { +export interface ISave { /** Should loot gained from raid be saved */ loot: boolean; } diff --git a/types/models/spt/config/IInventoryConfig.d.ts b/types/models/spt/config/IInventoryConfig.d.ts index 3a2de2a8..af0ec79c 100644 --- a/types/models/spt/config/IInventoryConfig.d.ts +++ b/types/models/spt/config/IInventoryConfig.d.ts @@ -4,14 +4,14 @@ export interface IInventoryConfig extends IBaseConfig { kind: "spt-inventory"; /** Should new items purchased by flagged as found in raid */ newItemsMarkedFound: boolean; - randomLootContainers: Record; + randomLootContainers: Record; sealedAirdropContainer: ISealedAirdropContainerSettings; /** Contains item tpls that the server should consider money and treat the same as roubles/euros/dollars */ customMoneyTpls: string[]; /** Multipliers for skill gain when inside menus, NOT in-game */ skillGainMultiplers: Record; } -export interface RewardDetails { +export interface IRewardDetails { rewardCount: number; foundInRaid: boolean; rewardTplPool?: Record; diff --git a/types/models/spt/config/IPlayerScavConfig.d.ts b/types/models/spt/config/IPlayerScavConfig.d.ts index 9c1046fe..f684f45c 100644 --- a/types/models/spt/config/IPlayerScavConfig.d.ts +++ b/types/models/spt/config/IPlayerScavConfig.d.ts @@ -2,16 +2,16 @@ import { IGenerationData } from "@spt/models/eft/common/tables/IBotType"; import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IPlayerScavConfig extends IBaseConfig { kind: "spt-playerscav"; - karmaLevel: Record; + karmaLevel: Record; } -export interface KarmaLevel { +export interface IKarmaLevel { botTypeForLoot: string; - modifiers: Modifiers; + modifiers: IModifiers; itemLimits: ItemLimits; equipmentBlacklist: Record; lootItemsToAddChancePercent: Record; } -export interface Modifiers { +export interface IModifiers { equipment: Record; mod: Record; } diff --git a/types/models/spt/config/IPmcConfig.d.ts b/types/models/spt/config/IPmcConfig.d.ts index 8fd2e5fb..2e682190 100644 --- a/types/models/spt/config/IPmcConfig.d.ts +++ b/types/models/spt/config/IPmcConfig.d.ts @@ -9,11 +9,11 @@ export interface IPmcConfig extends IBaseConfig { /** What account type should the PMC have */ accountTypeWeight: Record; /** Global whitelist/blacklist of vest loot for PMCs */ - vestLoot: SlotLootSettings; + vestLoot: ISlotLootSettings; /** Global whitelist/blacklist of pocket loot for PMCs */ - pocketLoot: SlotLootSettings; + pocketLoot: ISlotLootSettings; /** Global whitelist/blacklist of backpack loot for PMCs */ - backpackLoot: SlotLootSettings; + backpackLoot: ISlotLootSettings; /** Use difficulty defined in config/bot.json/difficulty instead of chosen difficulty dropdown value */ useDifficultyOverride: boolean; /** Difficulty override e.g. "AsOnline/Hard" */ @@ -32,7 +32,7 @@ export interface IPmcConfig extends IBaseConfig { bearType: string; /** What 'brain' does a PMC use, keyed by map and side (USEC/BEAR) key: map location, value: type for usec/bear */ pmcType: Record>>; - maxBackpackLootTotalRub: MinMaxLootValue[]; + maxBackpackLootTotalRub: IMinMaxLootValue[]; maxPocketLootTotalRub: number; maxVestLootTotalRub: number; /** Percentage chance a bot from a wave is converted into a PMC, first key = map, second key = bot wildspawn type (assault/exusec), value: min+max chance to be converted */ @@ -61,14 +61,14 @@ export interface IHostilitySettings { additionalFriendlyTypes?: string[]; savagePlayerBehaviour?: string; } -export interface PmcTypes { +export interface IPmcTypes { usec: string; bear: string; } -export interface SlotLootSettings { +export interface ISlotLootSettings { whitelist: string[]; blacklist: string[]; } -export interface MinMaxLootValue extends MinMax { +export interface IMinMaxLootValue extends MinMax { value: number; } diff --git a/types/models/spt/config/IRagfairConfig.d.ts b/types/models/spt/config/IRagfairConfig.d.ts index 6c77bb55..9b178615 100644 --- a/types/models/spt/config/IRagfairConfig.d.ts +++ b/types/models/spt/config/IRagfairConfig.d.ts @@ -7,13 +7,13 @@ export interface IRagfairConfig extends IBaseConfig { /** Default values used to hydrate `runIntervalSeconds` with */ runIntervalValues: IRunIntervalValues; /** Player listing settings */ - sell: Sell; + sell: ISell; /** Trader ids + should their assorts be listed on flea */ traders: Record; - dynamic: Dynamic; + dynamic: IDynamic; tieredFlea: ITieredFlea; } -export interface Sell { +export interface ISell { /** Should a fee be deducted from player when liting an item for sale */ fees: boolean; /** Settings to control chances of offer being sold */ @@ -33,7 +33,7 @@ export interface Chance { /** Min possible sell chance % for a player listed offer */ minSellChancePercent: number; } -export interface Dynamic { +export interface IDynamic { purchasesAreFoundInRaid: boolean; /** Use the highest trader price for an offer if its greater than the price in templates/prices.json */ useTraderPriceForOffersIfHigher: boolean; @@ -41,7 +41,7 @@ export interface Dynamic { barter: IBarterDetails; pack: IPackDetails; /** Dynamic offer price below handbook adjustment values */ - offerAdjustment: OfferAdjustment; + offerAdjustment: IOfferAdjustment; /** How many offers should expire before an offer regeneration occurs */ expiredOfferThreshold: number; /** How many offers should be listed */ @@ -70,7 +70,7 @@ export interface Dynamic { /** Should christmas/halloween items be removed from flea when not within the seasonal bounds */ removeSeasonalItemsWhenNotInEvent: boolean; /** Flea blacklist settings */ - blacklist: Blacklist; + blacklist: IRagfairBlacklist; /** Dict of price limits keyed by item type */ unreasonableModPrices: Record; } @@ -103,7 +103,7 @@ export interface IPackDetails { /** item types to allow being a pack */ itemTypeWhitelist: string[]; } -export interface OfferAdjustment { +export interface IOfferAdjustment { /** Shuld offer price be adjusted when below handbook price */ adjustPriceWhenBelowHandbookPrice: boolean; /** How big a percentage difference does price need to vary from handbook to be considered for adjustment */ @@ -119,7 +119,7 @@ export interface Condition { current: MinMax; max: MinMax; } -export interface Blacklist { +export interface IRagfairBlacklist { /** Damaged ammo packs */ damagedAmmoPacks: boolean; /** Custom blacklist for item Tpls */ diff --git a/types/models/spt/config/IRepairConfig.d.ts b/types/models/spt/config/IRepairConfig.d.ts index 12a87fa0..eca8e6c0 100644 --- a/types/models/spt/config/IRepairConfig.d.ts +++ b/types/models/spt/config/IRepairConfig.d.ts @@ -10,7 +10,7 @@ export interface IRepairConfig extends IBaseConfig { repairKitIntellectGainMultiplier: IIntellectGainValues; maxIntellectGainPerRepair: IMaxIntellectGainValues; weaponTreatment: IWeaponTreatmentRepairValues; - repairKit: RepairKit; + repairKit: IRepairKit; } export interface IIntellectGainValues { weapon: number; @@ -30,17 +30,17 @@ export interface IWeaponTreatmentRepairValues { /** The multiplier used for calculating weapon maintenance XP */ pointGainMultiplier: number; } -export interface RepairKit { - armor: BonusSettings; - weapon: BonusSettings; +export interface IRepairKit { + armor: IBonusSettings; + weapon: IBonusSettings; } -export interface BonusSettings { +export interface IBonusSettings { rarityWeight: Record; bonusTypeWeight: Record; - common: Record; - rare: Record; + common: Record; + rare: Record; } -export interface BonusValues { +export interface IBonusValues { valuesMinMax: MinMax; /** What dura is buff active between (min max of current max) */ activeDurabilityPercentMinMax: MinMax; diff --git a/types/models/spt/config/ITraderConfig.d.ts b/types/models/spt/config/ITraderConfig.d.ts index 43882027..31a213bc 100644 --- a/types/models/spt/config/ITraderConfig.d.ts +++ b/types/models/spt/config/ITraderConfig.d.ts @@ -1,24 +1,24 @@ import { MinMax } from "@spt/models/common/MinMax"; import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; -import { LootRequest } from "@spt/models/spt/services/LootRequest"; +import { ILootRequest } from "@spt/models/spt/services/ILootRequest"; export interface ITraderConfig extends IBaseConfig { kind: "spt-trader"; - updateTime: UpdateTime[]; + updateTime: IUpdateTime[]; purchasesAreFoundInRaid: boolean; /** Should trader reset times be set based on server start time (false = bsg time - on the hour) */ tradersResetFromServerStart: boolean; updateTimeDefault: number; traderPriceMultipler: number; - fence: FenceConfig; - moddedTraders: ModdedTraders; + fence: IFenceConfig; + moddedTraders: IModdedTraders; } -export interface UpdateTime { +export interface IUpdateTime { traderId: string; /** Seconds between trader resets */ seconds: MinMax; } -export interface FenceConfig { - discountOptions: DiscountOptions; +export interface IFenceConfig { + discountOptions: IDiscountOptions; partialRefreshTimeSeconds: number; partialRefreshChangePercent: number; assortSize: number; @@ -45,19 +45,19 @@ export interface FenceConfig { /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ ammoMaxPenLimit: number; blacklist: string[]; - coopExtractGift: CoopExtractReward; + coopExtractGift: ICoopExtractReward; btrDeliveryExpireHours: number; } export interface IItemDurabilityCurrentMax { current: MinMax; max: MinMax; } -export interface CoopExtractReward extends LootRequest { +export interface ICoopExtractReward extends ILootRequest { sendGift: boolean; messageLocaleIds: string[]; giftExpiryHours: number; } -export interface DiscountOptions { +export interface IDiscountOptions { assortSize: number; itemPriceMult: number; presetPriceMult: number; @@ -65,7 +65,7 @@ export interface DiscountOptions { equipmentPresetMinMax: MinMax; } /** Custom trader data needed client side for things such as the clothing service */ -export interface ModdedTraders { +export interface IModdedTraders { /** Trader Ids to enable the clothing service for */ clothingService: string[]; } diff --git a/types/models/spt/config/IWeatherConfig.d.ts b/types/models/spt/config/IWeatherConfig.d.ts index 970ade54..012f26c6 100644 --- a/types/models/spt/config/IWeatherConfig.d.ts +++ b/types/models/spt/config/IWeatherConfig.d.ts @@ -5,7 +5,7 @@ import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface IWeatherConfig extends IBaseConfig { kind: "spt-weather"; acceleration: number; - weather: Weather; + weather: IWeatherValues; seasonDates: ISeasonDateTimes[]; overrideSeason?: Season; } @@ -17,7 +17,9 @@ export interface ISeasonDateTimes { endDay: number; endMonth: number; } -export interface Weather { +export interface IWeatherValues { + /** How many hours to generate weather data into the future */ + generateWeatherAmountHours: number; clouds: WeatherSettings; windSpeed: WeatherSettings; windDirection: WeatherSettings; @@ -25,8 +27,14 @@ export interface Weather { rain: WeatherSettings; rainIntensity: MinMax; fog: WeatherSettings; - temp: MinMax; + temp: Record; pressure: MinMax; + /** Length of each weather period */ + timePeriod: WeatherSettings; +} +export interface ITempDayNight { + day: MinMax; + night: MinMax; } export interface WeatherSettings { values: T[]; diff --git a/types/models/spt/dialog/ISendMessageDetails.d.ts b/types/models/spt/dialog/ISendMessageDetails.d.ts index c3c23db0..8cb11f2a 100644 --- a/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -1,5 +1,5 @@ import { IItem } from "@spt/models/eft/common/tables/IItem"; -import { ISystemData, IUserDialogInfo, MessageContentRagfair } from "@spt/models/eft/profile/ISptProfile"; +import { IMessageContentRagfair, ISystemData, IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; export interface ISendMessageDetails { @@ -24,7 +24,7 @@ export interface ISendMessageDetails { /** Optional - ragfair related */ systemData?: ISystemData; /** Optional - Used by ragfair messages */ - ragfairDetails?: MessageContentRagfair; + ragfairDetails?: IMessageContentRagfair; /** OPTIONAL - allows modification of profile settings via mail */ profileChangeEvents?: IProfileChangeEvent[]; } diff --git a/types/models/spt/hideout/ScavCaseRewardCountsAndPrices.d.ts b/types/models/spt/hideout/ScavCaseRewardCountsAndPrices.d.ts index ee1893d9..3b4174f8 100644 --- a/types/models/spt/hideout/ScavCaseRewardCountsAndPrices.d.ts +++ b/types/models/spt/hideout/ScavCaseRewardCountsAndPrices.d.ts @@ -1,9 +1,9 @@ -export interface ScavCaseRewardCountsAndPrices { - Common: RewardCountAndPriceDetails; - Rare: RewardCountAndPriceDetails; - Superrare: RewardCountAndPriceDetails; +export interface IScavCaseRewardCountsAndPrices { + Common: IRewardCountAndPriceDetails; + Rare: IRewardCountAndPriceDetails; + Superrare: IRewardCountAndPriceDetails; } -export interface RewardCountAndPriceDetails { +export interface IRewardCountAndPriceDetails { minCount: number; maxCount: number; minPriceRub: number; diff --git a/types/models/spt/mod/NewItemDetails.d.ts b/types/models/spt/mod/NewItemDetails.d.ts index 65996c1c..87de4295 100644 --- a/types/models/spt/mod/NewItemDetails.d.ts +++ b/types/models/spt/mod/NewItemDetails.d.ts @@ -1,4 +1,4 @@ -import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IProps, ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; export declare abstract class NewItemDetailsBase { /** Price of the item on flea market */ fleaPriceRoubles: number; @@ -16,7 +16,7 @@ export declare class NewItemFromCloneDetails extends NewItemDetailsBase { /** Id of the item to copy and use as a base */ itemTplToClone: string; /** Item properties that should be applied over the top of the cloned base */ - overrideProperties: Props; + overrideProperties: IProps; /** ParentId for the new item (item type) */ parentId: string; /** diff --git a/types/models/spt/ragfair/ITplWithFleaPrice.d.ts b/types/models/spt/ragfair/ITplWithFleaPrice.d.ts new file mode 100644 index 00000000..4b768365 --- /dev/null +++ b/types/models/spt/ragfair/ITplWithFleaPrice.d.ts @@ -0,0 +1,5 @@ +export interface ITplWithFleaPrice { + tpl: string; + /** Roubles */ + price: number; +} diff --git a/types/models/spt/server/ISettingsBase.d.ts b/types/models/spt/server/ISettingsBase.d.ts index 2bca633e..4e98dd5f 100644 --- a/types/models/spt/server/ISettingsBase.d.ts +++ b/types/models/spt/server/ISettingsBase.d.ts @@ -1,25 +1,25 @@ export interface ISettingsBase { - config: Config; + config: IConfig; } -export interface Config { +export interface IConfig { AFKTimeoutSeconds: number; AdditionalRandomDelaySeconds: number; ClientSendRateLimit: number; CriticalRetriesCount: number; DefaultRetriesCount: number; FirstCycleDelaySeconds: number; - FramerateLimit: FramerateLimit; + FramerateLimit: IFramerateLimit; GroupStatusInterval: number; GroupStatusButtonInterval: number; KeepAliveInterval: number; LobbyKeepAliveInterval: number; Mark502and504AsNonImportant: boolean; - MemoryManagementSettings: MemoryManagementSettings; + MemoryManagementSettings: IMemoryManagementSettings; NVidiaHighlights: boolean; NextCycleDelaySeconds: number; PingServerResultSendInterval: number; PingServersInterval: number; - ReleaseProfiler: ReleaseProfiler; + ReleaseProfiler: IReleaseProfiler; RequestConfirmationTimeouts: number[]; RequestsMadeThroughLobby: string[]; SecondCycleDelaySeconds: number; @@ -30,12 +30,12 @@ export interface Config { NetworkStateView: INetworkStateView; WsReconnectionDelays: string[]; } -export interface FramerateLimit { +export interface IFramerateLimit { MaxFramerateGameLimit: number; MaxFramerateLobbyLimit: number; MinFramerateLimit: number; } -export interface MemoryManagementSettings { +export interface IMemoryManagementSettings { AggressiveGC: boolean; GigabytesRequiredToDisableGCDuringRaid: number; HeapPreAllocationEnabled: boolean; @@ -43,7 +43,7 @@ export interface MemoryManagementSettings { OverrideRamCleanerSettings: boolean; RamCleanerEnabled: boolean; } -export interface ReleaseProfiler { +export interface IReleaseProfiler { Enabled: boolean; MaxRecords: number; RecordTriggerValue: number; diff --git a/types/models/spt/services/ILootRequest.d.ts b/types/models/spt/services/ILootRequest.d.ts new file mode 100644 index 00000000..22bff2f2 --- /dev/null +++ b/types/models/spt/services/ILootRequest.d.ts @@ -0,0 +1,33 @@ +import { MinMax } from "@spt/models/common/MinMax"; +import { AirdropTypeEnum } from "@spt/models/enums/AirdropType"; +export interface ILootRequest { + /** Count of weapons to generate */ + weaponPresetCount: MinMax; + /** Count of armor to generate */ + armorPresetCount: MinMax; + /** Count of items to generate */ + itemCount: MinMax; + /** Count of sealed weapon crates to generate */ + weaponCrateCount: MinMax; + /** Item tpl blacklist to exclude */ + itemBlacklist: string[]; + /** Item tpl whitelist to pick from */ + itemTypeWhitelist: string[]; + /** key: item base type: value: max count */ + itemLimits: Record; + itemStackLimits: Record; + /** Allowed armor plate levels 2/3/4/5/6 for armor generated */ + armorLevelWhitelist: number[]; + /** Should boss items be included in allowed items */ + allowBossItems: boolean; + /** Should item.json item reward blacklist be used */ + useRewardItemBlacklist?: boolean; + /** Should forced loot be used instead of randomised loot */ + useForcedLoot?: boolean; + /** Item tpls + count of items to force include */ + forcedLoot?: Record; +} +export interface IAirdropLootRequest extends ILootRequest { + /** Airdrop icon used by client to show crate type */ + icon?: AirdropTypeEnum; +} diff --git a/types/models/spt/services/LootItem.d.ts b/types/models/spt/services/LootItem.d.ts index acb7606d..2d2f2360 100644 --- a/types/models/spt/services/LootItem.d.ts +++ b/types/models/spt/services/LootItem.d.ts @@ -1,4 +1,4 @@ -export declare class LootItem { +export declare class ILootItem { id?: string; tpl: string; isPreset: boolean; diff --git a/types/models/spt/services/LootRequest.d.ts b/types/models/spt/services/LootRequest.d.ts index 7e1329a0..c52a8763 100644 --- a/types/models/spt/services/LootRequest.d.ts +++ b/types/models/spt/services/LootRequest.d.ts @@ -1,5 +1,4 @@ import { MinMax } from "@spt/models/common/MinMax"; -import { AirdropTypeEnum } from "@spt/models/enums/AirdropType"; export interface LootRequest { weaponPresetCount: MinMax; armorPresetCount: MinMax; @@ -13,9 +12,4 @@ export interface LootRequest { armorLevelWhitelist: number[]; allowBossItems: boolean; useRewarditemBlacklist?: boolean; - useForcedLoot?: boolean; - forcedLoot?: Record; -} -export interface IAirdropLootRequest extends LootRequest { - icon?: AirdropTypeEnum; } diff --git a/types/models/spt/utils/ILogger.d.ts b/types/models/spt/utils/ILogger.d.ts index 1b9726d4..32c4941a 100644 --- a/types/models/spt/utils/ILogger.d.ts +++ b/types/models/spt/utils/ILogger.d.ts @@ -1,8 +1,8 @@ -import { Daum } from "@spt/models/eft/itemEvent/IItemEventRouterRequest"; +import { IDaum } from "@spt/models/eft/itemEvent/IItemEventRouterRequest"; import { LogBackgroundColor } from "@spt/models/spt/logging/LogBackgroundColor"; import { LogTextColor } from "@spt/models/spt/logging/LogTextColor"; export interface ILogger { - writeToLogFile(data: string | Daum): void; + writeToLogFile(data: string | IDaum): void; log(data: string | Record | Error, color: string, backgroundColor?: string): void; logWithColor(data: string | Record, textColor: LogTextColor, backgroundColor?: LogBackgroundColor): void; error(data: string): void; diff --git a/types/routers/EventOutputHolder.d.ts b/types/routers/EventOutputHolder.d.ts index 614a75c2..88ffb5d0 100644 --- a/types/routers/EventOutputHolder.d.ts +++ b/types/routers/EventOutputHolder.d.ts @@ -1,7 +1,7 @@ import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IHideoutImprovement, IMoneyTransferLimits, IProductive, ITraderInfo } from "@spt/models/eft/common/tables/IBotBase"; -import { TraderData } from "@spt/models/eft/itemEvent/IItemEventRouterBase"; +import { ITraderData } from "@spt/models/eft/itemEvent/IItemEventRouterBase"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { TimeUtil } from "@spt/utils/TimeUtil"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -36,7 +36,7 @@ export declare class EventOutputHolder { * @param traderData server data for traders * @returns dict of trader id + TraderData */ - protected constructTraderRelations(traderData: Record): Record; + protected constructTraderRelations(traderData: Record): Record; /** * Return all hideout Improvements from player profile, adjust completed Improvements' completed property to be true * @param pmcData Player profile diff --git a/types/servers/http/SptHttpListener.d.ts b/types/servers/http/SptHttpListener.d.ts index 54499bf3..9311f820 100644 --- a/types/servers/http/SptHttpListener.d.ts +++ b/types/servers/http/SptHttpListener.d.ts @@ -19,14 +19,26 @@ export declare class SptHttpListener implements IHttpListener { canHandle(_: string, req: IncomingMessage): boolean; handle(sessionId: string, req: IncomingMessage, resp: ServerResponse): Promise; /** - * Send http response to the client - * @param sessionID Player id + * Send HTTP response back to sender + * @param sessionID Player id making request * @param req Incoming request * @param resp Outgoing response * @param body Buffer * @param output Server generated response data */ sendResponse(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: Buffer, output: string): void; + /** + * Is request flagged as debug enabled + * @param req Incoming request + * @returns True if request is flagged as debug + */ + protected isDebugRequest(req: IncomingMessage): boolean; + /** + * Log request if enabled + * @param req Incoming message request + * @param output Output string + */ + protected logRequest(req: IncomingMessage, output: string): void; getResponse(sessionID: string, req: IncomingMessage, body: Buffer): Promise; protected getBodyInfo(body: Buffer, requestUrl?: any): any; sendJson(resp: ServerResponse, output: string, sessionID: string): void; diff --git a/types/services/AirdropService.d.ts b/types/services/AirdropService.d.ts index 239d6b2b..02e6fad3 100644 --- a/types/services/AirdropService.d.ts +++ b/types/services/AirdropService.d.ts @@ -4,9 +4,9 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IGetAirdropLootRequest } from "@spt/models/eft/location/IGetAirdropLootRequest"; import { IGetAirdropLootResponse } from "@spt/models/eft/location/IGetAirdropLootResponse"; -import { AirdropTypeEnum } from "@spt/models/enums/AirdropType"; +import { AirdropTypeEnum, SptAirdropTypeEnum } from "@spt/models/enums/AirdropType"; import { IAirdropConfig } from "@spt/models/spt/config/IAirdropConfig"; -import { IAirdropLootRequest } from "@spt/models/spt/services/LootRequest"; +import { IAirdropLootRequest } from "@spt/models/spt/services/ILootRequest"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -32,6 +32,7 @@ export declare class AirdropService { * Handle client/location/getAirdropLoot * Get loot for an airdrop container * Generates it randomly based on config/airdrop.json values + * @param forcedAirdropType OPTIONAL - Desired airdrop type, randomised when not provided * @returns Array of LootItem objects */ generateAirdropLoot(forcedAirdropType?: any): IGetAirdropLootResponse; @@ -40,12 +41,12 @@ export declare class AirdropService { * @param airdropType What tpye of container: weapon/common etc * @returns Item */ - protected getAirdropCrateItem(airdropType: AirdropTypeEnum): IItem; + protected getAirdropCrateItem(airdropType: SptAirdropTypeEnum): IItem; /** * Randomly pick a type of airdrop loot using weighted values from config * @returns airdrop type value */ - protected chooseAirdropType(): AirdropTypeEnum; + protected chooseAirdropType(): SptAirdropTypeEnum; /** * Get the configuration for a specific type of airdrop * @param airdropType Type of airdrop to get settings for diff --git a/types/services/BotEquipmentFilterService.d.ts b/types/services/BotEquipmentFilterService.d.ts index 7d51b1e8..10b8af6b 100644 --- a/types/services/BotEquipmentFilterService.d.ts +++ b/types/services/BotEquipmentFilterService.d.ts @@ -1,8 +1,8 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { EquipmentChances, IBotType, IGeneration, IGenerationData, IModsChances } from "@spt/models/eft/common/tables/IBotType"; -import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; -import { EquipmentFilterDetails, EquipmentFilters, IAdjustmentDetails, IBotConfig, WeightingAdjustmentDetails } from "@spt/models/spt/config/IBotConfig"; +import { IBotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; +import { EquipmentFilters, IAdjustmentDetails, IBotConfig, IEquipmentFilterDetails, IWeightingAdjustmentDetails } from "@spt/models/spt/config/IBotConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; export declare class BotEquipmentFilterService { @@ -20,7 +20,7 @@ export declare class BotEquipmentFilterService { * @param botLevel Level of the bot * @param botGenerationDetails details on how to generate a bot */ - filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: BotGenerationDetails): void; + filterBotEquipment(sessionId: string, baseBotNode: IBotType, botLevel: number, botGenerationDetails: IBotGenerationDetails): void; /** * Iterate over the changes passed in and apply them to baseValues parameter * @param equipmentChanges Changes to apply @@ -51,28 +51,28 @@ export declare class BotEquipmentFilterService { * @param playerLevel Level of the player * @returns EquipmentBlacklistDetails object */ - getBotEquipmentBlacklist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; + getBotEquipmentBlacklist(botRole: string, playerLevel: number): IEquipmentFilterDetails | undefined; /** * Get the whitelist for a specific bot type that's within the players level * @param botRole Bot type * @param playerLevel Players level * @returns EquipmentFilterDetails object */ - protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): EquipmentFilterDetails | undefined; + protected getBotEquipmentWhitelist(botRole: string, playerLevel: number): IEquipmentFilterDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on bot level * @param botRole Bot type to get adjustments for * @param botLevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustments(botRole: string, botLevel: number): WeightingAdjustmentDetails | undefined; + protected getBotWeightingAdjustments(botRole: string, botLevel: number): IWeightingAdjustmentDetails | undefined; /** * Retrieve item weighting adjustments from bot.json config based on player level * @param botRole Bot type to get adjustments for * @param playerlevel Level of bot * @returns Weighting adjustments for bot items */ - protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): WeightingAdjustmentDetails | undefined; + protected getBotWeightingAdjustmentsByPlayerLevel(botRole: string, playerlevel: number): IWeightingAdjustmentDetails | undefined; /** * Filter bot equipment based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored @@ -80,7 +80,7 @@ export declare class BotEquipmentFilterService { * @param blacklist equipment blacklist * @returns Filtered bot file */ - protected filterEquipment(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; + protected filterEquipment(baseBotNode: IBotType, blacklist: IEquipmentFilterDetails, whitelist: IEquipmentFilterDetails): void; /** * Filter bot cartridges based on blacklist and whitelist from config/bot.json * Prioritizes whitelist first, if one is found blacklist is ignored @@ -89,7 +89,7 @@ export declare class BotEquipmentFilterService { * @param whitelist equipment on this list should be used exclusively * @returns Filtered bot file */ - protected filterCartridges(baseBotNode: IBotType, blacklist: EquipmentFilterDetails, whitelist: EquipmentFilterDetails): void; + protected filterCartridges(baseBotNode: IBotType, blacklist: IEquipmentFilterDetails, whitelist: IEquipmentFilterDetails): void; /** * Add/Edit weighting changes to bot items using values from config/bot.json/equipment * @param weightingAdjustments Weighting change to apply to bot diff --git a/types/services/BotLootCacheService.d.ts b/types/services/BotLootCacheService.d.ts index 2b51c5bc..815d2ab1 100644 --- a/types/services/BotLootCacheService.d.ts +++ b/types/services/BotLootCacheService.d.ts @@ -1,7 +1,7 @@ import { PMCLootGenerator } from "@spt/generators/PMCLootGenerator"; import { ItemHelper } from "@spt/helpers/ItemHelper"; import { IBotType } from "@spt/models/eft/common/tables/IBotType"; -import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IProps, ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IBotLootCache, LootCacheType } from "@spt/models/spt/bots/IBotLootCache"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; @@ -50,25 +50,25 @@ export declare class BotLootCacheService { * @param props * @returns */ - protected isBulletOrGrenade(props: Props): boolean; + protected isBulletOrGrenade(props: IProps): boolean; /** * Internal and external magazine have this property * @param props * @returns */ - protected isMagazine(props: Props): boolean; + protected isMagazine(props: IProps): boolean; /** * Medical use items (e.g. morphine/lip balm/grizzly) * @param props * @returns */ - protected isMedicalItem(props: Props): boolean; + protected isMedicalItem(props: IProps): boolean; /** * Grenades have this property (e.g. smoke/frag/flash grenades) * @param props * @returns */ - protected isGrenade(props: Props): boolean; + protected isGrenade(props: IProps): boolean; protected isFood(tpl: string): boolean; protected isDrink(tpl: string): boolean; protected isCurrency(tpl: string): boolean; diff --git a/types/services/BotNameService.d.ts b/types/services/BotNameService.d.ts index e5b0f221..056bd0f3 100644 --- a/types/services/BotNameService.d.ts +++ b/types/services/BotNameService.d.ts @@ -1,5 +1,7 @@ +import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; -import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; +import { IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { IBotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -12,6 +14,7 @@ export declare class BotNameService { protected logger: ILogger; protected randomUtil: RandomUtil; protected profileHelper: ProfileHelper; + protected botHelper: BotHelper; protected databaseService: DatabaseService; protected localisationService: LocalisationService; protected configServer: ConfigServer; @@ -19,22 +22,21 @@ export declare class BotNameService { protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; protected usedNameCache: Set; - constructor(logger: ILogger, randomUtil: RandomUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, randomUtil: RandomUtil, profileHelper: ProfileHelper, botHelper: BotHelper, databaseService: DatabaseService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); /** * Clear out any entries in Name Set */ clearNameCache(): void; /** * Create a unique bot nickname - * @param firstNames FIRST names to choose from - * @param lastNames OPTIONAL: Names to choose from + * @param botJsonTemplate bot JSON data from db * @param botGenerationDetails * @param botRole role of bot e.g. assault * @param uniqueRoles Lowercase roles to always make unique * @param sessionId OPTIONAL: profile session id * @returns Nickname for bot */ - generateUniqueBotNickname(firstNames: string[], lastNames: string[], botGenerationDetails: BotGenerationDetails, botRole: string, uniqueRoles?: string[], sessionId?: string): string; + generateUniqueBotNickname(botJsonTemplate: IBotType, botGenerationDetails: IBotGenerationDetails, botRole: string, uniqueRoles?: string[]): string; /** * Should this bot have a name like "name (Pmc Name)" * @param botRole Role bot has diff --git a/types/services/CircleOfCultistService.d.ts b/types/services/CircleOfCultistService.d.ts index 7b217506..e4d34108 100644 --- a/types/services/CircleOfCultistService.d.ts +++ b/types/services/CircleOfCultistService.d.ts @@ -8,9 +8,9 @@ import { IBotHideoutArea } from "@spt/models/eft/common/tables/IBotBase"; import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IStageRequirement } from "@spt/models/eft/hideout/IHideoutArea"; import { IHideoutCircleOfCultistProductionStartRequestData } from "@spt/models/eft/hideout/IHideoutCircleOfCultistProductionStartRequestData"; -import { IHideoutProduction, IHideoutProductionData, IRequirementBase, Requirement } from "@spt/models/eft/hideout/IHideoutProduction"; +import { IHideoutProduction, IHideoutProductionData, IRequirement, IRequirementBase } from "@spt/models/eft/hideout/IHideoutProduction"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; -import { DirectRewardSettings, IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; +import { IDirectRewardSettings, IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt/routers/EventOutputHolder"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -59,7 +59,7 @@ export declare class CircleOfCultistService { * @param rewardAmountRoubles Rouble amount to reward player in items with * @param directRewardSettings OPTIONAL: If craft is giving direct rewards */ - protected registerCircleOfCultistProduction(sessionId: string, pmcData: IPmcData, recipeId: string, sacrificedItems: IItem[], rewardAmountRoubles: number, directRewardSettings?: DirectRewardSettings): void; + protected registerCircleOfCultistProduction(sessionId: string, pmcData: IPmcData, recipeId: string, sacrificedItems: IItem[], rewardAmountRoubles: number, directRewardSettings?: IDirectRewardSettings): void; /** * Get the circle craft time as seconds, value is based on reward item value * OR rewards are direct, then use custom craft time defined in oarameter object @@ -67,7 +67,7 @@ export declare class CircleOfCultistService { * @param directRewardSettings OPTIONAL: If craft is giving direct rewards * @returns craft time seconds */ - protected getCircleCraftTimeSeconds(rewardAmountRoubles: number, directRewardSettings?: DirectRewardSettings): number; + protected getCircleCraftTimeSeconds(rewardAmountRoubles: number, directRewardSettings?: IDirectRewardSettings): number; /** * Get the items player sacrificed in circle * @param pmcData Player profile @@ -88,7 +88,7 @@ export declare class CircleOfCultistService { * @param cultistCircleStashId Id of stash item * @returns Array of item arrays */ - protected getExplicitRewards(explicitRewardSettings: DirectRewardSettings, cultistCircleStashId: string): IItem[][]; + protected getExplicitRewards(explicitRewardSettings: IDirectRewardSettings, cultistCircleStashId: string): IItem[][]; /** * Explicit rewards have thier own stack sizes as they dont use a reward rouble pool * @param rewardTpl Item being rewarded to get stack size of @@ -128,5 +128,5 @@ export declare class CircleOfCultistService { * @param requirements Requirements to iterate over * @returns Array of item requirements */ - protected getItemRequirements(requirements: IRequirementBase[]): (IStageRequirement | Requirement)[]; + protected getItemRequirements(requirements: IRequirementBase[]): (IStageRequirement | IRequirement)[]; } diff --git a/types/services/MailSendService.d.ts b/types/services/MailSendService.d.ts index 58455204..5887ee7f 100644 --- a/types/services/MailSendService.d.ts +++ b/types/services/MailSendService.d.ts @@ -4,7 +4,7 @@ import { NotificationSendHelper } from "@spt/helpers/NotificationSendHelper"; import { NotifierHelper } from "@spt/helpers/NotifierHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IItem } from "@spt/models/eft/common/tables/IItem"; -import { Dialogue, ISystemData, IUserDialogInfo, Message, MessageContentRagfair, MessageItems } from "@spt/models/eft/profile/ISptProfile"; +import { IDialogue, IMessage, IMessageContentRagfair, IMessageItems, ISystemData, IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { Traders } from "@spt/models/enums/Traders"; import { IProfileChangeEvent, ISendMessageDetails } from "@spt/models/spt/dialog/ISendMessageDetails"; @@ -37,7 +37,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: IItem[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; + sendDirectNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, message: string, items?: IItem[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: IMessageContentRagfair): void; /** * Send a message from an NPC (e.g. prapor) to the player with or without items * @param sessionId The session ID to send the message to @@ -47,7 +47,7 @@ export declare class MailSendService { * @param items Optional items to send to player * @param maxStorageTimeSeconds Optional time to collect items before they expire */ - sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: IItem[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: MessageContentRagfair): void; + sendLocalisedNpcMessageToPlayer(sessionId: string, trader: Traders, messageType: MessageType, messageLocaleId: string, items?: IItem[], maxStorageTimeSeconds?: number, systemData?: ISystemData, ragfair?: IMessageContentRagfair): void; /** * Send a message from SYSTEM to the player with or without items * @param sessionId The session ID to send the message to @@ -92,21 +92,21 @@ export declare class MailSendService { * @param messageDetails Various details on what the message must contain/do * @returns Message */ - protected createDialogMessage(dialogId: string, messageDetails: ISendMessageDetails): Message; + protected createDialogMessage(dialogId: string, messageDetails: ISendMessageDetails): IMessage; /** * Add items to message and adjust various properties to reflect the items being added * @param message Message to add items to * @param itemsToSendToPlayer Items to add to message * @param maxStorageTimeSeconds total time items are stored in mail before being deleted */ - protected addRewardItemsToMessage(message: Message, itemsToSendToPlayer: MessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; + protected addRewardItemsToMessage(message: IMessage, itemsToSendToPlayer: IMessageItems | undefined, maxStorageTimeSeconds: number | undefined): void; /** * perform various sanitising actions on the items before they're considered ready for insertion into message * @param dialogType The type of the dialog that will hold the reward items being processed * @param messageDetails * @returns Sanitised items */ - protected processItemsBeforeAddingToMail(dialogType: MessageType, messageDetails: ISendMessageDetails): MessageItems; + protected processItemsBeforeAddingToMail(dialogType: MessageType, messageDetails: ISendMessageDetails): IMessageItems; /** * Try to find the most correct item to be the 'primary' item in a reward mail * @param items Possible items to choose from @@ -119,7 +119,7 @@ export declare class MailSendService { * @param messageDetails Data on what message should do * @returns Relevant Dialogue */ - protected getDialog(messageDetails: ISendMessageDetails): Dialogue; + protected getDialog(messageDetails: ISendMessageDetails): IDialogue; /** * Get the appropriate sender id by the sender enum type * @param messageDetails diff --git a/types/services/ProfileFixerService.d.ts b/types/services/ProfileFixerService.d.ts index 458828f7..43d1d119 100644 --- a/types/services/ProfileFixerService.d.ts +++ b/types/services/ProfileFixerService.d.ts @@ -7,7 +7,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IBonus, IHideoutSlot } from "@spt/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { StageBonus } from "@spt/models/eft/hideout/IHideoutArea"; +import { IStageBonus } from "@spt/models/eft/hideout/IHideoutArea"; import { IEquipmentBuild, IMagazineBuild, ISptProfile, IWeaponBuild } from "@spt/models/eft/profile/ISptProfile"; import { HideoutAreas } from "@spt/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; @@ -119,5 +119,5 @@ export declare class ProfileFixerService { * @param bonus bonus to find * @returns matching bonus */ - protected getBonusFromProfile(profileBonuses: IBonus[], bonus: StageBonus): IBonus | undefined; + protected getBonusFromProfile(profileBonuses: IBonus[], bonus: IStageBonus): IBonus | undefined; } diff --git a/types/services/RaidWeatherService.d.ts b/types/services/RaidWeatherService.d.ts new file mode 100644 index 00000000..fd82da24 --- /dev/null +++ b/types/services/RaidWeatherService.d.ts @@ -0,0 +1,43 @@ +import { WeatherGenerator } from "@spt/generators/WeatherGenerator"; +import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; +import { IWeather } from "@spt/models/eft/weather/IWeatherData"; +import { Season } from "@spt/models/enums/Season"; +import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt/servers/ConfigServer"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { TimeUtil } from "@spt/utils/TimeUtil"; +export declare class RaidWeatherService { + protected logger: ILogger; + protected databaseService: DatabaseService; + protected timeUtil: TimeUtil; + protected weatherGenerator: WeatherGenerator; + protected seasonalEventService: SeasonalEventService; + protected weightedRandomHelper: WeightedRandomHelper; + protected configServer: ConfigServer; + protected weatherConfig: IWeatherConfig; + protected weatherForecast: IWeather[]; + constructor(logger: ILogger, databaseService: DatabaseService, timeUtil: TimeUtil, weatherGenerator: WeatherGenerator, seasonalEventService: SeasonalEventService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + /** + * Generate 24 hours of weather data starting from midnight today + */ + generateWeather(currentSeason: Season): void; + /** + * Get a time period to increment by, e.g 15 or 30 minutes as milliseconds + * @returns milliseconds + */ + protected getWeightedWeatherTimePeriodMs(): number; + /** + * Find the first matching weather object that applies to the current time + */ + getCurrentWeather(): IWeather; + /** + * Find the first matching weather object that applies to the current time + all following weather data generated + */ + getUpcomingWeather(): IWeather[]; + /** + * Ensure future weather data exists + */ + protected validateWeatherDataExists(currentSeason: Season): void; +} diff --git a/types/services/RepairService.d.ts b/types/services/RepairService.d.ts index ec6144ef..c4772cf4 100644 --- a/types/services/RepairService.d.ts +++ b/types/services/RepairService.d.ts @@ -7,11 +7,11 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; -import { RepairKitsInfo } from "@spt/models/eft/repair/IRepairActionDataRequest"; -import { RepairItem } from "@spt/models/eft/repair/ITraderRepairActionDataRequest"; +import { IRepairKitsInfo } from "@spt/models/eft/repair/IRepairActionDataRequest"; +import { IRepairItem } from "@spt/models/eft/repair/ITraderRepairActionDataRequest"; import { BonusType } from "@spt/models/enums/BonusType"; import { SkillTypes } from "@spt/models/enums/SkillTypes"; -import { BonusSettings, IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; +import { IBonusSettings, IRepairConfig } from "@spt/models/spt/config/IRepairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -40,7 +40,7 @@ export declare class RepairService { * @param traderId Trader being used to repair item * @returns RepairDetails object */ - repairItemByTrader(sessionID: string, pmcData: IPmcData, repairItemDetails: RepairItem, traderId: string): RepairDetails; + repairItemByTrader(sessionID: string, pmcData: IPmcData, repairItemDetails: IRepairItem, traderId: string): RepairDetails; /** * @param sessionID Session id * @param pmcData profile to take money from @@ -72,7 +72,7 @@ export declare class RepairService { * @param output IItemEventRouterResponse * @returns Details of repair, item/price */ - repairItemByKit(sessionId: string, pmcData: IPmcData, repairKits: RepairKitsInfo[], itemToRepairId: string, output: IItemEventRouterResponse): RepairDetails; + repairItemByKit(sessionId: string, pmcData: IPmcData, repairKits: IRepairKitsInfo[], itemToRepairId: string, output: IItemEventRouterResponse): RepairDetails; /** * Calculate value repairkit points need to be divided by to get the durability points to be added to an item * @param itemToRepairDetails Item to repair details @@ -112,7 +112,7 @@ export declare class RepairService { * @param itemConfig weapon/armor config * @param repairDetails Details for item to repair */ - addBuff(itemConfig: BonusSettings, item: IItem): void; + addBuff(itemConfig: IBonusSettings, item: IItem): void; /** * Check if item should be buffed by checking the item type and relevant player skill level * @param repairDetails Item that was repaired diff --git a/types/services/SeasonalEventService.d.ts b/types/services/SeasonalEventService.d.ts index ca4a33cc..281bf992 100644 --- a/types/services/SeasonalEventService.d.ts +++ b/types/services/SeasonalEventService.d.ts @@ -117,8 +117,18 @@ export declare class SeasonalEventService { * @param eventName Name of the event to enable. e.g. Christmas */ protected updateGlobalEvents(sessionId: string, globalConfig: IConfig, eventType: SeasonalEventType): void; + /** + * Force zryachiy to always have a melee weapon + */ protected adjustZryachiyMeleeChance(): void; + /** + * Enable the halloween zryachiy summon event + */ protected enableHalloweenSummonEvent(): void; + /** + * Add event bosses to maps + * @param eventType Seasonal event, e.g. HALLOWEEN/CHRISTMAS + */ protected addEventBossesToMaps(eventType: SeasonalEventType): void; /** * Change trader icons to be more event themed (Halloween only so far) @@ -134,6 +144,9 @@ export declare class SeasonalEventService { * @param eventName Name of the event to read equipment in from config */ protected addEventGearToBots(eventType: SeasonalEventType): void; + /** + * Add pumpkin loot boxes to scavs + */ protected addPumpkinsToScavBackpacks(): void; /** * Set Khorovod(dancing tree) chance to 100% on all maps that support it @@ -155,5 +168,8 @@ export declare class SeasonalEventService { * @returns Bot role as string */ getBaseRoleForEventBot(eventBotRole: string): string; + /** + * Force the weather to be snow + */ enableSnow(): void; } diff --git a/types/services/TraderPurchasePersisterService.d.ts b/types/services/TraderPurchasePersisterService.d.ts index 6bef9f5e..ba85a678 100644 --- a/types/services/TraderPurchasePersisterService.d.ts +++ b/types/services/TraderPurchasePersisterService.d.ts @@ -1,5 +1,5 @@ import { ProfileHelper } from "@spt/helpers/ProfileHelper"; -import { TraderPurchaseData } from "@spt/models/eft/profile/ISptProfile"; +import { ITraderPurchaseData } from "@spt/models/eft/profile/ISptProfile"; import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -24,7 +24,7 @@ export declare class TraderPurchasePersisterService { * @param traderId Trader to loop up purchases for * @returns Dict of assort id and count purchased */ - getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; + getProfileTraderPurchases(sessionId: string, traderId: string): Record | undefined; /** * Get a purchase made from a trader for requested profile before the last trader reset * @param sessionId Session id @@ -32,7 +32,7 @@ export declare class TraderPurchasePersisterService { * @param assortId Id of assort to get data for * @returns TraderPurchaseData */ - getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): TraderPurchaseData | undefined; + getProfileTraderPurchase(sessionId: string, traderId: string, assortId: string): ITraderPurchaseData | undefined; /** * Remove all trader purchase records from all profiles that exist * @param traderId Traders id diff --git a/types/services/mod/CustomItemService.d.ts b/types/services/mod/CustomItemService.d.ts index f112872e..bbc0453c 100644 --- a/types/services/mod/CustomItemService.d.ts +++ b/types/services/mod/CustomItemService.d.ts @@ -1,5 +1,5 @@ import { ItemHelper } from "@spt/helpers/ItemHelper"; -import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem"; +import { IProps, ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { CreateItemResult, LocaleDetails, NewItemDetails, NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -47,7 +47,7 @@ export declare class CustomItemService { * @param overrideProperties new properties to apply * @param itemClone item to update */ - protected updateBaseItemPropertiesWithOverrides(overrideProperties: Props, itemClone: ITemplateItem): void; + protected updateBaseItemPropertiesWithOverrides(overrideProperties: IProps, itemClone: ITemplateItem): void; /** * Addd a new item object to the in-memory representation of items.json * @param newItemId id of the item to add to items.json diff --git a/types/utils/TimeUtil.d.ts b/types/utils/TimeUtil.d.ts index 6c14b9d1..48d769b9 100644 --- a/types/utils/TimeUtil.d.ts +++ b/types/utils/TimeUtil.d.ts @@ -42,11 +42,17 @@ export declare class TimeUtil { * @returns {number} The current timestamp in seconds since the Unix epoch in UTC. */ getTimestamp(): number; + getStartOfDayTimestamp(timestamp?: number): number; /** * Get timestamp of today + passed in day count * @param daysFromNow Days from now */ getTimeStampFromNowDays(daysFromNow: number): number; + /** + * Get timestamp of today + passed in hour count + * @param daysFromNow Days from now + */ + getTimeStampFromNowHours(hoursFromNow: number): number; /** * Gets the current time in UTC in a format suitable for mail in EFT. * @@ -67,4 +73,10 @@ export declare class TimeUtil { */ getHoursAsSeconds(hours: number): number; getTimestampOfNextHour(): number; + /** + * Returns the current days timestamp at 00:00 + * e.g. current time: 13th march 14:22 will return 13th march 00:00 + * @returns Timestamp + */ + getTodaysMidnightTimestamp(): number; } diff --git a/types/utils/logging/AbstractWinstonLogger.d.ts b/types/utils/logging/AbstractWinstonLogger.d.ts index b850284a..fb84b83d 100644 --- a/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/types/utils/logging/AbstractWinstonLogger.d.ts @@ -1,5 +1,5 @@ import fs from "node:fs"; -import { Daum } from "@spt/models/eft/itemEvent/IItemEventRouterRequest"; +import { IDaum } from "@spt/models/eft/itemEvent/IItemEventRouterRequest"; import { LogBackgroundColor } from "@spt/models/spt/logging/LogBackgroundColor"; import { LogTextColor } from "@spt/models/spt/logging/LogTextColor"; import { SptLogger } from "@spt/models/spt/logging/SptLogger"; @@ -50,7 +50,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; - writeToLogFile(data: string | Daum): Promise; + writeToLogFile(data: string | IDaum): Promise; log(data: string | Error | Record, color: string, backgroundColor?: string): Promise; error(data: string | Record): Promise; warning(data: string | Record): Promise; From 27d4e4ede6f8f9b8f38c1f914220d90828e059ac Mon Sep 17 00:00:00 2001 From: Archangel Date: Sat, 19 Oct 2024 14:06:37 +0200 Subject: [PATCH 101/119] Update imports --- src/controllers/FikaAchievementController.ts | 3 +-- src/controllers/FikaDialogueController.ts | 4 ++-- src/helpers/FikaPlayerRelationsHelper.ts | 1 - .../fika/routes/raid/dedicated/IStartDedicatedRequest.ts | 8 ++++---- src/services/FikaMatchService.ts | 1 - 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/controllers/FikaAchievementController.ts b/src/controllers/FikaAchievementController.ts index 34302994..046f3945 100644 --- a/src/controllers/FikaAchievementController.ts +++ b/src/controllers/FikaAchievementController.ts @@ -12,8 +12,7 @@ export class FikaAchievementController { ) { // empty } - // biome-ignore lint/correctness/noUnusedVariables: Can be ignored for now, could be useful in the future. - getAchievementStatistics(sessionID: string): ICompletedAchievementsResponse { + getAchievementStatistics(_sessionID: string): ICompletedAchievementsResponse { const achievements = this.databaseService.getAchievements(); const stats: Record = {}; diff --git a/src/controllers/FikaDialogueController.ts b/src/controllers/FikaDialogueController.ts index 60365efd..f596dcc0 100644 --- a/src/controllers/FikaDialogueController.ts +++ b/src/controllers/FikaDialogueController.ts @@ -11,7 +11,7 @@ import { ConfigServer } from "@spt/servers/ConfigServer"; import { DialogueController } from "@spt/controllers/DialogueController"; import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest"; -import { Dialogue, IUserDialogInfo, Message } from "@spt/models/eft/profile/ISptProfile"; +import { IMessage } from "@spt/models/eft/profile/ISptProfile"; import { MessageType } from "@spt/models/enums/MessageType"; import { SaveServer } from "@spt/servers/SaveServer"; import { SptWebSocketConnectionHandler } from "@spt/servers/ws/SptWebSocketConnectionHandler"; @@ -165,7 +165,7 @@ export class FikaDialogueController { }, ]; - const message: Message = { + const message: IMessage = { _id: this.hashUtil.generate(), uid: sessionID, type: request.type, diff --git a/src/helpers/FikaPlayerRelationsHelper.ts b/src/helpers/FikaPlayerRelationsHelper.ts index 6035ecf4..bc6c66f1 100644 --- a/src/helpers/FikaPlayerRelationsHelper.ts +++ b/src/helpers/FikaPlayerRelationsHelper.ts @@ -5,7 +5,6 @@ import { SaveServer } from "@spt/servers/SaveServer"; import { SptWebSocketConnectionHandler } from "@spt/servers/ws/SptWebSocketConnectionHandler"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; -import { LogTextColor } from "@spt/models/spt/logging/LogTextColor"; @injectable() export class FikaPlayerRelationsHelper { diff --git a/src/models/fika/routes/raid/dedicated/IStartDedicatedRequest.ts b/src/models/fika/routes/raid/dedicated/IStartDedicatedRequest.ts index c5aa6529..f9949138 100644 --- a/src/models/fika/routes/raid/dedicated/IStartDedicatedRequest.ts +++ b/src/models/fika/routes/raid/dedicated/IStartDedicatedRequest.ts @@ -1,4 +1,4 @@ -import { BotSettings, TimeAndWeatherSettings, WavesSettings } from "@spt/models/eft/match/IRaidSettings"; +import { IBotSettings, ITimeAndWeatherSettings, IWavesSettings } from "@spt/models/eft/match/IRaidSettings"; import { DateTime } from "@spt/models/enums/DateTime"; import { PlayersSpawnPlace } from "@spt/models/enums/PlayersSpawnPlace"; import { SideType } from "@spt/models/enums/SideType"; @@ -9,9 +9,9 @@ export interface IStartDedicatedRequest { locationId: string; spawnPlace: PlayersSpawnPlace; metabolismDisabled: boolean; - timeAndWeatherSettings: TimeAndWeatherSettings; - botSettings: BotSettings; - wavesSettings: WavesSettings; + timeAndWeatherSettings: ITimeAndWeatherSettings; + botSettings: IBotSettings; + wavesSettings: IWavesSettings; side: SideType; customWeather: boolean; } diff --git a/src/services/FikaMatchService.ts b/src/services/FikaMatchService.ts index e6f058d2..0e01b36a 100644 --- a/src/services/FikaMatchService.ts +++ b/src/services/FikaMatchService.ts @@ -15,7 +15,6 @@ import { FikaConfig } from "../utils/FikaConfig"; import { FikaDedicatedRaidService } from "./dedicated/FikaDedicatedRaidService"; import { FikaInsuranceService } from "./FikaInsuranceService"; import { FikaPresenceService } from "./FikaPresenceService"; -import { IFikaSetPresence } from "../models/fika/presence/IFikaSetPresence"; @injectable() export class FikaMatchService { From f2afbbd19270c0ef4bbbadcf0b456c51a1a020ee Mon Sep 17 00:00:00 2001 From: Archangel Date: Sat, 19 Oct 2024 14:17:19 +0200 Subject: [PATCH 102/119] Cleanup unused --- src/controllers/FikaClientController.ts | 4 +-- .../HideoutUpgradeCompleteRequestData.d.ts | 5 ---- .../models/spt/bots/GenerateWeaponResult.d.ts | 10 ------- types/models/spt/services/CustomPreset.d.ts | 5 ---- .../spt/services/CustomTraderAssortData.d.ts | 6 ---- types/models/spt/services/LootRequest.d.ts | 15 ---------- types/services/ProfileSnapshotService.d.ts | 30 ------------------- 7 files changed, 1 insertion(+), 74 deletions(-) delete mode 100644 types/models/eft/hideout/HideoutUpgradeCompleteRequestData.d.ts delete mode 100644 types/models/spt/bots/GenerateWeaponResult.d.ts delete mode 100644 types/models/spt/services/CustomPreset.d.ts delete mode 100644 types/models/spt/services/CustomTraderAssortData.d.ts delete mode 100644 types/models/spt/services/LootRequest.d.ts delete mode 100644 types/services/ProfileSnapshotService.d.ts diff --git a/src/controllers/FikaClientController.ts b/src/controllers/FikaClientController.ts index cd587760..ad2f68ca 100644 --- a/src/controllers/FikaClientController.ts +++ b/src/controllers/FikaClientController.ts @@ -32,7 +32,7 @@ export class FikaClientController { } protected filterEmptyMods(array: string[]): string[] { - return array.filter(str => str.trim() !== ""); + return array.filter((str) => str.trim() !== ""); } /** @@ -53,8 +53,6 @@ export class FikaClientController { * Handle /fika/client/check/mods */ public handleCheckMods(request: IFikaCheckModRequestData): IFikaCheckModResponse { - const config = this.fikaConfig.getConfig(); - const mismatchedMods: IFikaCheckModResponse = { forbidden: [], missingRequired: [], diff --git a/types/models/eft/hideout/HideoutUpgradeCompleteRequestData.d.ts b/types/models/eft/hideout/HideoutUpgradeCompleteRequestData.d.ts deleted file mode 100644 index 8583e8d9..00000000 --- a/types/models/eft/hideout/HideoutUpgradeCompleteRequestData.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface HideoutUpgradeCompleteRequestData { - Action: string; - areaType: number; - timestamp: number; -} diff --git a/types/models/spt/bots/GenerateWeaponResult.d.ts b/types/models/spt/bots/GenerateWeaponResult.d.ts deleted file mode 100644 index d4a25267..00000000 --- a/types/models/spt/bots/GenerateWeaponResult.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Mods } from "@spt/models/eft/common/tables/IBotType"; -import { Item } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -export declare class GenerateWeaponResult { - weapon: Item[]; - chosenAmmoTpl: string; - chosenUbglAmmoTpl: string; - weaponMods: Mods; - weaponTemplate: ITemplateItem; -} diff --git a/types/models/spt/services/CustomPreset.d.ts b/types/models/spt/services/CustomPreset.d.ts deleted file mode 100644 index 3301a551..00000000 --- a/types/models/spt/services/CustomPreset.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { IPreset } from "@spt/models/eft/common/IGlobals"; -export interface CustomPreset { - key: string; - preset: IPreset; -} diff --git a/types/models/spt/services/CustomTraderAssortData.d.ts b/types/models/spt/services/CustomTraderAssortData.d.ts deleted file mode 100644 index 7ad63418..00000000 --- a/types/models/spt/services/CustomTraderAssortData.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; -import { Traders } from "@spt/models/enums/Traders"; -export interface CustomTraderAssortData { - traderId: Traders; - assorts: ITraderAssort; -} diff --git a/types/models/spt/services/LootRequest.d.ts b/types/models/spt/services/LootRequest.d.ts deleted file mode 100644 index c52a8763..00000000 --- a/types/models/spt/services/LootRequest.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { MinMax } from "@spt/models/common/MinMax"; -export interface LootRequest { - weaponPresetCount: MinMax; - armorPresetCount: MinMax; - itemCount: MinMax; - weaponCrateCount: MinMax; - itemBlacklist: string[]; - itemTypeWhitelist: string[]; - /** key: item base type: value: max count */ - itemLimits: Record; - itemStackLimits: Record; - armorLevelWhitelist: number[]; - allowBossItems: boolean; - useRewarditemBlacklist?: boolean; -} diff --git a/types/services/ProfileSnapshotService.d.ts b/types/services/ProfileSnapshotService.d.ts deleted file mode 100644 index 4492ddae..00000000 --- a/types/services/ProfileSnapshotService.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; -import { ICloner } from "@spt/utils/cloners/ICloner"; -export declare class ProfileSnapshotService { - protected cloner: ICloner; - protected storedProfileSnapshots: Record; - constructor(cloner: ICloner); - /** - * Store a profile into an in-memory object - * @param sessionID session id - acts as the key - * @param profile - profile to save - */ - storeProfileSnapshot(sessionID: string, profile: ISptProfile): void; - /** - * Retreve a stored profile - * @param sessionID key - * @returns A player profile object - */ - getProfileSnapshot(sessionID: string): ISptProfile | undefined; - /** - * Does a profile exists against the provided key - * @param sessionID key - * @returns true if exists - */ - hasProfileSnapshot(sessionID: string): boolean; - /** - * Remove a stored profile by key - * @param sessionID key - */ - clearProfileSnapshot(sessionID: string): void; -} From cb66cde9e1a7ff890add6678071a0131a5ef68b3 Mon Sep 17 00:00:00 2001 From: Archangel Date: Sat, 19 Oct 2024 14:29:03 +0200 Subject: [PATCH 103/119] Add github workflow --- .github/workflows/build_lint.yml | 33 ++++++++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 34 insertions(+) create mode 100644 .github/workflows/build_lint.yml diff --git a/.github/workflows/build_lint.yml b/.github/workflows/build_lint.yml new file mode 100644 index 00000000..597e2bdf --- /dev/null +++ b/.github/workflows/build_lint.yml @@ -0,0 +1,33 @@ +name: NPM Build & Lint + +on: + workflow_dispatch: + push: + paths-ignore: + - '**/*.md' + pull_request: + paths-ignore: + - '**/*.md' + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install dependencies + run: npm install + + - name: Build + run: npm run build + + - name: Lint + run: npm run lint + diff --git a/package.json b/package.json index 982b43f4..7aa6ef9e 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "src/mod.js", "scripts": { "setup": "npm i", + "lint": "npx @biomejs/biome lint ./", "build": "node ./build.mjs", "buildinfo": "node ./build.mjs --verbose" }, From 5faa74c50e4194245b93dc56d7fb7516c3ab9149 Mon Sep 17 00:00:00 2001 From: Archangel Date: Sat, 19 Oct 2024 14:30:26 +0200 Subject: [PATCH 104/119] Update parameter name --- src/Fika.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Fika.ts b/src/Fika.ts index eebb4851..eae2ae8c 100644 --- a/src/Fika.ts +++ b/src/Fika.ts @@ -40,7 +40,7 @@ export class Fika { await this.overrider.override(container); } - public async postSptLoad(container: DependencyContainer): Promise { + public async postSptLoad(_container: DependencyContainer): Promise { if (this.natPunchServerConfig.enable) { this.fikaServerTools.startService("NatPunchServer"); } From a3a075727ae53d82c77e85abd1642d1a8265f616 Mon Sep 17 00:00:00 2001 From: Archangel Date: Sat, 19 Oct 2024 17:09:36 +0200 Subject: [PATCH 105/119] Revert "chore: Cleanup duplicate call to the configHandler" This reverts commit 3860fc14cb90410a9189ad8375a7db4932e0479c. --- src/controllers/FikaClientController.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/FikaClientController.ts b/src/controllers/FikaClientController.ts index ad2f68ca..543e21b4 100644 --- a/src/controllers/FikaClientController.ts +++ b/src/controllers/FikaClientController.ts @@ -60,7 +60,7 @@ export class FikaClientController { }; // if no configuration was made, allow all mods - if (this.allowedMods.size === 0) { + if (config.client.mods.required.length === 0 && config.client.mods.optional.length === 0) { return mismatchedMods; } From bce945c3d8ae4b52e2674d6178766bbc2eaf0b77 Mon Sep 17 00:00:00 2001 From: Archangel Date: Sat, 19 Oct 2024 17:13:17 +0200 Subject: [PATCH 106/119] Re-add config --- src/controllers/FikaClientController.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/controllers/FikaClientController.ts b/src/controllers/FikaClientController.ts index 543e21b4..84da6fcc 100644 --- a/src/controllers/FikaClientController.ts +++ b/src/controllers/FikaClientController.ts @@ -53,6 +53,8 @@ export class FikaClientController { * Handle /fika/client/check/mods */ public handleCheckMods(request: IFikaCheckModRequestData): IFikaCheckModResponse { + const config = this.fikaConfig.getConfig(); + const mismatchedMods: IFikaCheckModResponse = { forbidden: [], missingRequired: [], From cc8b3f05fd416d45573d85f80b19d17a1590498b Mon Sep 17 00:00:00 2001 From: Archangel Date: Sat, 19 Oct 2024 17:21:41 +0200 Subject: [PATCH 107/119] Add boolean to check if changes to the mod configuration have been made --- src/controllers/FikaClientController.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/controllers/FikaClientController.ts b/src/controllers/FikaClientController.ts index 84da6fcc..959e111b 100644 --- a/src/controllers/FikaClientController.ts +++ b/src/controllers/FikaClientController.ts @@ -15,6 +15,7 @@ import { FikaConfig } from "../utils/FikaConfig"; export class FikaClientController { protected requiredMods: Set; protected allowedMods: Set; + protected hasRequiredorOptionalMods: boolean = true; constructor( @inject("FikaClientModHashesHelper") protected fikaClientModHashesHelper: FikaClientModHashesHelper, @@ -27,6 +28,10 @@ export class FikaClientController { const sanitizedRequiredMods = this.filterEmptyMods(config.client.mods.required); const sanitizedOptionalMods = this.filterEmptyMods(config.client.mods.optional); + if (sanitizedRequiredMods.length === 0 && sanitizedRequiredMods.length === 0) { + this.hasRequiredorOptionalMods = false; + } + this.requiredMods = new Set([...sanitizedRequiredMods, "com.fika.core", "com.SPT.custom", "com.SPT.singleplayer", "com.SPT.core", "com.SPT.debugging"]); this.allowedMods = new Set([...this.requiredMods, ...sanitizedOptionalMods, "com.bepis.bepinex.configurationmanager"]); } @@ -53,8 +58,6 @@ export class FikaClientController { * Handle /fika/client/check/mods */ public handleCheckMods(request: IFikaCheckModRequestData): IFikaCheckModResponse { - const config = this.fikaConfig.getConfig(); - const mismatchedMods: IFikaCheckModResponse = { forbidden: [], missingRequired: [], @@ -62,7 +65,7 @@ export class FikaClientController { }; // if no configuration was made, allow all mods - if (config.client.mods.required.length === 0 && config.client.mods.optional.length === 0) { + if (!this.hasRequiredorOptionalMods) { return mismatchedMods; } From 25e7340b2f0486dda40edd960e8b0a26af41d4fd Mon Sep 17 00:00:00 2001 From: Archangel Date: Sat, 19 Oct 2024 19:27:07 +0200 Subject: [PATCH 108/119] Check required & optional array, change naming --- src/controllers/FikaClientController.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/controllers/FikaClientController.ts b/src/controllers/FikaClientController.ts index 959e111b..8118b106 100644 --- a/src/controllers/FikaClientController.ts +++ b/src/controllers/FikaClientController.ts @@ -15,7 +15,7 @@ import { FikaConfig } from "../utils/FikaConfig"; export class FikaClientController { protected requiredMods: Set; protected allowedMods: Set; - protected hasRequiredorOptionalMods: boolean = true; + protected hasRequiredOrOptionalMods: boolean = true; constructor( @inject("FikaClientModHashesHelper") protected fikaClientModHashesHelper: FikaClientModHashesHelper, @@ -28,8 +28,8 @@ export class FikaClientController { const sanitizedRequiredMods = this.filterEmptyMods(config.client.mods.required); const sanitizedOptionalMods = this.filterEmptyMods(config.client.mods.optional); - if (sanitizedRequiredMods.length === 0 && sanitizedRequiredMods.length === 0) { - this.hasRequiredorOptionalMods = false; + if (sanitizedRequiredMods.length === 0 && sanitizedOptionalMods.length === 0) { + this.hasRequiredOrOptionalMods = false; } this.requiredMods = new Set([...sanitizedRequiredMods, "com.fika.core", "com.SPT.custom", "com.SPT.singleplayer", "com.SPT.core", "com.SPT.debugging"]); @@ -65,7 +65,7 @@ export class FikaClientController { }; // if no configuration was made, allow all mods - if (!this.hasRequiredorOptionalMods) { + if (!this.hasRequiredOrOptionalMods) { return mismatchedMods; } From 60b8923949a50a5c8e777cd23b7f8d12a64f6bdb Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Mon, 21 Oct 2024 09:33:04 +0200 Subject: [PATCH 109/119] Allow disabling of RaidSettings --- assets/configs/fika.jsonc | 5 +++-- assets/database/locales/global/en.json | 3 ++- src/models/fika/config/IFikaConfigClient.ts | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/assets/configs/fika.jsonc b/assets/configs/fika.jsonc index 7eebfa9c..6a1f3a16 100644 --- a/assets/configs/fika.jsonc +++ b/assets/configs/fika.jsonc @@ -13,7 +13,8 @@ "optional": [] }, "useInertia": true, - "sharedQuestProgression": false + "sharedQuestProgression": false, + "canEditRaidSettings": true }, "server": { "giftedItemsLoseFIR": true, @@ -40,4 +41,4 @@ "enable": true, "easteregg": false } -} +} \ No newline at end of file diff --git a/assets/database/locales/global/en.json b/assets/database/locales/global/en.json index cd3baa2e..0c46e9d5 100644 --- a/assets/database/locales/global/en.json +++ b/assets/database/locales/global/en.json @@ -93,5 +93,6 @@ "F_UI_UpnpFailed": "UPnP mapping failed. Make sure the selected port is not already open!\nDisable UPnP if you are using a VPN.", "F_UI_InitWeather": "Generating weather...", "F_Notification_RaidStarted": "{0} started a raid on {1}", - "F_Notification_ItemReceived": "You received a {0} from {1}" + "F_Notification_ItemReceived": "You received a {0} from {1}", + "F_Notification_RaidSettingsDisabled": "Editing of RaidSettings is disabled by the server host" } \ No newline at end of file diff --git a/src/models/fika/config/IFikaConfigClient.ts b/src/models/fika/config/IFikaConfigClient.ts index 276353a3..e51471ae 100644 --- a/src/models/fika/config/IFikaConfigClient.ts +++ b/src/models/fika/config/IFikaConfigClient.ts @@ -13,4 +13,5 @@ export interface IFikaConfigClient { }; useInertia: boolean; sharedQuestProgression: boolean; + canEditRaidSettings: boolean; } From c9b92395d92d7b36e5a2be29133eb89500e92f23 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Tue, 29 Oct 2024 10:55:24 +0100 Subject: [PATCH 110/119] Fix player relations --- src/Fika.ts | 3 ++ .../cache/FikaPlayerRelationsCacheService.ts | 40 ++++++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/src/Fika.ts b/src/Fika.ts index eae2ae8c..9b48f507 100644 --- a/src/Fika.ts +++ b/src/Fika.ts @@ -10,6 +10,7 @@ import { IFikaConfigBackground } from "./models/fika/config/IFikaConfigBackgroun import { IFikaConfigDedicated } from "./models/fika/config/IFikaConfigDedicated"; import { IFikaConfigNatPunchServer } from "./models/fika/config/IFikaConfigNatPunchServer"; import { Overrider } from "./overrides/Overrider"; +import { FikaPlayerRelationsCacheService } from "./services/cache/FikaPlayerRelationsCacheService"; import { FikaDedicatedProfileService } from "./services/dedicated/FikaDedicatedProfileService"; import { FikaConfig } from "./utils/FikaConfig"; import { FikaServerTools } from "./utils/FikaServerTools"; @@ -29,6 +30,7 @@ export class Fika { @inject("FikaDedicatedProfileService") protected fikaDedicatedProfileService: FikaDedicatedProfileService, @inject("ImageRouter") protected imageRouter: ImageRouter, @inject("ImporterUtil") protected importerUtil: ImporterUtil, + @inject("FikaPlayerRelationsCacheService") protected fikaPlayerRelationCacheServce: FikaPlayerRelationsCacheService ) { this.modPath = fikaConfig.getModPath(); this.natPunchServerConfig = fikaConfig.getConfig().natPunchServer; @@ -50,6 +52,7 @@ export class Fika { } this.addFikaClientLocales(); + this.fikaPlayerRelationCacheServce.postInit(); if (this.backgroundConfig.enable) { const image = this.backgroundConfig.easteregg ? "assets/images/launcher/bg-senko.png" : "assets/images/launcher/bg.png"; diff --git a/src/services/cache/FikaPlayerRelationsCacheService.ts b/src/services/cache/FikaPlayerRelationsCacheService.ts index a9badc3b..cd4699eb 100644 --- a/src/services/cache/FikaPlayerRelationsCacheService.ts +++ b/src/services/cache/FikaPlayerRelationsCacheService.ts @@ -1,6 +1,7 @@ import { inject, injectable } from "tsyringe"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; import { JsonUtil } from "@spt/utils/JsonUtil"; import { VFS } from "@spt/utils/VFS"; @@ -14,6 +15,7 @@ export class FikaPlayerRelationsCacheService { private readonly playerRelationsPath = "cache/playerRelations.json"; constructor( + @inject("WinstonLogger") protected logger: ILogger, @inject("ProfileHelper") protected profileHelper: ProfileHelper, @inject("JsonUtil") protected jsonUtil: JsonUtil, @inject("VFS") protected vfs: VFS, @@ -26,16 +28,52 @@ export class FikaPlayerRelationsCacheService { } this.playerRelations = this.jsonUtil.deserialize(this.vfs.readFile(this.playerRelationsFullPath), this.playerRelationsFullPath); + } + public postInit() { const profiles = this.profileHelper.getProfiles(); + const profileIds = Object.keys(profiles); + var shouldSave = false; - for (const profileId of Object.keys(profiles)) { + for (const profileId of profileIds) { if (!this.playerRelations[profileId]) { this.storeValue(profileId, { Friends: [], Ignore: [], }); + + continue; + } + + const originalFriends = this.playerRelations[profileId].Friends; + const friendsToSearch = [...this.playerRelations[profileId].Friends]; + for (const friend of friendsToSearch) { + if (!profileIds.includes(friend)) { + const index = originalFriends.indexOf(friend); + if (index > -1) { + this.logger.warning("Deleting missing profile from friends: " + friend); + originalFriends.splice(index, 1); + shouldSave = true; + } + } } + + const originalIgnore = this.playerRelations[profileId].Ignore; + const ignoreToSearch = [...this.playerRelations[profileId].Ignore]; + for (const ignore of ignoreToSearch) { + if (!profileIds.includes(ignore)) { + const index = originalIgnore.indexOf(ignore); + if (index > -1) { + this.logger.warning("Deleting missing profile from ignores: " + ignore); + originalIgnore.splice(index, 1); + shouldSave = true; + } + } + } + } + + if (shouldSave) { + this.vfs.writeFile(this.playerRelationsFullPath, this.jsonUtil.serialize(this.playerRelations)); } } From 76329d401fb21cceb6b552f42d8eaa5ca0b53886 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Fri, 1 Nov 2024 18:40:29 +0100 Subject: [PATCH 111/119] Update types --- types/callbacks/HealthCallbacks.d.ts | 9 --- types/callbacks/InventoryCallbacks.d.ts | 2 + types/context/ContextVariableType.d.ts | 2 +- types/controllers/GameController.d.ts | 54 +------------ types/controllers/HealthController.d.ts | 10 --- types/controllers/InsuranceController.d.ts | 5 ++ types/controllers/InventoryController.d.ts | 10 +++ types/controllers/QuestController.d.ts | 51 ------------ types/generators/BotGenerator.d.ts | 10 ++- types/generators/RagfairOfferGenerator.d.ts | 5 +- types/helpers/InRaidHelper.d.ts | 7 -- types/helpers/ItemHelper.d.ts | 5 ++ types/helpers/QuestHelper.d.ts | 71 ++++++++++++++++- types/helpers/TraderHelper.d.ts | 2 +- types/models/eft/common/IGlobals.d.ts | 30 ++++++++ types/models/eft/common/ILocationBase.d.ts | 28 +++++++ types/models/eft/common/tables/IBotBase.d.ts | 1 + types/models/eft/common/tables/IBotType.d.ts | 1 + types/models/eft/common/tables/IItem.d.ts | 6 ++ types/models/eft/common/tables/ITrader.d.ts | 5 ++ .../HideoutUpgradeCompleteRequestData.d.ts | 5 ++ .../eft/inventory/IPinOrLockItemRequest.d.ts | 8 ++ types/models/enums/ItemEventActions.d.ts | 3 +- types/models/enums/SeasonalEventType.d.ts | 2 +- types/models/enums/WildSpawnTypeNumber.d.ts | 7 +- .../models/spt/bots/GenerateWeaponResult.d.ts | 10 +++ types/models/spt/config/IBotConfig.d.ts | 6 +- types/models/spt/config/ICoreConfig.d.ts | 1 + types/models/spt/config/IInsuranceConfig.d.ts | 4 +- types/models/spt/config/ILocationConfig.d.ts | 8 +- types/models/spt/config/IRagfairConfig.d.ts | 4 + .../spt/config/ISeasonalEventConfig.d.ts | 11 ++- types/models/spt/services/CustomPreset.d.ts | 5 ++ .../spt/services/CustomTraderAssortData.d.ts | 6 ++ types/models/spt/services/LootRequest.d.ts | 21 +++++ types/services/InsuranceService.d.ts | 1 + types/services/LocationLifecycleService.d.ts | 17 +++- types/services/PaymentService.d.ts | 3 +- types/services/PostDbLoadService.d.ts | 77 +++++++++++++++++++ types/services/ProfileSnapshotService.d.ts | 30 ++++++++ types/services/SeasonalEventService.d.ts | 26 +++++-- 41 files changed, 415 insertions(+), 154 deletions(-) create mode 100644 types/models/eft/hideout/HideoutUpgradeCompleteRequestData.d.ts create mode 100644 types/models/eft/inventory/IPinOrLockItemRequest.d.ts create mode 100644 types/models/spt/bots/GenerateWeaponResult.d.ts create mode 100644 types/models/spt/services/CustomPreset.d.ts create mode 100644 types/models/spt/services/CustomTraderAssortData.d.ts create mode 100644 types/models/spt/services/LootRequest.d.ts create mode 100644 types/services/PostDbLoadService.d.ts create mode 100644 types/services/ProfileSnapshotService.d.ts diff --git a/types/callbacks/HealthCallbacks.d.ts b/types/callbacks/HealthCallbacks.d.ts index 840c9b16..8523479d 100644 --- a/types/callbacks/HealthCallbacks.d.ts +++ b/types/callbacks/HealthCallbacks.d.ts @@ -4,7 +4,6 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IHealthTreatmentRequestData } from "@spt/models/eft/health/IHealthTreatmentRequestData"; import { IOffraidEatRequestData } from "@spt/models/eft/health/IOffraidEatRequestData"; import { IOffraidHealRequestData } from "@spt/models/eft/health/IOffraidHealRequestData"; -import { ISyncHealthRequestData } from "@spt/models/eft/health/ISyncHealthRequestData"; import { IWorkoutData } from "@spt/models/eft/health/IWorkoutData"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -14,14 +13,6 @@ export declare class HealthCallbacks { protected profileHelper: ProfileHelper; protected healthController: HealthController; constructor(httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, healthController: HealthController); - /** - * Custom spt server request found in modules/HealthSynchronizer.cs - * @param url - * @param info HealthListener.Instance.CurrentHealth class - * @param sessionID session id - * @returns empty response, no data sent back to client - */ - syncHealth(url: string, info: ISyncHealthRequestData, sessionID: string): IGetBodyResponseData; /** * Custom spt server request found in modules/QTEPatch.cs * @param url diff --git a/types/callbacks/InventoryCallbacks.d.ts b/types/callbacks/InventoryCallbacks.d.ts index e0968e64..cfbf6f37 100644 --- a/types/callbacks/InventoryCallbacks.d.ts +++ b/types/callbacks/InventoryCallbacks.d.ts @@ -18,6 +18,7 @@ import { IInventoryTagRequestData } from "@spt/models/eft/inventory/IInventoryTa import { IInventoryToggleRequestData } from "@spt/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IPinOrLockItemRequest } from "@spt/models/eft/inventory/IPinOrLockItemRequest"; import { IRedeemProfileRequestData } from "@spt/models/eft/inventory/IRedeemProfileRequestData"; import { ISetFavoriteItems } from "@spt/models/eft/inventory/ISetFavoriteItems"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -58,4 +59,5 @@ export declare class InventoryCallbacks { * Handle game/profile/items/moving - QuestFail */ failQuest(pmcData: IPmcData, request: IFailQuestRequestData, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse; + pinOrLock(pmcData: IPmcData, request: IPinOrLockItemRequest, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse; } diff --git a/types/context/ContextVariableType.d.ts b/types/context/ContextVariableType.d.ts index 38facc60..03a51882 100644 --- a/types/context/ContextVariableType.d.ts +++ b/types/context/ContextVariableType.d.ts @@ -3,7 +3,7 @@ export declare enum ContextVariableType { SESSION_ID = 0, /** Currently acive raid information */ RAID_CONFIGURATION = 1, - /** Timestamp when client first connected */ + /** SessionID + Timestamp when client first connected, has _ between values */ CLIENT_START_TIMESTAMP = 2, /** When player is loading into map and loot is requested */ REGISTER_PLAYER_REQUEST = 3, diff --git a/types/controllers/GameController.d.ts b/types/controllers/GameController.d.ts index dbcbce2a..cb9644af 100644 --- a/types/controllers/GameController.d.ts +++ b/types/controllers/GameController.d.ts @@ -19,9 +19,6 @@ import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; import { IHttpConfig } from "@spt/models/spt/config/IHttpConfig"; -import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; -import { ILootConfig } from "@spt/models/spt/config/ILootConfig"; -import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -31,6 +28,7 @@ import { GiftService } from "@spt/services/GiftService"; import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { OpenZoneService } from "@spt/services/OpenZoneService"; +import { PostDbLoadService } from "@spt/services/PostDbLoadService"; import { ProfileActivityService } from "@spt/services/ProfileActivityService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt/services/RaidTimeAdjustmentService"; @@ -52,6 +50,7 @@ export declare class GameController { protected profileHelper: ProfileHelper; protected profileFixerService: ProfileFixerService; protected localisationService: LocalisationService; + protected postDbLoadService: PostDbLoadService; protected customLocationWaveService: CustomLocationWaveService; protected openZoneService: OpenZoneService; protected seasonalEventService: SeasonalEventService; @@ -64,33 +63,16 @@ export declare class GameController { protected cloner: ICloner; protected httpConfig: IHttpConfig; protected coreConfig: ICoreConfig; - protected locationConfig: ILocationConfig; protected ragfairConfig: IRagfairConfig; protected hideoutConfig: IHideoutConfig; - protected pmcConfig: IPmcConfig; - protected lootConfig: ILootConfig; 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, 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, 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 migrate39xProfile(fullProfile: ISptProfile): void; - protected adjustHideoutCraftTimes(overrideSeconds: number): void; - /** - * Adjust all hideout craft times to be no higher than the override - */ - protected adjustHideoutBuildTimes(overrideSeconds: number): void; - protected adjustLocationBotValues(): void; - /** - * Out of date/incorrectly made trader mods forget this data - */ - protected checkTraderRepairValuesExist(): void; - protected addCustomLooseLootPositions(): void; - protected adjustLooseLootSpawnProbabilities(): void; - /** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */ - protected adjustMapBotLimits(): void; /** * Handle client/game/config */ @@ -119,48 +101,26 @@ export declare class GameController { * Handle singleplayer/settings/getRaidTime */ getRaidTime(sessionId: string, request: IGetRaidTimeRequest): IGetRaidTimeResponse; - /** - * BSG have two values for shotgun dispersion, we make sure both have the same value - */ - protected fixShotgunDispersions(): void; /** * Players set botReload to a high value and don't expect the crazy fast reload speeds, give them a warn about it * @param pmcProfile Player profile */ protected warnOnActiveBotReloadSkill(pmcProfile: IPmcData): void; - protected setAllDbItemsAsSellableOnFlea(): void; /** * When player logs in, iterate over all active effects and reduce timer * @param pmcProfile Profile to adjust values for */ protected updateProfileHealthValues(pmcProfile: IPmcData): void; - /** - * Waves with an identical min/max values spawn nothing, the number of bots that spawn is the difference between min and max - */ - protected fixBrokenOfflineMapWaves(): void; - /** - * Make Rogues spawn later to allow for scavs to spawn first instead of rogues filling up all spawn positions - */ - protected fixRoguesSpawningInstantlyOnLighthouse(): void; /** * Send starting gifts to profile after x days * @param pmcProfile Profile to add gifts to */ protected sendPraporGiftsToNewProfiles(pmcProfile: IPmcData): void; - /** - * Find and split waves with large numbers of bots into smaller waves - BSG appears to reduce the size of these - * waves to one bot when they're waiting to spawn for too long - */ - protected splitBotWavesIntoSingleWaves(): void; /** * Get a list of installed mods and save their details to the profile being used * @param fullProfile Profile to add mod details to */ protected saveActiveModsToProfile(fullProfile: ISptProfile): void; - /** - * Check for any missing assorts inside each traders assort.json data, checking against traders questassort.json - */ - protected validateQuestAssortUnlocksExist(): void; /** * Add the logged in players name to PMC name pool * @param pmcProfile Profile of player to get name from @@ -171,13 +131,5 @@ export declare class GameController { * @param fullProfile Profile to check for dialog in */ protected checkForAndRemoveUndefinedDialogs(fullProfile: ISptProfile): void; - /** - * Blank out the "test" mail message from prapor - */ - protected removePraporTestMessage(): void; - /** - * Make non-trigger-spawned raiders spawn earlier + always - */ - protected adjustLabsRaiderSpawnRate(): void; protected logProfileDetails(fullProfile: ISptProfile): void; } diff --git a/types/controllers/HealthController.d.ts b/types/controllers/HealthController.d.ts index 5a0a0a69..a17efe37 100644 --- a/types/controllers/HealthController.d.ts +++ b/types/controllers/HealthController.d.ts @@ -5,7 +5,6 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IHealthTreatmentRequestData } from "@spt/models/eft/health/IHealthTreatmentRequestData"; import { IOffraidEatRequestData } from "@spt/models/eft/health/IOffraidEatRequestData"; import { IOffraidHealRequestData } from "@spt/models/eft/health/IOffraidHealRequestData"; -import { ISyncHealthRequestData } from "@spt/models/eft/health/ISyncHealthRequestData"; import { IWorkoutData } from "@spt/models/eft/health/IWorkoutData"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -25,15 +24,6 @@ export declare class HealthController { protected healthHelper: HealthHelper; protected cloner: ICloner; constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, localisationService: LocalisationService, httpResponse: HttpResponseUtil, healthHelper: HealthHelper, cloner: ICloner); - /** - * stores in-raid player health - * @param pmcData Player profile - * @param info Request data - * @param sessionID Player id - * @param addEffects Should effects found be added or removed from profile - * @param deleteExistingEffects Should all prior effects be removed before apply new ones - */ - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void; /** * When healing in menu * @param pmcData Player profile diff --git a/types/controllers/InsuranceController.d.ts b/types/controllers/InsuranceController.d.ts index 2701622e..c9825292 100644 --- a/types/controllers/InsuranceController.d.ts +++ b/types/controllers/InsuranceController.d.ts @@ -176,6 +176,11 @@ export declare class InsuranceController { * @returns void */ protected sendMail(sessionID: string, insurance: IInsurance): void; + protected IsMapLabsAndInsuranceDisabled(insurance: IInsurance, labsId?: string): boolean; + /** + * Update IInsurance object with new messageTemplateId and wipe out items array data + */ + protected handleLabsInsurance(traderDialogMessages: Record, insurance: IInsurance): void; /** * Determines whether an insured item should be removed from the player's inventory based on a random roll and * trader-specific return chance. diff --git a/types/controllers/InventoryController.d.ts b/types/controllers/InventoryController.d.ts index c986ce8c..fb81a2ff 100644 --- a/types/controllers/InventoryController.d.ts +++ b/types/controllers/InventoryController.d.ts @@ -25,6 +25,7 @@ import { IInventoryTagRequestData } from "@spt/models/eft/inventory/IInventoryTa import { IInventoryToggleRequestData } from "@spt/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IPinOrLockItemRequest } from "@spt/models/eft/inventory/IPinOrLockItemRequest"; import { IRedeemProfileRequestData } from "@spt/models/eft/inventory/IRedeemProfileRequestData"; import { ISetFavoriteItems } from "@spt/models/eft/inventory/ISetFavoriteItems"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -228,4 +229,13 @@ export declare class InventoryController { openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string, output: IItemEventRouterResponse): void; redeemProfileReward(pmcData: IPmcData, request: IRedeemProfileRequestData, sessionId: string): void; setFavoriteItem(pmcData: IPmcData, request: ISetFavoriteItems, sessionId: string): void; + /** + * Handle /client/game/profile/items/moving - PinLock + * Requires no response to client, only server change + * @param pmcData Players profile + * @param request Pin/Lock request data + * @param sessionID Session id + * @param output data to send back to client + */ + pinOrLock(pmcData: IPmcData, request: IPinOrLockItemRequest, sessionID: string, output: IItemEventRouterResponse): IItemEventRouterResponse; } diff --git a/types/controllers/QuestController.d.ts b/types/controllers/QuestController.d.ts index 270a70a9..ac486e38 100644 --- a/types/controllers/QuestController.d.ts +++ b/types/controllers/QuestController.d.ts @@ -5,7 +5,6 @@ import { QuestConditionHelper } from "@spt/helpers/QuestConditionHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { IQuestStatus } from "@spt/models/eft/common/tables/IBotBase"; import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IQuest, IQuestCondition } from "@spt/models/eft/common/tables/IQuest"; import { IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; @@ -54,13 +53,6 @@ export declare class QuestController { * @returns array of IQuest */ getClientQuests(sessionID: string): IQuest[]; - /** - * Does a provided quest have a level requirement equal to or below defined level - * @param quest Quest to check - * @param playerLevel level of player to test against quest - * @returns true if quest can be seen/accepted by player of defined level - */ - protected playerLevelFulfillsQuestRequirement(quest: IQuest, playerLevel: number): boolean; /** * Handle QuestAccept event * Handle the client accepting a quest and starting it @@ -108,49 +100,6 @@ export declare class QuestController { * @returns ItemEvent client response */ completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; - /** - * Return a list of quests that would fail when supplied quest is completed - * @param completedQuestId quest completed id - * @returns array of IQuest objects - */ - protected getQuestsFailedByCompletingQuest(completedQuestId: string, pmcProfile: IPmcData): IQuest[]; - /** - * Remove a quest entirely from a profile - * @param sessionId Player id - * @param questIdToRemove Qid of quest to remove - */ - protected removeQuestFromScavProfile(sessionId: string, questIdToRemove: string): void; - /** - * Return quests that have different statuses - * @param preQuestStatusus Quests before - * @param postQuestStatuses Quests after - * @returns QuestStatusChange array - */ - protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; - /** - * Send a popup to player on successful completion of a quest - * @param sessionID session id - * @param pmcData Player profile - * @param completedQuestId Completed quest id - * @param questRewards Rewards given to player - */ - protected sendSuccessDialogMessageOnQuestComplete(sessionID: string, pmcData: IPmcData, completedQuestId: string, questRewards: IItem[]): void; - /** - * Look for newly available quests after completing a quest with a requirement to wait x minutes (time-locked) before being available and add data to profile - * @param pmcData Player profile to update - * @param quests Quests to look for wait conditions in - * @param completedQuestId Quest just completed - */ - protected addTimeLockedQuestsToProfile(pmcData: IPmcData, quests: IQuest[], completedQuestId: string): void; - /** - * Fail the provided quests - * Update quest in profile, otherwise add fresh quest object with failed status - * @param sessionID session id - * @param pmcData player profile - * @param questsToFail quests to fail - * @param output Client output - */ - protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[], output: IItemEventRouterResponse): void; /** * Handle QuestHandover event * @param pmcData Player profile diff --git a/types/generators/BotGenerator.d.ts b/types/generators/BotGenerator.d.ts index 6f76b378..6281031e 100644 --- a/types/generators/BotGenerator.d.ts +++ b/types/generators/BotGenerator.d.ts @@ -1,5 +1,6 @@ import { BotInventoryGenerator } from "@spt/generators/BotInventoryGenerator"; import { BotLevelGenerator } from "@spt/generators/BotLevelGenerator"; +import { BotGeneratorHelper } from "@spt/helpers/BotGeneratorHelper"; import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; @@ -31,6 +32,7 @@ export declare class BotGenerator { protected botEquipmentFilterService: BotEquipmentFilterService; protected weightedRandomHelper: WeightedRandomHelper; protected botHelper: BotHelper; + protected botGeneratorHelper: BotGeneratorHelper; protected seasonalEventService: SeasonalEventService; protected itemFilterService: ItemFilterService; protected botNameService: BotNameService; @@ -38,7 +40,7 @@ export declare class BotGenerator { protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, botNameService: BotNameService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, seasonalEventService: SeasonalEventService, itemFilterService: ItemFilterService, botNameService: BotNameService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -76,6 +78,12 @@ export declare class BotGenerator { * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: IBotGenerationDetails): IBotBase; + /** + * Set weighting of flagged equipment to 0 + * @param botJsonTemplate Bot data to adjust + * @param botGenerationDetails Generation details of bot + */ + protected filterBlacklistedGear(botJsonTemplate: IBotType, botGenerationDetails: IBotGenerationDetails): void; protected addAdditionalPocketLootWeightsForUnheardBot(botJsonTemplate: IBotType): void; /** * Remove items from item.json/lootableItemBlacklist from bots inventory diff --git a/types/generators/RagfairOfferGenerator.d.ts b/types/generators/RagfairOfferGenerator.d.ts index 3c88984b..60d6c9d1 100644 --- a/types/generators/RagfairOfferGenerator.d.ts +++ b/types/generators/RagfairOfferGenerator.d.ts @@ -149,12 +149,13 @@ export declare class RagfairOfferGenerator { protected removeBannedPlatesFromPreset(presetWithChildren: IItem[], plateSettings: IArmorPlateBlacklistSettings): boolean; /** * Create one flea offer for a specific item + * @param sellerId Id of seller * @param itemWithChildren Item to create offer for * @param isPreset Is item a weapon preset - * @param itemDetails raw db item details + * @param itemToSellDetails Raw db item details * @returns Item array */ - protected createSingleOfferForItem(itemWithChildren: IItem[], isPreset: boolean, itemDetails: [boolean, ITemplateItem]): Promise; + protected createSingleOfferForItem(sellerId: string, itemWithChildren: IItem[], isPreset: boolean, itemToSellDetails: ITemplateItem): Promise; /** * Generate trader offers on flea using the traders assort data * @param traderID Trader to generate offers for diff --git a/types/helpers/InRaidHelper.d.ts b/types/helpers/InRaidHelper.d.ts index 11b40439..87136b69 100644 --- a/types/helpers/InRaidHelper.d.ts +++ b/types/helpers/InRaidHelper.d.ts @@ -40,13 +40,6 @@ export declare class InRaidHelper { * @param postRaidProfile Profile returned by client after a raid */ setInventory(sessionID: string, serverProfile: IPmcData, postRaidProfile: IPmcData, isSurvived: boolean, isTransfer: boolean): void; - /** - * Iterate over inventory items and remove the property that defines an item as Found in Raid - * Only removes property if item had FiR when entering raid - * @param postRaidProfile profile to update items for - * @returns Updated profile with SpawnedInSession removed - */ - removeSpawnedInSessionPropertyFromItems(postRaidProfile: IPmcData): IPmcData; /** * Clear PMC inventory of all items except those that are exempt * Used post-raid to remove items after death diff --git a/types/helpers/ItemHelper.d.ts b/types/helpers/ItemHelper.d.ts index 366ad9b7..24a6b38f 100644 --- a/types/helpers/ItemHelper.d.ts +++ b/types/helpers/ItemHelper.d.ts @@ -536,6 +536,11 @@ export declare class ItemHelper { */ getRandomisedAmmoStackSize(ammoItemTemplate: ITemplateItem, maxLimit?: number): number; getItemBaseType(tpl: string, rootOnly?: boolean): string; + /** + * Remove FiR status from passed in items + * @param items Items to update FiR status of + */ + removeSpawnedInSessionPropertyFromItems(items: IItem[]): void; } declare namespace ItemHelper { interface IItemSize { diff --git a/types/helpers/QuestHelper.d.ts b/types/helpers/QuestHelper.d.ts index 02fc4399..ff0f72bc 100644 --- a/types/helpers/QuestHelper.d.ts +++ b/types/helpers/QuestHelper.d.ts @@ -12,6 +12,7 @@ import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IQuest, IQuestCondition, IQuestReward } from "@spt/models/eft/common/tables/IQuest"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { IAcceptQuestRequestData } from "@spt/models/eft/quests/IAcceptQuestRequestData"; +import { ICompleteQuestRequestData } from "@spt/models/eft/quests/ICompleteQuestRequestData"; import { IFailQuestRequestData } from "@spt/models/eft/quests/IFailQuestRequestData"; import { QuestStatus } from "@spt/models/enums/QuestStatus"; import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; @@ -22,6 +23,7 @@ import { DatabaseService } from "@spt/services/DatabaseService"; import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; +import { PlayerService } from "@spt/services/PlayerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; @@ -44,10 +46,11 @@ export declare class QuestHelper { protected traderHelper: TraderHelper; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; + protected playerService: PlayerService; 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, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, traderHelper: TraderHelper, presetHelper: PresetHelper, mailSendService: MailSendService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, databaseService: DatabaseService, questConditionHelper: QuestConditionHelper, eventOutputHolder: EventOutputHolder, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, traderHelper: TraderHelper, presetHelper: PresetHelper, mailSendService: MailSendService, playerService: PlayerService, configServer: ConfigServer, cloner: ICloner); /** * Get status of a quest in player profile by its id * @param pmcData Profile to search @@ -260,6 +263,13 @@ export declare class QuestHelper { * @returns Array of reward objects */ applyQuestReward(profileData: IPmcData, questId: string, state: QuestStatus, sessionId: string, questResponse: IItemEventRouterResponse): IItem[]; + /** + * Does the provided quest reward have a game version requirement to be given and does it match + * @param reward Reward to check + * @param gameVersion Version of game to check reward against + * @returns True if it has requirement, false if it doesnt pass check + */ + protected questRewardIsForGameEdition(reward: IQuestReward, gameVersion: string): boolean; /** * WIP - Find hideout craft id and add to unlockedProductionRecipe array in player profile * also update client response recipeUnlocked array with craft id @@ -302,4 +312,63 @@ export declare class QuestHelper { * @returns Hours item will be available for */ getMailItemRedeemTimeHoursForProfile(pmcData: IPmcData): number; + completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Handle client/quest/list + * Get all quests visible to player + * Exclude quests with incomplete preconditions (level/loyalty) + * @param sessionID session id + * @returns array of IQuest + */ + getClientQuests(sessionID: string): IQuest[]; + /** + * Return a list of quests that would fail when supplied quest is completed + * @param completedQuestId quest completed id + * @returns array of IQuest objects + */ + protected getQuestsFromProfileFailedByCompletingQuest(completedQuestId: string, pmcProfile: IPmcData): IQuest[]; + /** + * Fail the provided quests + * Update quest in profile, otherwise add fresh quest object with failed status + * @param sessionID session id + * @param pmcData player profile + * @param questsToFail quests to fail + * @param output Client output + */ + protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[], output: IItemEventRouterResponse): void; + /** + * Send a popup to player on successful completion of a quest + * @param sessionID session id + * @param pmcData Player profile + * @param completedQuestId Completed quest id + * @param questRewards Rewards given to player + */ + protected sendSuccessDialogMessageOnQuestComplete(sessionID: string, pmcData: IPmcData, completedQuestId: string, questRewards: IItem[]): void; + /** + * Look for newly available quests after completing a quest with a requirement to wait x minutes (time-locked) before being available and add data to profile + * @param pmcData Player profile to update + * @param quests Quests to look for wait conditions in + * @param completedQuestId Quest just completed + */ + protected addTimeLockedQuestsToProfile(pmcData: IPmcData, quests: IQuest[], completedQuestId: string): void; + /** + * Remove a quest entirely from a profile + * @param sessionId Player id + * @param questIdToRemove Qid of quest to remove + */ + protected removeQuestFromScavProfile(sessionId: string, questIdToRemove: string): void; + /** + * Return quests that have different statuses + * @param preQuestStatusus Quests before + * @param postQuestStatuses Quests after + * @returns QuestStatusChange array + */ + protected getQuestsWithDifferentStatuses(preQuestStatusus: IQuestStatus[], postQuestStatuses: IQuestStatus[]): IQuestStatus[] | undefined; + /** + * Does a provided quest have a level requirement equal to or below defined level + * @param quest Quest to check + * @param playerLevel level of player to test against quest + * @returns true if quest can be seen/accepted by player of defined level + */ + protected playerLevelFulfillsQuestRequirement(quest: IQuest, playerLevel: number): boolean; } diff --git a/types/helpers/TraderHelper.d.ts b/types/helpers/TraderHelper.d.ts index 0cce160f..1eb3426a 100644 --- a/types/helpers/TraderHelper.d.ts +++ b/types/helpers/TraderHelper.d.ts @@ -39,7 +39,7 @@ export declare class TraderHelper { * @param sessionID Players id * @returns Trader base */ - getTrader(traderID: string, sessionID: string): ITraderBase | undefined; + getTrader(traderID: string, sessionID: string): ITraderBase | any; /** * Get all assort data for a particular trader * @param traderId Trader to get assorts for diff --git a/types/models/eft/common/IGlobals.d.ts b/types/models/eft/common/IGlobals.d.ts index f23b608d..29f2abff 100644 --- a/types/models/eft/common/IGlobals.d.ts +++ b/types/models/eft/common/IGlobals.d.ts @@ -3,12 +3,25 @@ import { IItem } from "@spt/models/eft/common/tables/IItem"; export interface IGlobals { time: number; config: IConfig; + LocationInfection: ILocationInfection; bot_presets: IBotPreset[]; AudioSettings: IAudioSettings; EnvironmentSettings: IEnvironmentSettings; BotWeaponScatterings: IBotWeaponScattering[]; ItemPresets: Record; } +export interface ILocationInfection { + Interchange: number; + Lighthouse: number; + RezervBase: number; + Sandbox: number; + Shoreline: number; + TarkovStreets: number; + Woods: number; + bigmap: number; + factory4: number; + laboratory: number; +} export interface IArtilleryShelling { ArtilleryMapsConfigs: Record; ProjectileExplosionParams: IProjectileExplosionParams; @@ -96,6 +109,7 @@ export interface IConfig { MaxBotsAliveOnMapPvE: number; SavagePlayCooldown: number; SavagePlayCooldownNdaFree: number; + SeasonActivity: ISeasonActivity; MarksmanAccuracy: number; SavagePlayCooldownDevelop: number; TODSkyDate: string; @@ -182,6 +196,14 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface ISeasonActivity { + InfectionHalloween: ISeasonActivityHalloween; +} +export interface ISeasonActivityHalloween { + DisplayUIEnabled: boolean; + Enabled: boolean; + ZombieBleedMul: number; +} export interface IEnvironmentSetting2 { EnvironmentUIData: IEnvironmentUIData; } @@ -262,6 +284,7 @@ export interface ITransitSettings { PercentageOfMissingEnergyRestore: number; PercentageOfMissingHealthRestore: number; PercentageOfMissingWaterRestore: number; + RestoreHealthOnDestroyedParts: boolean; ScavPriceMod: number; UsecPriceMod: number; active: boolean; @@ -634,6 +657,12 @@ export interface IEffects { HeavyBleeding: IHeavyBleeding; LightBleeding: ILightBleeding; BodyTemperature: IBodyTemperature; + ZombieInfection: IZombieInfection; +} +export interface IZombieInfection { + Dehydration: number; + HearingDebuffPercentage: number; + СumulativeTime: number; } export interface IExistence { EnergyLoopTime: number; @@ -1203,6 +1232,7 @@ export interface IInsurance { CoefOfSendingMessageTime: number; CoefOfHavingMarkOfUnknown: number; EditionSendingMessageTime: Record; + OnlyInDeathCase: boolean; } export interface IMessageSendTImeMultipler { multiplier: number; diff --git a/types/models/eft/common/ILocationBase.d.ts b/types/models/eft/common/ILocationBase.d.ts index 473648da..75836b67 100644 --- a/types/models/eft/common/ILocationBase.d.ts +++ b/types/models/eft/common/ILocationBase.d.ts @@ -77,6 +77,7 @@ export interface ILocationBase { EscapeTimeLimit: number; EscapeTimeLimitCoop: number; EscapeTimeLimitPVE: number; + Events: ILocationEvents; exit_access_time: number; ForceOnlineRaidInPVE: boolean; exit_count: number; @@ -99,6 +100,7 @@ export interface ILocationBase { export interface ITransit { activateAfterSec: string; active: boolean; + name: string; conditions: string; description: string; id: number; @@ -271,10 +273,36 @@ export interface IWave { slots_min: number; time_max: number; time_min: number; + /** OPTIONAL - Needs to be unique - Used by custom wave service to ensure same wave isnt added multiple times */ sptId?: string; ChanceGroup?: number; + /** 'pve' and/or 'regular' */ SpawnMode: string[]; } +export interface ILocationEvents { + Halloween2024: IHalloween2024; +} +export interface IHalloween2024 { + CrowdAttackBlockRadius: number; + CrowdAttackSpawnParams: CrowdAttackSpawnParam[]; + CrowdCooldownPerPlayerSec: number; + CrowdsLimit: number; + InfectedLookCoeff: number; + MaxCrowdAttackSpawnLimit: number; + MinInfectionPercentage: number; + MinSpawnDistToPlayer: number; + TargetPointSearchRadiusLimit: number; + ZombieCallDeltaRadius: number; + ZombieCallPeriodSec: number; + ZombieCallRadiusLimit: number; + ZombieMultiplier: number; + InfectionPercentage: number; +} +export interface CrowdAttackSpawnParam { + Difficulty: string; + Role: string; + Weight: number; +} export declare enum WildSpawnType { ASSAULT = "assault", MARKSMAN = "marksman", diff --git a/types/models/eft/common/tables/IBotBase.d.ts b/types/models/eft/common/tables/IBotBase.d.ts index 307277c8..60960afa 100644 --- a/types/models/eft/common/tables/IBotBase.d.ts +++ b/types/models/eft/common/tables/IBotBase.d.ts @@ -93,6 +93,7 @@ export interface IBotInfoSettings { Experience: number; StandingForKill: number; AggressorBonus: number; + UseSimpleAnimator: boolean; } export interface IBan { banType: BanType; diff --git a/types/models/eft/common/tables/IBotType.d.ts b/types/models/eft/common/tables/IBotType.d.ts index 6d4b0c72..aded8fbd 100644 --- a/types/models/eft/common/tables/IBotType.d.ts +++ b/types/models/eft/common/tables/IBotType.d.ts @@ -101,6 +101,7 @@ export interface IExperience { level: MinMax; reward: MinMax; standingForKill: number; + useSimpleAnimator: boolean; } export interface IGeneration { items: IGenerationWeightingItems; diff --git a/types/models/eft/common/tables/IItem.d.ts b/types/models/eft/common/tables/IItem.d.ts index 8139fa14..443e6f10 100644 --- a/types/models/eft/common/tables/IItem.d.ts +++ b/types/models/eft/common/tables/IItem.d.ts @@ -42,6 +42,12 @@ export interface IUpd { SideEffect?: IUpdSideEffect; RepairKit?: IUpdRepairKit; CultistAmulet?: IUpdCultistAmulet; + PinLockState?: PinLockState; +} +export declare enum PinLockState { + FREE = "Free", + LOCKED = "Locked", + PINNED = "Pinned" } export interface IUpdBuff { rarity: string; diff --git a/types/models/eft/common/tables/ITrader.d.ts b/types/models/eft/common/tables/ITrader.d.ts index 9e161c8a..6dd54c10 100644 --- a/types/models/eft/common/tables/ITrader.d.ts +++ b/types/models/eft/common/tables/ITrader.d.ts @@ -88,18 +88,23 @@ export interface IBarterScheme { } export interface ISuit { _id: string; + externalObtain: boolean; + internalObtain: boolean; + isHiddenInPVE: boolean; tid: string; suiteId: string; isActive: boolean; requirements: ISuitRequirements; } export interface ISuitRequirements { + achievementRequirements: string[]; loyaltyLevel: number; profileLevel: number; standing: number; skillRequirements: string[]; questRequirements: string[]; itemRequirements: ItemRequirement[]; + requiredTid: string; } export interface ItemRequirement { count: number; diff --git a/types/models/eft/hideout/HideoutUpgradeCompleteRequestData.d.ts b/types/models/eft/hideout/HideoutUpgradeCompleteRequestData.d.ts new file mode 100644 index 00000000..8583e8d9 --- /dev/null +++ b/types/models/eft/hideout/HideoutUpgradeCompleteRequestData.d.ts @@ -0,0 +1,5 @@ +export interface HideoutUpgradeCompleteRequestData { + Action: string; + areaType: number; + timestamp: number; +} diff --git a/types/models/eft/inventory/IPinOrLockItemRequest.d.ts b/types/models/eft/inventory/IPinOrLockItemRequest.d.ts new file mode 100644 index 00000000..c39b4047 --- /dev/null +++ b/types/models/eft/inventory/IPinOrLockItemRequest.d.ts @@ -0,0 +1,8 @@ +import { PinLockState } from "../common/tables/IItem"; +export interface IPinOrLockItemRequest { + Action: "PinLock"; + /** Id of item being pinned */ + Item: string; + /** "Pinned"/"Locked"/"Free" */ + State: PinLockState; +} diff --git a/types/models/enums/ItemEventActions.d.ts b/types/models/enums/ItemEventActions.d.ts index f8a8b5a2..3541ae86 100644 --- a/types/models/enums/ItemEventActions.d.ts +++ b/types/models/enums/ItemEventActions.d.ts @@ -25,5 +25,6 @@ export declare enum ItemEventActions { REMOVE_EQUIPMENT_BUILD = "RemoveEquipmentBuild", REDEEM_PROFILE_REWARD = "RedeemProfileReward", SET_FAVORITE_ITEMS = "SetFavoriteItems", - QUEST_FAIL = "QuestFail" + QUEST_FAIL = "QuestFail", + PIN_LOCK = "PinLock" } diff --git a/types/models/enums/SeasonalEventType.d.ts b/types/models/enums/SeasonalEventType.d.ts index cfea1f5b..5e67118f 100644 --- a/types/models/enums/SeasonalEventType.d.ts +++ b/types/models/enums/SeasonalEventType.d.ts @@ -4,5 +4,5 @@ export declare enum SeasonalEventType { HALLOWEEN = "Halloween", NEW_YEARS = "NewYears", PROMO = "Promo", - SNOW = "Snow" + APRIL_FOOLS = "AprilFools" } diff --git a/types/models/enums/WildSpawnTypeNumber.d.ts b/types/models/enums/WildSpawnTypeNumber.d.ts index ab823cc6..d93c13b4 100644 --- a/types/models/enums/WildSpawnTypeNumber.d.ts +++ b/types/models/enums/WildSpawnTypeNumber.d.ts @@ -54,5 +54,10 @@ export declare enum WildSpawnTypeNumber { SKIER = 53, SECTANTPREDVESTNIK = 57, SECTANTPRIZRAK = 58, - SECTANTONI = 59 + SECTANTONI = 59, + INFECTEDASSAULT = 60, + INFECTEDPMC = 61, + INFECTEDCIVIL = 62, + INFECTEDLABORANT = 63, + INFECTEDTAGILLA = 64 } diff --git a/types/models/spt/bots/GenerateWeaponResult.d.ts b/types/models/spt/bots/GenerateWeaponResult.d.ts new file mode 100644 index 00000000..73209ac8 --- /dev/null +++ b/types/models/spt/bots/GenerateWeaponResult.d.ts @@ -0,0 +1,10 @@ +import { IMods } from "@spt/models/eft/common/tables/IBotType"; +import { IItem } from "@spt/models/eft/common/tables/IItem"; +import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; +export declare class GenerateWeaponResult { + weapon: IItem[]; + chosenAmmoTpl: string; + chosenUbglAmmoTpl: string; + weaponMods: IMods; + weaponTemplate: ITemplateItem; +} diff --git a/types/models/spt/config/IBotConfig.d.ts b/types/models/spt/config/IBotConfig.d.ts index 51a82b32..9fa301a2 100644 --- a/types/models/spt/config/IBotConfig.d.ts +++ b/types/models/spt/config/IBotConfig.d.ts @@ -169,9 +169,11 @@ export interface IEquipmentFilterDetails { /** Between what levels do these equipment filter setting apply to */ levelRange: MinMax; /** Key: mod slot name e.g. mod_magazine, value: item tpls */ - equipment: Record; + equipment?: Record; + /** Key: equipment slot name e.g. FirstPrimaryWeapon, value: item tpls */ + gear?: Record; /** Key: cartridge type e.g. Caliber23x75, value: item tpls */ - cartridge: Record; + cartridge?: Record; } export interface IWeightingAdjustmentDetails { /** Between what levels do these weight settings apply to */ diff --git a/types/models/spt/config/ICoreConfig.d.ts b/types/models/spt/config/ICoreConfig.d.ts index 39c4f18f..572d0b48 100644 --- a/types/models/spt/config/ICoreConfig.d.ts +++ b/types/models/spt/config/ICoreConfig.d.ts @@ -71,6 +71,7 @@ export interface IChatbotFeatures { commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; commandUseLimits: Record; + ids: Record; } export interface ICommandoFeatures { giveCommandEnabled: boolean; diff --git a/types/models/spt/config/IInsuranceConfig.d.ts b/types/models/spt/config/IInsuranceConfig.d.ts index 6c90fe09..fd15e947 100644 --- a/types/models/spt/config/IInsuranceConfig.d.ts +++ b/types/models/spt/config/IInsuranceConfig.d.ts @@ -7,8 +7,10 @@ export interface IInsuranceConfig extends IBaseConfig { blacklistedEquipment: string[]; /** Some slots should always be removed, e.g. 'cartridges' */ slotIdsToAlwaysRemove: string[]; - /** Override to control how quickly insurance is processed/returned in second */ + /** Override to control how quickly insurance is processed/returned in seconds */ returnTimeOverrideSeconds: number; + /** Override to control how long insurance returns stay in mail before expiring - in seconds */ + storageTimeOverrideSeconds: number; /** How often server should process insurance in seconds */ runIntervalSeconds: number; minAttachmentRoublePriceToBeTaken: number; diff --git a/types/models/spt/config/ILocationConfig.d.ts b/types/models/spt/config/ILocationConfig.d.ts index 55123d6f..6fcf23da 100644 --- a/types/models/spt/config/ILocationConfig.d.ts +++ b/types/models/spt/config/ILocationConfig.d.ts @@ -3,8 +3,6 @@ import { IBossLocationSpawn, IWave } from "@spt/models/eft/common/ILocationBase" import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface ILocationConfig extends IBaseConfig { kind: "spt-location"; - /** Waves with a min/max of the same value don't spawn any bots, bsg only spawn the difference between min and max */ - fixEmptyBotWavesSettings: IFixEmptyBotWavesSettings; /** Rogues are classified as bosses and spawn immediatly, this can result in no scavs spawning, delay rogues spawning to allow scavs to spawn first */ rogueLighthouseSpawnTimeSettings: IRogueLighthouseSpawnTimeSettings; /** When a map has hit max alive bots, any wave that should spawn will be reduced to 1 bot in size and placed in a spawn queue, this splits waves into smaller sizes to reduce the impact of this behaviour */ @@ -44,6 +42,12 @@ export interface ILocationConfig extends IBaseConfig { scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; + /** min percentage to set raider spawns at, -1 makes no changes */ + reserveRaiderSpawnChanceOverrides: IReserveRaiderSpawnChanceOverrides; +} +export interface IReserveRaiderSpawnChanceOverrides { + nonTriggered: number; + triggered: number; } export interface IEquipmentLootSettings { modSpawnChancePercent: Record; diff --git a/types/models/spt/config/IRagfairConfig.d.ts b/types/models/spt/config/IRagfairConfig.d.ts index 9b178615..36122c56 100644 --- a/types/models/spt/config/IRagfairConfig.d.ts +++ b/types/models/spt/config/IRagfairConfig.d.ts @@ -50,6 +50,8 @@ export interface IDynamic { priceRanges: IPriceRanges; /** Should default presets to listed only or should non-standard presets found in globals.json be listed too */ showDefaultPresetsOnly: boolean; + /** Tpls that should not use the variable price system when their quality is < 100% (lower dura/uses = lower price) */ + ignoreQualityPriceVarianceBlacklist: string[]; endTimeSeconds: MinMax; /** Settings to control the durability range of item items listed on flea */ condition: Condition; @@ -90,6 +92,8 @@ export interface IBarterDetails { priceRangeVariancePercent: number; /** Min rouble price for an offer to be considered for turning into a barter */ minRoubleCostToBecomeBarter: number; + /** Should barter offers only single stack */ + makeSingleStackOnly: boolean; /** Item Tpls to never be turned into a barter */ itemTypeBlacklist: string[]; } diff --git a/types/models/spt/config/ISeasonalEventConfig.d.ts b/types/models/spt/config/ISeasonalEventConfig.d.ts index 1280bc5b..9d92ceed 100644 --- a/types/models/spt/config/ISeasonalEventConfig.d.ts +++ b/types/models/spt/config/ISeasonalEventConfig.d.ts @@ -1,4 +1,4 @@ -import { IBossLocationSpawn } from "@spt/models/eft/common/ILocationBase"; +import { IBossLocationSpawn, IWave } from "@spt/models/eft/common/ILocationBase"; import { SeasonalEventType } from "@spt/models/enums/SeasonalEventType"; import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface ISeasonalEventConfig extends IBaseConfig { @@ -9,15 +9,24 @@ export interface ISeasonalEventConfig extends IBaseConfig { events: ISeasonalEvent[]; eventBotMapping: Record; eventBossSpawns: Record>; + eventWaves: Record>; gifterSettings: IGifterSetting[]; } export interface ISeasonalEvent { + enabled: boolean; name: string; type: SeasonalEventType; startDay: number; startMonth: number; endDay: number; endMonth: number; + settings?: Record; +} +export interface IZombieSettings { + enabled: boolean; + mapInfectionAmount: Record; + disableBosses: string[]; + disableWaves: string[]; } export interface IGifterSetting { map: string; diff --git a/types/models/spt/services/CustomPreset.d.ts b/types/models/spt/services/CustomPreset.d.ts new file mode 100644 index 00000000..3301a551 --- /dev/null +++ b/types/models/spt/services/CustomPreset.d.ts @@ -0,0 +1,5 @@ +import { IPreset } from "@spt/models/eft/common/IGlobals"; +export interface CustomPreset { + key: string; + preset: IPreset; +} diff --git a/types/models/spt/services/CustomTraderAssortData.d.ts b/types/models/spt/services/CustomTraderAssortData.d.ts new file mode 100644 index 00000000..7ad63418 --- /dev/null +++ b/types/models/spt/services/CustomTraderAssortData.d.ts @@ -0,0 +1,6 @@ +import { ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; +import { Traders } from "@spt/models/enums/Traders"; +export interface CustomTraderAssortData { + traderId: Traders; + assorts: ITraderAssort; +} diff --git a/types/models/spt/services/LootRequest.d.ts b/types/models/spt/services/LootRequest.d.ts new file mode 100644 index 00000000..7e1329a0 --- /dev/null +++ b/types/models/spt/services/LootRequest.d.ts @@ -0,0 +1,21 @@ +import { MinMax } from "@spt/models/common/MinMax"; +import { AirdropTypeEnum } from "@spt/models/enums/AirdropType"; +export interface LootRequest { + weaponPresetCount: MinMax; + armorPresetCount: MinMax; + itemCount: MinMax; + weaponCrateCount: MinMax; + itemBlacklist: string[]; + itemTypeWhitelist: string[]; + /** key: item base type: value: max count */ + itemLimits: Record; + itemStackLimits: Record; + armorLevelWhitelist: number[]; + allowBossItems: boolean; + useRewarditemBlacklist?: boolean; + useForcedLoot?: boolean; + forcedLoot?: Record; +} +export interface IAirdropLootRequest extends LootRequest { + icon?: AirdropTypeEnum; +} diff --git a/types/services/InsuranceService.d.ts b/types/services/InsuranceService.d.ts index 8b7b1b38..ac9cff5b 100644 --- a/types/services/InsuranceService.d.ts +++ b/types/services/InsuranceService.d.ts @@ -70,6 +70,7 @@ export declare class InsuranceService { * @returns void */ protected adoptOrphanedInsEquipment(sessionID: string): void; + protected getMaxInsuranceStorageTime(traderBase: ITraderBase): number; /** * Store lost gear post-raid inside profile, ready for later code to pick it up and mail it * @param equipmentPkg Gear to store - generated by getGearLostInRaid() diff --git a/types/services/LocationLifecycleService.d.ts b/types/services/LocationLifecycleService.d.ts index ba903027..53b83e8c 100644 --- a/types/services/LocationLifecycleService.d.ts +++ b/types/services/LocationLifecycleService.d.ts @@ -5,6 +5,7 @@ import { PlayerScavGenerator } from "@spt/generators/PlayerScavGenerator"; import { HealthHelper } from "@spt/helpers/HealthHelper"; import { InRaidHelper } from "@spt/helpers/InRaidHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; +import { QuestHelper } from "@spt/helpers/QuestHelper"; import { TraderHelper } from "@spt/helpers/TraderHelper"; import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; @@ -46,6 +47,7 @@ export declare class LocationLifecycleService { protected databaseService: DatabaseService; protected inRaidHelper: InRaidHelper; protected healthHelper: HealthHelper; + protected questHelper: QuestHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected pmcChatResponseService: PmcChatResponseService; protected playerScavGenerator: PlayerScavGenerator; @@ -68,7 +70,7 @@ export declare class LocationLifecycleService { protected hideoutConfig: IHideoutConfig; protected locationConfig: ILocationConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, timeUtil: TimeUtil, randomUtil: RandomUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, inRaidHelper: InRaidHelper, healthHelper: HealthHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, pmcChatResponseService: PmcChatResponseService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, localisationService: LocalisationService, insuranceService: InsuranceService, botLootCacheService: BotLootCacheService, configServer: ConfigServer, botGenerationCacheService: BotGenerationCacheService, mailSendService: MailSendService, raidTimeAdjustmentService: RaidTimeAdjustmentService, botNameService: BotNameService, lootGenerator: LootGenerator, applicationContext: ApplicationContext, locationLootGenerator: LocationLootGenerator, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, saveServer: SaveServer, timeUtil: TimeUtil, randomUtil: RandomUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, inRaidHelper: InRaidHelper, healthHelper: HealthHelper, questHelper: QuestHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, pmcChatResponseService: PmcChatResponseService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, localisationService: LocalisationService, insuranceService: InsuranceService, botLootCacheService: BotLootCacheService, configServer: ConfigServer, botGenerationCacheService: BotGenerationCacheService, mailSendService: MailSendService, raidTimeAdjustmentService: RaidTimeAdjustmentService, botNameService: BotNameService, lootGenerator: LootGenerator, applicationContext: ApplicationContext, locationLootGenerator: LocationLootGenerator, cloner: ICloner); /** Handle client/match/local/start */ startLocalRaid(sessionId: string, request: IStartLocalRaidRequestData): IStartLocalRaidResponseData; /** @@ -139,10 +141,21 @@ export declare class LocationLifecycleService { * @param locationName */ protected handlePostRaidPmc(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, isDead: boolean, isSurvived: boolean, isTransfer: boolean, request: IEndLocalRaidRequestData, locationName: string): void; + /** + * In 0.15 Lightkeeper quests do not give rewards in PvE, this issue also occurs in spt + * We check for newly completed Lk quests and run them through the servers `CompleteQuest` process + * This rewards players with items + craft unlocks + new trader assorts + * @param sessionId Session id + * @param postRaidQuests Quest statuses post-raid + * @param preRaidQuests Quest statuses pre-raid + * @param pmcProfile Players profile + */ + protected lightkeeperQuestWorkaround(sessionId: string, postRaidQuests: IQuestStatus[], preRaidQuests: IQuestStatus[], pmcProfile: IPmcData): void; /** * Convert post-raid quests into correct format * Quest status comes back as a string version of the enum `Success`, not the expected value of 1 - * @param questsToProcess + * @param questsToProcess quests data from client + * @param preRaidQuestStatuses quest data from before raid * @returns IQuestStatus */ protected processPostRaidQuests(questsToProcess: IQuestStatus[]): IQuestStatus[]; diff --git a/types/services/PaymentService.d.ts b/types/services/PaymentService.d.ts index 51fced12..f6ec79dc 100644 --- a/types/services/PaymentService.d.ts +++ b/types/services/PaymentService.d.ts @@ -60,8 +60,9 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** + * TODO - ensure money in containers inside secure container are LAST * Get all money stacks in inventory and prioritise items in stash - * @param pmcData + * @param pmcData Player profile * @param currencyTpl * @param playerStashId Players stash id * @returns Sorting money items diff --git a/types/services/PostDbLoadService.d.ts b/types/services/PostDbLoadService.d.ts new file mode 100644 index 00000000..c9e4bbe5 --- /dev/null +++ b/types/services/PostDbLoadService.d.ts @@ -0,0 +1,77 @@ +import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; +import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; +import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; +import { ILootConfig } from "@spt/models/spt/config/ILootConfig"; +import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; +import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { ConfigServer } from "@spt/servers/ConfigServer"; +import { CustomLocationWaveService } from "@spt/services/CustomLocationWaveService"; +import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemBaseClassService } from "@spt/services/ItemBaseClassService"; +import { LocalisationService } from "@spt/services/LocalisationService"; +import { OpenZoneService } from "@spt/services/OpenZoneService"; +import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; +export declare class PostDbLoadService { + protected logger: ILogger; + protected databaseService: DatabaseService; + protected localisationService: LocalisationService; + protected customLocationWaveService: CustomLocationWaveService; + protected openZoneService: OpenZoneService; + protected seasonalEventService: SeasonalEventService; + protected itemBaseClassService: ItemBaseClassService; + protected configServer: ConfigServer; + protected cloner: ICloner; + protected coreConfig: ICoreConfig; + protected locationConfig: ILocationConfig; + protected ragfairConfig: IRagfairConfig; + protected hideoutConfig: IHideoutConfig; + protected pmcConfig: IPmcConfig; + protected lootConfig: ILootConfig; + protected botConfig: IBotConfig; + constructor(logger: ILogger, databaseService: DatabaseService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, configServer: ConfigServer, cloner: ICloner); + performPostDbLoadActions(): void; + protected adjustMinReserveRaiderSpawnChance(): void; + protected addCustomLooseLootPositions(): void; + /** + * BSG have two values for shotgun dispersion, we make sure both have the same value + */ + protected fixShotgunDispersions(): void; + /** Apply custom limits on bot types as defined in configs/location.json/botTypeLimits */ + protected adjustMapBotLimits(): void; + protected adjustLooseLootSpawnProbabilities(): void; + /** + * Out of date/incorrectly made trader mods forget this data + */ + protected checkTraderRepairValuesExist(): void; + protected adjustLocationBotValues(): void; + /** + * Make Rogues spawn later to allow for scavs to spawn first instead of rogues filling up all spawn positions + */ + protected fixRoguesSpawningInstantlyOnLighthouse(): void; + /** + * Find and split waves with large numbers of bots into smaller waves - BSG appears to reduce the size of these + * waves to one bot when they're waiting to spawn for too long + */ + protected splitBotWavesIntoSingleWaves(): void; + /** + * Make non-trigger-spawned raiders spawn earlier + always + */ + protected adjustLabsRaiderSpawnRate(): void; + protected adjustHideoutCraftTimes(overrideSeconds: number): void; + /** + * Adjust all hideout craft times to be no higher than the override + */ + protected adjustHideoutBuildTimes(overrideSeconds: number): void; + /** + * Blank out the "test" mail message from prapor + */ + protected removePraporTestMessage(): void; + /** + * Check for any missing assorts inside each traders assort.json data, checking against traders questassort.json + */ + protected validateQuestAssortUnlocksExist(): void; + protected setAllDbItemsAsSellableOnFlea(): void; +} diff --git a/types/services/ProfileSnapshotService.d.ts b/types/services/ProfileSnapshotService.d.ts new file mode 100644 index 00000000..4492ddae --- /dev/null +++ b/types/services/ProfileSnapshotService.d.ts @@ -0,0 +1,30 @@ +import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; +import { ICloner } from "@spt/utils/cloners/ICloner"; +export declare class ProfileSnapshotService { + protected cloner: ICloner; + protected storedProfileSnapshots: Record; + constructor(cloner: ICloner); + /** + * Store a profile into an in-memory object + * @param sessionID session id - acts as the key + * @param profile - profile to save + */ + storeProfileSnapshot(sessionID: string, profile: ISptProfile): void; + /** + * Retreve a stored profile + * @param sessionID key + * @returns A player profile object + */ + getProfileSnapshot(sessionID: string): ISptProfile | undefined; + /** + * Does a profile exists against the provided key + * @param sessionID key + * @returns true if exists + */ + hasProfileSnapshot(sessionID: string): boolean; + /** + * Remove a stored profile by key + * @param sessionID key + */ + clearProfileSnapshot(sessionID: string): void; +} diff --git a/types/services/SeasonalEventService.d.ts b/types/services/SeasonalEventService.d.ts index 281bf992..bffa6e13 100644 --- a/types/services/SeasonalEventService.d.ts +++ b/types/services/SeasonalEventService.d.ts @@ -6,7 +6,7 @@ import { Season } from "@spt/models/enums/Season"; import { SeasonalEventType } from "@spt/models/enums/SeasonalEventType"; import { IHttpConfig } from "@spt/models/spt/config/IHttpConfig"; import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; -import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISeasonalEventConfig"; +import { ISeasonalEvent, ISeasonalEventConfig, IZombieSettings } from "@spt/models/spt/config/ISeasonalEventConfig"; import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -30,7 +30,7 @@ export declare class SeasonalEventService { protected halloweenEventActive?: boolean; protected christmasEventActive?: boolean; /** All events active at this point in time */ - protected currentlyActiveEvents: SeasonalEventType[]; + protected currentlyActiveEvents: ISeasonalEvent[]; constructor(logger: ILogger, databaseService: DatabaseService, databaseImporter: DatabaseImporter, giftService: GiftService, localisationService: LocalisationService, botHelper: BotHelper, profileHelper: ProfileHelper, configServer: ConfigServer); protected get christmasEventItems(): string[]; protected get halloweenEventItems(): string[]; @@ -98,11 +98,17 @@ export declare class SeasonalEventService { */ isQuestRelatedToEvent(questId: string, event: SeasonalEventType): boolean; /** - * Handle seasonal events - * @param sessionId Players id + * Handle activating seasonal events + */ + enableSeasonalEvents(): void; + /** + * Store active events inside class array property `currentlyActiveEvents` + set class properties: christmasEventActive/halloweenEventActive */ - enableSeasonalEvents(sessionId: string): void; protected cacheActiveEvents(): void; + /** + * Get the currently active weather season e.g. SUMMER/AUTUMN/WINTER + * @returns Season enum value + */ getActiveWeatherSeason(): Season; /** * Iterate through bots inventory and loot to find and remove christmas items (as defined in SeasonalEventService) @@ -112,11 +118,11 @@ export declare class SeasonalEventService { removeChristmasItemsFromBotInventory(botInventory: IInventory, botRole: string): void; /** * Make adjusted to server code based on the name of the event passed in - * @param sessionId Player id * @param globalConfig globals.json * @param eventName Name of the event to enable. e.g. Christmas */ - protected updateGlobalEvents(sessionId: string, globalConfig: IConfig, eventType: SeasonalEventType): void; + protected updateGlobalEvents(globalConfig: IConfig, event: ISeasonalEvent): void; + givePlayerSeasonalGifts(sessionId: string): void; /** * Force zryachiy to always have a melee weapon */ @@ -125,11 +131,13 @@ export declare class SeasonalEventService { * Enable the halloween zryachiy summon event */ protected enableHalloweenSummonEvent(): void; + protected configureZombies(zombieSettings: IZombieSettings): void; + protected addEventWavesToMaps(eventType: string): void; /** * Add event bosses to maps * @param eventType Seasonal event, e.g. HALLOWEEN/CHRISTMAS */ - protected addEventBossesToMaps(eventType: SeasonalEventType): void; + protected addEventBossesToMaps(eventType: string): void; /** * Change trader icons to be more event themed (Halloween only so far) * @param eventType What event is active @@ -148,6 +156,7 @@ export declare class SeasonalEventService { * Add pumpkin loot boxes to scavs */ protected addPumpkinsToScavBackpacks(): void; + protected renameBitcoin(): void; /** * Set Khorovod(dancing tree) chance to 100% on all maps that support it */ @@ -156,6 +165,7 @@ export declare class SeasonalEventService { * Add santa to maps */ protected addGifterBotToMaps(): void; + protected handleModEvent(event: ISeasonalEvent): void; /** * Send gift to player if they'e not already received it * @param playerId Player to send gift to From 789d4f38b667c9d5f1769494678b70e8b598c721 Mon Sep 17 00:00:00 2001 From: Archangel Date: Mon, 18 Nov 2024 18:22:02 +0100 Subject: [PATCH 112/119] Update types --- types/callbacks/GameCallbacks.d.ts | 14 +++++++- types/callbacks/InraidCallbacks.d.ts | 2 +- types/callbacks/MatchCallbacks.d.ts | 3 +- types/controllers/GameController.d.ts | 2 ++ types/controllers/InraidController.d.ts | 6 ++-- types/di/Serializer.d.ts | 2 +- .../generators/BotEquipmentModGenerator.d.ts | 7 ++++ types/generators/BotGenerator.d.ts | 27 +++++++++++++- types/generators/BotLootGenerator.d.ts | 8 ----- types/generators/LocationLootGenerator.d.ts | 6 ++-- types/generators/WeatherGenerator.d.ts | 2 +- .../helpers/Dialogue/SptDialogueChatBot.d.ts | 6 +++- types/helpers/InRaidHelper.d.ts | 11 ++++++ types/models/eft/common/tables/IBotBase.d.ts | 1 + types/models/eft/common/tables/IBotType.d.ts | 9 +++-- types/models/eft/common/tables/IItem.d.ts | 8 ++--- .../eft/game/ISendSurveyOpinionRequest.d.ts | 9 +++++ .../models/eft/game/ISurveyResponseData.d.ts | 35 +++++++++++++++++++ .../HideoutUpgradeCompleteRequestData.d.ts | 5 --- .../eft/hideout/IHideoutProduction.d.ts | 1 + .../eft/inRaid/IScavSaveRequestData.d.ts | 3 +- .../eft/match/IEndLocalRaidRequestData.d.ts | 9 +++-- types/models/enums/ExitStatis.d.ts | 11 +++--- types/models/enums/Season.d.ts | 4 ++- .../models/spt/bots/GenerateWeaponResult.d.ts | 10 ------ types/models/spt/bots/IModToSpawnRequest.d.ts | 3 +- types/models/spt/config/IBotConfig.d.ts | 2 ++ types/models/spt/config/ICoreConfig.d.ts | 2 ++ types/models/spt/config/IItemConfig.d.ts | 8 ++++- types/models/spt/config/ILocationConfig.d.ts | 2 ++ types/models/spt/config/IQuestConfig.d.ts | 2 +- .../spt/config/ISeasonalEventConfig.d.ts | 4 ++- types/models/spt/config/ITraderConfig.d.ts | 4 +++ types/models/spt/services/CustomPreset.d.ts | 5 --- .../spt/services/CustomTraderAssortData.d.ts | 6 ---- types/models/spt/services/LootRequest.d.ts | 21 ----------- types/routers/ImageRouter.d.ts | 2 +- .../routers/serializers/BundleSerializer.d.ts | 2 +- .../routers/serializers/ImageSerializer.d.ts | 2 +- .../routers/serializers/NotifySerializer.d.ts | 2 +- types/servers/http/SptHttpListener.d.ts | 4 +-- types/services/PmcChatResponseService.d.ts | 16 +++++++-- types/services/ProfileSnapshotService.d.ts | 30 ---------------- types/services/SeasonalEventService.d.ts | 9 ++++- .../ProductionQuestsGen.d.ts | 16 +++++++++ .../ProductionQuestsGenProgram.d.ts | 7 ++++ types/utils/HttpFileUtil.d.ts | 2 +- 47 files changed, 221 insertions(+), 131 deletions(-) create mode 100644 types/models/eft/game/ISendSurveyOpinionRequest.d.ts create mode 100644 types/models/eft/game/ISurveyResponseData.d.ts delete mode 100644 types/models/eft/hideout/HideoutUpgradeCompleteRequestData.d.ts delete mode 100644 types/models/spt/bots/GenerateWeaponResult.d.ts delete mode 100644 types/models/spt/services/CustomPreset.d.ts delete mode 100644 types/models/spt/services/CustomTraderAssortData.d.ts delete mode 100644 types/models/spt/services/LootRequest.d.ts delete mode 100644 types/services/ProfileSnapshotService.d.ts create mode 100644 types/tools/ProductionQuestsGen/ProductionQuestsGen.d.ts create mode 100644 types/tools/ProductionQuestsGen/ProductionQuestsGenProgram.d.ts diff --git a/types/callbacks/GameCallbacks.d.ts b/types/callbacks/GameCallbacks.d.ts index e34bc41d..fc866ce7 100644 --- a/types/callbacks/GameCallbacks.d.ts +++ b/types/callbacks/GameCallbacks.d.ts @@ -13,7 +13,9 @@ import { IGameModeResponse } from "@spt/models/eft/game/IGameModeResponse"; import { IGameStartResponse } from "@spt/models/eft/game/IGameStartResponse"; import { IGetRaidTimeRequest } from "@spt/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt/models/eft/game/IGetRaidTimeResponse"; +import { ISendSurveyOpinionRequest } from "@spt/models/eft/game/ISendSurveyOpinionRequest"; import { IServerDetails } from "@spt/models/eft/game/IServerDetails"; +import { ISurveyResponseData } from "@spt/models/eft/game/ISurveyResponseData"; import { IVersionValidateRequestData } from "@spt/models/eft/game/IVersionValidateRequestData"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; @@ -90,5 +92,15 @@ export declare class GameCallbacks implements OnLoad { * Handle /client/survey * @returns INullResponseData */ - getSurvey(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; + getSurvey(url: string, request: IEmptyRequestData, sessionId: string): INullResponseData | IGetBodyResponseData; + /** + * Handle client/survey/view + * @returns INullResponseData + */ + getSurveyView(url: string, request: any, sessionId: string): INullResponseData; + /** + * Handle client/survey/opinion + * @returns INullResponseData + */ + sendSurveyOpinion(url: string, request: ISendSurveyOpinionRequest, sessionId: string): INullResponseData; } diff --git a/types/callbacks/InraidCallbacks.d.ts b/types/callbacks/InraidCallbacks.d.ts index 675403fe..02b46f39 100644 --- a/types/callbacks/InraidCallbacks.d.ts +++ b/types/callbacks/InraidCallbacks.d.ts @@ -21,7 +21,7 @@ export declare class InraidCallbacks { */ registerPlayer(url: string, info: IRegisterPlayerRequestData, sessionID: string): INullResponseData; /** - * Handle raid/profile/save + * Handle raid/profile/scavsave * @param url * @param info Save progress request * @param sessionID Session id diff --git a/types/callbacks/MatchCallbacks.d.ts b/types/callbacks/MatchCallbacks.d.ts index b63c920e..0ab9f022 100644 --- a/types/callbacks/MatchCallbacks.d.ts +++ b/types/callbacks/MatchCallbacks.d.ts @@ -1,5 +1,6 @@ import { MatchController } from "@spt/controllers/MatchController"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; +import { IMetrics } from "@spt/models/eft/common/tables/IMatch"; import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "@spt/models/eft/httpResponse/INullResponseData"; import { IEndLocalRaidRequestData } from "@spt/models/eft/match/IEndLocalRaidRequestData"; @@ -53,7 +54,7 @@ export declare class MatchCallbacks { /** Handle match/group/start_game */ joinMatch(url: string, info: IMatchGroupStartGameRequest, sessionID: string): IGetBodyResponseData; /** Handle client/getMetricsConfig */ - getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData; + getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData; /** * Called periodically while in a group * Handle client/match/group/status diff --git a/types/controllers/GameController.d.ts b/types/controllers/GameController.d.ts index cb9644af..2717c3f9 100644 --- a/types/controllers/GameController.d.ts +++ b/types/controllers/GameController.d.ts @@ -14,6 +14,7 @@ import { IGameModeRequestData } from "@spt/models/eft/game/IGameModeRequestData" import { IGetRaidTimeRequest } from "@spt/models/eft/game/IGetRaidTimeRequest"; import { IGetRaidTimeResponse } from "@spt/models/eft/game/IGetRaidTimeResponse"; import { IServerDetails } from "@spt/models/eft/game/IServerDetails"; +import { ISurveyResponseData } from "@spt/models/eft/game/ISurveyResponseData"; import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; @@ -132,4 +133,5 @@ export declare class GameController { */ protected checkForAndRemoveUndefinedDialogs(fullProfile: ISptProfile): void; protected logProfileDetails(fullProfile: ISptProfile): void; + getSurvey(sessionId: string): ISurveyResponseData; } diff --git a/types/controllers/InraidController.d.ts b/types/controllers/InraidController.d.ts index 8f0bfc18..b9f69c22 100644 --- a/types/controllers/InraidController.d.ts +++ b/types/controllers/InraidController.d.ts @@ -28,13 +28,13 @@ export declare class InraidController { */ addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void; /** - * Handle raid/profile/save + * Handle raid/profile/scavsave * Save profile state to disk * Handles pmc/pscav - * @param offraidData post-raid request data + * @param offraidProfileData Post-raid scav profile data * @param sessionID Session id */ - savePostRaidProfileForScav(offraidData: IScavSaveRequestData, sessionID: string): void; + savePostRaidProfileForScav(offraidProfileData: IScavSaveRequestData, sessionID: string): void; /** * Get the inraid config from configs/inraid.json * @returns InRaid Config diff --git a/types/di/Serializer.d.ts b/types/di/Serializer.d.ts index 56db4774..a48dd584 100644 --- a/types/di/Serializer.d.ts +++ b/types/di/Serializer.d.ts @@ -1,5 +1,5 @@ import { IncomingMessage, ServerResponse } from "node:http"; export declare class Serializer { - serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void; + serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): Promise; canHandle(something: string): boolean; } diff --git a/types/generators/BotEquipmentModGenerator.d.ts b/types/generators/BotEquipmentModGenerator.d.ts index c2b531c3..40c361f0 100644 --- a/types/generators/BotEquipmentModGenerator.d.ts +++ b/types/generators/BotEquipmentModGenerator.d.ts @@ -139,6 +139,13 @@ export declare class BotEquipmentModGenerator { * @returns itemHelper.getItem() result */ protected chooseModToPutIntoSlot(request: IModToSpawnRequest): [boolean, ITemplateItem] | undefined; + /** + * Given the passed in array of magaizne tpls, look up the min size set in config and return only those that have that size or larger + * @param modSpawnRequest Request data + * @param modPool Pool of magazine tpls to filter + * @returns Filtered pool of magazine tpls + */ + protected getFilterdMagazinePoolByCapacity(modSpawnRequest: IModToSpawnRequest, modPool: string[]): string[]; /** * Choose a weapon mod tpl for a given slot from a pool of choices * Checks chosen tpl is compatible with all existing weapon items diff --git a/types/generators/BotGenerator.d.ts b/types/generators/BotGenerator.d.ts index 6281031e..2c7bba68 100644 --- a/types/generators/BotGenerator.d.ts +++ b/types/generators/BotGenerator.d.ts @@ -4,6 +4,7 @@ import { BotGeneratorHelper } from "@spt/helpers/BotGeneratorHelper"; import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; +import { MinMax } from "@spt/models/common/MinMax"; import { IBaseJsonSkills, IBaseSkill, IBotBase, IInfo, IHealth as PmcHealth, ISkills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; import { IAppearance, IBodyPart, IBotType, IHealth, IInventory } from "@spt/models/eft/common/tables/IBotType"; import { IBotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; @@ -50,7 +51,7 @@ export declare class BotGenerator { */ generatePlayerScav(sessionId: string, role: string, difficulty: string, botTemplate: IBotType): IBotBase; /** - * Create 1 bots of the type/side/difficulty defined in botGenerationDetails + * Create 1 bot of the type/side/difficulty defined in botGenerationDetails * @param sessionId Session id * @param botGenerationDetails details on how to generate bots * @returns constructed bot @@ -78,6 +79,30 @@ export declare class BotGenerator { * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: IBotGenerationDetails): IBotBase; + /** + * Get exp for kill by bot difficulty + * @param experience Dict of difficulties and experience + * @param botDifficulty the killed bots difficulty + * @param role Role of bot (optional, used for error logging) + * @returns Experience for kill + */ + protected getExperienceRewardForKillByDifficulty(experience: Record, botDifficulty: string, role: string): number; + /** + * Get the standing value change when player kills a bot + * @param standingForKill Dictionary of standing values keyed by bot difficulty + * @param botDifficulty Difficulty of bot to look up + * @param role Role of bot (optional, used for error logging) + * @returns Standing change value + */ + protected getStandingChangeForKillByDifficulty(standingForKill: Record, botDifficulty: string, role: string): number; + /** + * Get the agressor bonus value when player kills a bot + * @param standingForKill Dictionary of standing values keyed by bot difficulty + * @param botDifficulty Difficulty of bot to look up + * @param role Role of bot (optional, used for error logging) + * @returns Standing change value + */ + protected getAgressorBonusByDifficulty(aggressorBonus: Record, botDifficulty: string, role: string): number; /** * Set weighting of flagged equipment to 0 * @param botJsonTemplate Bot data to adjust diff --git a/types/generators/BotLootGenerator.d.ts b/types/generators/BotLootGenerator.d.ts index 07f8b684..6bea7877 100644 --- a/types/generators/BotLootGenerator.d.ts +++ b/types/generators/BotLootGenerator.d.ts @@ -71,14 +71,6 @@ export declare class BotLootGenerator { * @param botRole Role of bot (pmcBEAR/pmcUSEC) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; - /** - * Get a biased random number - * @param min Smallest size - * @param max Biggest size - * @param nValue Value to bias choice - * @returns Chosen number - */ - protected getRandomisedCount(min: number, max: number, nValue: number): number; /** * Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit or space limit is reached * @param pool Pool of items to pick from with weight diff --git a/types/generators/LocationLootGenerator.d.ts b/types/generators/LocationLootGenerator.d.ts index 6ef0bbce..79dddb2b 100644 --- a/types/generators/LocationLootGenerator.d.ts +++ b/types/generators/LocationLootGenerator.d.ts @@ -3,7 +3,7 @@ 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 { ILocationBase } from "@spt/models/eft/common/ILocationBase"; -import { ILooseLoot, ISpawnpoint, ISpawnpointTemplate, ISpawnpointsForced } from "@spt/models/eft/common/ILooseLoot"; +import { ILooseLoot, ISpawnpointTemplate, ISpawnpointsForced } from "@spt/models/eft/common/ILooseLoot"; import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -124,7 +124,7 @@ export declare class LocationLootGenerator { * @param forcedSpawnPoints forced Forced loot locations that must be added * @param locationName Name of map currently having force loot created for */ - protected addForcedLoot(lootLocationTemplates: ISpawnpointTemplate[], forcedSpawnPoints: ISpawnpointsForced[], locationName: string): void; + protected addForcedLoot(lootLocationTemplates: ISpawnpointTemplate[], forcedSpawnPoints: ISpawnpointsForced[], locationName: string, staticAmmoDist: Record): void; /** * Create array of item (with child items) and return * @param chosenComposedKey Key we want to look up items for @@ -132,7 +132,7 @@ export declare class LocationLootGenerator { * @param staticAmmoDist ammo distributions * @returns IContainerItem */ - protected createDynamicLootItem(chosenComposedKey: string, spawnPoint: ISpawnpoint, staticAmmoDist: Record): IContainerItem; + protected createDynamicLootItem(chosenComposedKey: string, items: IItem[], staticAmmoDist: Record): IContainerItem; /** * Find an item in array by its _tpl, handle differently if chosenTpl is a weapon * @param items Items array to search diff --git a/types/generators/WeatherGenerator.d.ts b/types/generators/WeatherGenerator.d.ts index 476f29cf..71d28262 100644 --- a/types/generators/WeatherGenerator.d.ts +++ b/types/generators/WeatherGenerator.d.ts @@ -66,5 +66,5 @@ export declare class WeatherGenerator { protected getWeightedWindSpeed(): number; protected getWeightedFog(): number; protected getWeightedRain(): number; - protected getRandomFloat(node: string): number; + protected getRandomFloat(node: string, precision?: number): number; } diff --git a/types/helpers/Dialogue/SptDialogueChatBot.d.ts b/types/helpers/Dialogue/SptDialogueChatBot.d.ts index 8d3aa979..d2bf5c52 100644 --- a/types/helpers/Dialogue/SptDialogueChatBot.d.ts +++ b/types/helpers/Dialogue/SptDialogueChatBot.d.ts @@ -6,17 +6,21 @@ import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig"; import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { GiftService } from "@spt/services/GiftService"; +import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; +import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { RandomUtil } from "@spt/utils/RandomUtil"; export declare class SptDialogueChatBot implements IDialogueChatBot { protected profileHelper: ProfileHelper; protected randomUtil: RandomUtil; protected mailSendService: MailSendService; + protected seasonalEventService: SeasonalEventService; + protected localisationService: LocalisationService; protected giftService: GiftService; protected configServer: ConfigServer; protected coreConfig: ICoreConfig; protected weatherConfig: IWeatherConfig; - constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, giftService: GiftService, configServer: ConfigServer); + constructor(profileHelper: ProfileHelper, randomUtil: RandomUtil, mailSendService: MailSendService, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, giftService: GiftService, configServer: ConfigServer); getChatBot(): IUserDialogInfo; /** * Send responses back to player when they communicate with SPT friend on friends list diff --git a/types/helpers/InRaidHelper.d.ts b/types/helpers/InRaidHelper.d.ts index 87136b69..eda416e2 100644 --- a/types/helpers/InRaidHelper.d.ts +++ b/types/helpers/InRaidHelper.d.ts @@ -40,6 +40,17 @@ export declare class InRaidHelper { * @param postRaidProfile Profile returned by client after a raid */ setInventory(sessionID: string, serverProfile: IPmcData, postRaidProfile: IPmcData, isSurvived: boolean, isTransfer: boolean): void; + /** + * Remove FiR status from items + * @param items Items to process + */ + protected removeFiRStatusFromCertainItems(items: IItem[]): void; + /** + * Add items from one parameter into another + * @param itemsToAdd Items we want to add + * @param serverInventoryItems Location to add items to + */ + protected addItemsToInventory(itemsToAdd: IItem[], serverInventoryItems: IItem[]): void; /** * Clear PMC inventory of all items except those that are exempt * Used post-raid to remove items after death diff --git a/types/models/eft/common/tables/IBotBase.d.ts b/types/models/eft/common/tables/IBotBase.d.ts index 60960afa..5becac2c 100644 --- a/types/models/eft/common/tables/IBotBase.d.ts +++ b/types/models/eft/common/tables/IBotBase.d.ts @@ -219,6 +219,7 @@ export interface IVictim { Level: number; Weapon: string; Role: string; + Location: string; } export interface ISessionCounters { Items: ICounterKeyValue[]; diff --git a/types/models/eft/common/tables/IBotType.d.ts b/types/models/eft/common/tables/IBotType.d.ts index aded8fbd..75811048 100644 --- a/types/models/eft/common/tables/IBotType.d.ts +++ b/types/models/eft/common/tables/IBotType.d.ts @@ -97,10 +97,13 @@ export interface IDifficultyCategories { Shoot: Record; } export interface IExperience { - aggressorBonus: number; + /** key = bot difficulty */ + aggressorBonus: Record; level: MinMax; - reward: MinMax; - standingForKill: number; + /** key = bot difficulty */ + reward: Record; + /** key = bot difficulty */ + standingForKill: Record; useSimpleAnimator: boolean; } export interface IGeneration { diff --git a/types/models/eft/common/tables/IItem.d.ts b/types/models/eft/common/tables/IItem.d.ts index 443e6f10..60b460f9 100644 --- a/types/models/eft/common/tables/IItem.d.ts +++ b/types/models/eft/common/tables/IItem.d.ts @@ -50,10 +50,10 @@ export declare enum PinLockState { PINNED = "Pinned" } export interface IUpdBuff { - rarity: string; - buffType: string; - value: number; - thresholdDurability?: number; + Rarity: string; + BuffType: string; + Value: number; + ThresholdDurability?: number; } export interface IUpdTogglable { On: boolean; diff --git a/types/models/eft/game/ISendSurveyOpinionRequest.d.ts b/types/models/eft/game/ISendSurveyOpinionRequest.d.ts new file mode 100644 index 00000000..70683e87 --- /dev/null +++ b/types/models/eft/game/ISendSurveyOpinionRequest.d.ts @@ -0,0 +1,9 @@ +export interface ISendSurveyOpinionRequest { + surveyId: number; + answers: ISurveyOpinionAnswer[]; +} +export interface ISurveyOpinionAnswer { + questionId: number; + answerType: string; + answers: any; +} diff --git a/types/models/eft/game/ISurveyResponseData.d.ts b/types/models/eft/game/ISurveyResponseData.d.ts new file mode 100644 index 00000000..7de9f509 --- /dev/null +++ b/types/models/eft/game/ISurveyResponseData.d.ts @@ -0,0 +1,35 @@ +export interface ISurveyResponseData { + locale: Record>; + survey: ISurvey; +} +export interface ISurvey { + id: number; + welcomePageData: IWelcomePageData; + farewellPageData: IFarewellPageData; + pages: number[][]; + questions: ISurveyQuestion[]; + isNew: boolean; +} +export interface IWelcomePageData { + titleLocaleKey: string; + timeLocaleKey: string; + descriptionLocaleKey: string; +} +export interface IFarewellPageData { + textLocaleKey: string; +} +export interface ISurveyQuestion { + id: number; + sortIndex: number; + titleLocaleKey: string; + hintLocaleKey: string; + answerLimit: number; + answerType: string; + answers: ISurveyAnswer[]; +} +export interface ISurveyAnswer { + id: number; + questionId: number; + sortIndex: number; + localeKey: string; +} diff --git a/types/models/eft/hideout/HideoutUpgradeCompleteRequestData.d.ts b/types/models/eft/hideout/HideoutUpgradeCompleteRequestData.d.ts deleted file mode 100644 index 8583e8d9..00000000 --- a/types/models/eft/hideout/HideoutUpgradeCompleteRequestData.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface HideoutUpgradeCompleteRequestData { - Action: string; - areaType: number; - timestamp: number; -} diff --git a/types/models/eft/hideout/IHideoutProduction.d.ts b/types/models/eft/hideout/IHideoutProduction.d.ts index 19263118..8f2af05c 100644 --- a/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/types/models/eft/hideout/IHideoutProduction.d.ts @@ -17,6 +17,7 @@ export interface IHideoutProduction { continuous: boolean; count: number; productionLimitCount: number; + isCodeProduction: boolean; } export interface IRequirement extends IRequirementBase { templateId?: string; diff --git a/types/models/eft/inRaid/IScavSaveRequestData.d.ts b/types/models/eft/inRaid/IScavSaveRequestData.d.ts index e96a9ed9..3f26e263 100644 --- a/types/models/eft/inRaid/IScavSaveRequestData.d.ts +++ b/types/models/eft/inRaid/IScavSaveRequestData.d.ts @@ -1,4 +1,3 @@ import { IPostRaidPmcData } from "@spt/models/eft/common/IPmcData"; -export interface IScavSaveRequestData { - profile: IPostRaidPmcData; +export interface IScavSaveRequestData extends IPostRaidPmcData { } diff --git a/types/models/eft/match/IEndLocalRaidRequestData.d.ts b/types/models/eft/match/IEndLocalRaidRequestData.d.ts index 08e3c120..cc5b0c53 100644 --- a/types/models/eft/match/IEndLocalRaidRequestData.d.ts +++ b/types/models/eft/match/IEndLocalRaidRequestData.d.ts @@ -13,14 +13,15 @@ export interface IEndLocalRaidRequestData { } export interface IEndRaidResult { profile: IPmcData; - /** "Survived/Transit etc" */ - result: string; - ExitStatus: ExitStatus; + /** "Survived/Transit" etc */ + result: ExitStatus; killerId: string; killerAid: string; + /** "Gate 3" etc */ exitName: string; inSession: boolean; favorite: boolean; + /** Seconds in raid */ playTime: number; } export interface ILocationTransit { @@ -33,6 +34,8 @@ export interface ILocationTransit { raidMode: string; side: string; dayTime: string; + /** The location player last visited */ + sptLastVisitedLocation: string; } export interface ITransitProfile { _id: string; diff --git a/types/models/enums/ExitStatis.d.ts b/types/models/enums/ExitStatis.d.ts index 78d97335..25330767 100644 --- a/types/models/enums/ExitStatis.d.ts +++ b/types/models/enums/ExitStatis.d.ts @@ -1,7 +1,8 @@ export declare enum ExitStatus { - SURVIVED = 0, - KILLED = 1, - LEFT = 2, - RUNNER = 3, - MISSINGINACTION = 4 + SURVIVED = "Survived", + KILLED = "Killed", + LEFT = "Left", + RUNNER = "Runner", + MISSINGINACTION = "MissingInAction", + TRANSIT = "Transit" } diff --git a/types/models/enums/Season.d.ts b/types/models/enums/Season.d.ts index b1d3662e..aae50b9c 100644 --- a/types/models/enums/Season.d.ts +++ b/types/models/enums/Season.d.ts @@ -3,5 +3,7 @@ export declare enum Season { AUTUMN = 1, WINTER = 2, SPRING = 3, - STORM = 4 + AUTUMN_LATE = 4, + SPRING_EARLY = 5, + STORM = 6 } diff --git a/types/models/spt/bots/GenerateWeaponResult.d.ts b/types/models/spt/bots/GenerateWeaponResult.d.ts deleted file mode 100644 index 73209ac8..00000000 --- a/types/models/spt/bots/GenerateWeaponResult.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { IMods } from "@spt/models/eft/common/tables/IBotType"; -import { IItem } from "@spt/models/eft/common/tables/IItem"; -import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -export declare class GenerateWeaponResult { - weapon: IItem[]; - chosenAmmoTpl: string; - chosenUbglAmmoTpl: string; - weaponMods: IMods; - weaponTemplate: ITemplateItem; -} diff --git a/types/models/spt/bots/IModToSpawnRequest.d.ts b/types/models/spt/bots/IModToSpawnRequest.d.ts index b34bda8a..c004664f 100644 --- a/types/models/spt/bots/IModToSpawnRequest.d.ts +++ b/types/models/spt/bots/IModToSpawnRequest.d.ts @@ -2,12 +2,13 @@ import { IItem } from "@spt/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; import { ModSpawn } from "@spt/models/enums/ModSpawn"; import { IBotData, IWeaponStats } from "@spt/models/spt/bots/IGenerateWeaponRequest"; -import { IEquipmentFilterDetails } from "@spt/models/spt/config/IBotConfig"; +import { IEquipmentFilterDetails, IRandomisationDetails } from "@spt/models/spt/config/IBotConfig"; export interface IModToSpawnRequest { /** Slot mod will fit into */ modSlot: string; /** Will generate a randomised mod pool if true */ isRandomisableSlot: boolean; + randomisationSettings: IRandomisationDetails; /** Parent slot the item will be a part of */ botWeaponSightWhitelist: Record; /** Blacklist to prevent mods from being picked */ diff --git a/types/models/spt/config/IBotConfig.d.ts b/types/models/spt/config/IBotConfig.d.ts index 9fa301a2..92f7b34e 100644 --- a/types/models/spt/config/IBotConfig.d.ts +++ b/types/models/spt/config/IBotConfig.d.ts @@ -160,6 +160,8 @@ export interface IRandomisationDetails { /** Equipment mod chances */ equipmentMods?: Record; nighttimeChanges?: INighttimeChanges; + /** Key = weapon tpl, value = min size of magaizne allowed */ + minimumMagazineSize?: Record; } export interface INighttimeChanges { /** Applies changes to values stored in equipmentMods */ diff --git a/types/models/spt/config/ICoreConfig.d.ts b/types/models/spt/config/ICoreConfig.d.ts index 572d0b48..d35cc7d9 100644 --- a/types/models/spt/config/ICoreConfig.d.ts +++ b/types/models/spt/config/ICoreConfig.d.ts @@ -1,3 +1,4 @@ +import { ISurveyResponseData } from "@spt/models/eft/game/ISurveyResponseData"; import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface ICoreConfig extends IBaseConfig { kind: "spt-core"; @@ -11,6 +12,7 @@ export interface ICoreConfig extends IBaseConfig { bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; + survey: ISurveyResponseData; features: IServerFeatures; /** Commit hash build server was created from */ commit?: string; diff --git a/types/models/spt/config/IItemConfig.d.ts b/types/models/spt/config/IItemConfig.d.ts index b9dfaea7..a8833bf0 100644 --- a/types/models/spt/config/IItemConfig.d.ts +++ b/types/models/spt/config/IItemConfig.d.ts @@ -9,5 +9,11 @@ export interface IItemConfig extends IBaseConfig { rewardItemBlacklist: string[]; /** Items that can only be found on bosses */ bossItems: string[]; - handbookPriceOverride: Record; + handbookPriceOverride: Record; +} +export interface IHandbookPriceOverride { + /** Price in roubles */ + price: number; + /** NOT parentId from items.json, but handbook.json */ + parentId: string; } diff --git a/types/models/spt/config/ILocationConfig.d.ts b/types/models/spt/config/ILocationConfig.d.ts index 6fcf23da..cbccd204 100644 --- a/types/models/spt/config/ILocationConfig.d.ts +++ b/types/models/spt/config/ILocationConfig.d.ts @@ -44,6 +44,8 @@ export interface ILocationConfig extends IBaseConfig { equipmentLootSettings: IEquipmentLootSettings; /** min percentage to set raider spawns at, -1 makes no changes */ reserveRaiderSpawnChanceOverrides: IReserveRaiderSpawnChanceOverrides; + /** Map ids players cannot visit */ + nonMaps: string[]; } export interface IReserveRaiderSpawnChanceOverrides { nonTriggered: number; diff --git a/types/models/spt/config/IQuestConfig.d.ts b/types/models/spt/config/IQuestConfig.d.ts index e4e76ebd..19bb3aa4 100644 --- a/types/models/spt/config/IQuestConfig.d.ts +++ b/types/models/spt/config/IQuestConfig.d.ts @@ -15,7 +15,7 @@ export interface IQuestConfig extends IBaseConfig { usecOnlyQuests: string[]; /** Quests that the keyed game version do not see/access */ profileBlacklist: Record; - /** Quests that only the keyed game version can see/access */ + /** key=questid, gameversions that can see/access quest */ profileWhitelist: Record; } export interface IPlayerTypeQuestIds { diff --git a/types/models/spt/config/ISeasonalEventConfig.d.ts b/types/models/spt/config/ISeasonalEventConfig.d.ts index 9d92ceed..5e119faa 100644 --- a/types/models/spt/config/ISeasonalEventConfig.d.ts +++ b/types/models/spt/config/ISeasonalEventConfig.d.ts @@ -1,4 +1,4 @@ -import { IBossLocationSpawn, IWave } from "@spt/models/eft/common/ILocationBase"; +import { IAdditionalHostilitySettings, IBossLocationSpawn, IWave } from "@spt/models/eft/common/ILocationBase"; import { SeasonalEventType } from "@spt/models/enums/SeasonalEventType"; import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig"; export interface ISeasonalEventConfig extends IBaseConfig { @@ -11,6 +11,8 @@ export interface ISeasonalEventConfig extends IBaseConfig { eventBossSpawns: Record>; eventWaves: Record>; gifterSettings: IGifterSetting[]; + /** key = event, second key = map name */ + hostilitySettingsForEvent: Record>; } export interface ISeasonalEvent { enabled: boolean; diff --git a/types/models/spt/config/ITraderConfig.d.ts b/types/models/spt/config/ITraderConfig.d.ts index 31a213bc..5d2d4a68 100644 --- a/types/models/spt/config/ITraderConfig.d.ts +++ b/types/models/spt/config/ITraderConfig.d.ts @@ -47,6 +47,10 @@ export interface IFenceConfig { blacklist: string[]; coopExtractGift: ICoopExtractReward; btrDeliveryExpireHours: number; + /** Smallest value player rep with fence can fall to */ + playerRepMin: number; + /** Highest value player rep with fence can climb to */ + playerRepMax: number; } export interface IItemDurabilityCurrentMax { current: MinMax; diff --git a/types/models/spt/services/CustomPreset.d.ts b/types/models/spt/services/CustomPreset.d.ts deleted file mode 100644 index 3301a551..00000000 --- a/types/models/spt/services/CustomPreset.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { IPreset } from "@spt/models/eft/common/IGlobals"; -export interface CustomPreset { - key: string; - preset: IPreset; -} diff --git a/types/models/spt/services/CustomTraderAssortData.d.ts b/types/models/spt/services/CustomTraderAssortData.d.ts deleted file mode 100644 index 7ad63418..00000000 --- a/types/models/spt/services/CustomTraderAssortData.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { ITraderAssort } from "@spt/models/eft/common/tables/ITrader"; -import { Traders } from "@spt/models/enums/Traders"; -export interface CustomTraderAssortData { - traderId: Traders; - assorts: ITraderAssort; -} diff --git a/types/models/spt/services/LootRequest.d.ts b/types/models/spt/services/LootRequest.d.ts deleted file mode 100644 index 7e1329a0..00000000 --- a/types/models/spt/services/LootRequest.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { MinMax } from "@spt/models/common/MinMax"; -import { AirdropTypeEnum } from "@spt/models/enums/AirdropType"; -export interface LootRequest { - weaponPresetCount: MinMax; - armorPresetCount: MinMax; - itemCount: MinMax; - weaponCrateCount: MinMax; - itemBlacklist: string[]; - itemTypeWhitelist: string[]; - /** key: item base type: value: max count */ - itemLimits: Record; - itemStackLimits: Record; - armorLevelWhitelist: number[]; - allowBossItems: boolean; - useRewarditemBlacklist?: boolean; - useForcedLoot?: boolean; - forcedLoot?: Record; -} -export interface IAirdropLootRequest extends LootRequest { - icon?: AirdropTypeEnum; -} diff --git a/types/routers/ImageRouter.d.ts b/types/routers/ImageRouter.d.ts index ca9afad0..cd29c815 100644 --- a/types/routers/ImageRouter.d.ts +++ b/types/routers/ImageRouter.d.ts @@ -8,6 +8,6 @@ export declare class ImageRouter { protected httpFileUtil: HttpFileUtil; constructor(vfs: VFS, imageRouteService: ImageRouteService, httpFileUtil: HttpFileUtil); addRoute(key: string, valueToAdd: string): void; - sendImage(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void; + sendImage(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): Promise; getImage(): string; } diff --git a/types/routers/serializers/BundleSerializer.d.ts b/types/routers/serializers/BundleSerializer.d.ts index 91332ff0..93e647d7 100644 --- a/types/routers/serializers/BundleSerializer.d.ts +++ b/types/routers/serializers/BundleSerializer.d.ts @@ -8,6 +8,6 @@ export declare class BundleSerializer extends Serializer { protected bundleLoader: BundleLoader; protected httpFileUtil: HttpFileUtil; constructor(logger: ILogger, bundleLoader: BundleLoader, httpFileUtil: HttpFileUtil); - serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void; + serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): Promise; canHandle(route: string): boolean; } diff --git a/types/routers/serializers/ImageSerializer.d.ts b/types/routers/serializers/ImageSerializer.d.ts index 92f06e34..84430c70 100644 --- a/types/routers/serializers/ImageSerializer.d.ts +++ b/types/routers/serializers/ImageSerializer.d.ts @@ -4,6 +4,6 @@ import { ImageRouter } from "@spt/routers/ImageRouter"; export declare class ImageSerializer extends Serializer { protected imageRouter: ImageRouter; constructor(imageRouter: ImageRouter); - serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void; + serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): Promise; canHandle(route: string): boolean; } diff --git a/types/routers/serializers/NotifySerializer.d.ts b/types/routers/serializers/NotifySerializer.d.ts index 4e1f28d2..20d90957 100644 --- a/types/routers/serializers/NotifySerializer.d.ts +++ b/types/routers/serializers/NotifySerializer.d.ts @@ -8,6 +8,6 @@ export declare class NotifySerializer extends Serializer { protected jsonUtil: JsonUtil; protected httpServerHelper: HttpServerHelper; constructor(notifierController: NotifierController, jsonUtil: JsonUtil, httpServerHelper: HttpServerHelper); - serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): void; + serialize(_sessionID: string, req: IncomingMessage, resp: ServerResponse, _: any): Promise; canHandle(route: string): boolean; } diff --git a/types/servers/http/SptHttpListener.d.ts b/types/servers/http/SptHttpListener.d.ts index 9311f820..64d4f047 100644 --- a/types/servers/http/SptHttpListener.d.ts +++ b/types/servers/http/SptHttpListener.d.ts @@ -26,7 +26,7 @@ export declare class SptHttpListener implements IHttpListener { * @param body Buffer * @param output Server generated response data */ - sendResponse(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: Buffer, output: string): void; + sendResponse(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: Buffer, output: string): Promise; /** * Is request flagged as debug enabled * @param req Incoming request @@ -42,5 +42,5 @@ export declare class SptHttpListener implements IHttpListener { getResponse(sessionID: string, req: IncomingMessage, body: Buffer): Promise; protected getBodyInfo(body: Buffer, requestUrl?: any): any; sendJson(resp: ServerResponse, output: string, sessionID: string): void; - sendZlibJson(resp: ServerResponse, output: string, sessionID: string): void; + sendZlibJson(resp: ServerResponse, output: string, sessionID: string): Promise; } diff --git a/types/services/PmcChatResponseService.d.ts b/types/services/PmcChatResponseService.d.ts index f44b12d0..d1df249c 100644 --- a/types/services/PmcChatResponseService.d.ts +++ b/types/services/PmcChatResponseService.d.ts @@ -8,6 +8,7 @@ import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { GiftService } from "@spt/services/GiftService"; +import { LocaleService } from "@spt/services/LocaleService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -19,12 +20,13 @@ export declare class PmcChatResponseService { protected notificationSendHelper: NotificationSendHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected localisationService: LocalisationService; + protected localeService: LocaleService; protected giftService: GiftService; protected weightedRandomHelper: WeightedRandomHelper; protected configServer: ConfigServer; protected pmcResponsesConfig: IPmcChatResponse; protected giftConfig: IGiftsConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, localeService: LocaleService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id @@ -43,9 +45,17 @@ export declare class PmcChatResponseService { * Choose a localised message to send the player (different if sender was killed or killed player) * @param isVictim Is the message coming from a bot killed by the player * @param pmcData Player profile + * @param victimData OPTIMAL - details of the pmc killed * @returns Message from PMC to player */ - protected chooseMessage(isVictim: boolean, pmcData: IPmcData): string | undefined; + protected chooseMessage(isVictim: boolean, pmcData: IPmcData, victimData?: IVictim): string | undefined; + /** + * use map key to get a localised location name + * e.g. factory4_day becomes "Factory" + * @param locationKey location key to localise + * @returns Localised location name + */ + protected getLocationName(locationKey: string): string; /** * Should capitalisation be stripped from the message response before sending * @param isVictim Was responder a victim of player @@ -63,7 +73,7 @@ export declare class PmcChatResponseService { * @param isVictim Was responder a victim of player * @returns true = should be stripped */ - appendSuffixToMessageEnd(isVictim: boolean): boolean; + protected appendSuffixToMessageEnd(isVictim: boolean): boolean; /** * Choose a type of response based on the weightings in pmc response config * @param isVictim Was responder killed by player diff --git a/types/services/ProfileSnapshotService.d.ts b/types/services/ProfileSnapshotService.d.ts deleted file mode 100644 index 4492ddae..00000000 --- a/types/services/ProfileSnapshotService.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { ISptProfile } from "@spt/models/eft/profile/ISptProfile"; -import { ICloner } from "@spt/utils/cloners/ICloner"; -export declare class ProfileSnapshotService { - protected cloner: ICloner; - protected storedProfileSnapshots: Record; - constructor(cloner: ICloner); - /** - * Store a profile into an in-memory object - * @param sessionID session id - acts as the key - * @param profile - profile to save - */ - storeProfileSnapshot(sessionID: string, profile: ISptProfile): void; - /** - * Retreve a stored profile - * @param sessionID key - * @returns A player profile object - */ - getProfileSnapshot(sessionID: string): ISptProfile | undefined; - /** - * Does a profile exists against the provided key - * @param sessionID key - * @returns true if exists - */ - hasProfileSnapshot(sessionID: string): boolean; - /** - * Remove a stored profile by key - * @param sessionID key - */ - clearProfileSnapshot(sessionID: string): void; -} diff --git a/types/services/SeasonalEventService.d.ts b/types/services/SeasonalEventService.d.ts index bffa6e13..7ce39dca 100644 --- a/types/services/SeasonalEventService.d.ts +++ b/types/services/SeasonalEventService.d.ts @@ -1,10 +1,12 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IConfig } from "@spt/models/eft/common/IGlobals"; +import { IAdditionalHostilitySettings } from "@spt/models/eft/common/ILocationBase"; import { IInventory } from "@spt/models/eft/common/tables/IBotType"; import { Season } from "@spt/models/enums/Season"; import { SeasonalEventType } from "@spt/models/enums/SeasonalEventType"; import { IHttpConfig } from "@spt/models/spt/config/IHttpConfig"; +import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { ISeasonalEvent, ISeasonalEventConfig, IZombieSettings } from "@spt/models/spt/config/ISeasonalEventConfig"; import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; @@ -27,6 +29,7 @@ export declare class SeasonalEventService { protected questConfig: IQuestConfig; protected httpConfig: IHttpConfig; protected weatherConfig: IWeatherConfig; + protected locationConfig: ILocationConfig; protected halloweenEventActive?: boolean; protected christmasEventActive?: boolean; /** All events active at this point in time */ @@ -101,6 +104,7 @@ export declare class SeasonalEventService { * Handle activating seasonal events */ enableSeasonalEvents(): void; + forceSeasonalEvent(eventType: SeasonalEventType): boolean; /** * Store active events inside class array property `currentlyActiveEvents` + set class properties: christmasEventActive/halloweenEventActive */ @@ -122,6 +126,8 @@ export declare class SeasonalEventService { * @param eventName Name of the event to enable. e.g. Christmas */ protected updateGlobalEvents(globalConfig: IConfig, event: ISeasonalEvent): void; + protected replaceBotHostility(hostilitySettings: Record): void; + protected removeEntryRequirement(locationIds: string[]): void; givePlayerSeasonalGifts(sessionId: string): void; /** * Force zryachiy to always have a melee weapon @@ -136,8 +142,9 @@ export declare class SeasonalEventService { /** * Add event bosses to maps * @param eventType Seasonal event, e.g. HALLOWEEN/CHRISTMAS + * @param mapWhitelist OPTIONAL - Maps to add bosses to */ - protected addEventBossesToMaps(eventType: string): void; + protected addEventBossesToMaps(eventType: string, mapIdWhitelist?: string[]): void; /** * Change trader icons to be more event themed (Halloween only so far) * @param eventType What event is active diff --git a/types/tools/ProductionQuestsGen/ProductionQuestsGen.d.ts b/types/tools/ProductionQuestsGen/ProductionQuestsGen.d.ts new file mode 100644 index 00000000..960f8ae0 --- /dev/null +++ b/types/tools/ProductionQuestsGen/ProductionQuestsGen.d.ts @@ -0,0 +1,16 @@ +import { OnLoad } from "@spt/di/OnLoad"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt/servers/DatabaseServer"; +export declare class ProductionQuestsGen { + protected databaseServer: DatabaseServer; + protected logger: ILogger; + protected onLoadComponents: OnLoad[]; + private questProductionOutputList; + private questProductionMap; + private blacklistedProductions; + constructor(databaseServer: DatabaseServer, logger: ILogger, onLoadComponents: OnLoad[]); + run(): Promise; + private updateProductionQuests; + private isValidQuestProduction; + private buildQuestProductionList; +} diff --git a/types/tools/ProductionQuestsGen/ProductionQuestsGenProgram.d.ts b/types/tools/ProductionQuestsGen/ProductionQuestsGenProgram.d.ts new file mode 100644 index 00000000..56637380 --- /dev/null +++ b/types/tools/ProductionQuestsGen/ProductionQuestsGenProgram.d.ts @@ -0,0 +1,7 @@ +import "reflect-metadata"; +import "source-map-support/register"; +export declare class ProductionQuestsGenProgram { + private errorHandler; + constructor(); + start(): Promise; +} diff --git a/types/utils/HttpFileUtil.d.ts b/types/utils/HttpFileUtil.d.ts index 57f21c85..9569f816 100644 --- a/types/utils/HttpFileUtil.d.ts +++ b/types/utils/HttpFileUtil.d.ts @@ -3,5 +3,5 @@ import { HttpServerHelper } from "@spt/helpers/HttpServerHelper"; export declare class HttpFileUtil { protected httpServerHelper: HttpServerHelper; constructor(httpServerHelper: HttpServerHelper); - sendFile(resp: ServerResponse, filePath: string): void; + sendFileAsync(resp: ServerResponse, filePath: string): Promise; } From cbd5e69a040bd12dd39c9bd1211cdd6d1b37797b Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Fri, 22 Nov 2024 19:47:35 +0100 Subject: [PATCH 113/119] Fix loot regen on transit --- .../services/LocationLifecycleService.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/overrides/services/LocationLifecycleService.ts b/src/overrides/services/LocationLifecycleService.ts index 4c1e2dbb..7f362bc9 100644 --- a/src/overrides/services/LocationLifecycleService.ts +++ b/src/overrides/services/LocationLifecycleService.ts @@ -1,23 +1,23 @@ import { DependencyContainer, inject, injectable } from "tsyringe"; -import { LocationController } from "@spt/controllers/LocationController"; -import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; - import { ApplicationContext } from "@spt/context/ApplicationContext"; import { ContextVariableType } from "@spt/context/ContextVariableType"; +import { LocationController } from "@spt/controllers/LocationController"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { ILocationBase } from "@spt/models/eft/common/ILocationBase"; import { IEndLocalRaidRequestData, ILocationTransit } from "@spt/models/eft/match/IEndLocalRaidRequestData"; import { IStartLocalRaidRequestData } from "@spt/models/eft/match/IStartLocalRaidRequestData"; import { IStartLocalRaidResponseData } from "@spt/models/eft/match/IStartLocalRaidResponseData"; +import { ILogger } from "@spt/models/spt/utils/ILogger"; import { BotGenerationCacheService } from "@spt/services/BotGenerationCacheService"; +import { BotLootCacheService } from "@spt/services/BotLootCacheService"; import { DatabaseService } from "@spt/services/DatabaseService"; import { LocationLifecycleService } from "@spt/services/LocationLifecycleService"; +import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; + import { Override } from "../../di/Override"; import { FikaMatchService } from "../../services/FikaMatchService"; -import { BotLootCacheService } from "@spt/services/BotLootCacheService"; -import { ILogger } from "@spt/models/spt/utils/ILogger"; @injectable() export class LocationLifecycleServiceOverride extends Override { @@ -51,8 +51,11 @@ export class LocationLifecycleServiceOverride extends Override { // player isn't in a Fika match, generate new loot locationLoot = lifecycleService.generateLocationAndLoot(request.location); } else { - // player is in a Fika match, use match location loot + // player is in a Fika match, use match location loot and regen if transit const match = this.fikaMatchService.getMatch(matchId); + if (matchId === sessionId) { + match.locationData = lifecycleService.generateLocationAndLoot(request.location); + } locationLoot = match.locationData; } @@ -84,7 +87,7 @@ export class LocationLifecycleServiceOverride extends Override { result.transition.isLocationTransition = true; result.transition.transitionRaidId = transitionData.transitionRaidId; result.transition.transitionCount += 1; - result.transition.visitedLocations.push(transitionData.location); // TODO - check doesnt exist before adding to prevent dupes + result.transition.visitedLocations.push(transitionData.sptLastVisitedLocation); // Complete, clean up this.applicationContext.clearValues(ContextVariableType.TRANSIT_INFO); From db873e58a963a859e262ebeb7782a362bef2f507 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Fri, 22 Nov 2024 22:27:08 +0100 Subject: [PATCH 114/119] User raid counter to determine whether to regen loot --- src/models/fika/IFikaMatch.ts | 1 + src/overrides/services/LocationLifecycleService.ts | 5 ++++- src/services/FikaMatchService.ts | 7 ++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/models/fika/IFikaMatch.ts b/src/models/fika/IFikaMatch.ts index 05843446..41dc95db 100644 --- a/src/models/fika/IFikaMatch.ts +++ b/src/models/fika/IFikaMatch.ts @@ -24,4 +24,5 @@ export interface IFikaMatch { raidCode: string; natPunch: boolean; isDedicated: boolean; + raids: number; } diff --git a/src/overrides/services/LocationLifecycleService.ts b/src/overrides/services/LocationLifecycleService.ts index 7f362bc9..0d1b39ef 100644 --- a/src/overrides/services/LocationLifecycleService.ts +++ b/src/overrides/services/LocationLifecycleService.ts @@ -54,7 +54,10 @@ export class LocationLifecycleServiceOverride extends Override { // player is in a Fika match, use match location loot and regen if transit const match = this.fikaMatchService.getMatch(matchId); if (matchId === sessionId) { - match.locationData = lifecycleService.generateLocationAndLoot(request.location); + match.raids++; + if (match.raids > 1) { + match.locationData = lifecycleService.generateLocationAndLoot(request.location); + } } locationLoot = match.locationData; } diff --git a/src/services/FikaMatchService.ts b/src/services/FikaMatchService.ts index 0e01b36a..3bd22fd2 100644 --- a/src/services/FikaMatchService.ts +++ b/src/services/FikaMatchService.ts @@ -1,20 +1,20 @@ import { inject, injectable } from "tsyringe"; -import { LocationLifecycleService } from "@spt/services/LocationLifecycleService"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { SaveServer } from "@spt/servers/SaveServer"; +import { LocationLifecycleService } from "@spt/services/LocationLifecycleService"; import { EFikaMatchEndSessionMessage } from "../models/enums/EFikaMatchEndSessionMessages"; import { EFikaMatchStatus } from "../models/enums/EFikaMatchStatus"; +import { EFikaPlayerPresences } from "../models/enums/EFikaPlayerPresences"; import { IFikaMatch } from "../models/fika/IFikaMatch"; import { IFikaPlayer } from "../models/fika/IFikaPlayer"; import { IFikaRaidCreateRequestData } from "../models/fika/routes/raid/create/IFikaRaidCreateRequestData"; -import { EFikaPlayerPresences } from "../models/enums/EFikaPlayerPresences"; import { FikaConfig } from "../utils/FikaConfig"; -import { FikaDedicatedRaidService } from "./dedicated/FikaDedicatedRaidService"; import { FikaInsuranceService } from "./FikaInsuranceService"; import { FikaPresenceService } from "./FikaPresenceService"; +import { FikaDedicatedRaidService } from "./dedicated/FikaDedicatedRaidService"; @injectable() export class FikaMatchService { @@ -209,6 +209,7 @@ export class FikaMatchService { raidCode: data.raidCode, natPunch: false, isDedicated: false, + raids: 0 }); this.addTimeoutInterval(data.serverId); From 4c3f3ca8fea30c44bb3adbf3fc2a768542b9262e Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Sun, 24 Nov 2024 23:48:55 +0100 Subject: [PATCH 115/119] Update locales --- assets/database/locales/global/ch.json | 14 ++- assets/database/locales/global/cz.json | 10 +- assets/database/locales/global/es-mx.json | 20 ++-- assets/database/locales/global/es.json | 98 +++++++++++--------- assets/database/locales/global/fr.json | 10 +- assets/database/locales/global/ge.json | 12 ++- assets/database/locales/global/hu.json | 16 +++- assets/database/locales/global/it.json | 12 ++- assets/database/locales/global/jp.json | 18 +++- assets/database/locales/global/kr.json | 108 ++++++++++++---------- assets/database/locales/global/pl.json | 14 ++- assets/database/locales/global/po.json | 12 ++- assets/database/locales/global/ro.json | 12 ++- assets/database/locales/global/ru.json | 12 ++- assets/database/locales/global/sk.json | 12 ++- assets/database/locales/global/tu.json | 10 +- 16 files changed, 260 insertions(+), 130 deletions(-) diff --git a/assets/database/locales/global/ch.json b/assets/database/locales/global/ch.json index 6fd28e96..ffa61a53 100644 --- a/assets/database/locales/global/ch.json +++ b/assets/database/locales/global/ch.json @@ -34,7 +34,7 @@ "F_SendItem_Header": "选择一个玩家", "F_SendItem_SendButton": "发送", "F_MMUI_RaidsHeader": "行动", - "F_MMUI_HostRaidButton": "主持一個行動", + "F_MMUI_HostRaidButton": "主持一个行动", "F_MMUI_JoinButton": "加入", "F_MMUI_SelectAmountHeader": "选择一个数量", "F_MMUI_SelectAmountDescription": "将有多少人(包括您) 在玩?", @@ -48,7 +48,7 @@ "F_UI_CannotJoinRaidPMCAsScav": "你不能以SCAV身份加入PMC行动", "F_UI_HostStillLoading": "主机仍在加载中。", "F_UI_RaidInProgress": "游戏已经开始了!", - "F_UI_ReJoinRaid": "點擊以重新加入", + "F_UI_ReJoinRaid": "点击以重新加入", "F_UI_CannotReJoinRaidDied": "不能重新加入你已經陣亡的行動", "F_UI_JoinRaid": "點擊以加入行動", "F_UI_ErrorConnecting": "连接错误", @@ -85,5 +85,13 @@ "F_UI_WaitForPlayer": "正在等待 {0} 位玩家", "F_UI_WaitForPlayers": "正在等待 {0} 位玩家", "F_UI_ToSLong": "欢迎来到Fika!\n\nFika 是一个SPT的合作模组,允许您与朋友一起玩。 如果您为此付了钱,说明你被骗了,Fika是免费的。 您也不允许建立付费或需要捐赠的公共服务器。\n\n等待此消息自动消失来接受我们的服务条款。\n\n您可以在这里加入我们的Discord: https://discord.gg/project-fika", - "F_UI_ToSShort": "欢迎来到Fika!\n\nFika 是一个SPT的合作模组,允许您与朋友一起玩。 如果您为此付了钱,说明你被骗了,Fika是免费的。 您也不允许建立付费或需要捐赠的公共服务器。\n\n您可以在这里加入我们的Discord: https://discord.gg/project-fika" + "F_UI_ToSShort": "欢迎来到Fika!\n\nFika 是一个SPT的合作模组,允许您与朋友一起玩。 如果您为此付了钱,说明你被骗了,Fika是免费的。 您也不允许建立付费或需要捐赠的公共服务器。\n\n您可以在这里加入我们的Discord: https://discord.gg/project-fika", + "F_UI_RaidSettingsDescription": "在此模式下,您可以与好友一起游玩在线合作游戏,而无需担心遇见其他玩家。\\n合作模式中的所有游戏机制(天气、AI、Boss 等)与在线机制相同。\\n仅主机设置才会生效。", + "F_UI_CoopGameMode": "Fika联机 游戏模式", + "F_UI_CoopRaidSettings": "Fika联机 战局设置", + "F_UI_FikaAlwaysCoop": "Fika 永远是 PVE", + "F_UI_UpnpFailed": "UPnP 映射失败。请确保所选端口尚未打开!\\n如果您正在使用 VPN,请禁用 UPnP。", + "F_UI_InitWeather": "正在生成天气...", + "F_Notification_RaidStarted": "{0} 开始了 {1} 行动", + "F_Notification_ItemReceived": "你收到了来自玩家 {1} 发送的 {0}" } diff --git a/assets/database/locales/global/cz.json b/assets/database/locales/global/cz.json index 654f8ee8..715c92db 100644 --- a/assets/database/locales/global/cz.json +++ b/assets/database/locales/global/cz.json @@ -85,5 +85,13 @@ "F_UI_WaitForPlayer": "Čekání na {0} hráče", "F_UI_WaitForPlayers": "Čekání na {0} hráčů", "F_UI_ToSLong": "Vítejte u Fika!\n\nFika je kooperativní mod pro SPT, který vám umožňuje hrát s přáteli. Fika je a vždy bude zdarma, pokud jste za ni zaplatili, byli jste podvedeni. Také není dovoleno provozovat veřejné servery s monetizací nebo přijímáním darů.\n\n\"Počkejte, až tato zpráva zmizí, abyste přijali naše podmínky služby.\"\n\nMůžete se připojit na náš Discord zde: https://discord.gg/project-fika", - "F_UI_ToSShort": "Vítejte u Fika!\n\nFika je kooperativní mod pro SPT, který vám umožňuje hrát s přáteli. Fika je a vždy bude zdarma, pokud jste za ni zaplatili, byli jste podvedeni. Také není dovoleno provozovat veřejné servery s monetizací nebo přijímáním darů.\n\nMůžete se připojit na náš Discord zde: https://discord.gg/project-fika" + "F_UI_ToSShort": "Vítejte u Fika!\n\nFika je kooperativní mod pro SPT, který vám umožňuje hrát s přáteli. Fika je a vždy bude zdarma, pokud jste za ni zaplatili, byli jste podvedeni. Také není dovoleno provozovat veřejné servery s monetizací nebo přijímáním darů.\n\nMůžete se připojit na náš Discord zde: https://discord.gg/project-fika", + "F_UI_RaidSettingsDescription": "In this mode, you can play online co-op with your friends without the risk of meeting others.\\nAll game mechanics in the co-op mode (weather, bots, bosses, etc.) are identical to the online mechanics.\\nOnly the hosts settings will take effect.", + "F_UI_CoopGameMode": "Fika Co-op Game Mode", + "F_UI_CoopRaidSettings": "Fika Co-op Raid Settings", + "F_UI_FikaAlwaysCoop": "Co-op is always enabled in Fika", + "F_UI_UpnpFailed": "UPnP mapping failed. Make sure the selected port is not already open!\\nDisable UPnP if you are using a VPN.", + "F_UI_InitWeather": "Generating weather...", + "F_Notification_RaidStarted": "{0} started a raid on {1}", + "F_Notification_ItemReceived": "You received a {0} from {1}" } diff --git a/assets/database/locales/global/es-mx.json b/assets/database/locales/global/es-mx.json index 16fb05b5..3554809b 100644 --- a/assets/database/locales/global/es-mx.json +++ b/assets/database/locales/global/es-mx.json @@ -80,10 +80,18 @@ "F_UI_SyncWindows": "Sincronizando ventanas...", "F_UI_ReceiveOwnPlayer": "Recibiendo su propio jugador...", "F_UI_FinishReconnect": "Finalizando la reconexión...", - "F_Client_FreeCamInputDisabled": "Free cam input disabled", - "F_Client_FreeCamInputEnabled": "Free cam input enabled", - "F_UI_WaitForPlayer": "Waiting for {0} player", - "F_UI_WaitForPlayers": "Waiting for {0} players", - "F_UI_ToSLong": "Welcome to Fika!\r\n\r\nFika is a co-op mod for SPT, allowing you to play with your friends. Fika is and will always be free, if you paid for it you got scammed. You are also not allowed to host public servers with monetization or donations.\r\n\r\nWait for this message to fade to accept our Terms of Service.\r\n\r\nYou can join our Discord here: https://discord.gg/project-fika", - "F_UI_ToSShort": "Welcome to Fika!\r\n\r\nFika is a co-op mod for SPT, allowing you to play with your friends. Fika is and will always be free, if you paid for it you got scammed. You are also not allowed to host public servers with monetization or donations.\r\n\r\nYou can join our Discord here: https://discord.gg/project-fika" + "F_Client_FreeCamInputDisabled": "Entrada de la cámara libre deshabilitada", + "F_Client_FreeCamInputEnabled": "Entrada de la cámara libre habilitada", + "F_UI_WaitForPlayer": "Esperando a {0} jugador", + "F_UI_WaitForPlayers": "Esperando a {0} jugadores", + "F_UI_ToSLong": "¡Bienvenido a Fika!\n\nFika es un mod cooperativo para SPT, permitiéndote jugar con tus amigos. Fika es y siempre será gratis, si pagaste por él, has sido estafado. No se permite alojar servidores públicos con monetización o donaciones.\n\nEspera a que este mensaje desaparezca para aceptar nuestros Términos de Servicio.\n\nPuedes unirte a nuestro Discord aquí: https://discord.gg/project-fika", + "F_UI_ToSShort": "¡Bienvenido a Fika!\n\nFika es un mod cooperativo para SPT, permitiéndote jugar con tus amigos. Fika es y siempre será gratis, si pagaste por él, has sido estafado. No se permite alojar servidores públicos con monetización o donaciones.\n\nPuedes unirte a nuestro Discord aquí: https://discord.gg/project-fika", + "F_UI_RaidSettingsDescription": "In this mode, you can play online co-op with your friends without the risk of meeting others.\\nAll game mechanics in the co-op mode (weather, bots, bosses, etc.) are identical to the online mechanics.\\nOnly the hosts settings will take effect.", + "F_UI_CoopGameMode": "Fika Co-op Game Mode", + "F_UI_CoopRaidSettings": "Fika Co-op Raid Settings", + "F_UI_FikaAlwaysCoop": "Co-op is always enabled in Fika", + "F_UI_UpnpFailed": "UPnP mapping failed. Make sure the selected port is not already open!\\nDisable UPnP if you are using a VPN.", + "F_UI_InitWeather": "Generating weather...", + "F_Notification_RaidStarted": "{0} started a raid on {1}", + "F_Notification_ItemReceived": "You received a {0} from {1}" } diff --git a/assets/database/locales/global/es.json b/assets/database/locales/global/es.json index 3930e719..39289413 100644 --- a/assets/database/locales/global/es.json +++ b/assets/database/locales/global/es.json @@ -17,17 +17,17 @@ "F_Client_ConnectedToServer": "Conectado al servidor en el puerto {0}", "F_Client_ServerStarted": "Servidor iniciado en el puerto {0}", "F_Client_CouldNotFindValidIP": "¡No se ha encontrado una IP local válida!", - "F_Client_ReconnectRequested": "Reconnect requested, expect lag...", + "F_Client_ReconnectRequested": "Reconexión solicitada, posible lag...", "F_Client_PeerConnected": "Peer conectado al servidor en el puerto {0}", - "F_Client_PeerDisconnected": "Peer disconnected {0}, info: {1}", + "F_Client_PeerDisconnected": "Par desconectado {0}, información: {1}", "F_Client_ConnectingToSession": "Conectándose a la sesión...", - "F_Client_ItemIsBlacklisted": "{0} is blacklisted from being sent", - "F_Client_ItemsContainsBlacklisted": "{0} contains {1} which is blacklisted from being sent", + "F_Client_ItemIsBlacklisted": "{0} está vetado de ser enviado", + "F_Client_ItemsContainsBlacklisted": "{0} contiene {1} que está vetado de ser enviado", "F_Client_SavedProfile": "Perfil guardado {0} en {1}", - "F_Client_UnknownError": "An unknown exception was thrown, check your log file", - "F_Client_HostCannotExtract": "You cannot exit the game until all clients have disconnected", - "F_Client_HostCannotExtractMenu": "You cannot disconnect while there are still peers connected! Remaining: {0}", - "F_Client_Wait5Seconds": "Please wait at least 5 seconds after the last peer disconnected before quitting", + "F_Client_UnknownError": "Se ha producido un error desconocido. Comprueba el log", + "F_Client_HostCannotExtract": "No puedes salir de la partida hasta que todos los clientes se hayan desconectado", + "F_Client_HostCannotExtractMenu": "No puedes desconectarte mientras siga habiendo pares conectados! Restantes: {0}", + "F_Client_Wait5Seconds": "Por favor espera al menos 5 segundos desde que se desconecte el último par para salir", "F_Client_StartingRaid": "Iniciando raid, por favor espere...", "F_Client_LostConnection": "Se perdió la conexión con el host", "F_Client_StartingRaidOnDedicated": "Iniciando raid en cliente dedicado... por favor espere", @@ -42,48 +42,56 @@ "F_MMUI_StartButton": "INICIAR", "F_MMUI_LoadingScreenHeader": "CARGANDO", "F_MMUI_LoadingScreenDescription": "Espere mientras la raid se inicializa... esto podría llevar algún tiempo.", - "F_UI_CannotJoinRaidOtherMap": "Cannot join a raid that is on another map.\nRaid map: {0}", - "F_UI_CannotJoinRaidOtherTime": "Cannot join a raid that is on another time.", - "F_UI_CannotJoinRaidScavAsPMC": "You cannot join a scav raid as a PMC.", - "F_UI_CannotJoinRaidPMCAsScav": "You cannot join a PMC raid as a scav.", - "F_UI_HostStillLoading": "Host is still loading.", - "F_UI_RaidInProgress": "Raid is already in progress.", - "F_UI_ReJoinRaid": "Click to rejoin raid.", - "F_UI_CannotReJoinRaidDied": "Cannot rejoin a raid where you died.", - "F_UI_JoinRaid": "Click to join raid.", - "F_UI_ErrorConnecting": "ERROR CONNECTING", - "F_UI_UnableToConnect": "Unable to connect to the server. Make sure that all ports are open and that all settings are configured correctly.", - "F_UI_FikaPingerFailStart": "Could not start the FikaPinger!", - "F_UI_RefreshRaids": "Refresh list of active raids.", - "F_UI_DedicatedError": "FIKA DEDICATED ERROR", - "F_UI_ErrorForceIPHeader": "ERROR FORCING IP", - "F_UI_ErrorForceIP": "'{0}' is not a valid IP address to connect to! Check your 'Force IP' setting.", - "F_UI_ErrorBindIPHeader": "ERROR BINDING", - "F_UI_ErrorBindIP": "'{0}' is not a valid IP address to bind to! Check your 'Force Bind IP' setting.", - "F_UI_NoDedicatedClients": "No dedicated clients are available.", - "F_UI_WaitForHostFinishInit": "Waiting for host to finish raid initialization...", - "F_UI_WaitForOtherPlayers": "Waiting for other players to finish loading...", + "F_UI_CannotJoinRaidOtherMap": "No puedes unirte a una partida en otro mapa. Mapa de la partida: {0}", + "F_UI_CannotJoinRaidOtherTime": "No puedes unirte a una partida en horario distinto.", + "F_UI_CannotJoinRaidScavAsPMC": "No puedes unirte a una partida scav como PMC.", + "F_UI_CannotJoinRaidPMCAsScav": "No puedes unirte a una partida PMC como scav.", + "F_UI_HostStillLoading": "El anfitrión está cargando todavía.", + "F_UI_RaidInProgress": "La partida está en progreso.", + "F_UI_ReJoinRaid": "Pulsa para reconectar a la partida.", + "F_UI_CannotReJoinRaidDied": "No puedes volver a unirte a la partida en la que has muerto.", + "F_UI_JoinRaid": "Pulsa para unirte a la partida.", + "F_UI_ErrorConnecting": "ERROR DE CONEXIÓN", + "F_UI_UnableToConnect": "Imposible conectar al servidor. Asegúrate de que todos los puertos están abiertos y todos los ajustes están correctamente configurados.", + "F_UI_FikaPingerFailStart": "No se ha podido arrancar el FikaPinger!", + "F_UI_RefreshRaids": "Actualizar la lista de partidas activas.", + "F_UI_DedicatedError": "ERROR DE FIKA DEDICADO", + "F_UI_ErrorForceIPHeader": "ERROR FORZANDO IP", + "F_UI_ErrorForceIP": "'{0}' no es una IP válida para la conexión! Comprueba el ajuste 'Forzar IP'.", + "F_UI_ErrorBindIPHeader": "ERROR DE UNIÓN", + "F_UI_ErrorBindIP": "'{0}' no es una IP válida a la que forzar la unión! Comprueba tus ajustes de 'Forzar Unión de IP'.", + "F_UI_NoDedicatedClients": "No hay clientes dedicados disponibles.", + "F_UI_WaitForHostFinishInit": "Esperando a que el anfitrión inicialice la partida...", + "F_UI_WaitForOtherPlayers": "Esperando a que otros jugadores terminen de cargar...", "F_UI_RetrieveSpawnInfo": "Recuperando información de reaparición del servidor...", - "F_UI_RetrieveLoot": "Retrieving loot from server...", - "F_UI_WaitForHostInit": "Waiting for host to initialize raid...", + "F_UI_RetrieveLoot": "Recuperando botín del servidor...", + "F_UI_WaitForHostInit": "Esperando a que el Host inicie la partida...", "F_UI_Reconnecting": "Reconectando...", - "F_UI_RetrieveExfilData": "Retrieving exfiltration data from server...", - "F_UI_RetrieveInteractables": "Retrieving interactable objects from server...", - "F_UI_InitCoopGame": "Initializing Coop Game...", + "F_UI_RetrieveExfilData": "Recuperando los datos de exfiltración del servidor...", + "F_UI_RetrieveInteractables": "Recuperando objetos interactuables del servidor...", + "F_UI_InitCoopGame": "Iniciando partida cooperativa...", "F_UI_AllPlayersJoined": "Todos los jugadores se unieron, comenzando el juego...", - "F_UI_WaitingForConnect": "Waiting for client to connect to server... If there is no notification it failed.", - "F_UI_ErrorConnectingToRaid": "Unable to connect to the raid server. Make sure ports are forwarded and/or UPnP is enabled and supported.", - "F_UI_FinishingRaidInit": "Finishing raid initialization...", - "F_UI_SyncThrowables": "Syncing throwables...", - "F_UI_SyncInteractables": "Syncing interactables...", - "F_UI_SyncLampStates": "Syncing lamp states...", - "F_UI_SyncWindows": "Syncing windows...", - "F_UI_ReceiveOwnPlayer": "Receiving own player...", + "F_UI_WaitingForConnect": "Esperando a que el cliente se conecte al servidor... Si no hay una notificación falló.", + "F_UI_ErrorConnectingToRaid": "Imposible conectar al servidor de la partida. Asegúrese de que los puertos están redirigidos y/o que el UPnP está habilitado y soportado.", + "F_UI_FinishingRaidInit": "Terminando la inicialización de la partida...", + "F_UI_SyncThrowables": "Sincronizando arrojadizas...", + "F_UI_SyncInteractables": "Sincronizando interactuables...", + "F_UI_SyncLampStates": "Sincronizando estado de las lámparas...", + "F_UI_SyncWindows": "Sincronizando ventanas...", + "F_UI_ReceiveOwnPlayer": "Recibiendo al jugador propio...", "F_UI_FinishReconnect": "Terminando de reconectar...", - "F_Client_FreeCamInputDisabled": "Free cam input disabled", - "F_Client_FreeCamInputEnabled": "Free cam input enabled", + "F_Client_FreeCamInputDisabled": "Entrada de la cámara libre desactivada", + "F_Client_FreeCamInputEnabled": "Entrada de la cámara libre activada", "F_UI_WaitForPlayer": "Esperando a {0} jugador", "F_UI_WaitForPlayers": "Esperando a {0} jugadores", "F_UI_ToSLong": "¡Bienvenido a Fika!\n\nFika es un mod cooperativo para SPT, que te permite jugar con tus amigos. Fika es y será siempre gratis, si has pagado por él te han estafado. Tampoco está permitido alojar servidores públicos con monetización o donaciones.\n\nEspera a que este mensaje se desvanezca para aceptar nuestros Términos de Servicio.\n\nPuedes unirte a nuestro Discord aquí: https://discord.gg/project-fika", - "F_UI_ToSShort": "¡Bienvenido a Fika!\n\nFika es un mod cooperativo para SPT, que te permite jugar con tus amigos. Fika es y será siempre gratis, si has pagado por él te han estafado. Tampoco está permitido alojar servidores públicos con monetización o donaciones.\n\nPuedes unirte a nuestro Discord aquí: https://discord.gg/project-fika" + "F_UI_ToSShort": "¡Bienvenido a Fika!\n\nFika es un mod cooperativo para SPT, que te permite jugar con tus amigos. Fika es y será siempre gratis, si has pagado por él te han estafado. Tampoco está permitido alojar servidores públicos con monetización o donaciones.\n\nPuedes unirte a nuestro Discord aquí: https://discord.gg/project-fika", + "F_UI_RaidSettingsDescription": "En este modo, puedes jugar online Co-op con tuis amigos sin el riesgo de encontrarte con otros.\\nTodas las mecánicas del juego en el modo Co-op (clima, bots, bosses, etcétera) son identicas a las mecánicas online.\\nSolo las opciones del host tendrán efecto.", + "F_UI_CoopGameMode": "Modo de juego Co-op de Fika", + "F_UI_CoopRaidSettings": "Opciones de Raid Co-op de Fika", + "F_UI_FikaAlwaysCoop": "Co-op está siempre habilitado en Fika", + "F_UI_UpnpFailed": "El mapeo de UPnP falló. ¡Asegúrate de que el puerto seleccionado no está actualmente abierto!\\nDeshabilita UPnP si estás usando una VPN.", + "F_UI_InitWeather": "Generando clima...", + "F_Notification_RaidStarted": "{0} comenzó una raid en {1}", + "F_Notification_ItemReceived": "Recibiste un {0} de {1}" } diff --git a/assets/database/locales/global/fr.json b/assets/database/locales/global/fr.json index ee665707..022731e4 100644 --- a/assets/database/locales/global/fr.json +++ b/assets/database/locales/global/fr.json @@ -85,5 +85,13 @@ "F_UI_WaitForPlayer": "En attente de {0} joueur", "F_UI_WaitForPlayers": "En attende de {0} joueurs", "F_UI_ToSLong": "Bienvenue sur Fika!\n\nFika est un mod pour SPT, vous permettant de jouer avec vos amis. Fika est et sera toujours gratuit, si vous avez payé pour l'obtenir, c'est une arnaque. Il n'est pas non plus autorisé d'heberger un serveur public avec monétisation ou dons.\n\nPatientez le temps que ce message disparaisse pour accepter nos conditions d'utilisation.\n\nVous pouvez rejoindre notre serveur Discord ici: https://discord.gg/project-fika", - "F_UI_ToSShort": "Bienvenue sur Fika!\n\nFika est un mod pour SPT, vous permettant de jouer avec vos amis. Fika est et sera toujours gratuit, si vous avez payé pour l'obtenir, c'est une arnaque. Il n'est pas non plus autorisé d'heberger un serveur public avec monétisation ou dons.\n\nVous pouvez rejoindre notre serveur Discord ici: https://discord.gg/project-fika" + "F_UI_ToSShort": "Bienvenue sur Fika!\n\nFika est un mod pour SPT, vous permettant de jouer avec vos amis. Fika est et sera toujours gratuit, si vous avez payé pour l'obtenir, c'est une arnaque. Il n'est pas non plus autorisé d'heberger un serveur public avec monétisation ou dons.\n\nVous pouvez rejoindre notre serveur Discord ici: https://discord.gg/project-fika", + "F_UI_RaidSettingsDescription": "Dans ce mode, vous pouvez jouer en co-op avec des amis sans le risque de rencontrer des joueurs.\\n Toutes les mécaniques de jeu dans le mode co-op (météo, bots, boss, etc.) sont identiques aux mécaniques en ligne.\\n Seulement les paramètres de l'hôte prendrons effet.", + "F_UI_CoopGameMode": "Fika Co-op Game Mode", + "F_UI_CoopRaidSettings": "Paramètres pour les raids du mod coop Fika", + "F_UI_FikaAlwaysCoop": "Co-op is always enabled in Fika", + "F_UI_UpnpFailed": "Échec du mappage UPnP. Vérifiez que le port sélectionné n'est pas déjà ouvert !\\nDésactivez UPnP si vous utilisez un VPN.", + "F_UI_InitWeather": "Generating weather...", + "F_Notification_RaidStarted": "{0} started a raid on {1}", + "F_Notification_ItemReceived": "Vous avez reçu un {0} de {1}" } diff --git a/assets/database/locales/global/ge.json b/assets/database/locales/global/ge.json index 1f5e83b9..5d70f66c 100644 --- a/assets/database/locales/global/ge.json +++ b/assets/database/locales/global/ge.json @@ -83,5 +83,15 @@ "F_Client_FreeCamInputDisabled": "Freie Kamera Eingaben deaktiviert", "F_Client_FreeCamInputEnabled": "Freie Kamera Eingaben aktiviert", "F_UI_WaitForPlayer": "Warte auf {0} Spieler", - "F_UI_WaitForPlayers": "Warte auf {0} Spieler" + "F_UI_WaitForPlayers": "Warte auf {0} Spieler", + "F_UI_ToSLong": "Willkommen bei Fika! \n\nFika ist ein Koop-Mod für SPT, mit dem du mit deinen Freunden spielen kannst. Fika ist und wird immer kostenlos sein, wenn Sie dafür bezahlt haben, wurden Sie betrogen. Es ist Ihnen nicht gestattet, öffentliche Server mit Monetarisierung oder Spenden zu hosten.\n\nWarten Sie, bis diese Meldung ausgeblendet wird, um unsere Nutzungsbedingungen zu akzeptieren.\n\n Du kannst unserem Discord hier beitreten: https://discord.gg/project-fika", + "F_UI_ToSShort": "Willkommen bei Fika! \n\nFika ist ein Koop-Mod für SPT, mit dem du mit deinen Freunden spielen kannst. Fika ist und wird immer kostenlos sein, wenn Sie dafür bezahlt haben, wurden Sie betrogen. Es ist Ihnen nicht gestattet, öffentliche Server mit Monetarisierung oder Spenden zu hosten.\n\n Du kannst unserem Discord hier beitreten: https://discord.gg/project-fika", + "F_UI_RaidSettingsDescription": "In diesem Modus kannst du online co-op mit deinen Freunden spielen, ohne das Risiko auf andere zu treffen.\\nAlle Spielmechaniken im co-op Modus (Wetter, Bots, Bosse, etc.) sind identisch mit den online Mechaniken.\\nNur die Einstellungen des Hosts werden übernommen.", + "F_UI_CoopGameMode": "Fika Co-op Spielmodus", + "F_UI_CoopRaidSettings": "Fika Co-op Raid Einstellungen", + "F_UI_FikaAlwaysCoop": "Fika ist immer im Co-op Modus", + "F_UI_UpnpFailed": "UPnP Mapping fehlgeschlagen. Stelle sicher, dass der ausgewählte Port nicht bereits offen ist!\\nStelle UPnP aus wenn du ein VPN benutzt.", + "F_UI_InitWeather": "Wetter wird generiert...", + "F_Notification_RaidStarted": "{0} hat einen Raid auf {1} gestartet", + "F_Notification_ItemReceived": "You received a {0} from {1}" } diff --git a/assets/database/locales/global/hu.json b/assets/database/locales/global/hu.json index b8e74a39..82526dcb 100644 --- a/assets/database/locales/global/hu.json +++ b/assets/database/locales/global/hu.json @@ -5,7 +5,7 @@ "F_Client_ReceivedSharedItemPickup": "\"{0} felvette: {1}\"", "F_Client_ReceivedSharedItemPlant": "\"{0} elhelyezett egy elemet {1} számára\"", "F_Client_ReceivePing": "\"Ping érkezett tőle: {0}\"", - "F_Client_ReceivePingObject": "\"{0} pingálta a következőt: {1}\"", + "F_Client_ReceivePingObject": "\"{0} megjelölte a következőt: {1}\"", "F_Client_RandomSpawnPoints": "Véletlenszerű spawn pontok használata", "F_Client_MetabolismDisabled": "Metabolizmus kikapcsolva", "F_Client_YouAreMIA": "Eltűntél akció közben...", @@ -27,7 +27,7 @@ "F_Client_UnknownError": "Ismeretlen kivétel történt, ellenőrizze a log fájlt", "F_Client_HostCannotExtract": "Addig nem léphetsz ki a játékból, amíg az összes kliens ki nem lép", "F_Client_HostCannotExtractMenu": "Nem bonthatja le a kapcsolatot, amíg továbbra is csatlakoznak társak! Hátralévő: {0}", - "F_Client_Wait5Seconds": "Kérem, várj legalább 5 másodpercet az utolsó partner kilépése után, mielőtt elhagynád a játékot", + "F_Client_Wait5Seconds": "Kérem, várjon legalább 5 másodpercet az utolsó társ kilépése után, mielőtt elhagyná a játékot", "F_Client_StartingRaid": "Raid indítása, kérem várjon...", "F_Client_LostConnection": "Kapcsolat megszakadt a hosttal", "F_Client_StartingRaidOnDedicated": "Raid indítása dedikált kliensen... kérem, várjon", @@ -84,6 +84,14 @@ "F_Client_FreeCamInputEnabled": "A szabad kamera bemenet bekapcsolva", "F_UI_WaitForPlayer": "Várakozás {0} játékosra", "F_UI_WaitForPlayers": "Várakozás {0} játékosra", - "F_UI_ToSLong": "Welcome to Fika!\r\n\r\nFika is a co-op mod for SPT, allowing you to play with your friends. Fika is and will always be free, if you paid for it you got scammed. You are also not allowed to host public servers with monetization or donations.\r\n\r\nWait for this message to fade to accept our Terms of Service.\r\n\r\nYou can join our Discord here: https://discord.gg/project-fika", - "F_UI_ToSShort": "Welcome to Fika!\r\n\r\nFika is a co-op mod for SPT, allowing you to play with your friends. Fika is and will always be free, if you paid for it you got scammed. You are also not allowed to host public servers with monetization or donations.\r\n\r\nYou can join our Discord here: https://discord.gg/project-fika" + "F_UI_ToSLong": "Üdvözöljük a Fika-ban!\n\nA Fika egy többjátékos mod az SPT-hez, ez a mod lehetővé teszi, hogy játssz a barátaiddal. A Fika mindig is ingyenes lesz, ha fizettél érte, akkor átvertek. TILOS a publikus szervereket monetizációval vagy adománygyűjtéssel hostolni!\n\nVárj amíg ez az üzenet eltűnik, hogy elfogadd a Szolgáltatási Feltételeket.\n\nItt tudsz belépni a Discord szerverünkre: https://discord.gg/project-fika", + "F_UI_ToSShort": "Üdvözöljük a Fika-ban!\n\nA Fika egy többjátékos mod az SPT-hez, ez a mod lehetővé teszi, hogy játssz a barátaiddal. A Fika mindig is ingyenes lesz, ha fizettél érte, akkor átvertek. TILOS a publikus szervereket monetizációval vagy adománygyűjtéssel hostolni!\n\nItt tudsz belépni a Discord szerverünkre: https://discord.gg/project-fika", + "F_UI_RaidSettingsDescription": "In this mode, you can play online co-op with your friends without the risk of meeting others.\\nAll game mechanics in the co-op mode (weather, bots, bosses, etc.) are identical to the online mechanics.\\nOnly the hosts settings will take effect.", + "F_UI_CoopGameMode": "Fika Co-op Game Mode", + "F_UI_CoopRaidSettings": "Fika Co-op Raid Settings", + "F_UI_FikaAlwaysCoop": "Co-op is always enabled in Fika", + "F_UI_UpnpFailed": "UPnP mapping failed. Make sure the selected port is not already open!\\nDisable UPnP if you are using a VPN.", + "F_UI_InitWeather": "Generating weather...", + "F_Notification_RaidStarted": "{0} started a raid on {1}", + "F_Notification_ItemReceived": "You received a {0} from {1}" } diff --git a/assets/database/locales/global/it.json b/assets/database/locales/global/it.json index df53f51c..6d246b82 100644 --- a/assets/database/locales/global/it.json +++ b/assets/database/locales/global/it.json @@ -84,6 +84,14 @@ "F_Client_FreeCamInputEnabled": "Input abilitati in Free cam", "F_UI_WaitForPlayer": "In attesa di {0} giocatore", "F_UI_WaitForPlayers": "In attesa di {0} giocatori", - "F_UI_ToSLong": "Welcome to Fika!\r\n\r\nFika is a co-op mod for SPT, allowing you to play with your friends. Fika is and will always be free, if you paid for it you got scammed. You are also not allowed to host public servers with monetization or donations.\r\n\r\nWait for this message to fade to accept our Terms of Service.\r\n\r\nYou can join our Discord here: https://discord.gg/project-fika", - "F_UI_ToSShort": "Welcome to Fika!\r\n\r\nFika is a co-op mod for SPT, allowing you to play with your friends. Fika is and will always be free, if you paid for it you got scammed. You are also not allowed to host public servers with monetization or donations.\r\n\r\nYou can join our Discord here: https://discord.gg/project-fika" + "F_UI_ToSLong": "Benvenuto su Fika!\n\nFika è una mod co-op per SPT, che ti permette di giocare con i tuoi amici. Fika è e sarà sempre gratuito, se lo hai pagato sei stato truffato. Non è inoltre consentito ospitare server pubblici con monetizzazione o donazioni.\n\nAspetta che questo messaggio svanisca per accettare i nostri Termini di Servizio.\n\nPuoi unirti alla nostra community Discord qui: https://discord.gg/project-fika", + "F_UI_ToSShort": "Benvenuto su Fika!\n\nFika è una mod co-op per SPT, che ti permette di giocare con i tuoi amici. Fika è e sarà sempre gratuito, se lo hai pagato sei stato truffato. Non è inoltre consentito ospitare server pubblici con monetizzazione o donazioni.\n\nPuoi unirti alla nostra community Discord qui: https://discord.gg/project-fika", + "F_UI_RaidSettingsDescription": "In this mode, you can play online co-op with your friends without the risk of meeting others.\\nAll game mechanics in the co-op mode (weather, bots, bosses, etc.) are identical to the online mechanics.\\nOnly the hosts settings will take effect.", + "F_UI_CoopGameMode": "Fika Co-op Game Mode", + "F_UI_CoopRaidSettings": "Fika Co-op Raid Settings", + "F_UI_FikaAlwaysCoop": "Co-op is always enabled in Fika", + "F_UI_UpnpFailed": "UPnP mapping failed. Make sure the selected port is not already open!\\nDisable UPnP if you are using a VPN.", + "F_UI_InitWeather": "Generating weather...", + "F_Notification_RaidStarted": "{0} started a raid on {1}", + "F_Notification_ItemReceived": "You received a {0} from {1}" } diff --git a/assets/database/locales/global/jp.json b/assets/database/locales/global/jp.json index 2fde511d..ab44b1d2 100644 --- a/assets/database/locales/global/jp.json +++ b/assets/database/locales/global/jp.json @@ -18,16 +18,16 @@ "F_Client_ServerStarted": "ポート {0} でサーバーを開始しました", "F_Client_CouldNotFindValidIP": "有効なローカルIPが見つかりません!", "F_Client_ReconnectRequested": "再接続が要求されました、遅延が予想されます…", - "F_Client_PeerConnected": "仲間がポート {0} でサーバーに接続しました", - "F_Client_PeerDisconnected": "仲間が {0} で切断しました、情報: {1}", + "F_Client_PeerConnected": "ピアがポート {0} でサーバーに接続しました", + "F_Client_PeerDisconnected": "ピアが {0} で切断しました、情報: {1}", "F_Client_ConnectingToSession": "セッションに接続中…", "F_Client_ItemIsBlacklisted": "{0} は送信がブラックリストに登録されています", "F_Client_ItemsContainsBlacklisted": "{0} には {1} が含まれており、送信がブラックリストに登録されています", "F_Client_SavedProfile": "プロファイル {0} を {1} に保存しました", "F_Client_UnknownError": "不明な例外が発生しました、ログファイルを確認してください", "F_Client_HostCannotExtract": "すべてのクライアントが切断されるまでゲームを終了することはできません", - "F_Client_HostCannotExtractMenu": "まだ接続されている仲間がいるため、切断できません! 残り: {0}", - "F_Client_Wait5Seconds": "最後の仲間が切断された後、終了する前に少なくとも5秒待ってください", + "F_Client_HostCannotExtractMenu": "まだ接続されているピアがいるため、切断できません! 残り: {0}", + "F_Client_Wait5Seconds": "最後のピアが切断された後、終了する前に少なくとも5秒待ってください", "F_Client_StartingRaid": "レイドを開始しています、しばらくお待ちください…", "F_Client_LostConnection": "ホストとの接続が失われました", "F_Client_StartingRaidOnDedicated": "専用クライアントでレイドを開始しています… しばらくお待ちください", @@ -85,5 +85,13 @@ "F_UI_WaitForPlayer": "{0} プレイヤーを待っています", "F_UI_WaitForPlayers": "{0} プレイヤーを待っています", "F_UI_ToSLong": "Fika へようこそ!\n\nFika は SPT 用の協力プレイ Mod で、友達と一緒にプレイすることができます。Fika は無料であり、今後も無料で提供されます。もしお金を支払った場合、それは詐欺です。また、収益化や寄付を目的とした公開サーバーのホストは許可されていません。\n\n利用規約に同意するには、このメッセージが消えるまで待ってください。\n\nDiscord への参加はこちらから: https://discord.gg/project-fika", - "F_UI_ToSShort": "Fika へようこそ!\n\nFika は SPT 用の協力プレイ Mod で、友達と一緒にプレイすることができます。Fika は無料であり、今後も無料で提供されます。もしお金を支払った場合、それは詐欺です。また、収益化や寄付を目的とした公開サーバーのホストは許可されていません。\n\nDiscord への参加はこちらから: https://discord.gg/project-fika" + "F_UI_ToSShort": "Fika へようこそ!\n\nFika は SPT 用の協力プレイ Mod で、友達と一緒にプレイすることができます。Fika は無料であり、今後も無料で提供されます。もしお金を支払った場合、それは詐欺です。また、収益化や寄付を目的とした公開サーバーのホストは許可されていません。\n\nDiscord への参加はこちらから: https://discord.gg/project-fika", + "F_UI_RaidSettingsDescription": "In this mode, you can play online co-op with your friends without the risk of meeting others.\\nAll game mechanics in the co-op mode (weather, bots, bosses, etc.) are identical to the online mechanics.\\nOnly the hosts settings will take effect.", + "F_UI_CoopGameMode": "Fika Co-op Game Mode", + "F_UI_CoopRaidSettings": "Fika Co-op Raid Settings", + "F_UI_FikaAlwaysCoop": "Co-op is always enabled in Fika", + "F_UI_UpnpFailed": "UPnP mapping failed. Make sure the selected port is not already open!\\nDisable UPnP if you are using a VPN.", + "F_UI_InitWeather": "Generating weather...", + "F_Notification_RaidStarted": "{0} started a raid on {1}", + "F_Notification_ItemReceived": "You received a {0} from {1}" } diff --git a/assets/database/locales/global/kr.json b/assets/database/locales/global/kr.json index 79127f23..06b32247 100644 --- a/assets/database/locales/global/kr.json +++ b/assets/database/locales/global/kr.json @@ -1,12 +1,12 @@ { - "Attention! This is a Beta version of Escape from Tarkov for testing purposes.": "오프라인에서 Coop을 즐길 수 있는 Fika에 오신걸 환영합니다.", - "NDA free warning": "To host/join a game you must select a map and go to the last screen to use the Server Browser.", - "F_Client_ReceivedSharedQuestProgress": "Received shared quest progression from {0} for the quest {1}", + "Attention! This is a Beta version of Escape from Tarkov for testing purposes.": "SPT 오프라인 코옵모드 FIKA 에 오신걸 환영합니다.", + "NDA free warning": "게임을 호스팅하거나 참가하기 위해서는 맵을 선택하고 시작직전단계에서 서버 브라우저를 이용하실 수 있습니다.", + "F_Client_ReceivedSharedQuestProgress": "{0} 으로부터 {1} 퀘스트 공유진행을 전달받았습니다", "F_Client_ReceivedSharedItemPickup": "{0} 이(가) {1} 을 주웠습니다.", "F_Client_ReceivedSharedItemPlant": "{0} 이(가) {1} 을 하기 위해 아이템을 설치했습니다.", "F_Client_ReceivePing": "{0} 으로 부터 핑을 수신했습니다.", "F_Client_ReceivePingObject": "{0} 이(가) {1} {2} 를 표시했습니다", - "F_Client_RandomSpawnPoints": "Using random spawn points", + "F_Client_RandomSpawnPoints": "랜덤 스폰장소를 적용합니다", "F_Client_MetabolismDisabled": "신진대사 비활성화", "F_Client_YouAreMIA": "작전 중 실종되었습니다...", "F_Client_KilledBoss": "{0}(이) 가 {1} 보스를 사살하였습니다.", @@ -16,29 +16,29 @@ "F_Client_GroupMemberDied": "그룹 멤버 {0} 이(가) 사망하였습니다.", "F_Client_ConnectedToServer": "포트 {0} 의 서버에 참여하였습니다.", "F_Client_ServerStarted": "포트 {0} 에서 서버가 시작되었습니다", - "F_Client_CouldNotFindValidIP": "Could not find a valid local IP!", + "F_Client_CouldNotFindValidIP": "유효한 로컬 ip를 찾을 수 없습니다", "F_Client_ReconnectRequested": "재참여 요청중, 랙이 걸릴 수 있습니다...", - "F_Client_PeerConnected": "Peer connected to server on port {0}", - "F_Client_PeerDisconnected": "Peer disconnected {0}, info: {1}", + "F_Client_PeerConnected": "{0} 포트로 클라이언트가 접속하였습니다", + "F_Client_PeerDisconnected": "클라이언트가 접속을 해제하였습니다 {0}, info: {1}", "F_Client_ConnectingToSession": "세션 참가중....", - "F_Client_ItemIsBlacklisted": "{0} is blacklisted from being sent", - "F_Client_ItemsContainsBlacklisted": "{0} contains {1} which is blacklisted from being sent", - "F_Client_SavedProfile": "Saved profile {0} to {1}", - "F_Client_UnknownError": "An unknown exception was thrown, check your log file", - "F_Client_HostCannotExtract": "You cannot exit the game until all clients have disconnected", - "F_Client_HostCannotExtractMenu": "You cannot disconnect while there are still peers connected! Remaining: {0}", + "F_Client_ItemIsBlacklisted": "{0}은 전송아이템 블랙리스트 되어있습니다", + "F_Client_ItemsContainsBlacklisted": "{0}에 블랙리스트 아이템인 {1}이 들어있어 보낼 수 없습니다", + "F_Client_SavedProfile": "프로필 {0}을 {1}에 저장하였습니다", + "F_Client_UnknownError": "알 수 없는 예외처리가 발생하였습니다. 로그를 확인해주십시오.", + "F_Client_HostCannotExtract": "모든 참가자가 접속해제하기 전까지 게임을 나갈 수 없습니다.", + "F_Client_HostCannotExtractMenu": "참가자가 연결되어 있는 동안 접속해제할 수 없습니다. 남은 참가자: {0}", "F_Client_Wait5Seconds": "마지막 피어가 연결을 끝내고 난 뒤, 5초간 대기 해 주십시오,", "F_Client_StartingRaid": "레이드를 시작 중입니다. 잠시만 기다려주십시오...", "F_Client_LostConnection": "호스트로부터 연결이 끊겼습니다.", - "F_Client_StartingRaidOnDedicated": "Starting raid on dedicated client... please wait", + "F_Client_StartingRaidOnDedicated": "전담 클라이언트로 레이드를 시작합니다. 기다려 주십시오.", "F_SendItem_Header": "플레이어 선택", "F_SendItem_SendButton": "보내기", "F_MMUI_RaidsHeader": "레이드 목록", "F_MMUI_HostRaidButton": "레이드 호스트하기", "F_MMUI_JoinButton": "참가", - "F_MMUI_SelectAmountHeader": "SELECT AMOUNT", + "F_MMUI_SelectAmountHeader": "양을 선택하십시오.", "F_MMUI_SelectAmountDescription": "당신을 포함하여 몇 명의 플레이어가 참가합니까?", - "F_MMUI_UseDedicatedHost": "Use Dedicated Host", + "F_MMUI_UseDedicatedHost": "전담 호스트를 사용하여 주십시오", "F_MMUI_StartButton": "시작", "F_MMUI_LoadingScreenHeader": "로딩 중", "F_MMUI_LoadingScreenDescription": "레이드를 동기화하는 중입니다... 잠시만 기다려주십시오.", @@ -52,38 +52,46 @@ "F_UI_CannotReJoinRaidDied": "이미 사망한 레이드에는 재참할 수 없습니다.", "F_UI_JoinRaid": "클릭하여 레이드에 참가합니다.", "F_UI_ErrorConnecting": "연결 오류", - "F_UI_UnableToConnect": "Unable to connect to the server. Make sure that all ports are open and that all settings are configured correctly.", - "F_UI_FikaPingerFailStart": "Could not start the FikaPinger!", - "F_UI_RefreshRaids": "Refresh list of active raids.", - "F_UI_DedicatedError": "FIKA DEDICATED ERROR", - "F_UI_ErrorForceIPHeader": "ERROR FORCING IP", - "F_UI_ErrorForceIP": "'{0}' is not a valid IP address to connect to! Check your 'Force IP' setting.", - "F_UI_ErrorBindIPHeader": "ERROR BINDING", - "F_UI_ErrorBindIP": "'{0}' is not a valid IP address to bind to! Check your 'Force Bind IP' setting.", - "F_UI_NoDedicatedClients": "No dedicated clients are available.", - "F_UI_WaitForHostFinishInit": "Waiting for host to finish raid initialization...", - "F_UI_WaitForOtherPlayers": "Waiting for other players to finish loading...", - "F_UI_RetrieveSpawnInfo": "Retrieving spawn info from server...", - "F_UI_RetrieveLoot": "Retrieving loot from server...", - "F_UI_WaitForHostInit": "Waiting for host to initialize raid...", - "F_UI_Reconnecting": "Reconnecting...", - "F_UI_RetrieveExfilData": "Retrieving exfiltration data from server...", - "F_UI_RetrieveInteractables": "Retrieving interactable objects from server...", - "F_UI_InitCoopGame": "Initializing Coop Game...", - "F_UI_AllPlayersJoined": "All players joined, starting game...", - "F_UI_WaitingForConnect": "Waiting for client to connect to server... If there is no notification it failed.", - "F_UI_ErrorConnectingToRaid": "Unable to connect to the raid server. Make sure ports are forwarded and/or UPnP is enabled and supported.", - "F_UI_FinishingRaidInit": "Finishing raid initialization...", - "F_UI_SyncThrowables": "Syncing throwables...", - "F_UI_SyncInteractables": "Syncing interactables...", - "F_UI_SyncLampStates": "Syncing lamp states...", - "F_UI_SyncWindows": "Syncing windows...", - "F_UI_ReceiveOwnPlayer": "Receiving own player...", - "F_UI_FinishReconnect": "Finishing reconnect...", - "F_Client_FreeCamInputDisabled": "Free cam input disabled", - "F_Client_FreeCamInputEnabled": "Free cam input enabled", - "F_UI_WaitForPlayer": "Waiting for {0} player", - "F_UI_WaitForPlayers": "Waiting for {0} players", - "F_UI_ToSLong": "Welcome to Fika!\r\n\r\nFika is a co-op mod for SPT, allowing you to play with your friends. Fika is and will always be free, if you paid for it you got scammed. You are also not allowed to host public servers with monetization or donations.\r\n\r\nWait for this message to fade to accept our Terms of Service.\r\n\r\nYou can join our Discord here: https://discord.gg/project-fika", - "F_UI_ToSShort": "Welcome to Fika!\r\n\r\nFika is a co-op mod for SPT, allowing you to play with your friends. Fika is and will always be free, if you paid for it you got scammed. You are also not allowed to host public servers with monetization or donations.\r\n\r\nYou can join our Discord here: https://discord.gg/project-fika" + "F_UI_UnableToConnect": "서버에 접속하지 못하였습니다. 모든 포트가 열려있고 모든 설정이 올바르게 되어있는지 확인하여 주십시오.", + "F_UI_FikaPingerFailStart": "피카 핑 생성기를 시작할 수 없습니다.", + "F_UI_RefreshRaids": "현재 진행중인 레이드 리스트를 새로고침 하십시오.", + "F_UI_DedicatedError": "피카 전담 에러", + "F_UI_ErrorForceIPHeader": "IP강제 에러", + "F_UI_ErrorForceIP": "{0} 은 유효한 IP주소가 아닙니다. IP강제하기 설정을 확인하십시오.", + "F_UI_ErrorBindIPHeader": "바인딩 에러", + "F_UI_ErrorBindIP": "{0} 은 바인드하기 유효한 IP주소가 아닙니다. IP 강제 바인드 설정을 확인해주십시오.", + "F_UI_NoDedicatedClients": "사용가능한 전담 클라이언트가 없습니다.", + "F_UI_WaitForHostFinishInit": "호스트의 레이드 초기화 대기중", + "F_UI_WaitForOtherPlayers": "다른 플레이어들의 로딩 대기중", + "F_UI_RetrieveSpawnInfo": "서버에서 스폰 정보 받아오는중", + "F_UI_RetrieveLoot": "서버에서 전리품 불러오는중", + "F_UI_WaitForHostInit": "호스트의 레이드 초기화 기다리는중", + "F_UI_Reconnecting": "재연결중", + "F_UI_RetrieveExfilData": "서버에서 탈출구 데이터 불러오는중", + "F_UI_RetrieveInteractables": "서버에서 상호작용물체 불러오는중", + "F_UI_InitCoopGame": "코옵 게임 초기화중", + "F_UI_AllPlayersJoined": "모든 플레이어가 접속하여 게임을 시작합니다.", + "F_UI_WaitingForConnect": "클라이언트가 서버에 연결하기를 기다리는중. 알림이 없으면 실패한 것 입니다.", + "F_UI_ErrorConnectingToRaid": "레이드 서버에 연결할 수 없습니다. 포트포워딩 상태와 UPnP의 활성화 여부를 확인바랍니다.", + "F_UI_FinishingRaidInit": "레이드 초기화 마무리 중", + "F_UI_SyncThrowables": "투척류 동기화중", + "F_UI_SyncInteractables": "상호작용물체 동기화중", + "F_UI_SyncLampStates": "광원상태 동기화중", + "F_UI_SyncWindows": "창 동기화 중", + "F_UI_ReceiveOwnPlayer": "캐릭터 받는 중", + "F_UI_FinishReconnect": "재접속 마무리 중", + "F_Client_FreeCamInputDisabled": "프리캠 입력 비활성화", + "F_Client_FreeCamInputEnabled": "프리캠 입력 활성화", + "F_UI_WaitForPlayer": "플레이어 {0}명 대기중", + "F_UI_WaitForPlayers": "플레이어 {0}명 대기중", + "F_UI_ToSLong": "Fika에 오신 것을 환영합니다! \n\nFika는 SPT를 위한 협동 모드로, 친구들과 함께 플레이할 수 있게 해줍니다. Fika는 현재도 그렇고 앞으로도 항상 무료일 것입니다. 만약 이에 대해 돈을 지불했다면 사기를 당한 것입니다. 또한 수익화나 기부를 받는 공개 서버를 호스팅하는 것은 허용되지 않습니다. \n\n이 메시지가 사라질 때까지 기다리면 우리의 서비스 약관에 동의하는 것입니다. \n\n다음 링크를 통해 우리의 Discord에 참여하실 수 있습니다: https://discord.gg/project-fika", + "F_UI_ToSShort": "Fika에 오신 것을 환영합니다! \n\nFika는 SPT를 위한 코옵 모드입니다. Fika는 무료 소프트웨어 입니다. 만약 돈을 지불했다면 사기를 당한 것입니다. 또한 수익화나 기부를 받는 공개 서버를 호스팅하는 것은 허용되지 않습니다. \n\n이 메시지가 사라질 때까지 기다리면 우리의 서비스 약관에 동의하는 것입니다. \n\n다음 링크를 통해 디스코드에 참여하실 수 있습니다: https://discord.gg/project-fika", + "F_UI_RaidSettingsDescription": "이 모드에서는 본섭에서 느꼈을 모르는 사람들과 경쟁하는 걱정없이 친구들과 함께 코옵을 즐길 수 있습니다.\\n날씨, 봇, 보스 등과 같은 대부분의 게임 요소들은 본섭과 동일합니다.\\n방을 판 사람(서버 킨 사람 x) 설정을 따라가게 되어있습니다.", + "F_UI_CoopGameMode": "Fika 코옵 게임모드", + "F_UI_CoopRaidSettings": "Fika 코옵 레이드 설정", + "F_UI_FikaAlwaysCoop": "Fika에서 코옵기능은 항상 켜져있습니다.", + "F_UI_UpnpFailed": "UPnP 매핑 실패. 선택한 포트가 이미 열려있지 않은지 확인해주세요\\nVPN을 사용중이라면 UPnP를 꺼주세요.", + "F_UI_InitWeather": "날씨 생성 중...", + "F_Notification_RaidStarted": "{0} 가 {1} 에서 레이드를 시작하였습니다", + "F_Notification_ItemReceived": "{1} 에게서 {0} 를 받았습니다" } diff --git a/assets/database/locales/global/pl.json b/assets/database/locales/global/pl.json index ea43734b..2407ff1c 100644 --- a/assets/database/locales/global/pl.json +++ b/assets/database/locales/global/pl.json @@ -72,7 +72,7 @@ "F_UI_InitCoopGame": "Inicjalizowanie gry kooperacyjnej...", "F_UI_AllPlayersJoined": "Wszyscy gracze dołączyli, rozpoczynanie gry...", "F_UI_WaitingForConnect": "Oczekiwanie na połączenie klienta z serwerem... Jeśli nie ma powiadomienia, to nie powiodło się.", - "F_UI_ErrorConnectingToRaid": "Nie można połączyć się z serwerem. Upewnij się, że porty odpowiednie porty są przekierowanie i/lub UPnP jest włączone i wspierane.", + "F_UI_ErrorConnectingToRaid": "Nie można połączyć się z serwerem. Upewnij się, że odpowiednie porty są przekierowanie i/lub UPnP jest włączone i wspierane.", "F_UI_FinishingRaidInit": "Kończenie inicjalizacji raidu...", "F_UI_SyncThrowables": "Synchronizowanie obiektów miotanych...", "F_UI_SyncInteractables": "Synchronizowanie obiektów interaktywnych...", @@ -84,6 +84,14 @@ "F_Client_FreeCamInputEnabled": "Sterowanie swobodną kamerą włączone", "F_UI_WaitForPlayer": "Oczekiwanie na {0} gracza", "F_UI_WaitForPlayers": "Oczekiwanie na {0} graczy", - "F_UI_ToSLong": "Welcome to Fika!\r\n\r\nFika is a co-op mod for SPT, allowing you to play with your friends. Fika is and will always be free, if you paid for it you got scammed. You are also not allowed to host public servers with monetization or donations.\r\n\r\nWait for this message to fade to accept our Terms of Service.\r\n\r\nYou can join our Discord here: https://discord.gg/project-fika", - "F_UI_ToSShort": "Welcome to Fika!\r\n\r\nFika is a co-op mod for SPT, allowing you to play with your friends. Fika is and will always be free, if you paid for it you got scammed. You are also not allowed to host public servers with monetization or donations.\r\n\r\nYou can join our Discord here: https://discord.gg/project-fika" + "F_UI_ToSLong": "Witamy w Fika!\n\nFika to mod Kooperacyjny dla SPT, pozwalający ci grać z Twoimi przyjaciółmi. Fika jest i zawsze będzie darmowa, jeśli za niego zapłaciłeś, to zostałeś oszukany. Zabrania się zakładania serwerów publicznych z mikropłatnościami lub dotacjami. \n\nZaczekaj aż ta wiadomość zniknie żeby zaakceptować nasze Warunki Świadczenia Usług.\n\nMożesz dołączyć do naszego Discorda tutaj: https://discord.gg/project-fika", + "F_UI_ToSShort": "Witamy w Fika!\n\nFika to mod Kooperacyjny dla SPT, pozwalający ci grać z Twoimi przyjaciółmi. Fika jest i zawsze będzie darmowa, jeśli za niego zapłaciłeś, to zostałeś oszukany. Zabrania się zakładanie serwerów publicznych z mikropłatnościami lub dotacjami. \n\nMożesz dołączyć do naszego Discorda tutaj: https://discord.gg/project-fika", + "F_UI_RaidSettingsDescription": "In this mode, you can play online co-op with your friends without the risk of meeting others.\\nAll game mechanics in the co-op mode (weather, bots, bosses, etc.) are identical to the online mechanics.\\nOnly the hosts settings will take effect.", + "F_UI_CoopGameMode": "Fika Co-op Game Mode", + "F_UI_CoopRaidSettings": "Fika Co-op Raid Settings", + "F_UI_FikaAlwaysCoop": "Co-op is always enabled in Fika", + "F_UI_UpnpFailed": "UPnP mapping failed. Make sure the selected port is not already open!\\nDisable UPnP if you are using a VPN.", + "F_UI_InitWeather": "Generating weather...", + "F_Notification_RaidStarted": "{0} started a raid on {1}", + "F_Notification_ItemReceived": "You received a {0} from {1}" } diff --git a/assets/database/locales/global/po.json b/assets/database/locales/global/po.json index b81d73de..33af9c44 100644 --- a/assets/database/locales/global/po.json +++ b/assets/database/locales/global/po.json @@ -84,6 +84,14 @@ "F_Client_FreeCamInputEnabled": "Controle de camera livre habilitada", "F_UI_WaitForPlayer": "Aguardando {0} jogador", "F_UI_WaitForPlayers": "Aguardando {0} jogadores", - "F_UI_ToSLong": "Welcome to Fika!\r\n\r\nFika is a co-op mod for SPT, allowing you to play with your friends. Fika is and will always be free, if you paid for it you got scammed. You are also not allowed to host public servers with monetization or donations.\r\n\r\nWait for this message to fade to accept our Terms of Service.\r\n\r\nYou can join our Discord here: https://discord.gg/project-fika", - "F_UI_ToSShort": "Welcome to Fika!\r\n\r\nFika is a co-op mod for SPT, allowing you to play with your friends. Fika is and will always be free, if you paid for it you got scammed. You are also not allowed to host public servers with monetization or donations.\r\n\r\nYou can join our Discord here: https://discord.gg/project-fika" + "F_UI_ToSLong": "Bem-vindo ao Fika!\n\nFika é um mod de Co-op para o SPT, que lhe permite jogar com seus amigos. Fika é e sempre será gratuito, se você pagou por ele, você foi enganado. Não é permitido hostear servidores públicos com monetização e/ou doações.\n\nEspere a messagem desaparecer para aceitar nossos termos de serviço.\n\nVocê pode entrar no nosso Discord aqui: https://discord.gg/project-fika", + "F_UI_ToSShort": "Bem-vindo ao Fika!\n\nFika é um mod de Co-op para o SPT, que lhe permite jogar com seus amigos. Fika é e sempre será gratuito, se você pagou por ele, você foi enganado. Não é permitido hostear servidores públicos com monetização e/ou doações.\n\nVocê pode entrar no nosso Discord aqui: https://discord.gg/project-fika", + "F_UI_RaidSettingsDescription": "Neste modo, é possível jogar online co-op com os seus amigos sem o risco de encontrar outros jogadores.\\nTodas as mecânicas de jogo no modo co-op (clima, bots, bosses, etc.) são idênticas às mecânicas online.\\nSó as definições do host vão ter efeito.", + "F_UI_CoopGameMode": "Modo de Jogo Fika Co-op", + "F_UI_CoopRaidSettings": "Definições de Raid Fika Co-op", + "F_UI_FikaAlwaysCoop": "O co-op está sempre ativado no Fika", + "F_UI_UpnpFailed": "UPnP mapping failed. Make sure the selected port is not already open!\\nDisable UPnP if you are using a VPN.", + "F_UI_InitWeather": "Generating weather...", + "F_Notification_RaidStarted": "{0} started a raid on {1}", + "F_Notification_ItemReceived": "You received a {0} from {1}" } diff --git a/assets/database/locales/global/ro.json b/assets/database/locales/global/ro.json index 4e49c001..2fe887b0 100644 --- a/assets/database/locales/global/ro.json +++ b/assets/database/locales/global/ro.json @@ -84,6 +84,14 @@ "F_Client_FreeCamInputEnabled": "Controlul camerei libere este activat", "F_UI_WaitForPlayer": "Se așteaptă jucătorul {0}", "F_UI_WaitForPlayers": "Se așteaptă {0} jucători", - "F_UI_ToSLong": "Welcome to Fika!\r\n\r\nFika is a co-op mod for SPT, allowing you to play with your friends. Fika is and will always be free, if you paid for it you got scammed. You are also not allowed to host public servers with monetization or donations.\r\n\r\nWait for this message to fade to accept our Terms of Service.\r\n\r\nYou can join our Discord here: https://discord.gg/project-fika", - "F_UI_ToSShort": "Welcome to Fika!\r\n\r\nFika is a co-op mod for SPT, allowing you to play with your friends. Fika is and will always be free, if you paid for it you got scammed. You are also not allowed to host public servers with monetization or donations.\r\n\r\nYou can join our Discord here: https://discord.gg/project-fika" + "F_UI_ToSLong": "Bun venit in Fika!\n\nFika este un mod co-op pentru SPT care vă permite să vă jucați împreună cu prietenii. Fika este și va rămâne întotdeauna gratuit, dacă ați plătit pentru acesta, ați fost înșelați. De asemenea, nu aveți dreptul de a găzdui servere publice cu sisteme de plată sau donații.\n\nVă rugăm să așteptati ca acest mesaj să dispară pentru a accepta termenii și condițiile.\n\nVă puteți alătura serverului nostru de discord aici: https://discord.gg/project-fika", + "F_UI_ToSShort": "Bun venit in Fika!\n\nFika este un mod co-op pentru SPT care vă permite să vă jucați împreună cu prietenii. Fika este și va rămâne întotdeauna gratuit, dacă ați plătit pentru acesta, ați fost înșelați. De asemenea, nu aveți dreptul de a găzdui servere publice cu sisteme de plată sau donații.\n\nVă puteți alătura serverului nostru de discord aici: https://discord.gg/project-fika", + "F_UI_RaidSettingsDescription": "In this mode, you can play online co-op with your friends without the risk of meeting others.\\nAll game mechanics in the co-op mode (weather, bots, bosses, etc.) are identical to the online mechanics.\\nOnly the hosts settings will take effect.", + "F_UI_CoopGameMode": "Fika Co-op Game Mode", + "F_UI_CoopRaidSettings": "Fika Co-op Raid Settings", + "F_UI_FikaAlwaysCoop": "Co-op is always enabled in Fika", + "F_UI_UpnpFailed": "UPnP mapping failed. Make sure the selected port is not already open!\\nDisable UPnP if you are using a VPN.", + "F_UI_InitWeather": "Se generează vremea...", + "F_Notification_RaidStarted": "{0} a început un raid pe {1}", + "F_Notification_ItemReceived": "Ai primit un/o {0} de la {1}" } diff --git a/assets/database/locales/global/ru.json b/assets/database/locales/global/ru.json index 9313f751..4893c751 100644 --- a/assets/database/locales/global/ru.json +++ b/assets/database/locales/global/ru.json @@ -6,7 +6,7 @@ "F_Client_ReceivedSharedItemPlant": "{0} положил предмет для {1}", "F_Client_ReceivePing": "Получен пинг от {0}", "F_Client_ReceivePingObject": "{0} отметил {1}", - "F_Client_RandomSpawnPoints": "Использовать случайные точки появления", + "F_Client_RandomSpawnPoints": "Используются случайные точки появления", "F_Client_MetabolismDisabled": "Метаболизм выключен", "F_Client_YouAreMIA": "Вы пропали без вести...", "F_Client_KilledBoss": "{0} убил босса {1}", @@ -85,5 +85,13 @@ "F_UI_WaitForPlayer": "Ожидание {0} игрока", "F_UI_WaitForPlayers": "Ожидание {0} игроков", "F_UI_ToSLong": "Fika это кооперативная модификация для SPT, позволяющая вам играть со своими друзьями. Fika всегда была и всегда будет бесплатной, если вы заплатили - вас обманули. Также запрещено хостить публичные сервера с монетизацией или сбором пожертвований.\n\nПодождите пока это сообщение исчезнет, чтобы принять наши Условия использования.\n\nВы можете вступить в наш Discord по этой ссылке: https://discord.gg/project-fika", - "F_UI_ToSShort": "Fika это кооперативная модификация для SPT, позволяющая вам играть со своими друзьями. Fika всегда была и всегда будет бесплатной, если вы заплатили - вас обманули. Также запрещено хостить публичные сервера с монетизацией или сбором пожертвований.\n\nВы можете вступить в наш Discord по этой ссылке: https://discord.gg/project-fika" + "F_UI_ToSShort": "Fika это кооперативная модификация для SPT, позволяющая вам играть со своими друзьями. Fika всегда была и всегда будет бесплатной, если вы заплатили - вас обманули. Также запрещено хостить публичные сервера с монетизацией или сбором пожертвований.\n\nВы можете вступить в наш Discord по этой ссылке: https://discord.gg/project-fika", + "F_UI_RaidSettingsDescription": "In this mode, you can play online co-op with your friends without the risk of meeting others.\\nAll game mechanics in the co-op mode (weather, bots, bosses, etc.) are identical to the online mechanics.\\nOnly the hosts settings will take effect.", + "F_UI_CoopGameMode": "Fika Co-op Game Mode", + "F_UI_CoopRaidSettings": "Fika Co-op Raid Settings", + "F_UI_FikaAlwaysCoop": "Co-op is always enabled in Fika", + "F_UI_UpnpFailed": "UPnP mapping failed. Make sure the selected port is not already open!\\nDisable UPnP if you are using a VPN.", + "F_UI_InitWeather": "Generating weather...", + "F_Notification_RaidStarted": "{0} started a raid on {1}", + "F_Notification_ItemReceived": "You received a {0} from {1}" } diff --git a/assets/database/locales/global/sk.json b/assets/database/locales/global/sk.json index d6a5ca86..7322b078 100644 --- a/assets/database/locales/global/sk.json +++ b/assets/database/locales/global/sk.json @@ -66,7 +66,7 @@ "F_UI_RetrieveSpawnInfo": "Retrieving spawn info from server...", "F_UI_RetrieveLoot": "Retrieving loot from server...", "F_UI_WaitForHostInit": "Waiting for host to initialize raid...", - "F_UI_Reconnecting": "Reconnecting...", + "F_UI_Reconnecting": "Prebieha opätovné pripojenie...", "F_UI_RetrieveExfilData": "Retrieving exfiltration data from server...", "F_UI_RetrieveInteractables": "Retrieving interactable objects from server...", "F_UI_InitCoopGame": "Initializing Coop Game...", @@ -85,5 +85,13 @@ "F_UI_WaitForPlayer": "Waiting for {0} player", "F_UI_WaitForPlayers": "Waiting for {0} players", "F_UI_ToSLong": "Welcome to Fika!\r\n\r\nFika is a co-op mod for SPT, allowing you to play with your friends. Fika is and will always be free, if you paid for it you got scammed. You are also not allowed to host public servers with monetization or donations.\r\n\r\nWait for this message to fade to accept our Terms of Service.\r\n\r\nYou can join our Discord here: https://discord.gg/project-fika", - "F_UI_ToSShort": "Welcome to Fika!\r\n\r\nFika is a co-op mod for SPT, allowing you to play with your friends. Fika is and will always be free, if you paid for it you got scammed. You are also not allowed to host public servers with monetization or donations.\r\n\r\nYou can join our Discord here: https://discord.gg/project-fika" + "F_UI_ToSShort": "Welcome to Fika!\r\n\r\nFika is a co-op mod for SPT, allowing you to play with your friends. Fika is and will always be free, if you paid for it you got scammed. You are also not allowed to host public servers with monetization or donations.\r\n\r\nYou can join our Discord here: https://discord.gg/project-fika", + "F_UI_RaidSettingsDescription": "In this mode, you can play online co-op with your friends without the risk of meeting others.\\nAll game mechanics in the co-op mode (weather, bots, bosses, etc.) are identical to the online mechanics.\\nOnly the hosts settings will take effect.", + "F_UI_CoopGameMode": "Fika Co-op Game Mode", + "F_UI_CoopRaidSettings": "Fika Co-op Raid Settings", + "F_UI_FikaAlwaysCoop": "Co-op is always enabled in Fika", + "F_UI_UpnpFailed": "UPnP mapping failed. Make sure the selected port is not already open!\\nDisable UPnP if you are using a VPN.", + "F_UI_InitWeather": "Generating weather...", + "F_Notification_RaidStarted": "{0} started a raid on {1}", + "F_Notification_ItemReceived": "You received a {0} from {1}" } diff --git a/assets/database/locales/global/tu.json b/assets/database/locales/global/tu.json index 6fc2523a..61af922d 100644 --- a/assets/database/locales/global/tu.json +++ b/assets/database/locales/global/tu.json @@ -85,5 +85,13 @@ "F_UI_WaitForPlayer": "Waiting for {0} player", "F_UI_WaitForPlayers": "Waiting for {0} players", "F_UI_ToSLong": "Welcome to Fika!\r\n\r\nFika is a co-op mod for SPT, allowing you to play with your friends. Fika is and will always be free, if you paid for it you got scammed. You are also not allowed to host public servers with monetization or donations.\r\n\r\nWait for this message to fade to accept our Terms of Service.\r\n\r\nYou can join our Discord here: https://discord.gg/project-fika", - "F_UI_ToSShort": "Welcome to Fika!\r\n\r\nFika is a co-op mod for SPT, allowing you to play with your friends. Fika is and will always be free, if you paid for it you got scammed. You are also not allowed to host public servers with monetization or donations.\r\n\r\nYou can join our Discord here: https://discord.gg/project-fika" + "F_UI_ToSShort": "Welcome to Fika!\r\n\r\nFika is a co-op mod for SPT, allowing you to play with your friends. Fika is and will always be free, if you paid for it you got scammed. You are also not allowed to host public servers with monetization or donations.\r\n\r\nYou can join our Discord here: https://discord.gg/project-fika", + "F_UI_RaidSettingsDescription": "In this mode, you can play online co-op with your friends without the risk of meeting others.\\nAll game mechanics in the co-op mode (weather, bots, bosses, etc.) are identical to the online mechanics.\\nOnly the hosts settings will take effect.", + "F_UI_CoopGameMode": "Fika Co-op Game Mode", + "F_UI_CoopRaidSettings": "Fika Co-op Raid Settings", + "F_UI_FikaAlwaysCoop": "Co-op is always enabled in Fika", + "F_UI_UpnpFailed": "UPnP mapping failed. Make sure the selected port is not already open!\\nDisable UPnP if you are using a VPN.", + "F_UI_InitWeather": "Generating weather...", + "F_Notification_RaidStarted": "{0} started a raid on {1}", + "F_Notification_ItemReceived": "You received a {0} from {1}" } From 7afae2968190d13455709c8b36e8b829f82aec45 Mon Sep 17 00:00:00 2001 From: Archangel Date: Mon, 25 Nov 2024 08:40:25 +0100 Subject: [PATCH 116/119] Get chatbots from the original Dialog Controller --- src/controllers/FikaDialogueController.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/controllers/FikaDialogueController.ts b/src/controllers/FikaDialogueController.ts index f596dcc0..5d6854d3 100644 --- a/src/controllers/FikaDialogueController.ts +++ b/src/controllers/FikaDialogueController.ts @@ -24,7 +24,6 @@ import { IFriendRequestListResponse } from "../models/eft/dialog/IFriendRequestL @injectable() export class FikaDialogueController { constructor( - @injectAll("DialogueChatBot") protected dialogueChatBots: IDialogueChatBot[], @inject("ProfileHelper") protected profileHelper: ProfileHelper, @inject("ConfigServer") protected configServer: ConfigServer, @inject("FikaFriendRequestsHelper") protected fikaFriendRequestsHelper: FikaFriendRequestsHelper, @@ -40,7 +39,9 @@ export class FikaDialogueController { public getFriendList(sessionID: string): IGetFriendListDataResponse { const core = this.configServer.getConfig(ConfigTypes.CORE); - let botsAndFriends = this.dialogueChatBots.map((v) => v.getChatBot()); + // Cast to any to get rid of protected error + const dialogueChatBots: IDialogueChatBot[] = (this.dialogController as any).dialogueChatBots; + let botsAndFriends = dialogueChatBots.map((v) => v.getChatBot()); if (!core.features.chatbotFeatures.commandoEnabled) { botsAndFriends = botsAndFriends.filter((u) => u._id != "sptCommando"); } From 8873f064e280385d0349d29659152671fc52413d Mon Sep 17 00:00:00 2001 From: Archangel Date: Mon, 25 Nov 2024 09:13:16 +0100 Subject: [PATCH 117/119] Remove code that is now handled by SPT --- src/controllers/FikaDialogueController.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/controllers/FikaDialogueController.ts b/src/controllers/FikaDialogueController.ts index 5d6854d3..c3ab435b 100644 --- a/src/controllers/FikaDialogueController.ts +++ b/src/controllers/FikaDialogueController.ts @@ -42,13 +42,6 @@ export class FikaDialogueController { // Cast to any to get rid of protected error const dialogueChatBots: IDialogueChatBot[] = (this.dialogController as any).dialogueChatBots; let botsAndFriends = dialogueChatBots.map((v) => v.getChatBot()); - if (!core.features.chatbotFeatures.commandoEnabled) { - botsAndFriends = botsAndFriends.filter((u) => u._id != "sptCommando"); - } - - if (!core.features.chatbotFeatures.sptFriendEnabled) { - botsAndFriends = botsAndFriends.filter((u) => u._id != "sptFriend"); - } const friendsIds = this.fikaPlayerRelationsHelper.getFriendsList(sessionID); From 17ca2dcfca4875ad940e307ec078240c55e50544 Mon Sep 17 00:00:00 2001 From: Archangel Date: Mon, 25 Nov 2024 09:14:23 +0100 Subject: [PATCH 118/119] Remove unused constant --- src/controllers/FikaDialogueController.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/controllers/FikaDialogueController.ts b/src/controllers/FikaDialogueController.ts index c3ab435b..6517dd19 100644 --- a/src/controllers/FikaDialogueController.ts +++ b/src/controllers/FikaDialogueController.ts @@ -38,7 +38,6 @@ export class FikaDialogueController { } public getFriendList(sessionID: string): IGetFriendListDataResponse { - const core = this.configServer.getConfig(ConfigTypes.CORE); // Cast to any to get rid of protected error const dialogueChatBots: IDialogueChatBot[] = (this.dialogController as any).dialogueChatBots; let botsAndFriends = dialogueChatBots.map((v) => v.getChatBot()); From a82cdc8b8b40cb758adde278673af5335f581079 Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Tue, 26 Nov 2024 06:13:54 +0100 Subject: [PATCH 119/119] Update locales --- assets/database/locales/global/fr.json | 8 ++++---- assets/database/locales/global/ru.json | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/assets/database/locales/global/fr.json b/assets/database/locales/global/fr.json index 022731e4..f468db68 100644 --- a/assets/database/locales/global/fr.json +++ b/assets/database/locales/global/fr.json @@ -87,11 +87,11 @@ "F_UI_ToSLong": "Bienvenue sur Fika!\n\nFika est un mod pour SPT, vous permettant de jouer avec vos amis. Fika est et sera toujours gratuit, si vous avez payé pour l'obtenir, c'est une arnaque. Il n'est pas non plus autorisé d'heberger un serveur public avec monétisation ou dons.\n\nPatientez le temps que ce message disparaisse pour accepter nos conditions d'utilisation.\n\nVous pouvez rejoindre notre serveur Discord ici: https://discord.gg/project-fika", "F_UI_ToSShort": "Bienvenue sur Fika!\n\nFika est un mod pour SPT, vous permettant de jouer avec vos amis. Fika est et sera toujours gratuit, si vous avez payé pour l'obtenir, c'est une arnaque. Il n'est pas non plus autorisé d'heberger un serveur public avec monétisation ou dons.\n\nVous pouvez rejoindre notre serveur Discord ici: https://discord.gg/project-fika", "F_UI_RaidSettingsDescription": "Dans ce mode, vous pouvez jouer en co-op avec des amis sans le risque de rencontrer des joueurs.\\n Toutes les mécaniques de jeu dans le mode co-op (météo, bots, boss, etc.) sont identiques aux mécaniques en ligne.\\n Seulement les paramètres de l'hôte prendrons effet.", - "F_UI_CoopGameMode": "Fika Co-op Game Mode", + "F_UI_CoopGameMode": "Fika coopérative mode de jeu", "F_UI_CoopRaidSettings": "Paramètres pour les raids du mod coop Fika", - "F_UI_FikaAlwaysCoop": "Co-op is always enabled in Fika", + "F_UI_FikaAlwaysCoop": "Coopérative est toujours activé dans Fika", "F_UI_UpnpFailed": "Échec du mappage UPnP. Vérifiez que le port sélectionné n'est pas déjà ouvert !\\nDésactivez UPnP si vous utilisez un VPN.", - "F_UI_InitWeather": "Generating weather...", - "F_Notification_RaidStarted": "{0} started a raid on {1}", + "F_UI_InitWeather": "Générer la météo...", + "F_Notification_RaidStarted": "{0} a démarrer un raid sur {1}", "F_Notification_ItemReceived": "Vous avez reçu un {0} de {1}" } diff --git a/assets/database/locales/global/ru.json b/assets/database/locales/global/ru.json index 4893c751..f36c3381 100644 --- a/assets/database/locales/global/ru.json +++ b/assets/database/locales/global/ru.json @@ -86,12 +86,12 @@ "F_UI_WaitForPlayers": "Ожидание {0} игроков", "F_UI_ToSLong": "Fika это кооперативная модификация для SPT, позволяющая вам играть со своими друзьями. Fika всегда была и всегда будет бесплатной, если вы заплатили - вас обманули. Также запрещено хостить публичные сервера с монетизацией или сбором пожертвований.\n\nПодождите пока это сообщение исчезнет, чтобы принять наши Условия использования.\n\nВы можете вступить в наш Discord по этой ссылке: https://discord.gg/project-fika", "F_UI_ToSShort": "Fika это кооперативная модификация для SPT, позволяющая вам играть со своими друзьями. Fika всегда была и всегда будет бесплатной, если вы заплатили - вас обманули. Также запрещено хостить публичные сервера с монетизацией или сбором пожертвований.\n\nВы можете вступить в наш Discord по этой ссылке: https://discord.gg/project-fika", - "F_UI_RaidSettingsDescription": "In this mode, you can play online co-op with your friends without the risk of meeting others.\\nAll game mechanics in the co-op mode (weather, bots, bosses, etc.) are identical to the online mechanics.\\nOnly the hosts settings will take effect.", - "F_UI_CoopGameMode": "Fika Co-op Game Mode", - "F_UI_CoopRaidSettings": "Fika Co-op Raid Settings", - "F_UI_FikaAlwaysCoop": "Co-op is always enabled in Fika", - "F_UI_UpnpFailed": "UPnP mapping failed. Make sure the selected port is not already open!\\nDisable UPnP if you are using a VPN.", - "F_UI_InitWeather": "Generating weather...", - "F_Notification_RaidStarted": "{0} started a raid on {1}", - "F_Notification_ItemReceived": "You received a {0} from {1}" + "F_UI_RaidSettingsDescription": "В этом режиме вы можете играть в кооператив с друзьями в сети без риска встречи с другими.\\nВсе игровые механики в кооперативном режиме (погода, боты, боты и т. д.) идентично онлайн.\\nВступят в силу только настройки хоста.", + "F_UI_CoopGameMode": "Кооперативный Режим Fika", + "F_UI_CoopRaidSettings": "Настройки Кооперативного Рейда Fika", + "F_UI_FikaAlwaysCoop": "Кооператив всегда включен в Fika", + "F_UI_UpnpFailed": "Ошибка сопоставления UPnP. Убедитесь, что выбранный порт уже не открыт!\\nОтключите UPnP, если вы используете VPN.", + "F_UI_InitWeather": "Генерируем погоду...", + "F_Notification_RaidStarted": "{0} запустил рейд на {1}", + "F_Notification_ItemReceived": "Вы получили {0} от {1}" }