From 2b69963163682419d525caf1dda00af80c5d77cd Mon Sep 17 00:00:00 2001 From: chomp Date: Sat, 4 May 2024 19:20:31 +0000 Subject: [PATCH] 3.8.1-DEV (#25) Co-authored-by: Dev Reviewed-on: https://dev.sp-tarkov.com/chomp/ModExamples/pulls/25 --- README.md | 2 +- TypeScript/10ScopesAndTypes/README.md | 2 +- .../types/callbacks/BotCallbacks.d.ts | 6 ++ .../types/callbacks/DialogueCallbacks.d.ts | 10 ++- .../types/callbacks/InraidCallbacks.d.ts | 5 -- .../types/controllers/BotController.d.ts | 6 +- .../types/controllers/BuildController.d.ts | 2 +- .../types/controllers/GameController.d.ts | 6 +- .../types/controllers/HideoutController.d.ts | 4 +- .../controllers/InsuranceController.d.ts | 8 +- .../types/controllers/LauncherController.d.ts | 5 ++ .../types/controllers/MatchController.d.ts | 3 +- .../generators/BotEquipmentModGenerator.d.ts | 12 +-- .../types/generators/BotGenerator.d.ts | 3 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../generators/FenceBaseAssortGenerator.d.ts | 18 ++++- .../types/generators/LootGenerator.d.ts | 18 ++--- .../RepeatableQuestRewardGenerator.d.ts | 2 +- .../types/helpers/BotGeneratorHelper.d.ts | 2 +- .../Dialogue/AbstractDialogueChatBot.d.ts | 20 +++++ ...CommandoCommand.d.ts => IChatCommand.d.ts} | 6 +- .../Commando/SptCommandoCommands.d.ts | 4 +- .../GiveCommand/GiveSptCommand.d.ts | 39 ++++++++++ .../SptCommands/GiveCommand/SavedCommand.d.ts | 6 ++ .../ProfileCommand/ProfileSptCommand.d.ts | 38 ++++++++++ .../TraderCommand/TraderSptCommand.d.ts} | 16 +++- .../Dialogue/CommandoDialogueChatBot.d.ts | 15 ++-- .../types/helpers/HideoutHelper.d.ts | 2 +- .../types/helpers/HttpServerHelper.d.ts | 2 +- .../types/helpers/ItemHelper.d.ts | 35 ++++++++- .../types/helpers/PresetHelper.d.ts | 8 ++ .../models/eft/common/tables/IBotType.d.ts | 3 + .../models/eft/common/tables/IQuest.d.ts | 1 + .../eft/dialog/IAcceptFriendRequestData.d.ts | 6 +- .../dialog/IFriendRequestSendResponse.d.ts | 2 +- .../eft/profile/IGetOtherProfileResponse.d.ts | 2 +- .../eft/profile/ISearchFriendResponse.d.ts | 2 + .../types/models/enums/AmmoTypes.d.ts | 4 + .../types/models/enums/WeaponTypes.d.ts | 37 +++++++-- .../types/models/spt/bots/IBotLootCache.d.ts | 8 +- .../types/models/spt/config/IBotConfig.d.ts | 5 +- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../models/spt/config/IHideoutConfig.d.ts | 4 + .../types/models/spt/config/IHttpConfig.d.ts | 6 +- .../models/spt/config/IInRaidConfig.d.ts | 1 - .../models/spt/config/ILocationConfig.d.ts | 4 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 + .../spt/dialog/ISendMessageDetails.d.ts | 10 ++- .../spt/fence/ICreateFenceAssortsResult.d.ts | 7 ++ .../types/servers/HttpServer.d.ts | 8 ++ .../types/services/BotLootCacheService.d.ts | 3 + .../types/services/FenceService.d.ts | 76 +++++++++++++++---- .../types/services/ItemBaseClassService.d.ts | 10 ++- .../types/services/MailSendService.d.ts | 6 +- .../types/services/PaymentService.d.ts | 2 +- .../services/ProfileActivityService.d.ts | 21 +++++ .../types/services/ProfileFixerService.d.ts | 25 +++++- .../types/services/RagfairPriceService.d.ts | 11 ++- .../10ScopesAndTypes/types/utils/App.d.ts | 4 +- .../types/utils/CompareUtil.d.ts | 11 +++ .../types/utils/RagfairOfferHolder.d.ts | 5 +- .../utils/logging/AbstractWinstonLogger.d.ts | 1 + TypeScript/11BundleLoadingSample/README.md | 2 +- .../types/callbacks/BotCallbacks.d.ts | 6 ++ .../types/callbacks/DialogueCallbacks.d.ts | 10 ++- .../types/callbacks/InraidCallbacks.d.ts | 5 -- .../types/controllers/BotController.d.ts | 6 +- .../types/controllers/BuildController.d.ts | 2 +- .../types/controllers/GameController.d.ts | 6 +- .../types/controllers/HideoutController.d.ts | 4 +- .../controllers/InsuranceController.d.ts | 8 +- .../types/controllers/LauncherController.d.ts | 5 ++ .../types/controllers/MatchController.d.ts | 3 +- .../generators/BotEquipmentModGenerator.d.ts | 12 +-- .../types/generators/BotGenerator.d.ts | 3 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../generators/FenceBaseAssortGenerator.d.ts | 18 ++++- .../types/generators/LootGenerator.d.ts | 18 ++--- .../RepeatableQuestRewardGenerator.d.ts | 2 +- .../types/helpers/BotGeneratorHelper.d.ts | 2 +- .../Dialogue/AbstractDialogueChatBot.d.ts | 20 +++++ .../Dialogue/Commando/IChatCommand.d.ts} | 6 +- .../Commando/SptCommandoCommands.d.ts | 4 +- .../GiveCommand/GiveSptCommand.d.ts | 39 ++++++++++ .../SptCommands/GiveCommand/SavedCommand.d.ts | 6 ++ .../ProfileCommand/ProfileSptCommand.d.ts | 38 ++++++++++ .../TraderCommand/TraderSptCommand.d.ts} | 16 +++- .../Dialogue/CommandoDialogueChatBot.d.ts | 15 ++-- .../types/helpers/HideoutHelper.d.ts | 2 +- .../types/helpers/HttpServerHelper.d.ts | 2 +- .../types/helpers/ItemHelper.d.ts | 35 ++++++++- .../types/helpers/PresetHelper.d.ts | 8 ++ .../models/eft/common/tables/IBotType.d.ts | 3 + .../models/eft/common/tables/IQuest.d.ts | 1 + .../eft/dialog/IAcceptFriendRequestData.d.ts | 6 +- .../dialog/IFriendRequestSendResponse.d.ts | 2 +- .../eft/profile/IGetOtherProfileResponse.d.ts | 2 +- .../eft/profile/ISearchFriendResponse.d.ts | 2 + .../types/models/enums/AmmoTypes.d.ts | 4 + .../types/models/enums/WeaponTypes.d.ts | 37 +++++++-- .../types/models/spt/bots/IBotLootCache.d.ts | 8 +- .../types/models/spt/config/IBotConfig.d.ts | 5 +- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../models/spt/config/IHideoutConfig.d.ts | 4 + .../types/models/spt/config/IHttpConfig.d.ts | 6 +- .../models/spt/config/IInRaidConfig.d.ts | 1 - .../models/spt/config/ILocationConfig.d.ts | 4 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 + .../spt/dialog/ISendMessageDetails.d.ts | 10 ++- .../spt/fence/ICreateFenceAssortsResult.d.ts | 7 ++ .../types/servers/HttpServer.d.ts | 8 ++ .../types/services/BotLootCacheService.d.ts | 3 + .../types/services/FenceService.d.ts | 76 +++++++++++++++---- .../types/services/ItemBaseClassService.d.ts | 10 ++- .../types/services/MailSendService.d.ts | 6 +- .../types/services/PaymentService.d.ts | 2 +- .../services/ProfileActivityService.d.ts | 21 +++++ .../types/services/ProfileFixerService.d.ts | 25 +++++- .../types/services/RagfairPriceService.d.ts | 11 ++- .../types/utils/App.d.ts | 4 +- .../types/utils/CompareUtil.d.ts | 11 +++ .../types/utils/RagfairOfferHolder.d.ts | 5 +- .../utils/logging/AbstractWinstonLogger.d.ts | 1 + TypeScript/12ClassExtensionOverride/README.md | 2 +- .../types/callbacks/BotCallbacks.d.ts | 6 ++ .../types/callbacks/DialogueCallbacks.d.ts | 10 ++- .../types/callbacks/InraidCallbacks.d.ts | 5 -- .../types/controllers/BotController.d.ts | 6 +- .../types/controllers/BuildController.d.ts | 2 +- .../types/controllers/GameController.d.ts | 6 +- .../types/controllers/HideoutController.d.ts | 4 +- .../controllers/InsuranceController.d.ts | 8 +- .../types/controllers/LauncherController.d.ts | 5 ++ .../types/controllers/MatchController.d.ts | 3 +- .../generators/BotEquipmentModGenerator.d.ts | 12 +-- .../types/generators/BotGenerator.d.ts | 3 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../generators/FenceBaseAssortGenerator.d.ts | 18 ++++- .../types/generators/LootGenerator.d.ts | 18 ++--- .../RepeatableQuestRewardGenerator.d.ts | 2 +- .../types/helpers/BotGeneratorHelper.d.ts | 2 +- .../Dialogue/AbstractDialogueChatBot.d.ts | 20 +++++ .../Dialogue/Commando/IChatCommand.d.ts} | 6 +- .../Commando/SptCommandoCommands.d.ts | 4 +- .../GiveCommand/GiveSptCommand.d.ts | 39 ++++++++++ .../SptCommands/GiveCommand/SavedCommand.d.ts | 6 ++ .../ProfileCommand/ProfileSptCommand.d.ts | 38 ++++++++++ .../TraderCommand/TraderSptCommand.d.ts} | 16 +++- .../Dialogue/CommandoDialogueChatBot.d.ts | 15 ++-- .../types/helpers/HideoutHelper.d.ts | 2 +- .../types/helpers/HttpServerHelper.d.ts | 2 +- .../types/helpers/ItemHelper.d.ts | 35 ++++++++- .../types/helpers/PresetHelper.d.ts | 8 ++ .../models/eft/common/tables/IBotType.d.ts | 3 + .../models/eft/common/tables/IQuest.d.ts | 1 + .../eft/dialog/IAcceptFriendRequestData.d.ts | 6 +- .../dialog/IFriendRequestSendResponse.d.ts | 2 +- .../eft/profile/IGetOtherProfileResponse.d.ts | 2 +- .../eft/profile/ISearchFriendResponse.d.ts | 2 + .../types/models/enums/AmmoTypes.d.ts | 4 + .../types/models/enums/WeaponTypes.d.ts | 37 +++++++-- .../types/models/spt/bots/IBotLootCache.d.ts | 8 +- .../types/models/spt/config/IBotConfig.d.ts | 5 +- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../models/spt/config/IHideoutConfig.d.ts | 4 + .../types/models/spt/config/IHttpConfig.d.ts | 6 +- .../models/spt/config/IInRaidConfig.d.ts | 1 - .../models/spt/config/ILocationConfig.d.ts | 4 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 + .../spt/dialog/ISendMessageDetails.d.ts | 10 ++- .../spt/fence/ICreateFenceAssortsResult.d.ts | 7 ++ .../types/servers/HttpServer.d.ts | 8 ++ .../types/services/BotLootCacheService.d.ts | 3 + .../types/services/FenceService.d.ts | 76 +++++++++++++++---- .../types/services/ItemBaseClassService.d.ts | 10 ++- .../types/services/MailSendService.d.ts | 6 +- .../types/services/PaymentService.d.ts | 2 +- .../services/ProfileActivityService.d.ts | 21 +++++ .../types/services/ProfileFixerService.d.ts | 25 +++++- .../types/services/RagfairPriceService.d.ts | 11 ++- .../types/utils/App.d.ts | 4 +- .../types/utils/CompareUtil.d.ts | 11 +++ .../types/utils/RagfairOfferHolder.d.ts | 5 +- .../utils/logging/AbstractWinstonLogger.d.ts | 1 + TypeScript/13AddTrader/README.md | 2 +- .../types/callbacks/BotCallbacks.d.ts | 6 ++ .../types/callbacks/DialogueCallbacks.d.ts | 10 ++- .../types/callbacks/InraidCallbacks.d.ts | 5 -- .../types/controllers/BotController.d.ts | 6 +- .../types/controllers/BuildController.d.ts | 2 +- .../types/controllers/GameController.d.ts | 6 +- .../types/controllers/HideoutController.d.ts | 4 +- .../controllers/InsuranceController.d.ts | 8 +- .../types/controllers/LauncherController.d.ts | 5 ++ .../types/controllers/MatchController.d.ts | 3 +- .../generators/BotEquipmentModGenerator.d.ts | 12 +-- .../types/generators/BotGenerator.d.ts | 3 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../generators/FenceBaseAssortGenerator.d.ts | 18 ++++- .../types/generators/LootGenerator.d.ts | 18 ++--- .../RepeatableQuestRewardGenerator.d.ts | 2 +- .../types/helpers/BotGeneratorHelper.d.ts | 2 +- .../Dialogue/AbstractDialogueChatBot.d.ts | 20 +++++ ...CommandoCommand.d.ts => IChatCommand.d.ts} | 6 +- .../Commando/SptCommandoCommands.d.ts | 4 +- .../GiveCommand/GiveSptCommand.d.ts | 39 ++++++++++ .../SptCommands/GiveCommand/SavedCommand.d.ts | 6 ++ .../ProfileCommand/ProfileSptCommand.d.ts | 38 ++++++++++ .../TraderCommand/TraderSptCommand.d.ts} | 16 +++- .../Dialogue/CommandoDialogueChatBot.d.ts | 15 ++-- .../types/helpers/HideoutHelper.d.ts | 2 +- .../types/helpers/HttpServerHelper.d.ts | 2 +- .../13AddTrader/types/helpers/ItemHelper.d.ts | 35 ++++++++- .../types/helpers/PresetHelper.d.ts | 8 ++ .../models/eft/common/tables/IBotType.d.ts | 3 + .../models/eft/common/tables/IQuest.d.ts | 1 + .../eft/dialog/IAcceptFriendRequestData.d.ts | 6 +- .../dialog/IFriendRequestSendResponse.d.ts | 2 +- .../eft/profile/IGetOtherProfileResponse.d.ts | 2 +- .../eft/profile/ISearchFriendResponse.d.ts | 2 + .../types/models/enums/AmmoTypes.d.ts | 4 + .../types/models/enums/WeaponTypes.d.ts | 37 +++++++-- .../types/models/spt/bots/IBotLootCache.d.ts | 8 +- .../types/models/spt/config/IBotConfig.d.ts | 5 +- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../models/spt/config/IHideoutConfig.d.ts | 4 + .../types/models/spt/config/IHttpConfig.d.ts | 6 +- .../models/spt/config/IInRaidConfig.d.ts | 1 - .../models/spt/config/ILocationConfig.d.ts | 4 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 + .../spt/dialog/ISendMessageDetails.d.ts | 10 ++- .../spt/fence/ICreateFenceAssortsResult.d.ts | 7 ++ .../13AddTrader/types/servers/HttpServer.d.ts | 8 ++ .../types/services/BotLootCacheService.d.ts | 3 + .../types/services/FenceService.d.ts | 76 +++++++++++++++---- .../types/services/ItemBaseClassService.d.ts | 10 ++- .../types/services/MailSendService.d.ts | 6 +- .../types/services/PaymentService.d.ts | 2 +- .../services/ProfileActivityService.d.ts | 21 +++++ .../types/services/ProfileFixerService.d.ts | 25 +++++- .../types/services/RagfairPriceService.d.ts | 11 ++- TypeScript/13AddTrader/types/utils/App.d.ts | 4 +- .../13AddTrader/types/utils/CompareUtil.d.ts | 11 +++ .../types/utils/RagfairOfferHolder.d.ts | 5 +- .../utils/logging/AbstractWinstonLogger.d.ts | 1 + TypeScript/14AfterDBLoadHook/README.md | 2 +- .../types/callbacks/BotCallbacks.d.ts | 6 ++ .../types/callbacks/DialogueCallbacks.d.ts | 10 ++- .../types/callbacks/InraidCallbacks.d.ts | 5 -- .../types/controllers/BotController.d.ts | 6 +- .../types/controllers/BuildController.d.ts | 2 +- .../types/controllers/GameController.d.ts | 6 +- .../types/controllers/HideoutController.d.ts | 4 +- .../controllers/InsuranceController.d.ts | 8 +- .../types/controllers/LauncherController.d.ts | 5 ++ .../types/controllers/MatchController.d.ts | 3 +- .../generators/BotEquipmentModGenerator.d.ts | 12 +-- .../types/generators/BotGenerator.d.ts | 3 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../generators/FenceBaseAssortGenerator.d.ts | 18 ++++- .../types/generators/LootGenerator.d.ts | 18 ++--- .../RepeatableQuestRewardGenerator.d.ts | 2 +- .../types/helpers/BotGeneratorHelper.d.ts | 2 +- .../Dialogue/AbstractDialogueChatBot.d.ts | 20 +++++ .../Dialogue/Commando/IChatCommand.d.ts | 12 +++ .../Dialogue/Commando/ICommandoCommand.d.ts | 8 -- .../Commando/SptCommandoCommands.d.ts | 4 +- .../GiveCommand/GiveSptCommand.d.ts | 39 ++++++++++ .../SptCommands/GiveCommand/SavedCommand.d.ts | 6 ++ .../Commando/SptCommands/GiveSptCommand.d.ts | 21 ----- .../ProfileCommand/ProfileSptCommand.d.ts | 38 ++++++++++ .../TraderCommand/TraderSptCommand.d.ts | 33 ++++++++ .../Dialogue/CommandoDialogueChatBot.d.ts | 15 ++-- .../types/helpers/HideoutHelper.d.ts | 2 +- .../types/helpers/HttpServerHelper.d.ts | 2 +- .../types/helpers/ItemHelper.d.ts | 35 ++++++++- .../types/helpers/PresetHelper.d.ts | 8 ++ .../models/eft/common/tables/IBotType.d.ts | 3 + .../models/eft/common/tables/IQuest.d.ts | 1 + .../eft/dialog/IAcceptFriendRequestData.d.ts | 6 +- .../dialog/IFriendRequestSendResponse.d.ts | 2 +- .../eft/profile/IGetOtherProfileResponse.d.ts | 2 +- .../eft/profile/ISearchFriendResponse.d.ts | 2 + .../types/models/enums/AmmoTypes.d.ts | 4 + .../types/models/enums/WeaponTypes.d.ts | 37 +++++++-- .../types/models/spt/bots/IBotLootCache.d.ts | 8 +- .../types/models/spt/config/IBotConfig.d.ts | 5 +- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../models/spt/config/IHideoutConfig.d.ts | 4 + .../types/models/spt/config/IHttpConfig.d.ts | 6 +- .../models/spt/config/IInRaidConfig.d.ts | 1 - .../models/spt/config/ILocationConfig.d.ts | 4 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 + .../spt/dialog/ISendMessageDetails.d.ts | 10 ++- .../spt/fence/ICreateFenceAssortsResult.d.ts | 7 ++ .../types/servers/HttpServer.d.ts | 8 ++ .../types/services/BotLootCacheService.d.ts | 3 + .../types/services/FenceService.d.ts | 76 +++++++++++++++---- .../types/services/ItemBaseClassService.d.ts | 10 ++- .../types/services/MailSendService.d.ts | 6 +- .../types/services/PaymentService.d.ts | 2 +- .../services/ProfileActivityService.d.ts | 21 +++++ .../types/services/ProfileFixerService.d.ts | 25 +++++- .../types/services/RagfairPriceService.d.ts | 11 ++- .../14AfterDBLoadHook/types/utils/App.d.ts | 4 +- .../types/utils/CompareUtil.d.ts | 11 +++ .../types/utils/RagfairOfferHolder.d.ts | 5 +- .../utils/logging/AbstractWinstonLogger.d.ts | 1 + TypeScript/15HttpListenerExample/README.md | 2 +- .../types/callbacks/BotCallbacks.d.ts | 6 ++ .../types/callbacks/DialogueCallbacks.d.ts | 10 ++- .../types/callbacks/InraidCallbacks.d.ts | 5 -- .../types/controllers/BotController.d.ts | 6 +- .../types/controllers/BuildController.d.ts | 2 +- .../types/controllers/GameController.d.ts | 6 +- .../types/controllers/HideoutController.d.ts | 4 +- .../controllers/InsuranceController.d.ts | 8 +- .../types/controllers/LauncherController.d.ts | 5 ++ .../types/controllers/MatchController.d.ts | 3 +- .../generators/BotEquipmentModGenerator.d.ts | 12 +-- .../types/generators/BotGenerator.d.ts | 3 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../generators/FenceBaseAssortGenerator.d.ts | 18 ++++- .../types/generators/LootGenerator.d.ts | 18 ++--- .../RepeatableQuestRewardGenerator.d.ts | 2 +- .../types/helpers/BotGeneratorHelper.d.ts | 2 +- .../Dialogue/AbstractDialogueChatBot.d.ts | 20 +++++ .../Dialogue/Commando/IChatCommand.d.ts | 12 +++ .../Dialogue/Commando/ICommandoCommand.d.ts | 8 -- .../Commando/SptCommandoCommands.d.ts | 4 +- .../GiveCommand/GiveSptCommand.d.ts | 39 ++++++++++ .../SptCommands/GiveCommand/SavedCommand.d.ts | 6 ++ .../Commando/SptCommands/GiveSptCommand.d.ts | 21 ----- .../ProfileCommand/ProfileSptCommand.d.ts | 38 ++++++++++ .../TraderCommand/TraderSptCommand.d.ts | 33 ++++++++ .../Dialogue/CommandoDialogueChatBot.d.ts | 15 ++-- .../types/helpers/HideoutHelper.d.ts | 2 +- .../types/helpers/HttpServerHelper.d.ts | 2 +- .../types/helpers/ItemHelper.d.ts | 35 ++++++++- .../types/helpers/PresetHelper.d.ts | 8 ++ .../models/eft/common/tables/IBotType.d.ts | 3 + .../models/eft/common/tables/IQuest.d.ts | 1 + .../eft/dialog/IAcceptFriendRequestData.d.ts | 6 +- .../dialog/IFriendRequestSendResponse.d.ts | 2 +- .../eft/profile/IGetOtherProfileResponse.d.ts | 2 +- .../eft/profile/ISearchFriendResponse.d.ts | 2 + .../types/models/enums/AmmoTypes.d.ts | 4 + .../types/models/enums/WeaponTypes.d.ts | 37 +++++++-- .../types/models/spt/bots/IBotLootCache.d.ts | 8 +- .../types/models/spt/config/IBotConfig.d.ts | 5 +- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../models/spt/config/IHideoutConfig.d.ts | 4 + .../types/models/spt/config/IHttpConfig.d.ts | 6 +- .../models/spt/config/IInRaidConfig.d.ts | 1 - .../models/spt/config/ILocationConfig.d.ts | 4 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 + .../spt/dialog/ISendMessageDetails.d.ts | 10 ++- .../spt/fence/ICreateFenceAssortsResult.d.ts | 7 ++ .../types/servers/HttpServer.d.ts | 8 ++ .../types/services/BotLootCacheService.d.ts | 3 + .../types/services/FenceService.d.ts | 76 +++++++++++++++---- .../types/services/ItemBaseClassService.d.ts | 10 ++- .../types/services/MailSendService.d.ts | 6 +- .../types/services/PaymentService.d.ts | 2 +- .../services/ProfileActivityService.d.ts | 21 +++++ .../types/services/ProfileFixerService.d.ts | 25 +++++- .../types/services/RagfairPriceService.d.ts | 11 ++- .../types/utils/App.d.ts | 4 +- .../types/utils/CompareUtil.d.ts | 11 +++ .../types/utils/RagfairOfferHolder.d.ts | 5 +- .../utils/logging/AbstractWinstonLogger.d.ts | 1 + TypeScript/16ImporterUtil/README.md | 2 +- .../types/callbacks/BotCallbacks.d.ts | 6 ++ .../types/callbacks/DialogueCallbacks.d.ts | 10 ++- .../types/callbacks/InraidCallbacks.d.ts | 5 -- .../types/controllers/BotController.d.ts | 6 +- .../types/controllers/BuildController.d.ts | 2 +- .../types/controllers/GameController.d.ts | 6 +- .../types/controllers/HideoutController.d.ts | 4 +- .../controllers/InsuranceController.d.ts | 8 +- .../types/controllers/LauncherController.d.ts | 5 ++ .../types/controllers/MatchController.d.ts | 3 +- .../generators/BotEquipmentModGenerator.d.ts | 12 +-- .../types/generators/BotGenerator.d.ts | 3 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../generators/FenceBaseAssortGenerator.d.ts | 18 ++++- .../types/generators/LootGenerator.d.ts | 18 ++--- .../RepeatableQuestRewardGenerator.d.ts | 2 +- .../types/helpers/BotGeneratorHelper.d.ts | 2 +- .../Dialogue/AbstractDialogueChatBot.d.ts | 20 +++++ .../Dialogue/Commando/IChatCommand.d.ts | 12 +++ .../Dialogue/Commando/ICommandoCommand.d.ts | 8 -- .../Commando/SptCommandoCommands.d.ts | 4 +- .../GiveCommand/GiveSptCommand.d.ts | 39 ++++++++++ .../SptCommands/GiveCommand/SavedCommand.d.ts | 6 ++ .../Commando/SptCommands/GiveSptCommand.d.ts | 21 ----- .../ProfileCommand/ProfileSptCommand.d.ts | 38 ++++++++++ .../TraderCommand/TraderSptCommand.d.ts | 33 ++++++++ .../Dialogue/CommandoDialogueChatBot.d.ts | 15 ++-- .../types/helpers/HideoutHelper.d.ts | 2 +- .../types/helpers/HttpServerHelper.d.ts | 2 +- .../types/helpers/ItemHelper.d.ts | 35 ++++++++- .../types/helpers/PresetHelper.d.ts | 8 ++ .../models/eft/common/tables/IBotType.d.ts | 3 + .../models/eft/common/tables/IQuest.d.ts | 1 + .../eft/dialog/IAcceptFriendRequestData.d.ts | 6 +- .../dialog/IFriendRequestSendResponse.d.ts | 2 +- .../eft/profile/IGetOtherProfileResponse.d.ts | 2 +- .../eft/profile/ISearchFriendResponse.d.ts | 2 + .../types/models/enums/AmmoTypes.d.ts | 4 + .../types/models/enums/WeaponTypes.d.ts | 37 +++++++-- .../types/models/spt/bots/IBotLootCache.d.ts | 8 +- .../types/models/spt/config/IBotConfig.d.ts | 5 +- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../models/spt/config/IHideoutConfig.d.ts | 4 + .../types/models/spt/config/IHttpConfig.d.ts | 6 +- .../models/spt/config/IInRaidConfig.d.ts | 1 - .../models/spt/config/ILocationConfig.d.ts | 4 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 + .../spt/dialog/ISendMessageDetails.d.ts | 10 ++- .../spt/fence/ICreateFenceAssortsResult.d.ts | 7 ++ .../types/servers/HttpServer.d.ts | 8 ++ .../types/services/BotLootCacheService.d.ts | 3 + .../types/services/FenceService.d.ts | 76 +++++++++++++++---- .../types/services/ItemBaseClassService.d.ts | 10 ++- .../types/services/MailSendService.d.ts | 6 +- .../types/services/PaymentService.d.ts | 2 +- .../services/ProfileActivityService.d.ts | 21 +++++ .../types/services/ProfileFixerService.d.ts | 25 +++++- .../types/services/RagfairPriceService.d.ts | 11 ++- .../16ImporterUtil/types/utils/App.d.ts | 4 +- .../types/utils/CompareUtil.d.ts | 11 +++ .../types/utils/RagfairOfferHolder.d.ts | 5 +- .../utils/logging/AbstractWinstonLogger.d.ts | 1 + .../17AsyncImporterWithDependency1/README.md | 2 +- .../types/callbacks/BotCallbacks.d.ts | 6 ++ .../types/callbacks/DialogueCallbacks.d.ts | 10 ++- .../types/callbacks/InraidCallbacks.d.ts | 5 -- .../types/controllers/BotController.d.ts | 6 +- .../types/controllers/BuildController.d.ts | 2 +- .../types/controllers/GameController.d.ts | 6 +- .../types/controllers/HideoutController.d.ts | 4 +- .../controllers/InsuranceController.d.ts | 8 +- .../types/controllers/LauncherController.d.ts | 5 ++ .../types/controllers/MatchController.d.ts | 3 +- .../generators/BotEquipmentModGenerator.d.ts | 12 +-- .../types/generators/BotGenerator.d.ts | 3 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../generators/FenceBaseAssortGenerator.d.ts | 18 ++++- .../types/generators/LootGenerator.d.ts | 18 ++--- .../RepeatableQuestRewardGenerator.d.ts | 2 +- .../types/helpers/BotGeneratorHelper.d.ts | 2 +- .../Dialogue/AbstractDialogueChatBot.d.ts | 20 +++++ .../Dialogue/Commando/IChatCommand.d.ts | 12 +++ .../Dialogue/Commando/ICommandoCommand.d.ts | 8 -- .../Commando/SptCommandoCommands.d.ts | 4 +- .../GiveCommand/GiveSptCommand.d.ts | 39 ++++++++++ .../SptCommands/GiveCommand/SavedCommand.d.ts | 6 ++ .../Commando/SptCommands/GiveSptCommand.d.ts | 21 ----- .../ProfileCommand/ProfileSptCommand.d.ts | 38 ++++++++++ .../TraderCommand/TraderSptCommand.d.ts | 33 ++++++++ .../Dialogue/CommandoDialogueChatBot.d.ts | 15 ++-- .../types/helpers/HideoutHelper.d.ts | 2 +- .../types/helpers/HttpServerHelper.d.ts | 2 +- .../types/helpers/ItemHelper.d.ts | 35 ++++++++- .../types/helpers/PresetHelper.d.ts | 8 ++ .../models/eft/common/tables/IBotType.d.ts | 3 + .../models/eft/common/tables/IQuest.d.ts | 1 + .../eft/dialog/IAcceptFriendRequestData.d.ts | 6 +- .../dialog/IFriendRequestSendResponse.d.ts | 2 +- .../eft/profile/IGetOtherProfileResponse.d.ts | 2 +- .../eft/profile/ISearchFriendResponse.d.ts | 2 + .../types/models/enums/AmmoTypes.d.ts | 4 + .../types/models/enums/WeaponTypes.d.ts | 37 +++++++-- .../types/models/spt/bots/IBotLootCache.d.ts | 8 +- .../types/models/spt/config/IBotConfig.d.ts | 5 +- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../models/spt/config/IHideoutConfig.d.ts | 4 + .../types/models/spt/config/IHttpConfig.d.ts | 6 +- .../models/spt/config/IInRaidConfig.d.ts | 1 - .../models/spt/config/ILocationConfig.d.ts | 4 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 + .../spt/dialog/ISendMessageDetails.d.ts | 10 ++- .../spt/fence/ICreateFenceAssortsResult.d.ts | 7 ++ .../types/servers/HttpServer.d.ts | 8 ++ .../types/services/BotLootCacheService.d.ts | 3 + .../types/services/FenceService.d.ts | 76 +++++++++++++++---- .../types/services/ItemBaseClassService.d.ts | 10 ++- .../types/services/MailSendService.d.ts | 6 +- .../types/services/PaymentService.d.ts | 2 +- .../services/ProfileActivityService.d.ts | 21 +++++ .../types/services/ProfileFixerService.d.ts | 25 +++++- .../types/services/RagfairPriceService.d.ts | 11 ++- .../types/utils/App.d.ts | 4 +- .../types/utils/CompareUtil.d.ts | 11 +++ .../types/utils/RagfairOfferHolder.d.ts | 5 +- .../utils/logging/AbstractWinstonLogger.d.ts | 1 + .../17AsyncImporterWithDependency2/README.md | 2 +- .../types/callbacks/BotCallbacks.d.ts | 6 ++ .../types/callbacks/DialogueCallbacks.d.ts | 10 ++- .../types/callbacks/InraidCallbacks.d.ts | 5 -- .../types/controllers/BotController.d.ts | 6 +- .../types/controllers/BuildController.d.ts | 2 +- .../types/controllers/GameController.d.ts | 6 +- .../types/controllers/HideoutController.d.ts | 4 +- .../controllers/InsuranceController.d.ts | 8 +- .../types/controllers/LauncherController.d.ts | 5 ++ .../types/controllers/MatchController.d.ts | 3 +- .../generators/BotEquipmentModGenerator.d.ts | 12 +-- .../types/generators/BotGenerator.d.ts | 3 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../generators/FenceBaseAssortGenerator.d.ts | 18 ++++- .../types/generators/LootGenerator.d.ts | 18 ++--- .../RepeatableQuestRewardGenerator.d.ts | 2 +- .../types/helpers/BotGeneratorHelper.d.ts | 2 +- .../Dialogue/AbstractDialogueChatBot.d.ts | 20 +++++ .../Dialogue/Commando/IChatCommand.d.ts | 12 +++ .../Dialogue/Commando/ICommandoCommand.d.ts | 8 -- .../Commando/SptCommandoCommands.d.ts | 4 +- .../GiveCommand/GiveSptCommand.d.ts | 39 ++++++++++ .../SptCommands/GiveCommand/SavedCommand.d.ts | 6 ++ .../Commando/SptCommands/GiveSptCommand.d.ts | 21 ----- .../ProfileCommand/ProfileSptCommand.d.ts | 38 ++++++++++ .../TraderCommand/TraderSptCommand.d.ts | 33 ++++++++ .../Dialogue/CommandoDialogueChatBot.d.ts | 15 ++-- .../types/helpers/HideoutHelper.d.ts | 2 +- .../types/helpers/HttpServerHelper.d.ts | 2 +- .../types/helpers/ItemHelper.d.ts | 35 ++++++++- .../types/helpers/PresetHelper.d.ts | 8 ++ .../models/eft/common/tables/IBotType.d.ts | 3 + .../models/eft/common/tables/IQuest.d.ts | 1 + .../eft/dialog/IAcceptFriendRequestData.d.ts | 6 +- .../dialog/IFriendRequestSendResponse.d.ts | 2 +- .../eft/profile/IGetOtherProfileResponse.d.ts | 2 +- .../eft/profile/ISearchFriendResponse.d.ts | 2 + .../types/models/enums/AmmoTypes.d.ts | 4 + .../types/models/enums/WeaponTypes.d.ts | 37 +++++++-- .../types/models/spt/bots/IBotLootCache.d.ts | 8 +- .../types/models/spt/config/IBotConfig.d.ts | 5 +- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../models/spt/config/IHideoutConfig.d.ts | 4 + .../types/models/spt/config/IHttpConfig.d.ts | 6 +- .../models/spt/config/IInRaidConfig.d.ts | 1 - .../models/spt/config/ILocationConfig.d.ts | 4 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 + .../spt/dialog/ISendMessageDetails.d.ts | 10 ++- .../spt/fence/ICreateFenceAssortsResult.d.ts | 7 ++ .../types/servers/HttpServer.d.ts | 8 ++ .../types/services/BotLootCacheService.d.ts | 3 + .../types/services/FenceService.d.ts | 76 +++++++++++++++---- .../types/services/ItemBaseClassService.d.ts | 10 ++- .../types/services/MailSendService.d.ts | 6 +- .../types/services/PaymentService.d.ts | 2 +- .../services/ProfileActivityService.d.ts | 21 +++++ .../types/services/ProfileFixerService.d.ts | 25 +++++- .../types/services/RagfairPriceService.d.ts | 11 ++- .../types/utils/App.d.ts | 4 +- .../types/utils/CompareUtil.d.ts | 11 +++ .../types/utils/RagfairOfferHolder.d.ts | 5 +- .../utils/logging/AbstractWinstonLogger.d.ts | 1 + TypeScript/18CustomItemService/README.md | 2 +- .../types/callbacks/BotCallbacks.d.ts | 6 ++ .../types/callbacks/DialogueCallbacks.d.ts | 10 ++- .../types/callbacks/InraidCallbacks.d.ts | 5 -- .../types/controllers/BotController.d.ts | 6 +- .../types/controllers/BuildController.d.ts | 2 +- .../types/controllers/GameController.d.ts | 6 +- .../types/controllers/HideoutController.d.ts | 4 +- .../controllers/InsuranceController.d.ts | 8 +- .../types/controllers/LauncherController.d.ts | 5 ++ .../types/controllers/MatchController.d.ts | 3 +- .../generators/BotEquipmentModGenerator.d.ts | 12 +-- .../types/generators/BotGenerator.d.ts | 3 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../generators/FenceBaseAssortGenerator.d.ts | 18 ++++- .../types/generators/LootGenerator.d.ts | 18 ++--- .../RepeatableQuestRewardGenerator.d.ts | 2 +- .../types/helpers/BotGeneratorHelper.d.ts | 2 +- .../Dialogue/AbstractDialogueChatBot.d.ts | 20 +++++ .../Dialogue/Commando/IChatCommand.d.ts | 12 +++ .../Dialogue/Commando/ICommandoCommand.d.ts | 8 -- .../Commando/SptCommandoCommands.d.ts | 4 +- .../GiveCommand/GiveSptCommand.d.ts | 39 ++++++++++ .../SptCommands/GiveCommand/SavedCommand.d.ts | 6 ++ .../Commando/SptCommands/GiveSptCommand.d.ts | 21 ----- .../ProfileCommand/ProfileSptCommand.d.ts | 38 ++++++++++ .../TraderCommand/TraderSptCommand.d.ts | 33 ++++++++ .../Dialogue/CommandoDialogueChatBot.d.ts | 15 ++-- .../types/helpers/HideoutHelper.d.ts | 2 +- .../types/helpers/HttpServerHelper.d.ts | 2 +- .../types/helpers/ItemHelper.d.ts | 35 ++++++++- .../types/helpers/PresetHelper.d.ts | 8 ++ .../models/eft/common/tables/IBotType.d.ts | 3 + .../models/eft/common/tables/IQuest.d.ts | 1 + .../eft/dialog/IAcceptFriendRequestData.d.ts | 6 +- .../dialog/IFriendRequestSendResponse.d.ts | 2 +- .../eft/profile/IGetOtherProfileResponse.d.ts | 2 +- .../eft/profile/ISearchFriendResponse.d.ts | 2 + .../types/models/enums/AmmoTypes.d.ts | 4 + .../types/models/enums/WeaponTypes.d.ts | 37 +++++++-- .../types/models/spt/bots/IBotLootCache.d.ts | 8 +- .../types/models/spt/config/IBotConfig.d.ts | 5 +- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../models/spt/config/IHideoutConfig.d.ts | 4 + .../types/models/spt/config/IHttpConfig.d.ts | 6 +- .../models/spt/config/IInRaidConfig.d.ts | 1 - .../models/spt/config/ILocationConfig.d.ts | 4 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 + .../spt/dialog/ISendMessageDetails.d.ts | 10 ++- .../spt/fence/ICreateFenceAssortsResult.d.ts | 7 ++ .../types/servers/HttpServer.d.ts | 8 ++ .../types/services/BotLootCacheService.d.ts | 3 + .../types/services/FenceService.d.ts | 76 +++++++++++++++---- .../types/services/ItemBaseClassService.d.ts | 10 ++- .../types/services/MailSendService.d.ts | 6 +- .../types/services/PaymentService.d.ts | 2 +- .../services/ProfileActivityService.d.ts | 21 +++++ .../types/services/ProfileFixerService.d.ts | 25 +++++- .../types/services/RagfairPriceService.d.ts | 11 ++- .../18CustomItemService/types/utils/App.d.ts | 4 +- .../types/utils/CompareUtil.d.ts | 11 +++ .../types/utils/RagfairOfferHolder.d.ts | 5 +- .../utils/logging/AbstractWinstonLogger.d.ts | 1 + TypeScript/19UseExternalLibraries/README.md | 2 +- .../types/callbacks/BotCallbacks.d.ts | 6 ++ .../types/callbacks/DialogueCallbacks.d.ts | 10 ++- .../types/callbacks/InraidCallbacks.d.ts | 5 -- .../types/controllers/BotController.d.ts | 6 +- .../types/controllers/BuildController.d.ts | 2 +- .../types/controllers/GameController.d.ts | 6 +- .../types/controllers/HideoutController.d.ts | 4 +- .../controllers/InsuranceController.d.ts | 8 +- .../types/controllers/LauncherController.d.ts | 5 ++ .../types/controllers/MatchController.d.ts | 3 +- .../generators/BotEquipmentModGenerator.d.ts | 12 +-- .../types/generators/BotGenerator.d.ts | 3 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../generators/FenceBaseAssortGenerator.d.ts | 18 ++++- .../types/generators/LootGenerator.d.ts | 18 ++--- .../RepeatableQuestRewardGenerator.d.ts | 2 +- .../types/helpers/BotGeneratorHelper.d.ts | 2 +- .../Dialogue/AbstractDialogueChatBot.d.ts | 20 +++++ .../Dialogue/Commando/IChatCommand.d.ts | 12 +++ .../Dialogue/Commando/ICommandoCommand.d.ts | 8 -- .../Commando/SptCommandoCommands.d.ts | 4 +- .../GiveCommand/GiveSptCommand.d.ts | 39 ++++++++++ .../SptCommands/GiveCommand/SavedCommand.d.ts | 6 ++ .../Commando/SptCommands/GiveSptCommand.d.ts | 21 ----- .../ProfileCommand/ProfileSptCommand.d.ts | 38 ++++++++++ .../TraderCommand/TraderSptCommand.d.ts | 33 ++++++++ .../Dialogue/CommandoDialogueChatBot.d.ts | 15 ++-- .../types/helpers/HideoutHelper.d.ts | 2 +- .../types/helpers/HttpServerHelper.d.ts | 2 +- .../types/helpers/ItemHelper.d.ts | 35 ++++++++- .../types/helpers/PresetHelper.d.ts | 8 ++ .../models/eft/common/tables/IBotType.d.ts | 3 + .../models/eft/common/tables/IQuest.d.ts | 1 + .../eft/dialog/IAcceptFriendRequestData.d.ts | 6 +- .../dialog/IFriendRequestSendResponse.d.ts | 2 +- .../eft/profile/IGetOtherProfileResponse.d.ts | 2 +- .../eft/profile/ISearchFriendResponse.d.ts | 2 + .../types/models/enums/AmmoTypes.d.ts | 4 + .../types/models/enums/WeaponTypes.d.ts | 37 +++++++-- .../types/models/spt/bots/IBotLootCache.d.ts | 8 +- .../types/models/spt/config/IBotConfig.d.ts | 5 +- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../models/spt/config/IHideoutConfig.d.ts | 4 + .../types/models/spt/config/IHttpConfig.d.ts | 6 +- .../models/spt/config/IInRaidConfig.d.ts | 1 - .../models/spt/config/ILocationConfig.d.ts | 4 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 + .../spt/dialog/ISendMessageDetails.d.ts | 10 ++- .../spt/fence/ICreateFenceAssortsResult.d.ts | 7 ++ .../types/servers/HttpServer.d.ts | 8 ++ .../types/services/BotLootCacheService.d.ts | 3 + .../types/services/FenceService.d.ts | 76 +++++++++++++++---- .../types/services/ItemBaseClassService.d.ts | 10 ++- .../types/services/MailSendService.d.ts | 6 +- .../types/services/PaymentService.d.ts | 2 +- .../services/ProfileActivityService.d.ts | 21 +++++ .../types/services/ProfileFixerService.d.ts | 25 +++++- .../types/services/RagfairPriceService.d.ts | 11 ++- .../types/utils/App.d.ts | 4 +- .../types/utils/CompareUtil.d.ts | 11 +++ .../types/utils/RagfairOfferHolder.d.ts | 5 +- .../utils/logging/AbstractWinstonLogger.d.ts | 1 + TypeScript/1LogToConsole/README.md | 2 +- .../types/callbacks/BotCallbacks.d.ts | 6 ++ .../types/callbacks/DialogueCallbacks.d.ts | 10 ++- .../types/callbacks/InraidCallbacks.d.ts | 5 -- .../types/controllers/BotController.d.ts | 6 +- .../types/controllers/BuildController.d.ts | 2 +- .../types/controllers/GameController.d.ts | 6 +- .../types/controllers/HideoutController.d.ts | 4 +- .../controllers/InsuranceController.d.ts | 8 +- .../types/controllers/LauncherController.d.ts | 5 ++ .../types/controllers/MatchController.d.ts | 3 +- .../generators/BotEquipmentModGenerator.d.ts | 12 +-- .../types/generators/BotGenerator.d.ts | 3 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../generators/FenceBaseAssortGenerator.d.ts | 18 ++++- .../types/generators/LootGenerator.d.ts | 18 ++--- .../RepeatableQuestRewardGenerator.d.ts | 2 +- .../types/helpers/BotGeneratorHelper.d.ts | 2 +- .../Dialogue/AbstractDialogueChatBot.d.ts | 20 +++++ .../Dialogue/Commando/IChatCommand.d.ts | 12 +++ .../Dialogue/Commando/ICommandoCommand.d.ts | 8 -- .../Commando/SptCommandoCommands.d.ts | 4 +- .../GiveCommand/GiveSptCommand.d.ts | 39 ++++++++++ .../SptCommands/GiveCommand/SavedCommand.d.ts | 6 ++ .../Commando/SptCommands/GiveSptCommand.d.ts | 21 ----- .../ProfileCommand/ProfileSptCommand.d.ts | 38 ++++++++++ .../TraderCommand/TraderSptCommand.d.ts | 33 ++++++++ .../Dialogue/CommandoDialogueChatBot.d.ts | 15 ++-- .../types/helpers/HideoutHelper.d.ts | 2 +- .../types/helpers/HttpServerHelper.d.ts | 2 +- .../types/helpers/ItemHelper.d.ts | 35 ++++++++- .../types/helpers/PresetHelper.d.ts | 8 ++ .../models/eft/common/tables/IBotType.d.ts | 3 + .../models/eft/common/tables/IQuest.d.ts | 1 + .../eft/dialog/IAcceptFriendRequestData.d.ts | 6 +- .../dialog/IFriendRequestSendResponse.d.ts | 2 +- .../eft/profile/IGetOtherProfileResponse.d.ts | 2 +- .../eft/profile/ISearchFriendResponse.d.ts | 2 + .../types/models/enums/AmmoTypes.d.ts | 4 + .../types/models/enums/WeaponTypes.d.ts | 37 +++++++-- .../types/models/spt/bots/IBotLootCache.d.ts | 8 +- .../types/models/spt/config/IBotConfig.d.ts | 5 +- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../models/spt/config/IHideoutConfig.d.ts | 4 + .../types/models/spt/config/IHttpConfig.d.ts | 6 +- .../models/spt/config/IInRaidConfig.d.ts | 1 - .../models/spt/config/ILocationConfig.d.ts | 4 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 + .../spt/dialog/ISendMessageDetails.d.ts | 10 ++- .../spt/fence/ICreateFenceAssortsResult.d.ts | 7 ++ .../types/servers/HttpServer.d.ts | 8 ++ .../types/services/BotLootCacheService.d.ts | 3 + .../types/services/FenceService.d.ts | 76 +++++++++++++++---- .../types/services/ItemBaseClassService.d.ts | 10 ++- .../types/services/MailSendService.d.ts | 6 +- .../types/services/PaymentService.d.ts | 2 +- .../services/ProfileActivityService.d.ts | 21 +++++ .../types/services/ProfileFixerService.d.ts | 25 +++++- .../types/services/RagfairPriceService.d.ts | 11 ++- TypeScript/1LogToConsole/types/utils/App.d.ts | 4 +- .../types/utils/CompareUtil.d.ts | 11 +++ .../types/utils/RagfairOfferHolder.d.ts | 5 +- .../utils/logging/AbstractWinstonLogger.d.ts | 1 + TypeScript/20CustomChatBot/README.md | 2 +- .../types/callbacks/BotCallbacks.d.ts | 6 ++ .../types/callbacks/DialogueCallbacks.d.ts | 10 ++- .../types/callbacks/InraidCallbacks.d.ts | 5 -- .../types/controllers/BotController.d.ts | 6 +- .../types/controllers/BuildController.d.ts | 2 +- .../types/controllers/GameController.d.ts | 6 +- .../types/controllers/HideoutController.d.ts | 4 +- .../controllers/InsuranceController.d.ts | 8 +- .../types/controllers/LauncherController.d.ts | 5 ++ .../types/controllers/MatchController.d.ts | 3 +- .../generators/BotEquipmentModGenerator.d.ts | 12 +-- .../types/generators/BotGenerator.d.ts | 3 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../generators/FenceBaseAssortGenerator.d.ts | 18 ++++- .../types/generators/LootGenerator.d.ts | 18 ++--- .../RepeatableQuestRewardGenerator.d.ts | 2 +- .../types/helpers/BotGeneratorHelper.d.ts | 2 +- .../Dialogue/AbstractDialogueChatBot.d.ts | 20 +++++ .../Dialogue/Commando/IChatCommand.d.ts | 12 +++ .../Dialogue/Commando/ICommandoCommand.d.ts | 8 -- .../Commando/SptCommandoCommands.d.ts | 4 +- .../GiveCommand/GiveSptCommand.d.ts | 39 ++++++++++ .../SptCommands/GiveCommand/SavedCommand.d.ts | 6 ++ .../Commando/SptCommands/GiveSptCommand.d.ts | 21 ----- .../ProfileCommand/ProfileSptCommand.d.ts | 38 ++++++++++ .../TraderCommand/TraderSptCommand.d.ts | 33 ++++++++ .../Dialogue/CommandoDialogueChatBot.d.ts | 15 ++-- .../types/helpers/HideoutHelper.d.ts | 2 +- .../types/helpers/HttpServerHelper.d.ts | 2 +- .../types/helpers/ItemHelper.d.ts | 35 ++++++++- .../types/helpers/PresetHelper.d.ts | 8 ++ .../models/eft/common/tables/IBotType.d.ts | 3 + .../models/eft/common/tables/IQuest.d.ts | 1 + .../eft/dialog/IAcceptFriendRequestData.d.ts | 6 +- .../dialog/IFriendRequestSendResponse.d.ts | 2 +- .../eft/profile/IGetOtherProfileResponse.d.ts | 2 +- .../eft/profile/ISearchFriendResponse.d.ts | 2 + .../types/models/enums/AmmoTypes.d.ts | 4 + .../types/models/enums/WeaponTypes.d.ts | 37 +++++++-- .../types/models/spt/bots/IBotLootCache.d.ts | 8 +- .../types/models/spt/config/IBotConfig.d.ts | 5 +- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../models/spt/config/IHideoutConfig.d.ts | 4 + .../types/models/spt/config/IHttpConfig.d.ts | 6 +- .../models/spt/config/IInRaidConfig.d.ts | 1 - .../models/spt/config/ILocationConfig.d.ts | 4 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 + .../spt/dialog/ISendMessageDetails.d.ts | 10 ++- .../spt/fence/ICreateFenceAssortsResult.d.ts | 7 ++ .../types/servers/HttpServer.d.ts | 8 ++ .../types/services/BotLootCacheService.d.ts | 3 + .../types/services/FenceService.d.ts | 76 +++++++++++++++---- .../types/services/ItemBaseClassService.d.ts | 10 ++- .../types/services/MailSendService.d.ts | 6 +- .../types/services/PaymentService.d.ts | 2 +- .../services/ProfileActivityService.d.ts | 21 +++++ .../types/services/ProfileFixerService.d.ts | 25 +++++- .../types/services/RagfairPriceService.d.ts | 11 ++- .../20CustomChatBot/types/utils/App.d.ts | 4 +- .../types/utils/CompareUtil.d.ts | 11 +++ .../types/utils/RagfairOfferHolder.d.ts | 5 +- .../utils/logging/AbstractWinstonLogger.d.ts | 1 + TypeScript/21CustomCommandoCommand/README.md | 2 +- .../types/callbacks/BotCallbacks.d.ts | 6 ++ .../types/callbacks/DialogueCallbacks.d.ts | 10 ++- .../types/callbacks/InraidCallbacks.d.ts | 5 -- .../types/controllers/BotController.d.ts | 6 +- .../types/controllers/BuildController.d.ts | 2 +- .../types/controllers/GameController.d.ts | 6 +- .../types/controllers/HideoutController.d.ts | 4 +- .../controllers/InsuranceController.d.ts | 8 +- .../types/controllers/LauncherController.d.ts | 5 ++ .../types/controllers/MatchController.d.ts | 3 +- .../generators/BotEquipmentModGenerator.d.ts | 12 +-- .../types/generators/BotGenerator.d.ts | 3 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../generators/FenceBaseAssortGenerator.d.ts | 18 ++++- .../types/generators/LootGenerator.d.ts | 18 ++--- .../RepeatableQuestRewardGenerator.d.ts | 2 +- .../types/helpers/BotGeneratorHelper.d.ts | 2 +- .../Dialogue/AbstractDialogueChatBot.d.ts | 20 +++++ .../Dialogue/Commando/IChatCommand.d.ts | 12 +++ .../Dialogue/Commando/ICommandoCommand.d.ts | 8 -- .../Commando/SptCommandoCommands.d.ts | 4 +- .../GiveCommand/GiveSptCommand.d.ts | 39 ++++++++++ .../SptCommands/GiveCommand/SavedCommand.d.ts | 6 ++ .../Commando/SptCommands/GiveSptCommand.d.ts | 21 ----- .../ProfileCommand/ProfileSptCommand.d.ts | 38 ++++++++++ .../TraderCommand/TraderSptCommand.d.ts | 33 ++++++++ .../Dialogue/CommandoDialogueChatBot.d.ts | 15 ++-- .../types/helpers/HideoutHelper.d.ts | 2 +- .../types/helpers/HttpServerHelper.d.ts | 2 +- .../types/helpers/ItemHelper.d.ts | 35 ++++++++- .../types/helpers/PresetHelper.d.ts | 8 ++ .../models/eft/common/tables/IBotType.d.ts | 3 + .../models/eft/common/tables/IQuest.d.ts | 1 + .../eft/dialog/IAcceptFriendRequestData.d.ts | 6 +- .../dialog/IFriendRequestSendResponse.d.ts | 2 +- .../eft/profile/IGetOtherProfileResponse.d.ts | 2 +- .../eft/profile/ISearchFriendResponse.d.ts | 2 + .../types/models/enums/AmmoTypes.d.ts | 4 + .../types/models/enums/WeaponTypes.d.ts | 37 +++++++-- .../types/models/spt/bots/IBotLootCache.d.ts | 8 +- .../types/models/spt/config/IBotConfig.d.ts | 5 +- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../models/spt/config/IHideoutConfig.d.ts | 4 + .../types/models/spt/config/IHttpConfig.d.ts | 6 +- .../models/spt/config/IInRaidConfig.d.ts | 1 - .../models/spt/config/ILocationConfig.d.ts | 4 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 + .../spt/dialog/ISendMessageDetails.d.ts | 10 ++- .../spt/fence/ICreateFenceAssortsResult.d.ts | 7 ++ .../types/servers/HttpServer.d.ts | 8 ++ .../types/services/BotLootCacheService.d.ts | 3 + .../types/services/FenceService.d.ts | 76 +++++++++++++++---- .../types/services/ItemBaseClassService.d.ts | 10 ++- .../types/services/MailSendService.d.ts | 6 +- .../types/services/PaymentService.d.ts | 2 +- .../services/ProfileActivityService.d.ts | 21 +++++ .../types/services/ProfileFixerService.d.ts | 25 +++++- .../types/services/RagfairPriceService.d.ts | 11 ++- .../types/utils/App.d.ts | 4 +- .../types/utils/CompareUtil.d.ts | 11 +++ .../types/utils/RagfairOfferHolder.d.ts | 5 +- .../utils/logging/AbstractWinstonLogger.d.ts | 1 + TypeScript/22CustomAkiCommand/README.md | 2 +- .../types/callbacks/BotCallbacks.d.ts | 6 ++ .../types/callbacks/DialogueCallbacks.d.ts | 10 ++- .../types/callbacks/InraidCallbacks.d.ts | 5 -- .../types/controllers/BotController.d.ts | 6 +- .../types/controllers/BuildController.d.ts | 2 +- .../types/controllers/GameController.d.ts | 6 +- .../types/controllers/HideoutController.d.ts | 4 +- .../controllers/InsuranceController.d.ts | 8 +- .../types/controllers/LauncherController.d.ts | 5 ++ .../types/controllers/MatchController.d.ts | 3 +- .../generators/BotEquipmentModGenerator.d.ts | 12 +-- .../types/generators/BotGenerator.d.ts | 3 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../generators/FenceBaseAssortGenerator.d.ts | 18 ++++- .../types/generators/LootGenerator.d.ts | 18 ++--- .../RepeatableQuestRewardGenerator.d.ts | 2 +- .../types/helpers/BotGeneratorHelper.d.ts | 2 +- .../Dialogue/AbstractDialogueChatBot.d.ts | 20 +++++ .../Dialogue/Commando/IChatCommand.d.ts | 12 +++ .../Dialogue/Commando/ICommandoCommand.d.ts | 8 -- .../Commando/SptCommandoCommands.d.ts | 4 +- .../GiveCommand/GiveSptCommand.d.ts | 39 ++++++++++ .../SptCommands/GiveCommand/SavedCommand.d.ts | 6 ++ .../Commando/SptCommands/GiveSptCommand.d.ts | 21 ----- .../ProfileCommand/ProfileSptCommand.d.ts | 38 ++++++++++ .../TraderCommand/TraderSptCommand.d.ts | 33 ++++++++ .../Dialogue/CommandoDialogueChatBot.d.ts | 15 ++-- .../types/helpers/HideoutHelper.d.ts | 2 +- .../types/helpers/HttpServerHelper.d.ts | 2 +- .../types/helpers/ItemHelper.d.ts | 35 ++++++++- .../types/helpers/PresetHelper.d.ts | 8 ++ .../models/eft/common/tables/IBotType.d.ts | 3 + .../models/eft/common/tables/IQuest.d.ts | 1 + .../eft/dialog/IAcceptFriendRequestData.d.ts | 6 +- .../dialog/IFriendRequestSendResponse.d.ts | 2 +- .../eft/profile/IGetOtherProfileResponse.d.ts | 2 +- .../eft/profile/ISearchFriendResponse.d.ts | 2 + .../types/models/enums/AmmoTypes.d.ts | 4 + .../types/models/enums/WeaponTypes.d.ts | 37 +++++++-- .../types/models/spt/bots/IBotLootCache.d.ts | 8 +- .../types/models/spt/config/IBotConfig.d.ts | 5 +- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../models/spt/config/IHideoutConfig.d.ts | 4 + .../types/models/spt/config/IHttpConfig.d.ts | 6 +- .../models/spt/config/IInRaidConfig.d.ts | 1 - .../models/spt/config/ILocationConfig.d.ts | 4 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 + .../spt/dialog/ISendMessageDetails.d.ts | 10 ++- .../spt/fence/ICreateFenceAssortsResult.d.ts | 7 ++ .../types/servers/HttpServer.d.ts | 8 ++ .../types/services/BotLootCacheService.d.ts | 3 + .../types/services/FenceService.d.ts | 76 +++++++++++++++---- .../types/services/ItemBaseClassService.d.ts | 10 ++- .../types/services/MailSendService.d.ts | 6 +- .../types/services/PaymentService.d.ts | 2 +- .../services/ProfileActivityService.d.ts | 21 +++++ .../types/services/ProfileFixerService.d.ts | 25 +++++- .../types/services/RagfairPriceService.d.ts | 11 ++- .../22CustomAkiCommand/types/utils/App.d.ts | 4 +- .../types/utils/CompareUtil.d.ts | 11 +++ .../types/utils/RagfairOfferHolder.d.ts | 5 +- .../utils/logging/AbstractWinstonLogger.d.ts | 1 + TypeScript/23CustomAbstractChatBot/README.md | 2 +- TypeScript/2EditDatabase/README.md | 2 +- .../types/callbacks/BotCallbacks.d.ts | 6 ++ .../types/callbacks/DialogueCallbacks.d.ts | 10 ++- .../types/callbacks/InraidCallbacks.d.ts | 5 -- .../types/controllers/BotController.d.ts | 6 +- .../types/controllers/BuildController.d.ts | 2 +- .../types/controllers/GameController.d.ts | 6 +- .../types/controllers/HideoutController.d.ts | 4 +- .../controllers/InsuranceController.d.ts | 8 +- .../types/controllers/LauncherController.d.ts | 5 ++ .../types/controllers/MatchController.d.ts | 3 +- .../generators/BotEquipmentModGenerator.d.ts | 12 +-- .../types/generators/BotGenerator.d.ts | 3 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../generators/FenceBaseAssortGenerator.d.ts | 18 ++++- .../types/generators/LootGenerator.d.ts | 18 ++--- .../RepeatableQuestRewardGenerator.d.ts | 2 +- .../types/helpers/BotGeneratorHelper.d.ts | 2 +- .../Dialogue/AbstractDialogueChatBot.d.ts | 20 +++++ .../Dialogue/Commando/IChatCommand.d.ts | 12 +++ .../Dialogue/Commando/ICommandoCommand.d.ts | 8 -- .../Commando/SptCommandoCommands.d.ts | 4 +- .../GiveCommand/GiveSptCommand.d.ts | 39 ++++++++++ .../SptCommands/GiveCommand/SavedCommand.d.ts | 6 ++ .../Commando/SptCommands/GiveSptCommand.d.ts | 21 ----- .../ProfileCommand/ProfileSptCommand.d.ts | 38 ++++++++++ .../TraderCommand/TraderSptCommand.d.ts | 33 ++++++++ .../Dialogue/CommandoDialogueChatBot.d.ts | 15 ++-- .../types/helpers/HideoutHelper.d.ts | 2 +- .../types/helpers/HttpServerHelper.d.ts | 2 +- .../types/helpers/ItemHelper.d.ts | 35 ++++++++- .../types/helpers/PresetHelper.d.ts | 8 ++ .../models/eft/common/tables/IBotType.d.ts | 3 + .../models/eft/common/tables/IQuest.d.ts | 1 + .../eft/dialog/IAcceptFriendRequestData.d.ts | 6 +- .../dialog/IFriendRequestSendResponse.d.ts | 2 +- .../eft/profile/IGetOtherProfileResponse.d.ts | 2 +- .../eft/profile/ISearchFriendResponse.d.ts | 2 + .../types/models/enums/AmmoTypes.d.ts | 4 + .../types/models/enums/WeaponTypes.d.ts | 37 +++++++-- .../types/models/spt/bots/IBotLootCache.d.ts | 8 +- .../types/models/spt/config/IBotConfig.d.ts | 5 +- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../models/spt/config/IHideoutConfig.d.ts | 4 + .../types/models/spt/config/IHttpConfig.d.ts | 6 +- .../models/spt/config/IInRaidConfig.d.ts | 1 - .../models/spt/config/ILocationConfig.d.ts | 4 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 + .../spt/dialog/ISendMessageDetails.d.ts | 10 ++- .../spt/fence/ICreateFenceAssortsResult.d.ts | 7 ++ .../types/servers/HttpServer.d.ts | 8 ++ .../types/services/BotLootCacheService.d.ts | 3 + .../types/services/FenceService.d.ts | 76 +++++++++++++++---- .../types/services/ItemBaseClassService.d.ts | 10 ++- .../types/services/MailSendService.d.ts | 6 +- .../types/services/PaymentService.d.ts | 2 +- .../services/ProfileActivityService.d.ts | 21 +++++ .../types/services/ProfileFixerService.d.ts | 25 +++++- .../types/services/RagfairPriceService.d.ts | 11 ++- TypeScript/2EditDatabase/types/utils/App.d.ts | 4 +- .../types/utils/CompareUtil.d.ts | 11 +++ .../types/utils/RagfairOfferHolder.d.ts | 5 +- .../utils/logging/AbstractWinstonLogger.d.ts | 1 + TypeScript/3GetSptConfigFile/README.md | 2 +- TypeScript/3GetSptConfigFile/src/mod.ts | 25 +++--- .../types/callbacks/BotCallbacks.d.ts | 6 ++ .../types/callbacks/DialogueCallbacks.d.ts | 10 ++- .../types/callbacks/InraidCallbacks.d.ts | 5 -- .../types/controllers/BotController.d.ts | 6 +- .../types/controllers/BuildController.d.ts | 2 +- .../types/controllers/GameController.d.ts | 6 +- .../types/controllers/HideoutController.d.ts | 4 +- .../controllers/InsuranceController.d.ts | 8 +- .../types/controllers/LauncherController.d.ts | 5 ++ .../types/controllers/MatchController.d.ts | 3 +- .../generators/BotEquipmentModGenerator.d.ts | 12 +-- .../types/generators/BotGenerator.d.ts | 3 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../generators/FenceBaseAssortGenerator.d.ts | 18 ++++- .../types/generators/LootGenerator.d.ts | 18 ++--- .../RepeatableQuestRewardGenerator.d.ts | 2 +- .../types/helpers/BotGeneratorHelper.d.ts | 2 +- .../Dialogue/AbstractDialogueChatBot.d.ts | 20 +++++ .../Dialogue/Commando/IChatCommand.d.ts | 12 +++ .../Dialogue/Commando/ICommandoCommand.d.ts | 8 -- .../Commando/SptCommandoCommands.d.ts | 4 +- .../GiveCommand/GiveSptCommand.d.ts | 39 ++++++++++ .../SptCommands/GiveCommand/SavedCommand.d.ts | 6 ++ .../Commando/SptCommands/GiveSptCommand.d.ts | 21 ----- .../ProfileCommand/ProfileSptCommand.d.ts | 38 ++++++++++ .../TraderCommand/TraderSptCommand.d.ts | 33 ++++++++ .../Dialogue/CommandoDialogueChatBot.d.ts | 15 ++-- .../types/helpers/HideoutHelper.d.ts | 2 +- .../types/helpers/HttpServerHelper.d.ts | 2 +- .../types/helpers/ItemHelper.d.ts | 35 ++++++++- .../types/helpers/PresetHelper.d.ts | 8 ++ .../models/eft/common/tables/IBotType.d.ts | 3 + .../models/eft/common/tables/IQuest.d.ts | 1 + .../eft/dialog/IAcceptFriendRequestData.d.ts | 6 +- .../dialog/IFriendRequestSendResponse.d.ts | 2 +- .../eft/profile/IGetOtherProfileResponse.d.ts | 2 +- .../eft/profile/ISearchFriendResponse.d.ts | 2 + .../types/models/enums/AmmoTypes.d.ts | 4 + .../types/models/enums/WeaponTypes.d.ts | 37 +++++++-- .../types/models/spt/bots/IBotLootCache.d.ts | 8 +- .../types/models/spt/config/IBotConfig.d.ts | 5 +- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../models/spt/config/IHideoutConfig.d.ts | 4 + .../types/models/spt/config/IHttpConfig.d.ts | 6 +- .../models/spt/config/IInRaidConfig.d.ts | 1 - .../models/spt/config/ILocationConfig.d.ts | 4 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 + .../spt/dialog/ISendMessageDetails.d.ts | 10 ++- .../spt/fence/ICreateFenceAssortsResult.d.ts | 7 ++ .../types/servers/HttpServer.d.ts | 8 ++ .../types/services/BotLootCacheService.d.ts | 3 + .../types/services/FenceService.d.ts | 76 +++++++++++++++---- .../types/services/ItemBaseClassService.d.ts | 10 ++- .../types/services/MailSendService.d.ts | 6 +- .../types/services/PaymentService.d.ts | 2 +- .../services/ProfileActivityService.d.ts | 21 +++++ .../types/services/ProfileFixerService.d.ts | 25 +++++- .../types/services/RagfairPriceService.d.ts | 11 ++- .../3GetSptConfigFile/types/utils/App.d.ts | 4 +- .../types/utils/CompareUtil.d.ts | 11 +++ .../types/utils/RagfairOfferHolder.d.ts | 5 +- .../utils/logging/AbstractWinstonLogger.d.ts | 1 + .../README.md | 2 +- .../types/callbacks/BotCallbacks.d.ts | 6 ++ .../types/callbacks/DialogueCallbacks.d.ts | 10 ++- .../types/callbacks/InraidCallbacks.d.ts | 5 -- .../types/controllers/BotController.d.ts | 6 +- .../types/controllers/BuildController.d.ts | 2 +- .../types/controllers/GameController.d.ts | 6 +- .../types/controllers/HideoutController.d.ts | 4 +- .../controllers/InsuranceController.d.ts | 8 +- .../types/controllers/LauncherController.d.ts | 5 ++ .../types/controllers/MatchController.d.ts | 3 +- .../generators/BotEquipmentModGenerator.d.ts | 12 +-- .../types/generators/BotGenerator.d.ts | 3 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../generators/FenceBaseAssortGenerator.d.ts | 18 ++++- .../types/generators/LootGenerator.d.ts | 18 ++--- .../RepeatableQuestRewardGenerator.d.ts | 2 +- .../types/helpers/BotGeneratorHelper.d.ts | 2 +- .../Dialogue/AbstractDialogueChatBot.d.ts | 20 +++++ .../Dialogue/Commando/IChatCommand.d.ts | 12 +++ .../Dialogue/Commando/ICommandoCommand.d.ts | 8 -- .../Commando/SptCommandoCommands.d.ts | 4 +- .../GiveCommand/GiveSptCommand.d.ts | 39 ++++++++++ .../SptCommands/GiveCommand/SavedCommand.d.ts | 6 ++ .../Commando/SptCommands/GiveSptCommand.d.ts | 21 ----- .../ProfileCommand/ProfileSptCommand.d.ts | 38 ++++++++++ .../TraderCommand/TraderSptCommand.d.ts | 33 ++++++++ .../Dialogue/CommandoDialogueChatBot.d.ts | 15 ++-- .../types/helpers/HideoutHelper.d.ts | 2 +- .../types/helpers/HttpServerHelper.d.ts | 2 +- .../types/helpers/ItemHelper.d.ts | 35 ++++++++- .../types/helpers/PresetHelper.d.ts | 8 ++ .../models/eft/common/tables/IBotType.d.ts | 3 + .../models/eft/common/tables/IQuest.d.ts | 1 + .../eft/dialog/IAcceptFriendRequestData.d.ts | 6 +- .../dialog/IFriendRequestSendResponse.d.ts | 2 +- .../eft/profile/IGetOtherProfileResponse.d.ts | 2 +- .../eft/profile/ISearchFriendResponse.d.ts | 2 + .../types/models/enums/AmmoTypes.d.ts | 4 + .../types/models/enums/WeaponTypes.d.ts | 37 +++++++-- .../types/models/spt/bots/IBotLootCache.d.ts | 8 +- .../types/models/spt/config/IBotConfig.d.ts | 5 +- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../models/spt/config/IHideoutConfig.d.ts | 4 + .../types/models/spt/config/IHttpConfig.d.ts | 6 +- .../models/spt/config/IInRaidConfig.d.ts | 1 - .../models/spt/config/ILocationConfig.d.ts | 4 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 + .../spt/dialog/ISendMessageDetails.d.ts | 10 ++- .../spt/fence/ICreateFenceAssortsResult.d.ts | 7 ++ .../types/servers/HttpServer.d.ts | 8 ++ .../types/services/BotLootCacheService.d.ts | 3 + .../types/services/FenceService.d.ts | 76 +++++++++++++++---- .../types/services/ItemBaseClassService.d.ts | 10 ++- .../types/services/MailSendService.d.ts | 6 +- .../types/services/PaymentService.d.ts | 2 +- .../services/ProfileActivityService.d.ts | 21 +++++ .../types/services/ProfileFixerService.d.ts | 25 +++++- .../types/services/RagfairPriceService.d.ts | 11 ++- .../types/utils/App.d.ts | 4 +- .../types/utils/CompareUtil.d.ts | 11 +++ .../types/utils/RagfairOfferHolder.d.ts | 5 +- .../utils/logging/AbstractWinstonLogger.d.ts | 1 + TypeScript/4UseACustomConfigFile/README.md | 2 +- .../types/callbacks/BotCallbacks.d.ts | 6 ++ .../types/callbacks/DialogueCallbacks.d.ts | 10 ++- .../types/callbacks/InraidCallbacks.d.ts | 5 -- .../types/controllers/BotController.d.ts | 6 +- .../types/controllers/BuildController.d.ts | 2 +- .../types/controllers/GameController.d.ts | 6 +- .../types/controllers/HideoutController.d.ts | 4 +- .../controllers/InsuranceController.d.ts | 8 +- .../types/controllers/LauncherController.d.ts | 5 ++ .../types/controllers/MatchController.d.ts | 3 +- .../generators/BotEquipmentModGenerator.d.ts | 12 +-- .../types/generators/BotGenerator.d.ts | 3 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../generators/FenceBaseAssortGenerator.d.ts | 18 ++++- .../types/generators/LootGenerator.d.ts | 18 ++--- .../RepeatableQuestRewardGenerator.d.ts | 2 +- .../types/helpers/BotGeneratorHelper.d.ts | 2 +- .../Dialogue/AbstractDialogueChatBot.d.ts | 20 +++++ .../Dialogue/Commando/IChatCommand.d.ts | 12 +++ .../Dialogue/Commando/ICommandoCommand.d.ts | 8 -- .../Commando/SptCommandoCommands.d.ts | 4 +- .../GiveCommand/GiveSptCommand.d.ts | 39 ++++++++++ .../SptCommands/GiveCommand/SavedCommand.d.ts | 6 ++ .../Commando/SptCommands/GiveSptCommand.d.ts | 21 ----- .../ProfileCommand/ProfileSptCommand.d.ts | 38 ++++++++++ .../TraderCommand/TraderSptCommand.d.ts | 33 ++++++++ .../Dialogue/CommandoDialogueChatBot.d.ts | 15 ++-- .../types/helpers/HideoutHelper.d.ts | 2 +- .../types/helpers/HttpServerHelper.d.ts | 2 +- .../types/helpers/ItemHelper.d.ts | 35 ++++++++- .../types/helpers/PresetHelper.d.ts | 8 ++ .../models/eft/common/tables/IBotType.d.ts | 3 + .../models/eft/common/tables/IQuest.d.ts | 1 + .../eft/dialog/IAcceptFriendRequestData.d.ts | 6 +- .../dialog/IFriendRequestSendResponse.d.ts | 2 +- .../eft/profile/IGetOtherProfileResponse.d.ts | 2 +- .../eft/profile/ISearchFriendResponse.d.ts | 2 + .../types/models/enums/AmmoTypes.d.ts | 4 + .../types/models/enums/WeaponTypes.d.ts | 37 +++++++-- .../types/models/spt/bots/IBotLootCache.d.ts | 8 +- .../types/models/spt/config/IBotConfig.d.ts | 5 +- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../models/spt/config/IHideoutConfig.d.ts | 4 + .../types/models/spt/config/IHttpConfig.d.ts | 6 +- .../models/spt/config/IInRaidConfig.d.ts | 1 - .../models/spt/config/ILocationConfig.d.ts | 4 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 + .../spt/dialog/ISendMessageDetails.d.ts | 10 ++- .../spt/fence/ICreateFenceAssortsResult.d.ts | 7 ++ .../types/servers/HttpServer.d.ts | 8 ++ .../types/services/BotLootCacheService.d.ts | 3 + .../types/services/FenceService.d.ts | 76 +++++++++++++++---- .../types/services/ItemBaseClassService.d.ts | 10 ++- .../types/services/MailSendService.d.ts | 6 +- .../types/services/PaymentService.d.ts | 2 +- .../services/ProfileActivityService.d.ts | 21 +++++ .../types/services/ProfileFixerService.d.ts | 25 +++++- .../types/services/RagfairPriceService.d.ts | 11 ++- .../types/utils/App.d.ts | 4 +- .../types/utils/CompareUtil.d.ts | 11 +++ .../types/utils/RagfairOfferHolder.d.ts | 5 +- .../utils/logging/AbstractWinstonLogger.d.ts | 1 + TypeScript/5ReplaceMethod/README.md | 2 +- .../types/callbacks/BotCallbacks.d.ts | 6 ++ .../types/callbacks/DialogueCallbacks.d.ts | 10 ++- .../types/callbacks/InraidCallbacks.d.ts | 5 -- .../types/controllers/BotController.d.ts | 6 +- .../types/controllers/BuildController.d.ts | 2 +- .../types/controllers/GameController.d.ts | 6 +- .../types/controllers/HideoutController.d.ts | 4 +- .../controllers/InsuranceController.d.ts | 8 +- .../types/controllers/LauncherController.d.ts | 5 ++ .../types/controllers/MatchController.d.ts | 3 +- .../generators/BotEquipmentModGenerator.d.ts | 12 +-- .../types/generators/BotGenerator.d.ts | 3 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../generators/FenceBaseAssortGenerator.d.ts | 18 ++++- .../types/generators/LootGenerator.d.ts | 18 ++--- .../RepeatableQuestRewardGenerator.d.ts | 2 +- .../types/helpers/BotGeneratorHelper.d.ts | 2 +- .../Dialogue/AbstractDialogueChatBot.d.ts | 20 +++++ .../Dialogue/Commando/IChatCommand.d.ts | 12 +++ .../Dialogue/Commando/ICommandoCommand.d.ts | 8 -- .../Commando/SptCommandoCommands.d.ts | 4 +- .../GiveCommand/GiveSptCommand.d.ts | 39 ++++++++++ .../SptCommands/GiveCommand/SavedCommand.d.ts | 6 ++ .../Commando/SptCommands/GiveSptCommand.d.ts | 21 ----- .../ProfileCommand/ProfileSptCommand.d.ts | 38 ++++++++++ .../TraderCommand/TraderSptCommand.d.ts | 33 ++++++++ .../Dialogue/CommandoDialogueChatBot.d.ts | 15 ++-- .../types/helpers/HideoutHelper.d.ts | 2 +- .../types/helpers/HttpServerHelper.d.ts | 2 +- .../types/helpers/ItemHelper.d.ts | 35 ++++++++- .../types/helpers/PresetHelper.d.ts | 8 ++ .../models/eft/common/tables/IBotType.d.ts | 3 + .../models/eft/common/tables/IQuest.d.ts | 1 + .../eft/dialog/IAcceptFriendRequestData.d.ts | 6 +- .../dialog/IFriendRequestSendResponse.d.ts | 2 +- .../eft/profile/IGetOtherProfileResponse.d.ts | 2 +- .../eft/profile/ISearchFriendResponse.d.ts | 2 + .../types/models/enums/AmmoTypes.d.ts | 4 + .../types/models/enums/WeaponTypes.d.ts | 37 +++++++-- .../types/models/spt/bots/IBotLootCache.d.ts | 8 +- .../types/models/spt/config/IBotConfig.d.ts | 5 +- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../models/spt/config/IHideoutConfig.d.ts | 4 + .../types/models/spt/config/IHttpConfig.d.ts | 6 +- .../models/spt/config/IInRaidConfig.d.ts | 1 - .../models/spt/config/ILocationConfig.d.ts | 4 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 + .../spt/dialog/ISendMessageDetails.d.ts | 10 ++- .../spt/fence/ICreateFenceAssortsResult.d.ts | 7 ++ .../types/servers/HttpServer.d.ts | 8 ++ .../types/services/BotLootCacheService.d.ts | 3 + .../types/services/FenceService.d.ts | 76 +++++++++++++++---- .../types/services/ItemBaseClassService.d.ts | 10 ++- .../types/services/MailSendService.d.ts | 6 +- .../types/services/PaymentService.d.ts | 2 +- .../services/ProfileActivityService.d.ts | 21 +++++ .../types/services/ProfileFixerService.d.ts | 25 +++++- .../types/services/RagfairPriceService.d.ts | 11 ++- .../5ReplaceMethod/types/utils/App.d.ts | 4 +- .../types/utils/CompareUtil.d.ts | 11 +++ .../types/utils/RagfairOfferHolder.d.ts | 5 +- .../utils/logging/AbstractWinstonLogger.d.ts | 1 + TypeScript/6ReferenceAnotherClass/README.md | 2 +- .../types/callbacks/BotCallbacks.d.ts | 6 ++ .../types/callbacks/DialogueCallbacks.d.ts | 10 ++- .../types/callbacks/InraidCallbacks.d.ts | 5 -- .../types/controllers/BotController.d.ts | 6 +- .../types/controllers/BuildController.d.ts | 2 +- .../types/controllers/GameController.d.ts | 6 +- .../types/controllers/HideoutController.d.ts | 4 +- .../controllers/InsuranceController.d.ts | 8 +- .../types/controllers/LauncherController.d.ts | 5 ++ .../types/controllers/MatchController.d.ts | 3 +- .../generators/BotEquipmentModGenerator.d.ts | 12 +-- .../types/generators/BotGenerator.d.ts | 3 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../generators/FenceBaseAssortGenerator.d.ts | 18 ++++- .../types/generators/LootGenerator.d.ts | 18 ++--- .../RepeatableQuestRewardGenerator.d.ts | 2 +- .../types/helpers/BotGeneratorHelper.d.ts | 2 +- .../Dialogue/AbstractDialogueChatBot.d.ts | 20 +++++ .../Dialogue/Commando/IChatCommand.d.ts | 12 +++ .../Dialogue/Commando/ICommandoCommand.d.ts | 8 -- .../Commando/SptCommandoCommands.d.ts | 4 +- .../GiveCommand/GiveSptCommand.d.ts | 39 ++++++++++ .../SptCommands/GiveCommand/SavedCommand.d.ts | 6 ++ .../Commando/SptCommands/GiveSptCommand.d.ts | 21 ----- .../ProfileCommand/ProfileSptCommand.d.ts | 38 ++++++++++ .../TraderCommand/TraderSptCommand.d.ts | 33 ++++++++ .../Dialogue/CommandoDialogueChatBot.d.ts | 15 ++-- .../types/helpers/HideoutHelper.d.ts | 2 +- .../types/helpers/HttpServerHelper.d.ts | 2 +- .../types/helpers/ItemHelper.d.ts | 35 ++++++++- .../types/helpers/PresetHelper.d.ts | 8 ++ .../models/eft/common/tables/IBotType.d.ts | 3 + .../models/eft/common/tables/IQuest.d.ts | 1 + .../eft/dialog/IAcceptFriendRequestData.d.ts | 6 +- .../dialog/IFriendRequestSendResponse.d.ts | 2 +- .../eft/profile/IGetOtherProfileResponse.d.ts | 2 +- .../eft/profile/ISearchFriendResponse.d.ts | 2 + .../types/models/enums/AmmoTypes.d.ts | 4 + .../types/models/enums/WeaponTypes.d.ts | 37 +++++++-- .../types/models/spt/bots/IBotLootCache.d.ts | 8 +- .../types/models/spt/config/IBotConfig.d.ts | 5 +- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../models/spt/config/IHideoutConfig.d.ts | 4 + .../types/models/spt/config/IHttpConfig.d.ts | 6 +- .../models/spt/config/IInRaidConfig.d.ts | 1 - .../models/spt/config/ILocationConfig.d.ts | 4 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 + .../spt/dialog/ISendMessageDetails.d.ts | 10 ++- .../spt/fence/ICreateFenceAssortsResult.d.ts | 7 ++ .../types/servers/HttpServer.d.ts | 8 ++ .../types/services/BotLootCacheService.d.ts | 3 + .../types/services/FenceService.d.ts | 76 +++++++++++++++---- .../types/services/ItemBaseClassService.d.ts | 10 ++- .../types/services/MailSendService.d.ts | 6 +- .../types/services/PaymentService.d.ts | 2 +- .../services/ProfileActivityService.d.ts | 21 +++++ .../types/services/ProfileFixerService.d.ts | 25 +++++- .../types/services/RagfairPriceService.d.ts | 11 ++- .../types/utils/App.d.ts | 4 +- .../types/utils/CompareUtil.d.ts | 11 +++ .../types/utils/RagfairOfferHolder.d.ts | 5 +- .../utils/logging/AbstractWinstonLogger.d.ts | 1 + TypeScript/7OnLoadHook/README.md | 2 +- .../types/callbacks/BotCallbacks.d.ts | 6 ++ .../types/callbacks/DialogueCallbacks.d.ts | 10 ++- .../types/callbacks/InraidCallbacks.d.ts | 5 -- .../types/controllers/BotController.d.ts | 6 +- .../types/controllers/BuildController.d.ts | 2 +- .../types/controllers/GameController.d.ts | 6 +- .../types/controllers/HideoutController.d.ts | 4 +- .../controllers/InsuranceController.d.ts | 8 +- .../types/controllers/LauncherController.d.ts | 5 ++ .../types/controllers/MatchController.d.ts | 3 +- .../generators/BotEquipmentModGenerator.d.ts | 12 +-- .../types/generators/BotGenerator.d.ts | 3 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../generators/FenceBaseAssortGenerator.d.ts | 18 ++++- .../types/generators/LootGenerator.d.ts | 18 ++--- .../RepeatableQuestRewardGenerator.d.ts | 2 +- .../types/helpers/BotGeneratorHelper.d.ts | 2 +- .../Dialogue/AbstractDialogueChatBot.d.ts | 20 +++++ .../Dialogue/Commando/IChatCommand.d.ts | 12 +++ .../Dialogue/Commando/ICommandoCommand.d.ts | 8 -- .../Commando/SptCommandoCommands.d.ts | 4 +- .../GiveCommand/GiveSptCommand.d.ts | 39 ++++++++++ .../SptCommands/GiveCommand/SavedCommand.d.ts | 6 ++ .../Commando/SptCommands/GiveSptCommand.d.ts | 21 ----- .../ProfileCommand/ProfileSptCommand.d.ts | 38 ++++++++++ .../TraderCommand/TraderSptCommand.d.ts | 33 ++++++++ .../Dialogue/CommandoDialogueChatBot.d.ts | 15 ++-- .../types/helpers/HideoutHelper.d.ts | 2 +- .../types/helpers/HttpServerHelper.d.ts | 2 +- .../7OnLoadHook/types/helpers/ItemHelper.d.ts | 35 ++++++++- .../types/helpers/PresetHelper.d.ts | 8 ++ .../models/eft/common/tables/IBotType.d.ts | 3 + .../models/eft/common/tables/IQuest.d.ts | 1 + .../eft/dialog/IAcceptFriendRequestData.d.ts | 6 +- .../dialog/IFriendRequestSendResponse.d.ts | 2 +- .../eft/profile/IGetOtherProfileResponse.d.ts | 2 +- .../eft/profile/ISearchFriendResponse.d.ts | 2 + .../types/models/enums/AmmoTypes.d.ts | 4 + .../types/models/enums/WeaponTypes.d.ts | 37 +++++++-- .../types/models/spt/bots/IBotLootCache.d.ts | 8 +- .../types/models/spt/config/IBotConfig.d.ts | 5 +- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../models/spt/config/IHideoutConfig.d.ts | 4 + .../types/models/spt/config/IHttpConfig.d.ts | 6 +- .../models/spt/config/IInRaidConfig.d.ts | 1 - .../models/spt/config/ILocationConfig.d.ts | 4 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 + .../spt/dialog/ISendMessageDetails.d.ts | 10 ++- .../spt/fence/ICreateFenceAssortsResult.d.ts | 7 ++ .../7OnLoadHook/types/servers/HttpServer.d.ts | 8 ++ .../types/services/BotLootCacheService.d.ts | 3 + .../types/services/FenceService.d.ts | 76 +++++++++++++++---- .../types/services/ItemBaseClassService.d.ts | 10 ++- .../types/services/MailSendService.d.ts | 6 +- .../types/services/PaymentService.d.ts | 2 +- .../services/ProfileActivityService.d.ts | 21 +++++ .../types/services/ProfileFixerService.d.ts | 25 +++++- .../types/services/RagfairPriceService.d.ts | 11 ++- TypeScript/7OnLoadHook/types/utils/App.d.ts | 4 +- .../7OnLoadHook/types/utils/CompareUtil.d.ts | 11 +++ .../types/utils/RagfairOfferHolder.d.ts | 5 +- .../utils/logging/AbstractWinstonLogger.d.ts | 1 + TypeScript/8OnUpdateHook/README.md | 2 +- .../types/callbacks/BotCallbacks.d.ts | 6 ++ .../types/callbacks/DialogueCallbacks.d.ts | 10 ++- .../types/callbacks/InraidCallbacks.d.ts | 5 -- .../types/controllers/BotController.d.ts | 6 +- .../types/controllers/BuildController.d.ts | 2 +- .../types/controllers/GameController.d.ts | 6 +- .../types/controllers/HideoutController.d.ts | 4 +- .../controllers/InsuranceController.d.ts | 8 +- .../types/controllers/LauncherController.d.ts | 5 ++ .../types/controllers/MatchController.d.ts | 3 +- .../generators/BotEquipmentModGenerator.d.ts | 12 +-- .../types/generators/BotGenerator.d.ts | 3 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../generators/FenceBaseAssortGenerator.d.ts | 18 ++++- .../types/generators/LootGenerator.d.ts | 18 ++--- .../RepeatableQuestRewardGenerator.d.ts | 2 +- .../types/helpers/BotGeneratorHelper.d.ts | 2 +- .../Dialogue/AbstractDialogueChatBot.d.ts | 20 +++++ .../Dialogue/Commando/IChatCommand.d.ts | 12 +++ .../Dialogue/Commando/ICommandoCommand.d.ts | 8 -- .../Commando/SptCommandoCommands.d.ts | 4 +- .../GiveCommand/GiveSptCommand.d.ts | 39 ++++++++++ .../SptCommands/GiveCommand/SavedCommand.d.ts | 6 ++ .../Commando/SptCommands/GiveSptCommand.d.ts | 21 ----- .../ProfileCommand/ProfileSptCommand.d.ts | 38 ++++++++++ .../TraderCommand/TraderSptCommand.d.ts | 33 ++++++++ .../Dialogue/CommandoDialogueChatBot.d.ts | 15 ++-- .../types/helpers/HideoutHelper.d.ts | 2 +- .../types/helpers/HttpServerHelper.d.ts | 2 +- .../types/helpers/ItemHelper.d.ts | 35 ++++++++- .../types/helpers/PresetHelper.d.ts | 8 ++ .../models/eft/common/tables/IBotType.d.ts | 3 + .../models/eft/common/tables/IQuest.d.ts | 1 + .../eft/dialog/IAcceptFriendRequestData.d.ts | 6 +- .../dialog/IFriendRequestSendResponse.d.ts | 2 +- .../eft/profile/IGetOtherProfileResponse.d.ts | 2 +- .../eft/profile/ISearchFriendResponse.d.ts | 2 + .../types/models/enums/AmmoTypes.d.ts | 4 + .../types/models/enums/WeaponTypes.d.ts | 37 +++++++-- .../types/models/spt/bots/IBotLootCache.d.ts | 8 +- .../types/models/spt/config/IBotConfig.d.ts | 5 +- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../models/spt/config/IHideoutConfig.d.ts | 4 + .../types/models/spt/config/IHttpConfig.d.ts | 6 +- .../models/spt/config/IInRaidConfig.d.ts | 1 - .../models/spt/config/ILocationConfig.d.ts | 4 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 + .../spt/dialog/ISendMessageDetails.d.ts | 10 ++- .../spt/fence/ICreateFenceAssortsResult.d.ts | 7 ++ .../types/servers/HttpServer.d.ts | 8 ++ .../types/services/BotLootCacheService.d.ts | 3 + .../types/services/FenceService.d.ts | 76 +++++++++++++++---- .../types/services/ItemBaseClassService.d.ts | 10 ++- .../types/services/MailSendService.d.ts | 6 +- .../types/services/PaymentService.d.ts | 2 +- .../services/ProfileActivityService.d.ts | 21 +++++ .../types/services/ProfileFixerService.d.ts | 25 +++++- .../types/services/RagfairPriceService.d.ts | 11 ++- TypeScript/8OnUpdateHook/types/utils/App.d.ts | 4 +- .../types/utils/CompareUtil.d.ts | 11 +++ .../types/utils/RagfairOfferHolder.d.ts | 5 +- .../utils/logging/AbstractWinstonLogger.d.ts | 1 + TypeScript/9RouterHooks/README.md | 2 +- .../types/callbacks/BotCallbacks.d.ts | 6 ++ .../types/callbacks/DialogueCallbacks.d.ts | 10 ++- .../types/callbacks/InraidCallbacks.d.ts | 5 -- .../types/controllers/BotController.d.ts | 6 +- .../types/controllers/BuildController.d.ts | 2 +- .../types/controllers/GameController.d.ts | 6 +- .../types/controllers/HideoutController.d.ts | 4 +- .../controllers/InsuranceController.d.ts | 8 +- .../types/controllers/LauncherController.d.ts | 5 ++ .../types/controllers/MatchController.d.ts | 3 +- .../generators/BotEquipmentModGenerator.d.ts | 12 +-- .../types/generators/BotGenerator.d.ts | 3 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../generators/FenceBaseAssortGenerator.d.ts | 18 ++++- .../types/generators/LootGenerator.d.ts | 18 ++--- .../RepeatableQuestRewardGenerator.d.ts | 2 +- .../types/helpers/BotGeneratorHelper.d.ts | 2 +- .../Dialogue/AbstractDialogueChatBot.d.ts | 20 +++++ .../Dialogue/Commando/IChatCommand.d.ts | 12 +++ .../Dialogue/Commando/ICommandoCommand.d.ts | 8 -- .../Commando/SptCommandoCommands.d.ts | 4 +- .../GiveCommand/GiveSptCommand.d.ts | 39 ++++++++++ .../SptCommands/GiveCommand/SavedCommand.d.ts | 6 ++ .../Commando/SptCommands/GiveSptCommand.d.ts | 21 ----- .../ProfileCommand/ProfileSptCommand.d.ts | 38 ++++++++++ .../TraderCommand/TraderSptCommand.d.ts | 33 ++++++++ .../Dialogue/CommandoDialogueChatBot.d.ts | 15 ++-- .../types/helpers/HideoutHelper.d.ts | 2 +- .../types/helpers/HttpServerHelper.d.ts | 2 +- .../types/helpers/ItemHelper.d.ts | 35 ++++++++- .../types/helpers/PresetHelper.d.ts | 8 ++ .../models/eft/common/tables/IBotType.d.ts | 3 + .../models/eft/common/tables/IQuest.d.ts | 1 + .../eft/dialog/IAcceptFriendRequestData.d.ts | 6 +- .../dialog/IFriendRequestSendResponse.d.ts | 2 +- .../eft/profile/IGetOtherProfileResponse.d.ts | 2 +- .../eft/profile/ISearchFriendResponse.d.ts | 2 + .../types/models/enums/AmmoTypes.d.ts | 4 + .../types/models/enums/WeaponTypes.d.ts | 37 +++++++-- .../types/models/spt/bots/IBotLootCache.d.ts | 8 +- .../types/models/spt/config/IBotConfig.d.ts | 5 +- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../models/spt/config/IHideoutConfig.d.ts | 4 + .../types/models/spt/config/IHttpConfig.d.ts | 6 +- .../models/spt/config/IInRaidConfig.d.ts | 1 - .../models/spt/config/ILocationConfig.d.ts | 4 +- .../types/models/spt/config/IPmcConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 + .../spt/dialog/ISendMessageDetails.d.ts | 10 ++- .../spt/fence/ICreateFenceAssortsResult.d.ts | 7 ++ .../types/servers/HttpServer.d.ts | 8 ++ .../types/services/BotLootCacheService.d.ts | 3 + .../types/services/FenceService.d.ts | 76 +++++++++++++++---- .../types/services/ItemBaseClassService.d.ts | 10 ++- .../types/services/MailSendService.d.ts | 6 +- .../types/services/PaymentService.d.ts | 2 +- .../services/ProfileActivityService.d.ts | 21 +++++ .../types/services/ProfileFixerService.d.ts | 25 +++++- .../types/services/RagfairPriceService.d.ts | 11 ++- TypeScript/9RouterHooks/types/utils/App.d.ts | 4 +- .../9RouterHooks/types/utils/CompareUtil.d.ts | 11 +++ .../types/utils/RagfairOfferHolder.d.ts | 5 +- .../utils/logging/AbstractWinstonLogger.d.ts | 1 + 1531 files changed, 12367 insertions(+), 3030 deletions(-) create mode 100644 TypeScript/10ScopesAndTypes/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts rename TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/{ICommandoCommand.d.ts => IChatCommand.d.ts} (71%) create mode 100644 TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts create mode 100644 TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts create mode 100644 TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts rename TypeScript/{12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts => 10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts} (61%) create mode 100644 TypeScript/10ScopesAndTypes/types/models/spt/fence/ICreateFenceAssortsResult.d.ts create mode 100644 TypeScript/10ScopesAndTypes/types/services/ProfileActivityService.d.ts create mode 100644 TypeScript/10ScopesAndTypes/types/utils/CompareUtil.d.ts create mode 100644 TypeScript/11BundleLoadingSample/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts rename TypeScript/{12ClassExtensionOverride/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts => 11BundleLoadingSample/types/helpers/Dialogue/Commando/IChatCommand.d.ts} (71%) create mode 100644 TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts create mode 100644 TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts create mode 100644 TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts rename TypeScript/{10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts => 11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts} (61%) create mode 100644 TypeScript/11BundleLoadingSample/types/models/spt/fence/ICreateFenceAssortsResult.d.ts create mode 100644 TypeScript/11BundleLoadingSample/types/services/ProfileActivityService.d.ts create mode 100644 TypeScript/11BundleLoadingSample/types/utils/CompareUtil.d.ts create mode 100644 TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts rename TypeScript/{11BundleLoadingSample/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts => 12ClassExtensionOverride/types/helpers/Dialogue/Commando/IChatCommand.d.ts} (71%) create mode 100644 TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts create mode 100644 TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts create mode 100644 TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts rename TypeScript/{13AddTrader/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts => 12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts} (61%) create mode 100644 TypeScript/12ClassExtensionOverride/types/models/spt/fence/ICreateFenceAssortsResult.d.ts create mode 100644 TypeScript/12ClassExtensionOverride/types/services/ProfileActivityService.d.ts create mode 100644 TypeScript/12ClassExtensionOverride/types/utils/CompareUtil.d.ts create mode 100644 TypeScript/13AddTrader/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts rename TypeScript/13AddTrader/types/helpers/Dialogue/Commando/{ICommandoCommand.d.ts => IChatCommand.d.ts} (71%) create mode 100644 TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts create mode 100644 TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts create mode 100644 TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts rename TypeScript/{11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts => 13AddTrader/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts} (61%) create mode 100644 TypeScript/13AddTrader/types/models/spt/fence/ICreateFenceAssortsResult.d.ts create mode 100644 TypeScript/13AddTrader/types/services/ProfileActivityService.d.ts create mode 100644 TypeScript/13AddTrader/types/utils/CompareUtil.d.ts create mode 100644 TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts create mode 100644 TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/IChatCommand.d.ts delete mode 100644 TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts create mode 100644 TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts create mode 100644 TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts delete mode 100644 TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts create mode 100644 TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts create mode 100644 TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts create mode 100644 TypeScript/14AfterDBLoadHook/types/models/spt/fence/ICreateFenceAssortsResult.d.ts create mode 100644 TypeScript/14AfterDBLoadHook/types/services/ProfileActivityService.d.ts create mode 100644 TypeScript/14AfterDBLoadHook/types/utils/CompareUtil.d.ts create mode 100644 TypeScript/15HttpListenerExample/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts create mode 100644 TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/IChatCommand.d.ts delete mode 100644 TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts create mode 100644 TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts create mode 100644 TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts delete mode 100644 TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts create mode 100644 TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts create mode 100644 TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts create mode 100644 TypeScript/15HttpListenerExample/types/models/spt/fence/ICreateFenceAssortsResult.d.ts create mode 100644 TypeScript/15HttpListenerExample/types/services/ProfileActivityService.d.ts create mode 100644 TypeScript/15HttpListenerExample/types/utils/CompareUtil.d.ts create mode 100644 TypeScript/16ImporterUtil/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts create mode 100644 TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/IChatCommand.d.ts delete mode 100644 TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts create mode 100644 TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts create mode 100644 TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts delete mode 100644 TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts create mode 100644 TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts create mode 100644 TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts create mode 100644 TypeScript/16ImporterUtil/types/models/spt/fence/ICreateFenceAssortsResult.d.ts create mode 100644 TypeScript/16ImporterUtil/types/services/ProfileActivityService.d.ts create mode 100644 TypeScript/16ImporterUtil/types/utils/CompareUtil.d.ts create mode 100644 TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts create mode 100644 TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/IChatCommand.d.ts delete mode 100644 TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts create mode 100644 TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts create mode 100644 TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts delete mode 100644 TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts create mode 100644 TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts create mode 100644 TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts create mode 100644 TypeScript/17AsyncImporterWithDependency1/types/models/spt/fence/ICreateFenceAssortsResult.d.ts create mode 100644 TypeScript/17AsyncImporterWithDependency1/types/services/ProfileActivityService.d.ts create mode 100644 TypeScript/17AsyncImporterWithDependency1/types/utils/CompareUtil.d.ts create mode 100644 TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts create mode 100644 TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/IChatCommand.d.ts delete mode 100644 TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts create mode 100644 TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts create mode 100644 TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts delete mode 100644 TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts create mode 100644 TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts create mode 100644 TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts create mode 100644 TypeScript/17AsyncImporterWithDependency2/types/models/spt/fence/ICreateFenceAssortsResult.d.ts create mode 100644 TypeScript/17AsyncImporterWithDependency2/types/services/ProfileActivityService.d.ts create mode 100644 TypeScript/17AsyncImporterWithDependency2/types/utils/CompareUtil.d.ts create mode 100644 TypeScript/18CustomItemService/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts create mode 100644 TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/IChatCommand.d.ts delete mode 100644 TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts create mode 100644 TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts create mode 100644 TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts delete mode 100644 TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts create mode 100644 TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts create mode 100644 TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts create mode 100644 TypeScript/18CustomItemService/types/models/spt/fence/ICreateFenceAssortsResult.d.ts create mode 100644 TypeScript/18CustomItemService/types/services/ProfileActivityService.d.ts create mode 100644 TypeScript/18CustomItemService/types/utils/CompareUtil.d.ts create mode 100644 TypeScript/19UseExternalLibraries/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts create mode 100644 TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/IChatCommand.d.ts delete mode 100644 TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts create mode 100644 TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts create mode 100644 TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts delete mode 100644 TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts create mode 100644 TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts create mode 100644 TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts create mode 100644 TypeScript/19UseExternalLibraries/types/models/spt/fence/ICreateFenceAssortsResult.d.ts create mode 100644 TypeScript/19UseExternalLibraries/types/services/ProfileActivityService.d.ts create mode 100644 TypeScript/19UseExternalLibraries/types/utils/CompareUtil.d.ts create mode 100644 TypeScript/1LogToConsole/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts create mode 100644 TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/IChatCommand.d.ts delete mode 100644 TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts create mode 100644 TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts create mode 100644 TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts delete mode 100644 TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts create mode 100644 TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts create mode 100644 TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts create mode 100644 TypeScript/1LogToConsole/types/models/spt/fence/ICreateFenceAssortsResult.d.ts create mode 100644 TypeScript/1LogToConsole/types/services/ProfileActivityService.d.ts create mode 100644 TypeScript/1LogToConsole/types/utils/CompareUtil.d.ts create mode 100644 TypeScript/20CustomChatBot/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts create mode 100644 TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/IChatCommand.d.ts delete mode 100644 TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts create mode 100644 TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts create mode 100644 TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts delete mode 100644 TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts create mode 100644 TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts create mode 100644 TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts create mode 100644 TypeScript/20CustomChatBot/types/models/spt/fence/ICreateFenceAssortsResult.d.ts create mode 100644 TypeScript/20CustomChatBot/types/services/ProfileActivityService.d.ts create mode 100644 TypeScript/20CustomChatBot/types/utils/CompareUtil.d.ts create mode 100644 TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts create mode 100644 TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/IChatCommand.d.ts delete mode 100644 TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts create mode 100644 TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts create mode 100644 TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts delete mode 100644 TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts create mode 100644 TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts create mode 100644 TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts create mode 100644 TypeScript/21CustomCommandoCommand/types/models/spt/fence/ICreateFenceAssortsResult.d.ts create mode 100644 TypeScript/21CustomCommandoCommand/types/services/ProfileActivityService.d.ts create mode 100644 TypeScript/21CustomCommandoCommand/types/utils/CompareUtil.d.ts create mode 100644 TypeScript/22CustomAkiCommand/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts create mode 100644 TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/IChatCommand.d.ts delete mode 100644 TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts create mode 100644 TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts create mode 100644 TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts delete mode 100644 TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts create mode 100644 TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts create mode 100644 TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts create mode 100644 TypeScript/22CustomAkiCommand/types/models/spt/fence/ICreateFenceAssortsResult.d.ts create mode 100644 TypeScript/22CustomAkiCommand/types/services/ProfileActivityService.d.ts create mode 100644 TypeScript/22CustomAkiCommand/types/utils/CompareUtil.d.ts create mode 100644 TypeScript/2EditDatabase/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts create mode 100644 TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/IChatCommand.d.ts delete mode 100644 TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts create mode 100644 TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts create mode 100644 TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts delete mode 100644 TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts create mode 100644 TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts create mode 100644 TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts create mode 100644 TypeScript/2EditDatabase/types/models/spt/fence/ICreateFenceAssortsResult.d.ts create mode 100644 TypeScript/2EditDatabase/types/services/ProfileActivityService.d.ts create mode 100644 TypeScript/2EditDatabase/types/utils/CompareUtil.d.ts create mode 100644 TypeScript/3GetSptConfigFile/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts create mode 100644 TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/IChatCommand.d.ts delete mode 100644 TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts create mode 100644 TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts create mode 100644 TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts delete mode 100644 TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts create mode 100644 TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts create mode 100644 TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts create mode 100644 TypeScript/3GetSptConfigFile/types/models/spt/fence/ICreateFenceAssortsResult.d.ts create mode 100644 TypeScript/3GetSptConfigFile/types/services/ProfileActivityService.d.ts create mode 100644 TypeScript/3GetSptConfigFile/types/utils/CompareUtil.d.ts create mode 100644 TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts create mode 100644 TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/IChatCommand.d.ts delete mode 100644 TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts create mode 100644 TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts create mode 100644 TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts delete mode 100644 TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts create mode 100644 TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts create mode 100644 TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts create mode 100644 TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/fence/ICreateFenceAssortsResult.d.ts create mode 100644 TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ProfileActivityService.d.ts create mode 100644 TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/CompareUtil.d.ts create mode 100644 TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts create mode 100644 TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/IChatCommand.d.ts delete mode 100644 TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts create mode 100644 TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts create mode 100644 TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts delete mode 100644 TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts create mode 100644 TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts create mode 100644 TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts create mode 100644 TypeScript/4UseACustomConfigFile/types/models/spt/fence/ICreateFenceAssortsResult.d.ts create mode 100644 TypeScript/4UseACustomConfigFile/types/services/ProfileActivityService.d.ts create mode 100644 TypeScript/4UseACustomConfigFile/types/utils/CompareUtil.d.ts create mode 100644 TypeScript/5ReplaceMethod/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts create mode 100644 TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/IChatCommand.d.ts delete mode 100644 TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts create mode 100644 TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts create mode 100644 TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts delete mode 100644 TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts create mode 100644 TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts create mode 100644 TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts create mode 100644 TypeScript/5ReplaceMethod/types/models/spt/fence/ICreateFenceAssortsResult.d.ts create mode 100644 TypeScript/5ReplaceMethod/types/services/ProfileActivityService.d.ts create mode 100644 TypeScript/5ReplaceMethod/types/utils/CompareUtil.d.ts create mode 100644 TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts create mode 100644 TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/IChatCommand.d.ts delete mode 100644 TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts create mode 100644 TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts create mode 100644 TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts delete mode 100644 TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts create mode 100644 TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts create mode 100644 TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts create mode 100644 TypeScript/6ReferenceAnotherClass/types/models/spt/fence/ICreateFenceAssortsResult.d.ts create mode 100644 TypeScript/6ReferenceAnotherClass/types/services/ProfileActivityService.d.ts create mode 100644 TypeScript/6ReferenceAnotherClass/types/utils/CompareUtil.d.ts create mode 100644 TypeScript/7OnLoadHook/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts create mode 100644 TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/IChatCommand.d.ts delete mode 100644 TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts create mode 100644 TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts create mode 100644 TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts delete mode 100644 TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts create mode 100644 TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts create mode 100644 TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts create mode 100644 TypeScript/7OnLoadHook/types/models/spt/fence/ICreateFenceAssortsResult.d.ts create mode 100644 TypeScript/7OnLoadHook/types/services/ProfileActivityService.d.ts create mode 100644 TypeScript/7OnLoadHook/types/utils/CompareUtil.d.ts create mode 100644 TypeScript/8OnUpdateHook/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts create mode 100644 TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/IChatCommand.d.ts delete mode 100644 TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts create mode 100644 TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts create mode 100644 TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts delete mode 100644 TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts create mode 100644 TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts create mode 100644 TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts create mode 100644 TypeScript/8OnUpdateHook/types/models/spt/fence/ICreateFenceAssortsResult.d.ts create mode 100644 TypeScript/8OnUpdateHook/types/services/ProfileActivityService.d.ts create mode 100644 TypeScript/8OnUpdateHook/types/utils/CompareUtil.d.ts create mode 100644 TypeScript/9RouterHooks/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts create mode 100644 TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/IChatCommand.d.ts delete mode 100644 TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts create mode 100644 TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts create mode 100644 TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts delete mode 100644 TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts create mode 100644 TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts create mode 100644 TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts create mode 100644 TypeScript/9RouterHooks/types/models/spt/fence/ICreateFenceAssortsResult.d.ts create mode 100644 TypeScript/9RouterHooks/types/services/ProfileActivityService.d.ts create mode 100644 TypeScript/9RouterHooks/types/utils/CompareUtil.d.ts diff --git a/README.md b/README.md index 5143b86..0e2ce0e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Mod examples for v3.8.0 +# Mod examples for v3.8.1 A collection of example mods that perform typical actions in SPT diff --git a/TypeScript/10ScopesAndTypes/README.md b/TypeScript/10ScopesAndTypes/README.md index 48c742b..e760f8b 100644 --- a/TypeScript/10ScopesAndTypes/README.md +++ b/TypeScript/10ScopesAndTypes/README.md @@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an ## **NodeJS Setup** -Before you begin, ensure to install NodeJS version `v18.15.0`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). +Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). After installation, it's advised to reboot your system. diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/BotCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/DialogueCallbacks.d.ts index 7ed60b9..2de57cb 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/DialogueCallbacks.d.ts @@ -1,7 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; -import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; +import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest"; @@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/friend/request/send */ sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/accept-all + */ + acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; /** * Handle client/friend/request/accept */ acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/decline + */ + declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/friend/request/cancel */ diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/InraidCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts index d148abc..556cc5d 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts @@ -51,12 +51,14 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * 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 ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string): Difficulty; + getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/10ScopesAndTypes/types/controllers/BuildController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/BuildController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, 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); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/10ScopesAndTypes/types/controllers/LauncherController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/LauncherController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/10ScopesAndTypes/types/controllers/MatchController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/MatchController.d.ts index 6b1a7c3..708cee2 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/MatchController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/MatchController.d.ts @@ -75,10 +75,11 @@ export declare class MatchController { 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(pmcData: IPmcData, extractName: string): void; + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; /** * Was extract by car * @param extractName name of extract diff --git a/TypeScript/10ScopesAndTypes/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/BotEquipmentModGenerator.d.ts index dd1dcce..f850eea 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/BotEquipmentModGenerator.d.ts @@ -187,12 +187,12 @@ export declare class BotEquipmentModGenerator { */ protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param slotAddedToTemplate slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate template of the mods being added - * @param botRole + * Check if mod exists in db + is for a required slot + * @param modToAdd Db template of mod to check + * @param slotAddedToTemplate Slot object the item will be placed as child into + * @param modSlot Slot the mod will fill + * @param parentTemplate Db template of the mods being added + * @param botRole Bots wildspawntype (assault/pmcBot etc) * @returns true if valid */ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; diff --git a/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: 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/TypeScript/10ScopesAndTypes/types/generators/BotLootGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/BotLootGenerator.d.ts index 014617e..ca5d1bd 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/BotLootGenerator.d.ts @@ -82,7 +82,7 @@ export declare class BotLootGenerator { * @param totalValueLimitRub Total value of loot allowed in roubles * @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): void; + 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[][]; /** * Some items need child items to function, add them to the itemToAddChildrenTo array @@ -101,7 +101,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): void; + protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, 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 diff --git a/TypeScript/10ScopesAndTypes/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..5ca8ed7 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/FenceBaseAssortGenerator.d.ts @@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { FenceService } from "@spt-aki/services/FenceService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -22,14 +23,25 @@ export declare class FenceBaseAssortGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; + protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; - protected getItemPrice(itemTpl: string, items: Item[]): number; - protected getAmmoBoxPrice(items: Item[]): number; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * Get the penetration power value of an ammo, works with ammo boxes and raw ammos + * @param rootItemDb Ammo box or ammo item from items.db + * @returns Penetration power of passed in item, null if it doesnt have a power + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/10ScopesAndTypes/types/generators/LootGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/LootGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/10ScopesAndTypes/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/10ScopesAndTypes/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/BotGeneratorHelper.d.ts index 7f7555b..c756725 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/BotGeneratorHelper.d.ts @@ -92,7 +92,7 @@ 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): ItemAddedResult; + addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set): ItemAddedResult; /** * Is the provided item allowed inside a container * @param slotGrid Items sub-grid we want to place item inside diff --git a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/IChatCommand.d.ts similarity index 71% rename from TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts rename to TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/IChatCommand.d.ts index cca1fb3..ade0adc 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -1,6 +1,10 @@ import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { getCommandPrefix(): string; getCommandHelp(command: string): string; getCommands(): Set; diff --git a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts new file mode 100644 index 0000000..26958ca --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -0,0 +1,39 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected itemFilterService: ItemFilterService; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en espaƱol" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: Map; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts new file mode 100644 index 0000000..8ec2ada --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts @@ -0,0 +1,38 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class ProfileSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected profileHelper: ProfileHelper; + /** + * Regex to account for all these cases: + * spt profile level 20 + * spt profile skill metabolism 10 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent; + protected handleLevelCommand(level: number): IProfileChangeEvent; +} diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts similarity index 61% rename from TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts rename to TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 33d05de..d84158a 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -1,20 +1,32 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -export declare class GiveSptCommand implements ISptCommand { +export declare class TraderSptCommand implements ISptCommand { protected logger: ILogger; protected itemHelper: ItemHelper; protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt trader prapor rep 100 + * spt trader mechanic spend 1000000 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/10ScopesAndTypes/types/helpers/HttpServerHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts index 3e91ef7..9195579 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; +import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { CompareUtil } from "@spt-aki/utils/CompareUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; @@ -28,8 +29,33 @@ export declare class ItemHelper { protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; + protected compareUtil: CompareUtil; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil); + /** + * 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 + * @param item1 first item with all its children to compare + * @param item2 second item with all its children to compare + * @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; + /** + * This method will compare two items and see if the are equivalent. + * This method will NOT compare IDs on the items + * @param item1 first item to compare + * @param item2 second item to compare + * @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; + /** + * 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; /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl @@ -363,10 +389,11 @@ export declare class ItemHelper { * Chose a randomly weighted cartridge that fits * @param caliber Desired caliber * @param staticAmmoDist Cartridges and thier weights + * @param fallbackCartridgeTpl If a cartridge cannot be found in the above staticAmmoDist param, use this instead * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -401,7 +428,7 @@ export declare class ItemHelper { addChildSlotItems(itemToAdd: Item[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): Item[]; /** * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter - * @param possibleTpls Tpls to randomply choose from + * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow * @returns Chosen tpl or null */ diff --git a/TypeScript/10ScopesAndTypes/types/helpers/PresetHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/PresetHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotType.d.ts index db6e56e..2a00af9 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,9 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/dialog/IAcceptFriendRequestData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/dialog/IAcceptFriendRequestData.d.ts index 87461aa..0913eb5 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/dialog/IAcceptFriendRequestData.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/dialog/IAcceptFriendRequestData.d.ts @@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest { } export interface ICancelFriendRequestData extends IBaseFriendRequest { } -export interface IBaseFriendRequest { - request_id: string; +export interface IDeclineFriendRequestData extends IBaseFriendRequest { +} +export interface IBaseFriendRequest { + profileId: string; } diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/dialog/IFriendRequestSendResponse.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/dialog/IFriendRequestSendResponse.d.ts index 06c40f3..fc311eb 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/dialog/IFriendRequestSendResponse.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/dialog/IFriendRequestSendResponse.d.ts @@ -1,5 +1,5 @@ export interface IFriendRequestSendResponse { status: number; - requestid: string; + requestId: string; retryAfter: number; } diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 6c3c9eb..26e43ac 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -1,5 +1,5 @@ import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item } from "../common/tables/IItem"; +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; export interface IGetOtherProfileResponse { id: string; aid: number; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/profile/ISearchFriendResponse.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/profile/ISearchFriendResponse.d.ts index 96d88b2..d3cc7df 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/profile/ISearchFriendResponse.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/profile/ISearchFriendResponse.d.ts @@ -1,9 +1,11 @@ export interface ISearchFriendResponse { _id: string; + aid: number; Info: Info; } export interface Info { Nickname: string; Side: string; Level: number; + MemberCategory: number; } diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/AmmoTypes.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/WeaponTypes.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..529c2cd 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,9 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +23,8 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IPmcConfig.d.ts index 65da29b..f17d3e4 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IPmcConfig.d.ts @@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig { /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; allPMCsHavePlayerNameWithRandomPrefixChance: number; + /** Should secure container loot from usec.json/bear.json be added to pmc bots secure */ + addSecureContainerLootFromBotConfig: boolean; } export interface PmcTypes { usec: string; diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/dialog/ISendMessageDetails.d.ts index 2068ede..05b3bcd 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -30,7 +30,15 @@ export interface ISendMessageDetails { } export interface IProfileChangeEvent { _id: string; - Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + Type: ProfileChangeEventType; value: number; entity?: string; } +export declare enum ProfileChangeEventType { + TRADER_SALES_SUM = "TraderSalesSum", + TRADER_STANDING = "TraderStanding", + PROFILE_LEVEL = "ProfileLevel", + SKILL_POINTS = "SkillPoints", + EXAMINE_ALL_ITEMS = "ExamineAllItems", + UNLOCK_TRADER = "UnlockTrader" +} diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/10ScopesAndTypes/types/servers/HttpServer.d.ts b/TypeScript/10ScopesAndTypes/types/servers/HttpServer.d.ts index 8574cdd..bcd740f 100644 --- a/TypeScript/10ScopesAndTypes/types/servers/HttpServer.d.ts +++ b/TypeScript/10ScopesAndTypes/types/servers/HttpServer.d.ts @@ -19,11 +19,19 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/10ScopesAndTypes/types/services/BotLootCacheService.d.ts b/TypeScript/10ScopesAndTypes/types/services/BotLootCacheService.d.ts index b013e5e..7f79bfe 100644 --- a/TypeScript/10ScopesAndTypes/types/services/BotLootCacheService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/BotLootCacheService.d.ts @@ -69,6 +69,9 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts b/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts index bb1d035..75c4b28 100644 --- a/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,14 +38,30 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; + protected fenceItemUpdCompareProperties: Set; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with */ setFenceAssort(assort: ITraderAssort): void; + /** + * Replace discount fence assort with new assort + * @param assort New assorts to replace old with + */ + setDiscountFenceAssort(assort: ITraderAssort): void; + /** + * Get main fence assort + * @return ITraderAssort + */ + getMainFenceAssort(): ITraderAssort; + /** + * Get discount fence assort + * @return ITraderAssort + */ + getDiscountFenceAssort(): ITraderAssort; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -57,6 +74,26 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adds to fence assort a single item (with its children) + * @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; + /** + * 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; + /** + * 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; /** * Adjust all items contained inside an assort by a multiplier * @param assort (clone)Assort that contains items with prices to adjust @@ -93,17 +130,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -112,8 +155,8 @@ export declare class FenceService { protected deleteRandomAssorts(itemCountToReplace: number, assort: ITraderAssort): void; /** * Choose an item at random and remove it + mods from assorts - * @param assort Items to remove from - * @param rootItems Assort root items to pick from to remove + * @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; /** @@ -132,6 +175,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +196,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +205,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +214,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +225,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +247,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/10ScopesAndTypes/types/services/ItemBaseClassService.d.ts b/TypeScript/10ScopesAndTypes/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/10ScopesAndTypes/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/10ScopesAndTypes/types/services/MailSendService.d.ts b/TypeScript/10ScopesAndTypes/types/services/MailSendService.d.ts index 08752bf..e5643f9 100644 --- a/TypeScript/10ScopesAndTypes/types/services/MailSendService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/MailSendService.d.ts @@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { Traders } from "@spt-aki/models/enums/Traders"; -import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -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?: any): void; + sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], 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?: any[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], 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 diff --git a/TypeScript/10ScopesAndTypes/types/services/PaymentService.d.ts b/TypeScript/10ScopesAndTypes/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/10ScopesAndTypes/types/services/PaymentService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/10ScopesAndTypes/types/services/ProfileActivityService.d.ts b/TypeScript/10ScopesAndTypes/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts b/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts index 804b3bf..1045d0a 100644 --- a/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @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 @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @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 @@ -165,4 +183,9 @@ export declare class ProfileFixerService { * @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 null + */ + protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts b/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts index 5649751..0fefdd8 100644 --- a/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], 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 diff --git a/TypeScript/10ScopesAndTypes/types/utils/App.d.ts b/TypeScript/10ScopesAndTypes/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/10ScopesAndTypes/types/utils/App.d.ts +++ b/TypeScript/10ScopesAndTypes/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/10ScopesAndTypes/types/utils/CompareUtil.d.ts b/TypeScript/10ScopesAndTypes/types/utils/CompareUtil.d.ts new file mode 100644 index 0000000..a5b94d5 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/utils/CompareUtil.d.ts @@ -0,0 +1,11 @@ +export declare class CompareUtil { + private static typesToCheckAgainst; + /** + * This function does an object comparison, equivalent to applying reflections + * and scanning for all possible properties including arrays. + * @param v1 value 1 to compare + * @param v2 value 2 to compare + * @returns true if equal, false if not + */ + recursiveCompare(v1: any, v2: any): boolean; +} diff --git a/TypeScript/10ScopesAndTypes/types/utils/RagfairOfferHolder.d.ts b/TypeScript/10ScopesAndTypes/types/utils/RagfairOfferHolder.d.ts index 3942ed1..b95e54a 100644 --- a/TypeScript/10ScopesAndTypes/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/10ScopesAndTypes/types/utils/RagfairOfferHolder.d.ts @@ -1,9 +1,12 @@ +import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { + protected maxOffersPerTemplate: number; + protected ragfairServerHelper: RagfairServerHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(); + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); getOfferById(id: string): IRagfairOffer; getOffersByTemplate(templateId: string): Array; getOffersByTrader(traderId: string): Array; diff --git a/TypeScript/10ScopesAndTypes/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/10ScopesAndTypes/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/10ScopesAndTypes/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/10ScopesAndTypes/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/11BundleLoadingSample/README.md b/TypeScript/11BundleLoadingSample/README.md index 48c742b..e760f8b 100644 --- a/TypeScript/11BundleLoadingSample/README.md +++ b/TypeScript/11BundleLoadingSample/README.md @@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an ## **NodeJS Setup** -Before you begin, ensure to install NodeJS version `v18.15.0`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). +Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). After installation, it's advised to reboot your system. diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/BotCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/DialogueCallbacks.d.ts index 7ed60b9..2de57cb 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/DialogueCallbacks.d.ts @@ -1,7 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; -import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; +import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest"; @@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/friend/request/send */ sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/accept-all + */ + acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; /** * Handle client/friend/request/accept */ acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/decline + */ + declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/friend/request/cancel */ diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/InraidCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/11BundleLoadingSample/types/controllers/BotController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/BotController.d.ts index d148abc..556cc5d 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/BotController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/BotController.d.ts @@ -51,12 +51,14 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * 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 ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string): Difficulty; + getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/11BundleLoadingSample/types/controllers/BuildController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/BuildController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, 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); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/11BundleLoadingSample/types/controllers/HideoutController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/HideoutController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/11BundleLoadingSample/types/controllers/LauncherController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/LauncherController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/11BundleLoadingSample/types/controllers/MatchController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/MatchController.d.ts index 6b1a7c3..708cee2 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/MatchController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/MatchController.d.ts @@ -75,10 +75,11 @@ export declare class MatchController { 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(pmcData: IPmcData, extractName: string): void; + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; /** * Was extract by car * @param extractName name of extract diff --git a/TypeScript/11BundleLoadingSample/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/BotEquipmentModGenerator.d.ts index dd1dcce..f850eea 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/BotEquipmentModGenerator.d.ts @@ -187,12 +187,12 @@ export declare class BotEquipmentModGenerator { */ protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param slotAddedToTemplate slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate template of the mods being added - * @param botRole + * Check if mod exists in db + is for a required slot + * @param modToAdd Db template of mod to check + * @param slotAddedToTemplate Slot object the item will be placed as child into + * @param modSlot Slot the mod will fill + * @param parentTemplate Db template of the mods being added + * @param botRole Bots wildspawntype (assault/pmcBot etc) * @returns true if valid */ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; diff --git a/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: 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/TypeScript/11BundleLoadingSample/types/generators/BotLootGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/BotLootGenerator.d.ts index 014617e..ca5d1bd 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/BotLootGenerator.d.ts @@ -82,7 +82,7 @@ export declare class BotLootGenerator { * @param totalValueLimitRub Total value of loot allowed in roubles * @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): void; + 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[][]; /** * Some items need child items to function, add them to the itemToAddChildrenTo array @@ -101,7 +101,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): void; + protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, 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 diff --git a/TypeScript/11BundleLoadingSample/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..5ca8ed7 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/FenceBaseAssortGenerator.d.ts @@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { FenceService } from "@spt-aki/services/FenceService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -22,14 +23,25 @@ export declare class FenceBaseAssortGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; + protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; - protected getItemPrice(itemTpl: string, items: Item[]): number; - protected getAmmoBoxPrice(items: Item[]): number; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * Get the penetration power value of an ammo, works with ammo boxes and raw ammos + * @param rootItemDb Ammo box or ammo item from items.db + * @returns Penetration power of passed in item, null if it doesnt have a power + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/11BundleLoadingSample/types/generators/LootGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/LootGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/11BundleLoadingSample/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/11BundleLoadingSample/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/BotGeneratorHelper.d.ts index 7f7555b..c756725 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/BotGeneratorHelper.d.ts @@ -92,7 +92,7 @@ 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): ItemAddedResult; + addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set): ItemAddedResult; /** * Is the provided item allowed inside a container * @param slotGrid Items sub-grid we want to place item inside diff --git a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/IChatCommand.d.ts similarity index 71% rename from TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts rename to TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/IChatCommand.d.ts index cca1fb3..ade0adc 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -1,6 +1,10 @@ import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { getCommandPrefix(): string; getCommandHelp(command: string): string; getCommands(): Set; diff --git a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts new file mode 100644 index 0000000..26958ca --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -0,0 +1,39 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected itemFilterService: ItemFilterService; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en espaƱol" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: Map; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts new file mode 100644 index 0000000..8ec2ada --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts @@ -0,0 +1,38 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class ProfileSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected profileHelper: ProfileHelper; + /** + * Regex to account for all these cases: + * spt profile level 20 + * spt profile skill metabolism 10 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent; + protected handleLevelCommand(level: number): IProfileChangeEvent; +} diff --git a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts similarity index 61% rename from TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts rename to TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 33d05de..d84158a 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -1,20 +1,32 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -export declare class GiveSptCommand implements ISptCommand { +export declare class TraderSptCommand implements ISptCommand { protected logger: ILogger; protected itemHelper: ItemHelper; protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt trader prapor rep 100 + * spt trader mechanic spend 1000000 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/11BundleLoadingSample/types/helpers/HttpServerHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts index 3e91ef7..9195579 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; +import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { CompareUtil } from "@spt-aki/utils/CompareUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; @@ -28,8 +29,33 @@ export declare class ItemHelper { protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; + protected compareUtil: CompareUtil; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil); + /** + * 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 + * @param item1 first item with all its children to compare + * @param item2 second item with all its children to compare + * @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; + /** + * This method will compare two items and see if the are equivalent. + * This method will NOT compare IDs on the items + * @param item1 first item to compare + * @param item2 second item to compare + * @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; + /** + * 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; /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl @@ -363,10 +389,11 @@ export declare class ItemHelper { * Chose a randomly weighted cartridge that fits * @param caliber Desired caliber * @param staticAmmoDist Cartridges and thier weights + * @param fallbackCartridgeTpl If a cartridge cannot be found in the above staticAmmoDist param, use this instead * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -401,7 +428,7 @@ export declare class ItemHelper { addChildSlotItems(itemToAdd: Item[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): Item[]; /** * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter - * @param possibleTpls Tpls to randomply choose from + * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow * @returns Chosen tpl or null */ diff --git a/TypeScript/11BundleLoadingSample/types/helpers/PresetHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/PresetHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotType.d.ts index db6e56e..2a00af9 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,9 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/dialog/IAcceptFriendRequestData.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/dialog/IAcceptFriendRequestData.d.ts index 87461aa..0913eb5 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/dialog/IAcceptFriendRequestData.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/dialog/IAcceptFriendRequestData.d.ts @@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest { } export interface ICancelFriendRequestData extends IBaseFriendRequest { } -export interface IBaseFriendRequest { - request_id: string; +export interface IDeclineFriendRequestData extends IBaseFriendRequest { +} +export interface IBaseFriendRequest { + profileId: string; } diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/dialog/IFriendRequestSendResponse.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/dialog/IFriendRequestSendResponse.d.ts index 06c40f3..fc311eb 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/dialog/IFriendRequestSendResponse.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/dialog/IFriendRequestSendResponse.d.ts @@ -1,5 +1,5 @@ export interface IFriendRequestSendResponse { status: number; - requestid: string; + requestId: string; retryAfter: number; } diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 6c3c9eb..26e43ac 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -1,5 +1,5 @@ import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item } from "../common/tables/IItem"; +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; export interface IGetOtherProfileResponse { id: string; aid: number; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/profile/ISearchFriendResponse.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/profile/ISearchFriendResponse.d.ts index 96d88b2..d3cc7df 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/profile/ISearchFriendResponse.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/profile/ISearchFriendResponse.d.ts @@ -1,9 +1,11 @@ export interface ISearchFriendResponse { _id: string; + aid: number; Info: Info; } export interface Info { Nickname: string; Side: string; Level: number; + MemberCategory: number; } diff --git a/TypeScript/11BundleLoadingSample/types/models/enums/AmmoTypes.d.ts b/TypeScript/11BundleLoadingSample/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/11BundleLoadingSample/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/11BundleLoadingSample/types/models/enums/WeaponTypes.d.ts b/TypeScript/11BundleLoadingSample/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/11BundleLoadingSample/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..529c2cd 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,9 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +23,8 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IPmcConfig.d.ts index 65da29b..f17d3e4 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IPmcConfig.d.ts @@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig { /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; allPMCsHavePlayerNameWithRandomPrefixChance: number; + /** Should secure container loot from usec.json/bear.json be added to pmc bots secure */ + addSecureContainerLootFromBotConfig: boolean; } export interface PmcTypes { usec: string; diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/dialog/ISendMessageDetails.d.ts index 2068ede..05b3bcd 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -30,7 +30,15 @@ export interface ISendMessageDetails { } export interface IProfileChangeEvent { _id: string; - Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + Type: ProfileChangeEventType; value: number; entity?: string; } +export declare enum ProfileChangeEventType { + TRADER_SALES_SUM = "TraderSalesSum", + TRADER_STANDING = "TraderStanding", + PROFILE_LEVEL = "ProfileLevel", + SKILL_POINTS = "SkillPoints", + EXAMINE_ALL_ITEMS = "ExamineAllItems", + UNLOCK_TRADER = "UnlockTrader" +} diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/11BundleLoadingSample/types/servers/HttpServer.d.ts b/TypeScript/11BundleLoadingSample/types/servers/HttpServer.d.ts index 8574cdd..bcd740f 100644 --- a/TypeScript/11BundleLoadingSample/types/servers/HttpServer.d.ts +++ b/TypeScript/11BundleLoadingSample/types/servers/HttpServer.d.ts @@ -19,11 +19,19 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/11BundleLoadingSample/types/services/BotLootCacheService.d.ts b/TypeScript/11BundleLoadingSample/types/services/BotLootCacheService.d.ts index b013e5e..7f79bfe 100644 --- a/TypeScript/11BundleLoadingSample/types/services/BotLootCacheService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/BotLootCacheService.d.ts @@ -69,6 +69,9 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/11BundleLoadingSample/types/services/FenceService.d.ts b/TypeScript/11BundleLoadingSample/types/services/FenceService.d.ts index bb1d035..75c4b28 100644 --- a/TypeScript/11BundleLoadingSample/types/services/FenceService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,14 +38,30 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; + protected fenceItemUpdCompareProperties: Set; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with */ setFenceAssort(assort: ITraderAssort): void; + /** + * Replace discount fence assort with new assort + * @param assort New assorts to replace old with + */ + setDiscountFenceAssort(assort: ITraderAssort): void; + /** + * Get main fence assort + * @return ITraderAssort + */ + getMainFenceAssort(): ITraderAssort; + /** + * Get discount fence assort + * @return ITraderAssort + */ + getDiscountFenceAssort(): ITraderAssort; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -57,6 +74,26 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adds to fence assort a single item (with its children) + * @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; + /** + * 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; + /** + * 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; /** * Adjust all items contained inside an assort by a multiplier * @param assort (clone)Assort that contains items with prices to adjust @@ -93,17 +130,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -112,8 +155,8 @@ export declare class FenceService { protected deleteRandomAssorts(itemCountToReplace: number, assort: ITraderAssort): void; /** * Choose an item at random and remove it + mods from assorts - * @param assort Items to remove from - * @param rootItems Assort root items to pick from to remove + * @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; /** @@ -132,6 +175,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +196,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +205,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +214,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +225,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +247,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/11BundleLoadingSample/types/services/ItemBaseClassService.d.ts b/TypeScript/11BundleLoadingSample/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/11BundleLoadingSample/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/11BundleLoadingSample/types/services/MailSendService.d.ts b/TypeScript/11BundleLoadingSample/types/services/MailSendService.d.ts index 08752bf..e5643f9 100644 --- a/TypeScript/11BundleLoadingSample/types/services/MailSendService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/MailSendService.d.ts @@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { Traders } from "@spt-aki/models/enums/Traders"; -import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -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?: any): void; + sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], 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?: any[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], 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 diff --git a/TypeScript/11BundleLoadingSample/types/services/PaymentService.d.ts b/TypeScript/11BundleLoadingSample/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/11BundleLoadingSample/types/services/PaymentService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/11BundleLoadingSample/types/services/ProfileActivityService.d.ts b/TypeScript/11BundleLoadingSample/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/11BundleLoadingSample/types/services/ProfileFixerService.d.ts b/TypeScript/11BundleLoadingSample/types/services/ProfileFixerService.d.ts index 804b3bf..1045d0a 100644 --- a/TypeScript/11BundleLoadingSample/types/services/ProfileFixerService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @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 @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @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 @@ -165,4 +183,9 @@ export declare class ProfileFixerService { * @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 null + */ + protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/11BundleLoadingSample/types/services/RagfairPriceService.d.ts b/TypeScript/11BundleLoadingSample/types/services/RagfairPriceService.d.ts index 5649751..0fefdd8 100644 --- a/TypeScript/11BundleLoadingSample/types/services/RagfairPriceService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], 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 diff --git a/TypeScript/11BundleLoadingSample/types/utils/App.d.ts b/TypeScript/11BundleLoadingSample/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/11BundleLoadingSample/types/utils/App.d.ts +++ b/TypeScript/11BundleLoadingSample/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/11BundleLoadingSample/types/utils/CompareUtil.d.ts b/TypeScript/11BundleLoadingSample/types/utils/CompareUtil.d.ts new file mode 100644 index 0000000..a5b94d5 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/utils/CompareUtil.d.ts @@ -0,0 +1,11 @@ +export declare class CompareUtil { + private static typesToCheckAgainst; + /** + * This function does an object comparison, equivalent to applying reflections + * and scanning for all possible properties including arrays. + * @param v1 value 1 to compare + * @param v2 value 2 to compare + * @returns true if equal, false if not + */ + recursiveCompare(v1: any, v2: any): boolean; +} diff --git a/TypeScript/11BundleLoadingSample/types/utils/RagfairOfferHolder.d.ts b/TypeScript/11BundleLoadingSample/types/utils/RagfairOfferHolder.d.ts index 3942ed1..b95e54a 100644 --- a/TypeScript/11BundleLoadingSample/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/11BundleLoadingSample/types/utils/RagfairOfferHolder.d.ts @@ -1,9 +1,12 @@ +import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { + protected maxOffersPerTemplate: number; + protected ragfairServerHelper: RagfairServerHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(); + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); getOfferById(id: string): IRagfairOffer; getOffersByTemplate(templateId: string): Array; getOffersByTrader(traderId: string): Array; diff --git a/TypeScript/11BundleLoadingSample/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/11BundleLoadingSample/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/11BundleLoadingSample/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/11BundleLoadingSample/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/12ClassExtensionOverride/README.md b/TypeScript/12ClassExtensionOverride/README.md index 48c742b..e760f8b 100644 --- a/TypeScript/12ClassExtensionOverride/README.md +++ b/TypeScript/12ClassExtensionOverride/README.md @@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an ## **NodeJS Setup** -Before you begin, ensure to install NodeJS version `v18.15.0`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). +Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). After installation, it's advised to reboot your system. diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/BotCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/DialogueCallbacks.d.ts index 7ed60b9..2de57cb 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/DialogueCallbacks.d.ts @@ -1,7 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; -import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; +import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest"; @@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/friend/request/send */ sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/accept-all + */ + acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; /** * Handle client/friend/request/accept */ acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/decline + */ + declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/friend/request/cancel */ diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/InraidCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/BotController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/BotController.d.ts index d148abc..556cc5d 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/BotController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/BotController.d.ts @@ -51,12 +51,14 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * 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 ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string): Difficulty; + getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/BuildController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/BuildController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, 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); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/HideoutController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/HideoutController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/LauncherController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/LauncherController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/MatchController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/MatchController.d.ts index 6b1a7c3..708cee2 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/MatchController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/MatchController.d.ts @@ -75,10 +75,11 @@ export declare class MatchController { 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(pmcData: IPmcData, extractName: string): void; + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; /** * Was extract by car * @param extractName name of extract diff --git a/TypeScript/12ClassExtensionOverride/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/BotEquipmentModGenerator.d.ts index dd1dcce..f850eea 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/BotEquipmentModGenerator.d.ts @@ -187,12 +187,12 @@ export declare class BotEquipmentModGenerator { */ protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param slotAddedToTemplate slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate template of the mods being added - * @param botRole + * Check if mod exists in db + is for a required slot + * @param modToAdd Db template of mod to check + * @param slotAddedToTemplate Slot object the item will be placed as child into + * @param modSlot Slot the mod will fill + * @param parentTemplate Db template of the mods being added + * @param botRole Bots wildspawntype (assault/pmcBot etc) * @returns true if valid */ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; diff --git a/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: 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/TypeScript/12ClassExtensionOverride/types/generators/BotLootGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/BotLootGenerator.d.ts index 014617e..ca5d1bd 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/BotLootGenerator.d.ts @@ -82,7 +82,7 @@ export declare class BotLootGenerator { * @param totalValueLimitRub Total value of loot allowed in roubles * @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): void; + 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[][]; /** * Some items need child items to function, add them to the itemToAddChildrenTo array @@ -101,7 +101,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): void; + protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, 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 diff --git a/TypeScript/12ClassExtensionOverride/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..5ca8ed7 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/FenceBaseAssortGenerator.d.ts @@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { FenceService } from "@spt-aki/services/FenceService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -22,14 +23,25 @@ export declare class FenceBaseAssortGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; + protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; - protected getItemPrice(itemTpl: string, items: Item[]): number; - protected getAmmoBoxPrice(items: Item[]): number; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * Get the penetration power value of an ammo, works with ammo boxes and raw ammos + * @param rootItemDb Ammo box or ammo item from items.db + * @returns Penetration power of passed in item, null if it doesnt have a power + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/12ClassExtensionOverride/types/generators/LootGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/LootGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/12ClassExtensionOverride/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/BotGeneratorHelper.d.ts index 7f7555b..c756725 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/BotGeneratorHelper.d.ts @@ -92,7 +92,7 @@ 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): ItemAddedResult; + addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set): ItemAddedResult; /** * Is the provided item allowed inside a container * @param slotGrid Items sub-grid we want to place item inside diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/IChatCommand.d.ts similarity index 71% rename from TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts rename to TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/IChatCommand.d.ts index cca1fb3..ade0adc 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -1,6 +1,10 @@ import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { getCommandPrefix(): string; getCommandHelp(command: string): string; getCommands(): Set; diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts new file mode 100644 index 0000000..26958ca --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -0,0 +1,39 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected itemFilterService: ItemFilterService; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en espaƱol" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: Map; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts new file mode 100644 index 0000000..8ec2ada --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts @@ -0,0 +1,38 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class ProfileSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected profileHelper: ProfileHelper; + /** + * Regex to account for all these cases: + * spt profile level 20 + * spt profile skill metabolism 10 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent; + protected handleLevelCommand(level: number): IProfileChangeEvent; +} diff --git a/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts similarity index 61% rename from TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts rename to TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 33d05de..d84158a 100644 --- a/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -1,20 +1,32 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -export declare class GiveSptCommand implements ISptCommand { +export declare class TraderSptCommand implements ISptCommand { protected logger: ILogger; protected itemHelper: ItemHelper; protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt trader prapor rep 100 + * spt trader mechanic spend 1000000 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/HttpServerHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts index 3e91ef7..9195579 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; +import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { CompareUtil } from "@spt-aki/utils/CompareUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; @@ -28,8 +29,33 @@ export declare class ItemHelper { protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; + protected compareUtil: CompareUtil; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil); + /** + * 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 + * @param item1 first item with all its children to compare + * @param item2 second item with all its children to compare + * @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; + /** + * This method will compare two items and see if the are equivalent. + * This method will NOT compare IDs on the items + * @param item1 first item to compare + * @param item2 second item to compare + * @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; + /** + * 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; /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl @@ -363,10 +389,11 @@ export declare class ItemHelper { * Chose a randomly weighted cartridge that fits * @param caliber Desired caliber * @param staticAmmoDist Cartridges and thier weights + * @param fallbackCartridgeTpl If a cartridge cannot be found in the above staticAmmoDist param, use this instead * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -401,7 +428,7 @@ export declare class ItemHelper { addChildSlotItems(itemToAdd: Item[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): Item[]; /** * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter - * @param possibleTpls Tpls to randomply choose from + * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow * @returns Chosen tpl or null */ diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/PresetHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/PresetHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotType.d.ts index db6e56e..2a00af9 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,9 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/dialog/IAcceptFriendRequestData.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/dialog/IAcceptFriendRequestData.d.ts index 87461aa..0913eb5 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/dialog/IAcceptFriendRequestData.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/dialog/IAcceptFriendRequestData.d.ts @@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest { } export interface ICancelFriendRequestData extends IBaseFriendRequest { } -export interface IBaseFriendRequest { - request_id: string; +export interface IDeclineFriendRequestData extends IBaseFriendRequest { +} +export interface IBaseFriendRequest { + profileId: string; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/dialog/IFriendRequestSendResponse.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/dialog/IFriendRequestSendResponse.d.ts index 06c40f3..fc311eb 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/dialog/IFriendRequestSendResponse.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/dialog/IFriendRequestSendResponse.d.ts @@ -1,5 +1,5 @@ export interface IFriendRequestSendResponse { status: number; - requestid: string; + requestId: string; retryAfter: number; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 6c3c9eb..26e43ac 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -1,5 +1,5 @@ import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item } from "../common/tables/IItem"; +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; export interface IGetOtherProfileResponse { id: string; aid: number; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/profile/ISearchFriendResponse.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/profile/ISearchFriendResponse.d.ts index 96d88b2..d3cc7df 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/profile/ISearchFriendResponse.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/profile/ISearchFriendResponse.d.ts @@ -1,9 +1,11 @@ export interface ISearchFriendResponse { _id: string; + aid: number; Info: Info; } export interface Info { Nickname: string; Side: string; Level: number; + MemberCategory: number; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/enums/AmmoTypes.d.ts b/TypeScript/12ClassExtensionOverride/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/enums/WeaponTypes.d.ts b/TypeScript/12ClassExtensionOverride/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..529c2cd 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,9 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +23,8 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IPmcConfig.d.ts index 65da29b..f17d3e4 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IPmcConfig.d.ts @@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig { /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; allPMCsHavePlayerNameWithRandomPrefixChance: number; + /** Should secure container loot from usec.json/bear.json be added to pmc bots secure */ + addSecureContainerLootFromBotConfig: boolean; } export interface PmcTypes { usec: string; diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/dialog/ISendMessageDetails.d.ts index 2068ede..05b3bcd 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -30,7 +30,15 @@ export interface ISendMessageDetails { } export interface IProfileChangeEvent { _id: string; - Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + Type: ProfileChangeEventType; value: number; entity?: string; } +export declare enum ProfileChangeEventType { + TRADER_SALES_SUM = "TraderSalesSum", + TRADER_STANDING = "TraderStanding", + PROFILE_LEVEL = "ProfileLevel", + SKILL_POINTS = "SkillPoints", + EXAMINE_ALL_ITEMS = "ExamineAllItems", + UNLOCK_TRADER = "UnlockTrader" +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/12ClassExtensionOverride/types/servers/HttpServer.d.ts b/TypeScript/12ClassExtensionOverride/types/servers/HttpServer.d.ts index 8574cdd..bcd740f 100644 --- a/TypeScript/12ClassExtensionOverride/types/servers/HttpServer.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/servers/HttpServer.d.ts @@ -19,11 +19,19 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/12ClassExtensionOverride/types/services/BotLootCacheService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/BotLootCacheService.d.ts index b013e5e..7f79bfe 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/BotLootCacheService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/BotLootCacheService.d.ts @@ -69,6 +69,9 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/12ClassExtensionOverride/types/services/FenceService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/FenceService.d.ts index bb1d035..75c4b28 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/FenceService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,14 +38,30 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; + protected fenceItemUpdCompareProperties: Set; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with */ setFenceAssort(assort: ITraderAssort): void; + /** + * Replace discount fence assort with new assort + * @param assort New assorts to replace old with + */ + setDiscountFenceAssort(assort: ITraderAssort): void; + /** + * Get main fence assort + * @return ITraderAssort + */ + getMainFenceAssort(): ITraderAssort; + /** + * Get discount fence assort + * @return ITraderAssort + */ + getDiscountFenceAssort(): ITraderAssort; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -57,6 +74,26 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adds to fence assort a single item (with its children) + * @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; + /** + * 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; + /** + * 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; /** * Adjust all items contained inside an assort by a multiplier * @param assort (clone)Assort that contains items with prices to adjust @@ -93,17 +130,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -112,8 +155,8 @@ export declare class FenceService { protected deleteRandomAssorts(itemCountToReplace: number, assort: ITraderAssort): void; /** * Choose an item at random and remove it + mods from assorts - * @param assort Items to remove from - * @param rootItems Assort root items to pick from to remove + * @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; /** @@ -132,6 +175,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +196,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +205,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +214,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +225,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +247,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/12ClassExtensionOverride/types/services/ItemBaseClassService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/12ClassExtensionOverride/types/services/MailSendService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/MailSendService.d.ts index 08752bf..e5643f9 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/MailSendService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/MailSendService.d.ts @@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { Traders } from "@spt-aki/models/enums/Traders"; -import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -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?: any): void; + sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], 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?: any[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], 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 diff --git a/TypeScript/12ClassExtensionOverride/types/services/PaymentService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/PaymentService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/12ClassExtensionOverride/types/services/ProfileActivityService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/12ClassExtensionOverride/types/services/ProfileFixerService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/ProfileFixerService.d.ts index 804b3bf..1045d0a 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/ProfileFixerService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @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 @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @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 @@ -165,4 +183,9 @@ export declare class ProfileFixerService { * @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 null + */ + protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/12ClassExtensionOverride/types/services/RagfairPriceService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/RagfairPriceService.d.ts index 5649751..0fefdd8 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/RagfairPriceService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], 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 diff --git a/TypeScript/12ClassExtensionOverride/types/utils/App.d.ts b/TypeScript/12ClassExtensionOverride/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/12ClassExtensionOverride/types/utils/App.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/12ClassExtensionOverride/types/utils/CompareUtil.d.ts b/TypeScript/12ClassExtensionOverride/types/utils/CompareUtil.d.ts new file mode 100644 index 0000000..a5b94d5 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/utils/CompareUtil.d.ts @@ -0,0 +1,11 @@ +export declare class CompareUtil { + private static typesToCheckAgainst; + /** + * This function does an object comparison, equivalent to applying reflections + * and scanning for all possible properties including arrays. + * @param v1 value 1 to compare + * @param v2 value 2 to compare + * @returns true if equal, false if not + */ + recursiveCompare(v1: any, v2: any): boolean; +} diff --git a/TypeScript/12ClassExtensionOverride/types/utils/RagfairOfferHolder.d.ts b/TypeScript/12ClassExtensionOverride/types/utils/RagfairOfferHolder.d.ts index 3942ed1..b95e54a 100644 --- a/TypeScript/12ClassExtensionOverride/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/utils/RagfairOfferHolder.d.ts @@ -1,9 +1,12 @@ +import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { + protected maxOffersPerTemplate: number; + protected ragfairServerHelper: RagfairServerHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(); + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); getOfferById(id: string): IRagfairOffer; getOffersByTemplate(templateId: string): Array; getOffersByTrader(traderId: string): Array; diff --git a/TypeScript/12ClassExtensionOverride/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/12ClassExtensionOverride/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/12ClassExtensionOverride/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/13AddTrader/README.md b/TypeScript/13AddTrader/README.md index 48c742b..e760f8b 100644 --- a/TypeScript/13AddTrader/README.md +++ b/TypeScript/13AddTrader/README.md @@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an ## **NodeJS Setup** -Before you begin, ensure to install NodeJS version `v18.15.0`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). +Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). After installation, it's advised to reboot your system. diff --git a/TypeScript/13AddTrader/types/callbacks/BotCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/13AddTrader/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/13AddTrader/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/DialogueCallbacks.d.ts index 7ed60b9..2de57cb 100644 --- a/TypeScript/13AddTrader/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/DialogueCallbacks.d.ts @@ -1,7 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; -import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; +import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest"; @@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/friend/request/send */ sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/accept-all + */ + acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; /** * Handle client/friend/request/accept */ acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/decline + */ + declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/friend/request/cancel */ diff --git a/TypeScript/13AddTrader/types/callbacks/InraidCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/13AddTrader/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/13AddTrader/types/controllers/BotController.d.ts b/TypeScript/13AddTrader/types/controllers/BotController.d.ts index d148abc..556cc5d 100644 --- a/TypeScript/13AddTrader/types/controllers/BotController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/BotController.d.ts @@ -51,12 +51,14 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * 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 ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string): Difficulty; + getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/13AddTrader/types/controllers/BuildController.d.ts b/TypeScript/13AddTrader/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/13AddTrader/types/controllers/BuildController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/13AddTrader/types/controllers/GameController.d.ts b/TypeScript/13AddTrader/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/13AddTrader/types/controllers/GameController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, 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); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/13AddTrader/types/controllers/HideoutController.d.ts b/TypeScript/13AddTrader/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/13AddTrader/types/controllers/HideoutController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts b/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/13AddTrader/types/controllers/LauncherController.d.ts b/TypeScript/13AddTrader/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/13AddTrader/types/controllers/LauncherController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/13AddTrader/types/controllers/MatchController.d.ts b/TypeScript/13AddTrader/types/controllers/MatchController.d.ts index 6b1a7c3..708cee2 100644 --- a/TypeScript/13AddTrader/types/controllers/MatchController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/MatchController.d.ts @@ -75,10 +75,11 @@ export declare class MatchController { 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(pmcData: IPmcData, extractName: string): void; + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; /** * Was extract by car * @param extractName name of extract diff --git a/TypeScript/13AddTrader/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/13AddTrader/types/generators/BotEquipmentModGenerator.d.ts index dd1dcce..f850eea 100644 --- a/TypeScript/13AddTrader/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/BotEquipmentModGenerator.d.ts @@ -187,12 +187,12 @@ export declare class BotEquipmentModGenerator { */ protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param slotAddedToTemplate slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate template of the mods being added - * @param botRole + * Check if mod exists in db + is for a required slot + * @param modToAdd Db template of mod to check + * @param slotAddedToTemplate Slot object the item will be placed as child into + * @param modSlot Slot the mod will fill + * @param parentTemplate Db template of the mods being added + * @param botRole Bots wildspawntype (assault/pmcBot etc) * @returns true if valid */ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; diff --git a/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts b/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: 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/TypeScript/13AddTrader/types/generators/BotLootGenerator.d.ts b/TypeScript/13AddTrader/types/generators/BotLootGenerator.d.ts index 014617e..ca5d1bd 100644 --- a/TypeScript/13AddTrader/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/BotLootGenerator.d.ts @@ -82,7 +82,7 @@ export declare class BotLootGenerator { * @param totalValueLimitRub Total value of loot allowed in roubles * @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): void; + 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[][]; /** * Some items need child items to function, add them to the itemToAddChildrenTo array @@ -101,7 +101,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): void; + protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, 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 diff --git a/TypeScript/13AddTrader/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/13AddTrader/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..5ca8ed7 100644 --- a/TypeScript/13AddTrader/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/FenceBaseAssortGenerator.d.ts @@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { FenceService } from "@spt-aki/services/FenceService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -22,14 +23,25 @@ export declare class FenceBaseAssortGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; + protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; - protected getItemPrice(itemTpl: string, items: Item[]): number; - protected getAmmoBoxPrice(items: Item[]): number; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * Get the penetration power value of an ammo, works with ammo boxes and raw ammos + * @param rootItemDb Ammo box or ammo item from items.db + * @returns Penetration power of passed in item, null if it doesnt have a power + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/13AddTrader/types/generators/LootGenerator.d.ts b/TypeScript/13AddTrader/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/13AddTrader/types/generators/LootGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/13AddTrader/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/13AddTrader/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/13AddTrader/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/13AddTrader/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/13AddTrader/types/helpers/BotGeneratorHelper.d.ts index 7f7555b..c756725 100644 --- a/TypeScript/13AddTrader/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/BotGeneratorHelper.d.ts @@ -92,7 +92,7 @@ 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): ItemAddedResult; + addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set): ItemAddedResult; /** * Is the provided item allowed inside a container * @param slotGrid Items sub-grid we want to place item inside diff --git a/TypeScript/13AddTrader/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/13AddTrader/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/13AddTrader/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/IChatCommand.d.ts similarity index 71% rename from TypeScript/13AddTrader/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts rename to TypeScript/13AddTrader/types/helpers/Dialogue/Commando/IChatCommand.d.ts index cca1fb3..ade0adc 100644 --- a/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -1,6 +1,10 @@ import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { getCommandPrefix(): string; getCommandHelp(command: string): string; getCommands(): Set; diff --git a/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts new file mode 100644 index 0000000..26958ca --- /dev/null +++ b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -0,0 +1,39 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected itemFilterService: ItemFilterService; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en espaƱol" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: Map; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts new file mode 100644 index 0000000..8ec2ada --- /dev/null +++ b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts @@ -0,0 +1,38 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class ProfileSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected profileHelper: ProfileHelper; + /** + * Regex to account for all these cases: + * spt profile level 20 + * spt profile skill metabolism 10 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent; + protected handleLevelCommand(level: number): IProfileChangeEvent; +} diff --git a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts similarity index 61% rename from TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts rename to TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts index 33d05de..d84158a 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ b/TypeScript/13AddTrader/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -1,20 +1,32 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -export declare class GiveSptCommand implements ISptCommand { +export declare class TraderSptCommand implements ISptCommand { protected logger: ILogger; protected itemHelper: ItemHelper; protected hashUtil: HashUtil; protected jsonUtil: JsonUtil; protected presetHelper: PresetHelper; protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt trader prapor rep 100 + * spt trader mechanic spend 1000000 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); getCommand(): string; getCommandHelp(): string; performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; diff --git a/TypeScript/13AddTrader/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/13AddTrader/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/13AddTrader/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/13AddTrader/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts b/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/13AddTrader/types/helpers/HttpServerHelper.d.ts b/TypeScript/13AddTrader/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/13AddTrader/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts b/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts index 3e91ef7..9195579 100644 --- a/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; +import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { CompareUtil } from "@spt-aki/utils/CompareUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; @@ -28,8 +29,33 @@ export declare class ItemHelper { protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; + protected compareUtil: CompareUtil; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil); + /** + * 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 + * @param item1 first item with all its children to compare + * @param item2 second item with all its children to compare + * @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; + /** + * This method will compare two items and see if the are equivalent. + * This method will NOT compare IDs on the items + * @param item1 first item to compare + * @param item2 second item to compare + * @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; + /** + * 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; /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl @@ -363,10 +389,11 @@ export declare class ItemHelper { * Chose a randomly weighted cartridge that fits * @param caliber Desired caliber * @param staticAmmoDist Cartridges and thier weights + * @param fallbackCartridgeTpl If a cartridge cannot be found in the above staticAmmoDist param, use this instead * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -401,7 +428,7 @@ export declare class ItemHelper { addChildSlotItems(itemToAdd: Item[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): Item[]; /** * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter - * @param possibleTpls Tpls to randomply choose from + * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow * @returns Chosen tpl or null */ diff --git a/TypeScript/13AddTrader/types/helpers/PresetHelper.d.ts b/TypeScript/13AddTrader/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/13AddTrader/types/helpers/PresetHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/13AddTrader/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/13AddTrader/types/models/eft/common/tables/IBotType.d.ts index db6e56e..2a00af9 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,9 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/13AddTrader/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/13AddTrader/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/13AddTrader/types/models/eft/dialog/IAcceptFriendRequestData.d.ts b/TypeScript/13AddTrader/types/models/eft/dialog/IAcceptFriendRequestData.d.ts index 87461aa..0913eb5 100644 --- a/TypeScript/13AddTrader/types/models/eft/dialog/IAcceptFriendRequestData.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/dialog/IAcceptFriendRequestData.d.ts @@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest { } export interface ICancelFriendRequestData extends IBaseFriendRequest { } -export interface IBaseFriendRequest { - request_id: string; +export interface IDeclineFriendRequestData extends IBaseFriendRequest { +} +export interface IBaseFriendRequest { + profileId: string; } diff --git a/TypeScript/13AddTrader/types/models/eft/dialog/IFriendRequestSendResponse.d.ts b/TypeScript/13AddTrader/types/models/eft/dialog/IFriendRequestSendResponse.d.ts index 06c40f3..fc311eb 100644 --- a/TypeScript/13AddTrader/types/models/eft/dialog/IFriendRequestSendResponse.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/dialog/IFriendRequestSendResponse.d.ts @@ -1,5 +1,5 @@ export interface IFriendRequestSendResponse { status: number; - requestid: string; + requestId: string; retryAfter: number; } diff --git a/TypeScript/13AddTrader/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/TypeScript/13AddTrader/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 6c3c9eb..26e43ac 100644 --- a/TypeScript/13AddTrader/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -1,5 +1,5 @@ import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item } from "../common/tables/IItem"; +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; export interface IGetOtherProfileResponse { id: string; aid: number; diff --git a/TypeScript/13AddTrader/types/models/eft/profile/ISearchFriendResponse.d.ts b/TypeScript/13AddTrader/types/models/eft/profile/ISearchFriendResponse.d.ts index 96d88b2..d3cc7df 100644 --- a/TypeScript/13AddTrader/types/models/eft/profile/ISearchFriendResponse.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/profile/ISearchFriendResponse.d.ts @@ -1,9 +1,11 @@ export interface ISearchFriendResponse { _id: string; + aid: number; Info: Info; } export interface Info { Nickname: string; Side: string; Level: number; + MemberCategory: number; } diff --git a/TypeScript/13AddTrader/types/models/enums/AmmoTypes.d.ts b/TypeScript/13AddTrader/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/13AddTrader/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/13AddTrader/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/13AddTrader/types/models/enums/WeaponTypes.d.ts b/TypeScript/13AddTrader/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/13AddTrader/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/13AddTrader/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/13AddTrader/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/13AddTrader/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..529c2cd 100644 --- a/TypeScript/13AddTrader/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,9 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +23,8 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/13AddTrader/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/13AddTrader/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/13AddTrader/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/13AddTrader/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/13AddTrader/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/13AddTrader/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IPmcConfig.d.ts index 65da29b..f17d3e4 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IPmcConfig.d.ts @@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig { /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; allPMCsHavePlayerNameWithRandomPrefixChance: number; + /** Should secure container loot from usec.json/bear.json be added to pmc bots secure */ + addSecureContainerLootFromBotConfig: boolean; } export interface PmcTypes { usec: string; diff --git a/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/13AddTrader/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/13AddTrader/types/models/spt/dialog/ISendMessageDetails.d.ts index 2068ede..05b3bcd 100644 --- a/TypeScript/13AddTrader/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -30,7 +30,15 @@ export interface ISendMessageDetails { } export interface IProfileChangeEvent { _id: string; - Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + Type: ProfileChangeEventType; value: number; entity?: string; } +export declare enum ProfileChangeEventType { + TRADER_SALES_SUM = "TraderSalesSum", + TRADER_STANDING = "TraderStanding", + PROFILE_LEVEL = "ProfileLevel", + SKILL_POINTS = "SkillPoints", + EXAMINE_ALL_ITEMS = "ExamineAllItems", + UNLOCK_TRADER = "UnlockTrader" +} diff --git a/TypeScript/13AddTrader/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/13AddTrader/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/13AddTrader/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/13AddTrader/types/servers/HttpServer.d.ts b/TypeScript/13AddTrader/types/servers/HttpServer.d.ts index 8574cdd..bcd740f 100644 --- a/TypeScript/13AddTrader/types/servers/HttpServer.d.ts +++ b/TypeScript/13AddTrader/types/servers/HttpServer.d.ts @@ -19,11 +19,19 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/13AddTrader/types/services/BotLootCacheService.d.ts b/TypeScript/13AddTrader/types/services/BotLootCacheService.d.ts index b013e5e..7f79bfe 100644 --- a/TypeScript/13AddTrader/types/services/BotLootCacheService.d.ts +++ b/TypeScript/13AddTrader/types/services/BotLootCacheService.d.ts @@ -69,6 +69,9 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/13AddTrader/types/services/FenceService.d.ts b/TypeScript/13AddTrader/types/services/FenceService.d.ts index bb1d035..75c4b28 100644 --- a/TypeScript/13AddTrader/types/services/FenceService.d.ts +++ b/TypeScript/13AddTrader/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,14 +38,30 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; + protected fenceItemUpdCompareProperties: Set; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with */ setFenceAssort(assort: ITraderAssort): void; + /** + * Replace discount fence assort with new assort + * @param assort New assorts to replace old with + */ + setDiscountFenceAssort(assort: ITraderAssort): void; + /** + * Get main fence assort + * @return ITraderAssort + */ + getMainFenceAssort(): ITraderAssort; + /** + * Get discount fence assort + * @return ITraderAssort + */ + getDiscountFenceAssort(): ITraderAssort; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -57,6 +74,26 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adds to fence assort a single item (with its children) + * @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; + /** + * 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; + /** + * 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; /** * Adjust all items contained inside an assort by a multiplier * @param assort (clone)Assort that contains items with prices to adjust @@ -93,17 +130,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -112,8 +155,8 @@ export declare class FenceService { protected deleteRandomAssorts(itemCountToReplace: number, assort: ITraderAssort): void; /** * Choose an item at random and remove it + mods from assorts - * @param assort Items to remove from - * @param rootItems Assort root items to pick from to remove + * @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; /** @@ -132,6 +175,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +196,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +205,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +214,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +225,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +247,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/13AddTrader/types/services/ItemBaseClassService.d.ts b/TypeScript/13AddTrader/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/13AddTrader/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/13AddTrader/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/13AddTrader/types/services/MailSendService.d.ts b/TypeScript/13AddTrader/types/services/MailSendService.d.ts index 08752bf..e5643f9 100644 --- a/TypeScript/13AddTrader/types/services/MailSendService.d.ts +++ b/TypeScript/13AddTrader/types/services/MailSendService.d.ts @@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { Traders } from "@spt-aki/models/enums/Traders"; -import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -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?: any): void; + sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], 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?: any[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], 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 diff --git a/TypeScript/13AddTrader/types/services/PaymentService.d.ts b/TypeScript/13AddTrader/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/13AddTrader/types/services/PaymentService.d.ts +++ b/TypeScript/13AddTrader/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/13AddTrader/types/services/ProfileActivityService.d.ts b/TypeScript/13AddTrader/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/13AddTrader/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/13AddTrader/types/services/ProfileFixerService.d.ts b/TypeScript/13AddTrader/types/services/ProfileFixerService.d.ts index 804b3bf..1045d0a 100644 --- a/TypeScript/13AddTrader/types/services/ProfileFixerService.d.ts +++ b/TypeScript/13AddTrader/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @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 @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @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 @@ -165,4 +183,9 @@ export declare class ProfileFixerService { * @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 null + */ + protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/13AddTrader/types/services/RagfairPriceService.d.ts b/TypeScript/13AddTrader/types/services/RagfairPriceService.d.ts index 5649751..0fefdd8 100644 --- a/TypeScript/13AddTrader/types/services/RagfairPriceService.d.ts +++ b/TypeScript/13AddTrader/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], 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 diff --git a/TypeScript/13AddTrader/types/utils/App.d.ts b/TypeScript/13AddTrader/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/13AddTrader/types/utils/App.d.ts +++ b/TypeScript/13AddTrader/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/13AddTrader/types/utils/CompareUtil.d.ts b/TypeScript/13AddTrader/types/utils/CompareUtil.d.ts new file mode 100644 index 0000000..a5b94d5 --- /dev/null +++ b/TypeScript/13AddTrader/types/utils/CompareUtil.d.ts @@ -0,0 +1,11 @@ +export declare class CompareUtil { + private static typesToCheckAgainst; + /** + * This function does an object comparison, equivalent to applying reflections + * and scanning for all possible properties including arrays. + * @param v1 value 1 to compare + * @param v2 value 2 to compare + * @returns true if equal, false if not + */ + recursiveCompare(v1: any, v2: any): boolean; +} diff --git a/TypeScript/13AddTrader/types/utils/RagfairOfferHolder.d.ts b/TypeScript/13AddTrader/types/utils/RagfairOfferHolder.d.ts index 3942ed1..b95e54a 100644 --- a/TypeScript/13AddTrader/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/13AddTrader/types/utils/RagfairOfferHolder.d.ts @@ -1,9 +1,12 @@ +import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { + protected maxOffersPerTemplate: number; + protected ragfairServerHelper: RagfairServerHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(); + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); getOfferById(id: string): IRagfairOffer; getOffersByTemplate(templateId: string): Array; getOffersByTrader(traderId: string): Array; diff --git a/TypeScript/13AddTrader/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/13AddTrader/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/13AddTrader/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/13AddTrader/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/14AfterDBLoadHook/README.md b/TypeScript/14AfterDBLoadHook/README.md index 48c742b..e760f8b 100644 --- a/TypeScript/14AfterDBLoadHook/README.md +++ b/TypeScript/14AfterDBLoadHook/README.md @@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an ## **NodeJS Setup** -Before you begin, ensure to install NodeJS version `v18.15.0`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). +Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). After installation, it's advised to reboot your system. diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/BotCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/DialogueCallbacks.d.ts index 7ed60b9..2de57cb 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/DialogueCallbacks.d.ts @@ -1,7 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; -import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; +import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest"; @@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/friend/request/send */ sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/accept-all + */ + acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; /** * Handle client/friend/request/accept */ acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/decline + */ + declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/friend/request/cancel */ diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/InraidCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/BotController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/BotController.d.ts index d148abc..556cc5d 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/BotController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/BotController.d.ts @@ -51,12 +51,14 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * 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 ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string): Difficulty; + getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/BuildController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/BuildController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, 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); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/HideoutController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/HideoutController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/LauncherController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/LauncherController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/MatchController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/MatchController.d.ts index 6b1a7c3..708cee2 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/MatchController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/MatchController.d.ts @@ -75,10 +75,11 @@ export declare class MatchController { 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(pmcData: IPmcData, extractName: string): void; + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; /** * Was extract by car * @param extractName name of extract diff --git a/TypeScript/14AfterDBLoadHook/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/BotEquipmentModGenerator.d.ts index dd1dcce..f850eea 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/BotEquipmentModGenerator.d.ts @@ -187,12 +187,12 @@ export declare class BotEquipmentModGenerator { */ protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param slotAddedToTemplate slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate template of the mods being added - * @param botRole + * Check if mod exists in db + is for a required slot + * @param modToAdd Db template of mod to check + * @param slotAddedToTemplate Slot object the item will be placed as child into + * @param modSlot Slot the mod will fill + * @param parentTemplate Db template of the mods being added + * @param botRole Bots wildspawntype (assault/pmcBot etc) * @returns true if valid */ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; diff --git a/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: 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/TypeScript/14AfterDBLoadHook/types/generators/BotLootGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/BotLootGenerator.d.ts index 014617e..ca5d1bd 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/BotLootGenerator.d.ts @@ -82,7 +82,7 @@ export declare class BotLootGenerator { * @param totalValueLimitRub Total value of loot allowed in roubles * @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): void; + 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[][]; /** * Some items need child items to function, add them to the itemToAddChildrenTo array @@ -101,7 +101,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): void; + protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, 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 diff --git a/TypeScript/14AfterDBLoadHook/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..5ca8ed7 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/FenceBaseAssortGenerator.d.ts @@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { FenceService } from "@spt-aki/services/FenceService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -22,14 +23,25 @@ export declare class FenceBaseAssortGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; + protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; - protected getItemPrice(itemTpl: string, items: Item[]): number; - protected getAmmoBoxPrice(items: Item[]): number; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * Get the penetration power value of an ammo, works with ammo boxes and raw ammos + * @param rootItemDb Ammo box or ammo item from items.db + * @returns Penetration power of passed in item, null if it doesnt have a power + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/14AfterDBLoadHook/types/generators/LootGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/LootGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/14AfterDBLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/BotGeneratorHelper.d.ts index 7f7555b..c756725 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/BotGeneratorHelper.d.ts @@ -92,7 +92,7 @@ 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): ItemAddedResult; + addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set): ItemAddedResult; /** * Is the provided item allowed inside a container * @param slotGrid Items sub-grid we want to place item inside diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts new file mode 100644 index 0000000..26958ca --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -0,0 +1,39 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected itemFilterService: ItemFilterService; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en espaƱol" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: Map; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts deleted file mode 100644 index 33d05de..0000000 --- a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; -import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; -import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -export declare class GiveSptCommand implements ISptCommand { - protected logger: ILogger; - protected itemHelper: ItemHelper; - protected hashUtil: HashUtil; - protected jsonUtil: JsonUtil; - protected presetHelper: PresetHelper; - protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); - getCommand(): string; - getCommandHelp(): string; - performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts new file mode 100644 index 0000000..8ec2ada --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts @@ -0,0 +1,38 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class ProfileSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected profileHelper: ProfileHelper; + /** + * Regex to account for all these cases: + * spt profile level 20 + * spt profile skill metabolism 10 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent; + protected handleLevelCommand(level: number): IProfileChangeEvent; +} diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts new file mode 100644 index 0000000..d84158a --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -0,0 +1,33 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class TraderSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt trader prapor rep 100 + * spt trader mechanic spend 1000000 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/HttpServerHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts index 3e91ef7..9195579 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; +import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { CompareUtil } from "@spt-aki/utils/CompareUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; @@ -28,8 +29,33 @@ export declare class ItemHelper { protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; + protected compareUtil: CompareUtil; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil); + /** + * 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 + * @param item1 first item with all its children to compare + * @param item2 second item with all its children to compare + * @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; + /** + * This method will compare two items and see if the are equivalent. + * This method will NOT compare IDs on the items + * @param item1 first item to compare + * @param item2 second item to compare + * @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; + /** + * 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; /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl @@ -363,10 +389,11 @@ export declare class ItemHelper { * Chose a randomly weighted cartridge that fits * @param caliber Desired caliber * @param staticAmmoDist Cartridges and thier weights + * @param fallbackCartridgeTpl If a cartridge cannot be found in the above staticAmmoDist param, use this instead * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -401,7 +428,7 @@ export declare class ItemHelper { addChildSlotItems(itemToAdd: Item[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): Item[]; /** * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter - * @param possibleTpls Tpls to randomply choose from + * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow * @returns Chosen tpl or null */ diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/PresetHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/PresetHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotType.d.ts index db6e56e..2a00af9 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,9 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/dialog/IAcceptFriendRequestData.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/dialog/IAcceptFriendRequestData.d.ts index 87461aa..0913eb5 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/dialog/IAcceptFriendRequestData.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/dialog/IAcceptFriendRequestData.d.ts @@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest { } export interface ICancelFriendRequestData extends IBaseFriendRequest { } -export interface IBaseFriendRequest { - request_id: string; +export interface IDeclineFriendRequestData extends IBaseFriendRequest { +} +export interface IBaseFriendRequest { + profileId: string; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/dialog/IFriendRequestSendResponse.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/dialog/IFriendRequestSendResponse.d.ts index 06c40f3..fc311eb 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/dialog/IFriendRequestSendResponse.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/dialog/IFriendRequestSendResponse.d.ts @@ -1,5 +1,5 @@ export interface IFriendRequestSendResponse { status: number; - requestid: string; + requestId: string; retryAfter: number; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 6c3c9eb..26e43ac 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -1,5 +1,5 @@ import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item } from "../common/tables/IItem"; +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; export interface IGetOtherProfileResponse { id: string; aid: number; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/profile/ISearchFriendResponse.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/profile/ISearchFriendResponse.d.ts index 96d88b2..d3cc7df 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/profile/ISearchFriendResponse.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/profile/ISearchFriendResponse.d.ts @@ -1,9 +1,11 @@ export interface ISearchFriendResponse { _id: string; + aid: number; Info: Info; } export interface Info { Nickname: string; Side: string; Level: number; + MemberCategory: number; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/enums/AmmoTypes.d.ts b/TypeScript/14AfterDBLoadHook/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/enums/WeaponTypes.d.ts b/TypeScript/14AfterDBLoadHook/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..529c2cd 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,9 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +23,8 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IPmcConfig.d.ts index 65da29b..f17d3e4 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IPmcConfig.d.ts @@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig { /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; allPMCsHavePlayerNameWithRandomPrefixChance: number; + /** Should secure container loot from usec.json/bear.json be added to pmc bots secure */ + addSecureContainerLootFromBotConfig: boolean; } export interface PmcTypes { usec: string; diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/dialog/ISendMessageDetails.d.ts index 2068ede..05b3bcd 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -30,7 +30,15 @@ export interface ISendMessageDetails { } export interface IProfileChangeEvent { _id: string; - Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + Type: ProfileChangeEventType; value: number; entity?: string; } +export declare enum ProfileChangeEventType { + TRADER_SALES_SUM = "TraderSalesSum", + TRADER_STANDING = "TraderStanding", + PROFILE_LEVEL = "ProfileLevel", + SKILL_POINTS = "SkillPoints", + EXAMINE_ALL_ITEMS = "ExamineAllItems", + UNLOCK_TRADER = "UnlockTrader" +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/14AfterDBLoadHook/types/servers/HttpServer.d.ts b/TypeScript/14AfterDBLoadHook/types/servers/HttpServer.d.ts index 8574cdd..bcd740f 100644 --- a/TypeScript/14AfterDBLoadHook/types/servers/HttpServer.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/servers/HttpServer.d.ts @@ -19,11 +19,19 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/14AfterDBLoadHook/types/services/BotLootCacheService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/BotLootCacheService.d.ts index b013e5e..7f79bfe 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/BotLootCacheService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/BotLootCacheService.d.ts @@ -69,6 +69,9 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/14AfterDBLoadHook/types/services/FenceService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/FenceService.d.ts index bb1d035..75c4b28 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/FenceService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,14 +38,30 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; + protected fenceItemUpdCompareProperties: Set; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with */ setFenceAssort(assort: ITraderAssort): void; + /** + * Replace discount fence assort with new assort + * @param assort New assorts to replace old with + */ + setDiscountFenceAssort(assort: ITraderAssort): void; + /** + * Get main fence assort + * @return ITraderAssort + */ + getMainFenceAssort(): ITraderAssort; + /** + * Get discount fence assort + * @return ITraderAssort + */ + getDiscountFenceAssort(): ITraderAssort; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -57,6 +74,26 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adds to fence assort a single item (with its children) + * @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; + /** + * 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; + /** + * 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; /** * Adjust all items contained inside an assort by a multiplier * @param assort (clone)Assort that contains items with prices to adjust @@ -93,17 +130,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -112,8 +155,8 @@ export declare class FenceService { protected deleteRandomAssorts(itemCountToReplace: number, assort: ITraderAssort): void; /** * Choose an item at random and remove it + mods from assorts - * @param assort Items to remove from - * @param rootItems Assort root items to pick from to remove + * @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; /** @@ -132,6 +175,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +196,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +205,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +214,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +225,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +247,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/14AfterDBLoadHook/types/services/ItemBaseClassService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/14AfterDBLoadHook/types/services/MailSendService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/MailSendService.d.ts index 08752bf..e5643f9 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/MailSendService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/MailSendService.d.ts @@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { Traders } from "@spt-aki/models/enums/Traders"; -import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -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?: any): void; + sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], 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?: any[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], 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 diff --git a/TypeScript/14AfterDBLoadHook/types/services/PaymentService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/PaymentService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/14AfterDBLoadHook/types/services/ProfileActivityService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/14AfterDBLoadHook/types/services/ProfileFixerService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/ProfileFixerService.d.ts index 804b3bf..1045d0a 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/ProfileFixerService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @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 @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @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 @@ -165,4 +183,9 @@ export declare class ProfileFixerService { * @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 null + */ + protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/14AfterDBLoadHook/types/services/RagfairPriceService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/RagfairPriceService.d.ts index 5649751..0fefdd8 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/RagfairPriceService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], 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 diff --git a/TypeScript/14AfterDBLoadHook/types/utils/App.d.ts b/TypeScript/14AfterDBLoadHook/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/14AfterDBLoadHook/types/utils/App.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/14AfterDBLoadHook/types/utils/CompareUtil.d.ts b/TypeScript/14AfterDBLoadHook/types/utils/CompareUtil.d.ts new file mode 100644 index 0000000..a5b94d5 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/utils/CompareUtil.d.ts @@ -0,0 +1,11 @@ +export declare class CompareUtil { + private static typesToCheckAgainst; + /** + * This function does an object comparison, equivalent to applying reflections + * and scanning for all possible properties including arrays. + * @param v1 value 1 to compare + * @param v2 value 2 to compare + * @returns true if equal, false if not + */ + recursiveCompare(v1: any, v2: any): boolean; +} diff --git a/TypeScript/14AfterDBLoadHook/types/utils/RagfairOfferHolder.d.ts b/TypeScript/14AfterDBLoadHook/types/utils/RagfairOfferHolder.d.ts index 3942ed1..b95e54a 100644 --- a/TypeScript/14AfterDBLoadHook/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/utils/RagfairOfferHolder.d.ts @@ -1,9 +1,12 @@ +import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { + protected maxOffersPerTemplate: number; + protected ragfairServerHelper: RagfairServerHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(); + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); getOfferById(id: string): IRagfairOffer; getOffersByTemplate(templateId: string): Array; getOffersByTrader(traderId: string): Array; diff --git a/TypeScript/14AfterDBLoadHook/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/14AfterDBLoadHook/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/14AfterDBLoadHook/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/15HttpListenerExample/README.md b/TypeScript/15HttpListenerExample/README.md index 48c742b..e760f8b 100644 --- a/TypeScript/15HttpListenerExample/README.md +++ b/TypeScript/15HttpListenerExample/README.md @@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an ## **NodeJS Setup** -Before you begin, ensure to install NodeJS version `v18.15.0`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). +Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). After installation, it's advised to reboot your system. diff --git a/TypeScript/15HttpListenerExample/types/callbacks/BotCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/15HttpListenerExample/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/DialogueCallbacks.d.ts index 7ed60b9..2de57cb 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/DialogueCallbacks.d.ts @@ -1,7 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; -import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; +import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest"; @@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/friend/request/send */ sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/accept-all + */ + acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; /** * Handle client/friend/request/accept */ acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/decline + */ + declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/friend/request/cancel */ diff --git a/TypeScript/15HttpListenerExample/types/callbacks/InraidCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/15HttpListenerExample/types/controllers/BotController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/BotController.d.ts index d148abc..556cc5d 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/BotController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/BotController.d.ts @@ -51,12 +51,14 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * 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 ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string): Difficulty; + getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/15HttpListenerExample/types/controllers/BuildController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/BuildController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, 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); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/15HttpListenerExample/types/controllers/HideoutController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/HideoutController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/15HttpListenerExample/types/controllers/LauncherController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/LauncherController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/15HttpListenerExample/types/controllers/MatchController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/MatchController.d.ts index 6b1a7c3..708cee2 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/MatchController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/MatchController.d.ts @@ -75,10 +75,11 @@ export declare class MatchController { 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(pmcData: IPmcData, extractName: string): void; + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; /** * Was extract by car * @param extractName name of extract diff --git a/TypeScript/15HttpListenerExample/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/BotEquipmentModGenerator.d.ts index dd1dcce..f850eea 100644 --- a/TypeScript/15HttpListenerExample/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/BotEquipmentModGenerator.d.ts @@ -187,12 +187,12 @@ export declare class BotEquipmentModGenerator { */ protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param slotAddedToTemplate slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate template of the mods being added - * @param botRole + * Check if mod exists in db + is for a required slot + * @param modToAdd Db template of mod to check + * @param slotAddedToTemplate Slot object the item will be placed as child into + * @param modSlot Slot the mod will fill + * @param parentTemplate Db template of the mods being added + * @param botRole Bots wildspawntype (assault/pmcBot etc) * @returns true if valid */ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; diff --git a/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: 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/TypeScript/15HttpListenerExample/types/generators/BotLootGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/BotLootGenerator.d.ts index 014617e..ca5d1bd 100644 --- a/TypeScript/15HttpListenerExample/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/BotLootGenerator.d.ts @@ -82,7 +82,7 @@ export declare class BotLootGenerator { * @param totalValueLimitRub Total value of loot allowed in roubles * @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): void; + 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[][]; /** * Some items need child items to function, add them to the itemToAddChildrenTo array @@ -101,7 +101,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): void; + protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, 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 diff --git a/TypeScript/15HttpListenerExample/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..5ca8ed7 100644 --- a/TypeScript/15HttpListenerExample/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/FenceBaseAssortGenerator.d.ts @@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { FenceService } from "@spt-aki/services/FenceService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -22,14 +23,25 @@ export declare class FenceBaseAssortGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; + protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; - protected getItemPrice(itemTpl: string, items: Item[]): number; - protected getAmmoBoxPrice(items: Item[]): number; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * Get the penetration power value of an ammo, works with ammo boxes and raw ammos + * @param rootItemDb Ammo box or ammo item from items.db + * @returns Penetration power of passed in item, null if it doesnt have a power + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/15HttpListenerExample/types/generators/LootGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/15HttpListenerExample/types/generators/LootGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/15HttpListenerExample/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/15HttpListenerExample/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/15HttpListenerExample/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/BotGeneratorHelper.d.ts index 7f7555b..c756725 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/BotGeneratorHelper.d.ts @@ -92,7 +92,7 @@ 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): ItemAddedResult; + addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set): ItemAddedResult; /** * Is the provided item allowed inside a container * @param slotGrid Items sub-grid we want to place item inside diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts new file mode 100644 index 0000000..26958ca --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -0,0 +1,39 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected itemFilterService: ItemFilterService; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en espaƱol" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: Map; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts deleted file mode 100644 index 33d05de..0000000 --- a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; -import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; -import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -export declare class GiveSptCommand implements ISptCommand { - protected logger: ILogger; - protected itemHelper: ItemHelper; - protected hashUtil: HashUtil; - protected jsonUtil: JsonUtil; - protected presetHelper: PresetHelper; - protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); - getCommand(): string; - getCommandHelp(): string; - performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts new file mode 100644 index 0000000..8ec2ada --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts @@ -0,0 +1,38 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class ProfileSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected profileHelper: ProfileHelper; + /** + * Regex to account for all these cases: + * spt profile level 20 + * spt profile skill metabolism 10 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent; + protected handleLevelCommand(level: number): IProfileChangeEvent; +} diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts new file mode 100644 index 0000000..d84158a --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -0,0 +1,33 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class TraderSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt trader prapor rep 100 + * spt trader mechanic spend 1000000 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/15HttpListenerExample/types/helpers/HttpServerHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/15HttpListenerExample/types/helpers/ItemHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/ItemHelper.d.ts index 3e91ef7..9195579 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/ItemHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/ItemHelper.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; +import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { CompareUtil } from "@spt-aki/utils/CompareUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; @@ -28,8 +29,33 @@ export declare class ItemHelper { protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; + protected compareUtil: CompareUtil; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil); + /** + * 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 + * @param item1 first item with all its children to compare + * @param item2 second item with all its children to compare + * @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; + /** + * This method will compare two items and see if the are equivalent. + * This method will NOT compare IDs on the items + * @param item1 first item to compare + * @param item2 second item to compare + * @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; + /** + * 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; /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl @@ -363,10 +389,11 @@ export declare class ItemHelper { * Chose a randomly weighted cartridge that fits * @param caliber Desired caliber * @param staticAmmoDist Cartridges and thier weights + * @param fallbackCartridgeTpl If a cartridge cannot be found in the above staticAmmoDist param, use this instead * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -401,7 +428,7 @@ export declare class ItemHelper { addChildSlotItems(itemToAdd: Item[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): Item[]; /** * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter - * @param possibleTpls Tpls to randomply choose from + * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow * @returns Chosen tpl or null */ diff --git a/TypeScript/15HttpListenerExample/types/helpers/PresetHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/PresetHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotType.d.ts index db6e56e..2a00af9 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,9 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/dialog/IAcceptFriendRequestData.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/dialog/IAcceptFriendRequestData.d.ts index 87461aa..0913eb5 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/dialog/IAcceptFriendRequestData.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/dialog/IAcceptFriendRequestData.d.ts @@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest { } export interface ICancelFriendRequestData extends IBaseFriendRequest { } -export interface IBaseFriendRequest { - request_id: string; +export interface IDeclineFriendRequestData extends IBaseFriendRequest { +} +export interface IBaseFriendRequest { + profileId: string; } diff --git a/TypeScript/15HttpListenerExample/types/models/eft/dialog/IFriendRequestSendResponse.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/dialog/IFriendRequestSendResponse.d.ts index 06c40f3..fc311eb 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/dialog/IFriendRequestSendResponse.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/dialog/IFriendRequestSendResponse.d.ts @@ -1,5 +1,5 @@ export interface IFriendRequestSendResponse { status: number; - requestid: string; + requestId: string; retryAfter: number; } diff --git a/TypeScript/15HttpListenerExample/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 6c3c9eb..26e43ac 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -1,5 +1,5 @@ import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item } from "../common/tables/IItem"; +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; export interface IGetOtherProfileResponse { id: string; aid: number; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/profile/ISearchFriendResponse.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/profile/ISearchFriendResponse.d.ts index 96d88b2..d3cc7df 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/profile/ISearchFriendResponse.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/profile/ISearchFriendResponse.d.ts @@ -1,9 +1,11 @@ export interface ISearchFriendResponse { _id: string; + aid: number; Info: Info; } export interface Info { Nickname: string; Side: string; Level: number; + MemberCategory: number; } diff --git a/TypeScript/15HttpListenerExample/types/models/enums/AmmoTypes.d.ts b/TypeScript/15HttpListenerExample/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/15HttpListenerExample/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/15HttpListenerExample/types/models/enums/WeaponTypes.d.ts b/TypeScript/15HttpListenerExample/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/15HttpListenerExample/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/15HttpListenerExample/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..529c2cd 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,9 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +23,8 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IPmcConfig.d.ts index 65da29b..f17d3e4 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IPmcConfig.d.ts @@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig { /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; allPMCsHavePlayerNameWithRandomPrefixChance: number; + /** Should secure container loot from usec.json/bear.json be added to pmc bots secure */ + addSecureContainerLootFromBotConfig: boolean; } export interface PmcTypes { usec: string; diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/15HttpListenerExample/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/dialog/ISendMessageDetails.d.ts index 2068ede..05b3bcd 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -30,7 +30,15 @@ export interface ISendMessageDetails { } export interface IProfileChangeEvent { _id: string; - Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + Type: ProfileChangeEventType; value: number; entity?: string; } +export declare enum ProfileChangeEventType { + TRADER_SALES_SUM = "TraderSalesSum", + TRADER_STANDING = "TraderStanding", + PROFILE_LEVEL = "ProfileLevel", + SKILL_POINTS = "SkillPoints", + EXAMINE_ALL_ITEMS = "ExamineAllItems", + UNLOCK_TRADER = "UnlockTrader" +} diff --git a/TypeScript/15HttpListenerExample/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/15HttpListenerExample/types/servers/HttpServer.d.ts b/TypeScript/15HttpListenerExample/types/servers/HttpServer.d.ts index 8574cdd..bcd740f 100644 --- a/TypeScript/15HttpListenerExample/types/servers/HttpServer.d.ts +++ b/TypeScript/15HttpListenerExample/types/servers/HttpServer.d.ts @@ -19,11 +19,19 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/15HttpListenerExample/types/services/BotLootCacheService.d.ts b/TypeScript/15HttpListenerExample/types/services/BotLootCacheService.d.ts index b013e5e..7f79bfe 100644 --- a/TypeScript/15HttpListenerExample/types/services/BotLootCacheService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/BotLootCacheService.d.ts @@ -69,6 +69,9 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/15HttpListenerExample/types/services/FenceService.d.ts b/TypeScript/15HttpListenerExample/types/services/FenceService.d.ts index bb1d035..75c4b28 100644 --- a/TypeScript/15HttpListenerExample/types/services/FenceService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,14 +38,30 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; + protected fenceItemUpdCompareProperties: Set; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with */ setFenceAssort(assort: ITraderAssort): void; + /** + * Replace discount fence assort with new assort + * @param assort New assorts to replace old with + */ + setDiscountFenceAssort(assort: ITraderAssort): void; + /** + * Get main fence assort + * @return ITraderAssort + */ + getMainFenceAssort(): ITraderAssort; + /** + * Get discount fence assort + * @return ITraderAssort + */ + getDiscountFenceAssort(): ITraderAssort; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -57,6 +74,26 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adds to fence assort a single item (with its children) + * @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; + /** + * 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; + /** + * 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; /** * Adjust all items contained inside an assort by a multiplier * @param assort (clone)Assort that contains items with prices to adjust @@ -93,17 +130,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -112,8 +155,8 @@ export declare class FenceService { protected deleteRandomAssorts(itemCountToReplace: number, assort: ITraderAssort): void; /** * Choose an item at random and remove it + mods from assorts - * @param assort Items to remove from - * @param rootItems Assort root items to pick from to remove + * @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; /** @@ -132,6 +175,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +196,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +205,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +214,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +225,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +247,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/15HttpListenerExample/types/services/ItemBaseClassService.d.ts b/TypeScript/15HttpListenerExample/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/15HttpListenerExample/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/15HttpListenerExample/types/services/MailSendService.d.ts b/TypeScript/15HttpListenerExample/types/services/MailSendService.d.ts index 08752bf..e5643f9 100644 --- a/TypeScript/15HttpListenerExample/types/services/MailSendService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/MailSendService.d.ts @@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { Traders } from "@spt-aki/models/enums/Traders"; -import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -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?: any): void; + sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], 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?: any[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], 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 diff --git a/TypeScript/15HttpListenerExample/types/services/PaymentService.d.ts b/TypeScript/15HttpListenerExample/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/15HttpListenerExample/types/services/PaymentService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/15HttpListenerExample/types/services/ProfileActivityService.d.ts b/TypeScript/15HttpListenerExample/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/15HttpListenerExample/types/services/ProfileFixerService.d.ts b/TypeScript/15HttpListenerExample/types/services/ProfileFixerService.d.ts index 804b3bf..1045d0a 100644 --- a/TypeScript/15HttpListenerExample/types/services/ProfileFixerService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @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 @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @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 @@ -165,4 +183,9 @@ export declare class ProfileFixerService { * @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 null + */ + protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/15HttpListenerExample/types/services/RagfairPriceService.d.ts b/TypeScript/15HttpListenerExample/types/services/RagfairPriceService.d.ts index 5649751..0fefdd8 100644 --- a/TypeScript/15HttpListenerExample/types/services/RagfairPriceService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], 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 diff --git a/TypeScript/15HttpListenerExample/types/utils/App.d.ts b/TypeScript/15HttpListenerExample/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/15HttpListenerExample/types/utils/App.d.ts +++ b/TypeScript/15HttpListenerExample/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/15HttpListenerExample/types/utils/CompareUtil.d.ts b/TypeScript/15HttpListenerExample/types/utils/CompareUtil.d.ts new file mode 100644 index 0000000..a5b94d5 --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/utils/CompareUtil.d.ts @@ -0,0 +1,11 @@ +export declare class CompareUtil { + private static typesToCheckAgainst; + /** + * This function does an object comparison, equivalent to applying reflections + * and scanning for all possible properties including arrays. + * @param v1 value 1 to compare + * @param v2 value 2 to compare + * @returns true if equal, false if not + */ + recursiveCompare(v1: any, v2: any): boolean; +} diff --git a/TypeScript/15HttpListenerExample/types/utils/RagfairOfferHolder.d.ts b/TypeScript/15HttpListenerExample/types/utils/RagfairOfferHolder.d.ts index 3942ed1..b95e54a 100644 --- a/TypeScript/15HttpListenerExample/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/15HttpListenerExample/types/utils/RagfairOfferHolder.d.ts @@ -1,9 +1,12 @@ +import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { + protected maxOffersPerTemplate: number; + protected ragfairServerHelper: RagfairServerHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(); + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); getOfferById(id: string): IRagfairOffer; getOffersByTemplate(templateId: string): Array; getOffersByTrader(traderId: string): Array; diff --git a/TypeScript/15HttpListenerExample/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/15HttpListenerExample/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/15HttpListenerExample/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/15HttpListenerExample/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/16ImporterUtil/README.md b/TypeScript/16ImporterUtil/README.md index 48c742b..e760f8b 100644 --- a/TypeScript/16ImporterUtil/README.md +++ b/TypeScript/16ImporterUtil/README.md @@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an ## **NodeJS Setup** -Before you begin, ensure to install NodeJS version `v18.15.0`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). +Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). After installation, it's advised to reboot your system. diff --git a/TypeScript/16ImporterUtil/types/callbacks/BotCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/16ImporterUtil/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/DialogueCallbacks.d.ts index 7ed60b9..2de57cb 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/DialogueCallbacks.d.ts @@ -1,7 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; -import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; +import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest"; @@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/friend/request/send */ sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/accept-all + */ + acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; /** * Handle client/friend/request/accept */ acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/decline + */ + declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/friend/request/cancel */ diff --git a/TypeScript/16ImporterUtil/types/callbacks/InraidCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/16ImporterUtil/types/controllers/BotController.d.ts b/TypeScript/16ImporterUtil/types/controllers/BotController.d.ts index d148abc..556cc5d 100644 --- a/TypeScript/16ImporterUtil/types/controllers/BotController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/BotController.d.ts @@ -51,12 +51,14 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * 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 ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string): Difficulty; + getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/16ImporterUtil/types/controllers/BuildController.d.ts b/TypeScript/16ImporterUtil/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/16ImporterUtil/types/controllers/BuildController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/16ImporterUtil/types/controllers/GameController.d.ts b/TypeScript/16ImporterUtil/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/16ImporterUtil/types/controllers/GameController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, 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); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/16ImporterUtil/types/controllers/HideoutController.d.ts b/TypeScript/16ImporterUtil/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/16ImporterUtil/types/controllers/HideoutController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/16ImporterUtil/types/controllers/InsuranceController.d.ts b/TypeScript/16ImporterUtil/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/16ImporterUtil/types/controllers/InsuranceController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/16ImporterUtil/types/controllers/LauncherController.d.ts b/TypeScript/16ImporterUtil/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/16ImporterUtil/types/controllers/LauncherController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/16ImporterUtil/types/controllers/MatchController.d.ts b/TypeScript/16ImporterUtil/types/controllers/MatchController.d.ts index 6b1a7c3..708cee2 100644 --- a/TypeScript/16ImporterUtil/types/controllers/MatchController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/MatchController.d.ts @@ -75,10 +75,11 @@ export declare class MatchController { 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(pmcData: IPmcData, extractName: string): void; + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; /** * Was extract by car * @param extractName name of extract diff --git a/TypeScript/16ImporterUtil/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/BotEquipmentModGenerator.d.ts index dd1dcce..f850eea 100644 --- a/TypeScript/16ImporterUtil/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/BotEquipmentModGenerator.d.ts @@ -187,12 +187,12 @@ export declare class BotEquipmentModGenerator { */ protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param slotAddedToTemplate slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate template of the mods being added - * @param botRole + * Check if mod exists in db + is for a required slot + * @param modToAdd Db template of mod to check + * @param slotAddedToTemplate Slot object the item will be placed as child into + * @param modSlot Slot the mod will fill + * @param parentTemplate Db template of the mods being added + * @param botRole Bots wildspawntype (assault/pmcBot etc) * @returns true if valid */ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; diff --git a/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: 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/TypeScript/16ImporterUtil/types/generators/BotLootGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/BotLootGenerator.d.ts index 014617e..ca5d1bd 100644 --- a/TypeScript/16ImporterUtil/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/BotLootGenerator.d.ts @@ -82,7 +82,7 @@ export declare class BotLootGenerator { * @param totalValueLimitRub Total value of loot allowed in roubles * @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): void; + 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[][]; /** * Some items need child items to function, add them to the itemToAddChildrenTo array @@ -101,7 +101,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): void; + protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, 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 diff --git a/TypeScript/16ImporterUtil/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..5ca8ed7 100644 --- a/TypeScript/16ImporterUtil/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/FenceBaseAssortGenerator.d.ts @@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { FenceService } from "@spt-aki/services/FenceService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -22,14 +23,25 @@ export declare class FenceBaseAssortGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; + protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; - protected getItemPrice(itemTpl: string, items: Item[]): number; - protected getAmmoBoxPrice(items: Item[]): number; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * Get the penetration power value of an ammo, works with ammo boxes and raw ammos + * @param rootItemDb Ammo box or ammo item from items.db + * @returns Penetration power of passed in item, null if it doesnt have a power + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/16ImporterUtil/types/generators/LootGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/16ImporterUtil/types/generators/LootGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/16ImporterUtil/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/16ImporterUtil/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/16ImporterUtil/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/BotGeneratorHelper.d.ts index 7f7555b..c756725 100644 --- a/TypeScript/16ImporterUtil/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/BotGeneratorHelper.d.ts @@ -92,7 +92,7 @@ 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): ItemAddedResult; + addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set): ItemAddedResult; /** * Is the provided item allowed inside a container * @param slotGrid Items sub-grid we want to place item inside diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/16ImporterUtil/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts new file mode 100644 index 0000000..26958ca --- /dev/null +++ b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -0,0 +1,39 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected itemFilterService: ItemFilterService; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en espaƱol" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: Map; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts deleted file mode 100644 index 33d05de..0000000 --- a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; -import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; -import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -export declare class GiveSptCommand implements ISptCommand { - protected logger: ILogger; - protected itemHelper: ItemHelper; - protected hashUtil: HashUtil; - protected jsonUtil: JsonUtil; - protected presetHelper: PresetHelper; - protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); - getCommand(): string; - getCommandHelp(): string; - performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts new file mode 100644 index 0000000..8ec2ada --- /dev/null +++ b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts @@ -0,0 +1,38 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class ProfileSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected profileHelper: ProfileHelper; + /** + * Regex to account for all these cases: + * spt profile level 20 + * spt profile skill metabolism 10 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent; + protected handleLevelCommand(level: number): IProfileChangeEvent; +} diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts new file mode 100644 index 0000000..d84158a --- /dev/null +++ b/TypeScript/16ImporterUtil/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -0,0 +1,33 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class TraderSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt trader prapor rep 100 + * spt trader mechanic spend 1000000 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/16ImporterUtil/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/16ImporterUtil/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/16ImporterUtil/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/16ImporterUtil/types/helpers/HttpServerHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/16ImporterUtil/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/16ImporterUtil/types/helpers/ItemHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/ItemHelper.d.ts index 3e91ef7..9195579 100644 --- a/TypeScript/16ImporterUtil/types/helpers/ItemHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/ItemHelper.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; +import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { CompareUtil } from "@spt-aki/utils/CompareUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; @@ -28,8 +29,33 @@ export declare class ItemHelper { protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; + protected compareUtil: CompareUtil; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil); + /** + * 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 + * @param item1 first item with all its children to compare + * @param item2 second item with all its children to compare + * @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; + /** + * This method will compare two items and see if the are equivalent. + * This method will NOT compare IDs on the items + * @param item1 first item to compare + * @param item2 second item to compare + * @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; + /** + * 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; /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl @@ -363,10 +389,11 @@ export declare class ItemHelper { * Chose a randomly weighted cartridge that fits * @param caliber Desired caliber * @param staticAmmoDist Cartridges and thier weights + * @param fallbackCartridgeTpl If a cartridge cannot be found in the above staticAmmoDist param, use this instead * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -401,7 +428,7 @@ export declare class ItemHelper { addChildSlotItems(itemToAdd: Item[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): Item[]; /** * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter - * @param possibleTpls Tpls to randomply choose from + * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow * @returns Chosen tpl or null */ diff --git a/TypeScript/16ImporterUtil/types/helpers/PresetHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/16ImporterUtil/types/helpers/PresetHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotType.d.ts index db6e56e..2a00af9 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,9 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/16ImporterUtil/types/models/eft/dialog/IAcceptFriendRequestData.d.ts b/TypeScript/16ImporterUtil/types/models/eft/dialog/IAcceptFriendRequestData.d.ts index 87461aa..0913eb5 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/dialog/IAcceptFriendRequestData.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/dialog/IAcceptFriendRequestData.d.ts @@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest { } export interface ICancelFriendRequestData extends IBaseFriendRequest { } -export interface IBaseFriendRequest { - request_id: string; +export interface IDeclineFriendRequestData extends IBaseFriendRequest { +} +export interface IBaseFriendRequest { + profileId: string; } diff --git a/TypeScript/16ImporterUtil/types/models/eft/dialog/IFriendRequestSendResponse.d.ts b/TypeScript/16ImporterUtil/types/models/eft/dialog/IFriendRequestSendResponse.d.ts index 06c40f3..fc311eb 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/dialog/IFriendRequestSendResponse.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/dialog/IFriendRequestSendResponse.d.ts @@ -1,5 +1,5 @@ export interface IFriendRequestSendResponse { status: number; - requestid: string; + requestId: string; retryAfter: number; } diff --git a/TypeScript/16ImporterUtil/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/TypeScript/16ImporterUtil/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 6c3c9eb..26e43ac 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -1,5 +1,5 @@ import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item } from "../common/tables/IItem"; +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; export interface IGetOtherProfileResponse { id: string; aid: number; diff --git a/TypeScript/16ImporterUtil/types/models/eft/profile/ISearchFriendResponse.d.ts b/TypeScript/16ImporterUtil/types/models/eft/profile/ISearchFriendResponse.d.ts index 96d88b2..d3cc7df 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/profile/ISearchFriendResponse.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/profile/ISearchFriendResponse.d.ts @@ -1,9 +1,11 @@ export interface ISearchFriendResponse { _id: string; + aid: number; Info: Info; } export interface Info { Nickname: string; Side: string; Level: number; + MemberCategory: number; } diff --git a/TypeScript/16ImporterUtil/types/models/enums/AmmoTypes.d.ts b/TypeScript/16ImporterUtil/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/16ImporterUtil/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/16ImporterUtil/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/16ImporterUtil/types/models/enums/WeaponTypes.d.ts b/TypeScript/16ImporterUtil/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/16ImporterUtil/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/16ImporterUtil/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/16ImporterUtil/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/16ImporterUtil/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..529c2cd 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,9 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +23,8 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IPmcConfig.d.ts index 65da29b..f17d3e4 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IPmcConfig.d.ts @@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig { /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; allPMCsHavePlayerNameWithRandomPrefixChance: number; + /** Should secure container loot from usec.json/bear.json be added to pmc bots secure */ + addSecureContainerLootFromBotConfig: boolean; } export interface PmcTypes { usec: string; diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/16ImporterUtil/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/16ImporterUtil/types/models/spt/dialog/ISendMessageDetails.d.ts index 2068ede..05b3bcd 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -30,7 +30,15 @@ export interface ISendMessageDetails { } export interface IProfileChangeEvent { _id: string; - Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + Type: ProfileChangeEventType; value: number; entity?: string; } +export declare enum ProfileChangeEventType { + TRADER_SALES_SUM = "TraderSalesSum", + TRADER_STANDING = "TraderStanding", + PROFILE_LEVEL = "ProfileLevel", + SKILL_POINTS = "SkillPoints", + EXAMINE_ALL_ITEMS = "ExamineAllItems", + UNLOCK_TRADER = "UnlockTrader" +} diff --git a/TypeScript/16ImporterUtil/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/16ImporterUtil/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/16ImporterUtil/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/16ImporterUtil/types/servers/HttpServer.d.ts b/TypeScript/16ImporterUtil/types/servers/HttpServer.d.ts index 8574cdd..bcd740f 100644 --- a/TypeScript/16ImporterUtil/types/servers/HttpServer.d.ts +++ b/TypeScript/16ImporterUtil/types/servers/HttpServer.d.ts @@ -19,11 +19,19 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/16ImporterUtil/types/services/BotLootCacheService.d.ts b/TypeScript/16ImporterUtil/types/services/BotLootCacheService.d.ts index b013e5e..7f79bfe 100644 --- a/TypeScript/16ImporterUtil/types/services/BotLootCacheService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/BotLootCacheService.d.ts @@ -69,6 +69,9 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/16ImporterUtil/types/services/FenceService.d.ts b/TypeScript/16ImporterUtil/types/services/FenceService.d.ts index bb1d035..75c4b28 100644 --- a/TypeScript/16ImporterUtil/types/services/FenceService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,14 +38,30 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; + protected fenceItemUpdCompareProperties: Set; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with */ setFenceAssort(assort: ITraderAssort): void; + /** + * Replace discount fence assort with new assort + * @param assort New assorts to replace old with + */ + setDiscountFenceAssort(assort: ITraderAssort): void; + /** + * Get main fence assort + * @return ITraderAssort + */ + getMainFenceAssort(): ITraderAssort; + /** + * Get discount fence assort + * @return ITraderAssort + */ + getDiscountFenceAssort(): ITraderAssort; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -57,6 +74,26 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adds to fence assort a single item (with its children) + * @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; + /** + * 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; + /** + * 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; /** * Adjust all items contained inside an assort by a multiplier * @param assort (clone)Assort that contains items with prices to adjust @@ -93,17 +130,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -112,8 +155,8 @@ export declare class FenceService { protected deleteRandomAssorts(itemCountToReplace: number, assort: ITraderAssort): void; /** * Choose an item at random and remove it + mods from assorts - * @param assort Items to remove from - * @param rootItems Assort root items to pick from to remove + * @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; /** @@ -132,6 +175,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +196,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +205,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +214,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +225,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +247,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/16ImporterUtil/types/services/ItemBaseClassService.d.ts b/TypeScript/16ImporterUtil/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/16ImporterUtil/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/16ImporterUtil/types/services/MailSendService.d.ts b/TypeScript/16ImporterUtil/types/services/MailSendService.d.ts index 08752bf..e5643f9 100644 --- a/TypeScript/16ImporterUtil/types/services/MailSendService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/MailSendService.d.ts @@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { Traders } from "@spt-aki/models/enums/Traders"; -import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -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?: any): void; + sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], 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?: any[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], 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 diff --git a/TypeScript/16ImporterUtil/types/services/PaymentService.d.ts b/TypeScript/16ImporterUtil/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/16ImporterUtil/types/services/PaymentService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/16ImporterUtil/types/services/ProfileActivityService.d.ts b/TypeScript/16ImporterUtil/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/16ImporterUtil/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/16ImporterUtil/types/services/ProfileFixerService.d.ts b/TypeScript/16ImporterUtil/types/services/ProfileFixerService.d.ts index 804b3bf..1045d0a 100644 --- a/TypeScript/16ImporterUtil/types/services/ProfileFixerService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @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 @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @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 @@ -165,4 +183,9 @@ export declare class ProfileFixerService { * @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 null + */ + protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/16ImporterUtil/types/services/RagfairPriceService.d.ts b/TypeScript/16ImporterUtil/types/services/RagfairPriceService.d.ts index 5649751..0fefdd8 100644 --- a/TypeScript/16ImporterUtil/types/services/RagfairPriceService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], 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 diff --git a/TypeScript/16ImporterUtil/types/utils/App.d.ts b/TypeScript/16ImporterUtil/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/16ImporterUtil/types/utils/App.d.ts +++ b/TypeScript/16ImporterUtil/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/16ImporterUtil/types/utils/CompareUtil.d.ts b/TypeScript/16ImporterUtil/types/utils/CompareUtil.d.ts new file mode 100644 index 0000000..a5b94d5 --- /dev/null +++ b/TypeScript/16ImporterUtil/types/utils/CompareUtil.d.ts @@ -0,0 +1,11 @@ +export declare class CompareUtil { + private static typesToCheckAgainst; + /** + * This function does an object comparison, equivalent to applying reflections + * and scanning for all possible properties including arrays. + * @param v1 value 1 to compare + * @param v2 value 2 to compare + * @returns true if equal, false if not + */ + recursiveCompare(v1: any, v2: any): boolean; +} diff --git a/TypeScript/16ImporterUtil/types/utils/RagfairOfferHolder.d.ts b/TypeScript/16ImporterUtil/types/utils/RagfairOfferHolder.d.ts index 3942ed1..b95e54a 100644 --- a/TypeScript/16ImporterUtil/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/16ImporterUtil/types/utils/RagfairOfferHolder.d.ts @@ -1,9 +1,12 @@ +import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { + protected maxOffersPerTemplate: number; + protected ragfairServerHelper: RagfairServerHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(); + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); getOfferById(id: string): IRagfairOffer; getOffersByTemplate(templateId: string): Array; getOffersByTrader(traderId: string): Array; diff --git a/TypeScript/16ImporterUtil/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/16ImporterUtil/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/16ImporterUtil/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/16ImporterUtil/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/17AsyncImporterWithDependency1/README.md b/TypeScript/17AsyncImporterWithDependency1/README.md index 48c742b..e760f8b 100644 --- a/TypeScript/17AsyncImporterWithDependency1/README.md +++ b/TypeScript/17AsyncImporterWithDependency1/README.md @@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an ## **NodeJS Setup** -Before you begin, ensure to install NodeJS version `v18.15.0`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). +Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). After installation, it's advised to reboot your system. diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/BotCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/DialogueCallbacks.d.ts index 7ed60b9..2de57cb 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/DialogueCallbacks.d.ts @@ -1,7 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; -import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; +import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest"; @@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/friend/request/send */ sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/accept-all + */ + acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; /** * Handle client/friend/request/accept */ acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/decline + */ + declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/friend/request/cancel */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/InraidCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/BotController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/BotController.d.ts index d148abc..556cc5d 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/BotController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/BotController.d.ts @@ -51,12 +51,14 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * 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 ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string): Difficulty; + getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/BuildController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/BuildController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/GameController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/GameController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, 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); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/HideoutController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/HideoutController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/InsuranceController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/InsuranceController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/LauncherController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/LauncherController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/MatchController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/MatchController.d.ts index 6b1a7c3..708cee2 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/MatchController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/MatchController.d.ts @@ -75,10 +75,11 @@ export declare class MatchController { 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(pmcData: IPmcData, extractName: string): void; + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; /** * Was extract by car * @param extractName name of extract diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotEquipmentModGenerator.d.ts index dd1dcce..f850eea 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotEquipmentModGenerator.d.ts @@ -187,12 +187,12 @@ export declare class BotEquipmentModGenerator { */ protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param slotAddedToTemplate slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate template of the mods being added - * @param botRole + * Check if mod exists in db + is for a required slot + * @param modToAdd Db template of mod to check + * @param slotAddedToTemplate Slot object the item will be placed as child into + * @param modSlot Slot the mod will fill + * @param parentTemplate Db template of the mods being added + * @param botRole Bots wildspawntype (assault/pmcBot etc) * @returns true if valid */ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: 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/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLootGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLootGenerator.d.ts index 014617e..ca5d1bd 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLootGenerator.d.ts @@ -82,7 +82,7 @@ export declare class BotLootGenerator { * @param totalValueLimitRub Total value of loot allowed in roubles * @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): void; + 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[][]; /** * Some items need child items to function, add them to the itemToAddChildrenTo array @@ -101,7 +101,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): void; + protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, 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 diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..5ca8ed7 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/FenceBaseAssortGenerator.d.ts @@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { FenceService } from "@spt-aki/services/FenceService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -22,14 +23,25 @@ export declare class FenceBaseAssortGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; + protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; - protected getItemPrice(itemTpl: string, items: Item[]): number; - protected getAmmoBoxPrice(items: Item[]): number; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * Get the penetration power value of an ammo, works with ammo boxes and raw ammos + * @param rootItemDb Ammo box or ammo item from items.db + * @returns Penetration power of passed in item, null if it doesnt have a power + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/LootGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/LootGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotGeneratorHelper.d.ts index 7f7555b..c756725 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotGeneratorHelper.d.ts @@ -92,7 +92,7 @@ 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): ItemAddedResult; + addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set): ItemAddedResult; /** * Is the provided item allowed inside a container * @param slotGrid Items sub-grid we want to place item inside diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts new file mode 100644 index 0000000..26958ca --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -0,0 +1,39 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected itemFilterService: ItemFilterService; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en espaƱol" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: Map; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts deleted file mode 100644 index 33d05de..0000000 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; -import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; -import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -export declare class GiveSptCommand implements ISptCommand { - protected logger: ILogger; - protected itemHelper: ItemHelper; - protected hashUtil: HashUtil; - protected jsonUtil: JsonUtil; - protected presetHelper: PresetHelper; - protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); - getCommand(): string; - getCommandHelp(): string; - performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts new file mode 100644 index 0000000..8ec2ada --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts @@ -0,0 +1,38 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class ProfileSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected profileHelper: ProfileHelper; + /** + * Regex to account for all these cases: + * spt profile level 20 + * spt profile skill metabolism 10 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent; + protected handleLevelCommand(level: number): IProfileChangeEvent; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts new file mode 100644 index 0000000..d84158a --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -0,0 +1,33 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class TraderSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt trader prapor rep 100 + * spt trader mechanic spend 1000000 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/HttpServerHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/ItemHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/ItemHelper.d.ts index 3e91ef7..9195579 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/ItemHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/ItemHelper.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; +import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { CompareUtil } from "@spt-aki/utils/CompareUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; @@ -28,8 +29,33 @@ export declare class ItemHelper { protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; + protected compareUtil: CompareUtil; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil); + /** + * 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 + * @param item1 first item with all its children to compare + * @param item2 second item with all its children to compare + * @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; + /** + * This method will compare two items and see if the are equivalent. + * This method will NOT compare IDs on the items + * @param item1 first item to compare + * @param item2 second item to compare + * @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; + /** + * 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; /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl @@ -363,10 +389,11 @@ export declare class ItemHelper { * Chose a randomly weighted cartridge that fits * @param caliber Desired caliber * @param staticAmmoDist Cartridges and thier weights + * @param fallbackCartridgeTpl If a cartridge cannot be found in the above staticAmmoDist param, use this instead * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -401,7 +428,7 @@ export declare class ItemHelper { addChildSlotItems(itemToAdd: Item[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): Item[]; /** * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter - * @param possibleTpls Tpls to randomply choose from + * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow * @returns Chosen tpl or null */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/PresetHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/PresetHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotType.d.ts index db6e56e..2a00af9 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,9 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/dialog/IAcceptFriendRequestData.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/dialog/IAcceptFriendRequestData.d.ts index 87461aa..0913eb5 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/dialog/IAcceptFriendRequestData.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/dialog/IAcceptFriendRequestData.d.ts @@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest { } export interface ICancelFriendRequestData extends IBaseFriendRequest { } -export interface IBaseFriendRequest { - request_id: string; +export interface IDeclineFriendRequestData extends IBaseFriendRequest { +} +export interface IBaseFriendRequest { + profileId: string; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/dialog/IFriendRequestSendResponse.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/dialog/IFriendRequestSendResponse.d.ts index 06c40f3..fc311eb 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/dialog/IFriendRequestSendResponse.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/dialog/IFriendRequestSendResponse.d.ts @@ -1,5 +1,5 @@ export interface IFriendRequestSendResponse { status: number; - requestid: string; + requestId: string; retryAfter: number; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 6c3c9eb..26e43ac 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -1,5 +1,5 @@ import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item } from "../common/tables/IItem"; +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; export interface IGetOtherProfileResponse { id: string; aid: number; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/ISearchFriendResponse.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/ISearchFriendResponse.d.ts index 96d88b2..d3cc7df 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/ISearchFriendResponse.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/ISearchFriendResponse.d.ts @@ -1,9 +1,11 @@ export interface ISearchFriendResponse { _id: string; + aid: number; Info: Info; } export interface Info { Nickname: string; Side: string; Level: number; + MemberCategory: number; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/AmmoTypes.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/WeaponTypes.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..529c2cd 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,9 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +23,8 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IPmcConfig.d.ts index 65da29b..f17d3e4 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IPmcConfig.d.ts @@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig { /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; allPMCsHavePlayerNameWithRandomPrefixChance: number; + /** Should secure container loot from usec.json/bear.json be added to pmc bots secure */ + addSecureContainerLootFromBotConfig: boolean; } export interface PmcTypes { usec: string; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/dialog/ISendMessageDetails.d.ts index 2068ede..05b3bcd 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -30,7 +30,15 @@ export interface ISendMessageDetails { } export interface IProfileChangeEvent { _id: string; - Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + Type: ProfileChangeEventType; value: number; entity?: string; } +export declare enum ProfileChangeEventType { + TRADER_SALES_SUM = "TraderSalesSum", + TRADER_STANDING = "TraderStanding", + PROFILE_LEVEL = "ProfileLevel", + SKILL_POINTS = "SkillPoints", + EXAMINE_ALL_ITEMS = "ExamineAllItems", + UNLOCK_TRADER = "UnlockTrader" +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/servers/HttpServer.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/servers/HttpServer.d.ts index 8574cdd..bcd740f 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/servers/HttpServer.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/servers/HttpServer.d.ts @@ -19,11 +19,19 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/BotLootCacheService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/BotLootCacheService.d.ts index b013e5e..7f79bfe 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/BotLootCacheService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/BotLootCacheService.d.ts @@ -69,6 +69,9 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/FenceService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/FenceService.d.ts index bb1d035..75c4b28 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/FenceService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,14 +38,30 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; + protected fenceItemUpdCompareProperties: Set; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with */ setFenceAssort(assort: ITraderAssort): void; + /** + * Replace discount fence assort with new assort + * @param assort New assorts to replace old with + */ + setDiscountFenceAssort(assort: ITraderAssort): void; + /** + * Get main fence assort + * @return ITraderAssort + */ + getMainFenceAssort(): ITraderAssort; + /** + * Get discount fence assort + * @return ITraderAssort + */ + getDiscountFenceAssort(): ITraderAssort; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -57,6 +74,26 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adds to fence assort a single item (with its children) + * @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; + /** + * 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; + /** + * 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; /** * Adjust all items contained inside an assort by a multiplier * @param assort (clone)Assort that contains items with prices to adjust @@ -93,17 +130,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -112,8 +155,8 @@ export declare class FenceService { protected deleteRandomAssorts(itemCountToReplace: number, assort: ITraderAssort): void; /** * Choose an item at random and remove it + mods from assorts - * @param assort Items to remove from - * @param rootItems Assort root items to pick from to remove + * @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; /** @@ -132,6 +175,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +196,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +205,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +214,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +225,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +247,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/ItemBaseClassService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/MailSendService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/MailSendService.d.ts index 08752bf..e5643f9 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/MailSendService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/MailSendService.d.ts @@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { Traders } from "@spt-aki/models/enums/Traders"; -import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -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?: any): void; + sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], 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?: any[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], 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 diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/PaymentService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/PaymentService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileActivityService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileFixerService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileFixerService.d.ts index 804b3bf..1045d0a 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileFixerService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @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 @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @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 @@ -165,4 +183,9 @@ export declare class ProfileFixerService { * @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 null + */ + protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairPriceService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairPriceService.d.ts index 5649751..0fefdd8 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairPriceService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], 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 diff --git a/TypeScript/17AsyncImporterWithDependency1/types/utils/App.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/utils/App.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/utils/CompareUtil.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/utils/CompareUtil.d.ts new file mode 100644 index 0000000..a5b94d5 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/utils/CompareUtil.d.ts @@ -0,0 +1,11 @@ +export declare class CompareUtil { + private static typesToCheckAgainst; + /** + * This function does an object comparison, equivalent to applying reflections + * and scanning for all possible properties including arrays. + * @param v1 value 1 to compare + * @param v2 value 2 to compare + * @returns true if equal, false if not + */ + recursiveCompare(v1: any, v2: any): boolean; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/utils/RagfairOfferHolder.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/utils/RagfairOfferHolder.d.ts index 3942ed1..b95e54a 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/utils/RagfairOfferHolder.d.ts @@ -1,9 +1,12 @@ +import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { + protected maxOffersPerTemplate: number; + protected ragfairServerHelper: RagfairServerHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(); + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); getOfferById(id: string): IRagfairOffer; getOffersByTemplate(templateId: string): Array; getOffersByTrader(traderId: string): Array; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/17AsyncImporterWithDependency2/README.md b/TypeScript/17AsyncImporterWithDependency2/README.md index 48c742b..e760f8b 100644 --- a/TypeScript/17AsyncImporterWithDependency2/README.md +++ b/TypeScript/17AsyncImporterWithDependency2/README.md @@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an ## **NodeJS Setup** -Before you begin, ensure to install NodeJS version `v18.15.0`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). +Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). After installation, it's advised to reboot your system. diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/BotCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/DialogueCallbacks.d.ts index 7ed60b9..2de57cb 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/DialogueCallbacks.d.ts @@ -1,7 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; -import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; +import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest"; @@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/friend/request/send */ sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/accept-all + */ + acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; /** * Handle client/friend/request/accept */ acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/decline + */ + declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/friend/request/cancel */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/InraidCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/BotController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/BotController.d.ts index d148abc..556cc5d 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/BotController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/BotController.d.ts @@ -51,12 +51,14 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * 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 ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string): Difficulty; + getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/BuildController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/BuildController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/GameController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/GameController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, 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); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/HideoutController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/HideoutController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/InsuranceController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/InsuranceController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/LauncherController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/LauncherController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/MatchController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/MatchController.d.ts index 6b1a7c3..708cee2 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/MatchController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/MatchController.d.ts @@ -75,10 +75,11 @@ export declare class MatchController { 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(pmcData: IPmcData, extractName: string): void; + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; /** * Was extract by car * @param extractName name of extract diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotEquipmentModGenerator.d.ts index dd1dcce..f850eea 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotEquipmentModGenerator.d.ts @@ -187,12 +187,12 @@ export declare class BotEquipmentModGenerator { */ protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param slotAddedToTemplate slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate template of the mods being added - * @param botRole + * Check if mod exists in db + is for a required slot + * @param modToAdd Db template of mod to check + * @param slotAddedToTemplate Slot object the item will be placed as child into + * @param modSlot Slot the mod will fill + * @param parentTemplate Db template of the mods being added + * @param botRole Bots wildspawntype (assault/pmcBot etc) * @returns true if valid */ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: 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/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLootGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLootGenerator.d.ts index 014617e..ca5d1bd 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLootGenerator.d.ts @@ -82,7 +82,7 @@ export declare class BotLootGenerator { * @param totalValueLimitRub Total value of loot allowed in roubles * @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): void; + 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[][]; /** * Some items need child items to function, add them to the itemToAddChildrenTo array @@ -101,7 +101,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): void; + protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, 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 diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..5ca8ed7 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/FenceBaseAssortGenerator.d.ts @@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { FenceService } from "@spt-aki/services/FenceService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -22,14 +23,25 @@ export declare class FenceBaseAssortGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; + protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; - protected getItemPrice(itemTpl: string, items: Item[]): number; - protected getAmmoBoxPrice(items: Item[]): number; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * Get the penetration power value of an ammo, works with ammo boxes and raw ammos + * @param rootItemDb Ammo box or ammo item from items.db + * @returns Penetration power of passed in item, null if it doesnt have a power + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/LootGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/LootGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotGeneratorHelper.d.ts index 7f7555b..c756725 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotGeneratorHelper.d.ts @@ -92,7 +92,7 @@ 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): ItemAddedResult; + addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set): ItemAddedResult; /** * Is the provided item allowed inside a container * @param slotGrid Items sub-grid we want to place item inside diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts new file mode 100644 index 0000000..26958ca --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -0,0 +1,39 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected itemFilterService: ItemFilterService; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en espaƱol" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: Map; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts deleted file mode 100644 index 33d05de..0000000 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; -import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; -import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -export declare class GiveSptCommand implements ISptCommand { - protected logger: ILogger; - protected itemHelper: ItemHelper; - protected hashUtil: HashUtil; - protected jsonUtil: JsonUtil; - protected presetHelper: PresetHelper; - protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); - getCommand(): string; - getCommandHelp(): string; - performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts new file mode 100644 index 0000000..8ec2ada --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts @@ -0,0 +1,38 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class ProfileSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected profileHelper: ProfileHelper; + /** + * Regex to account for all these cases: + * spt profile level 20 + * spt profile skill metabolism 10 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent; + protected handleLevelCommand(level: number): IProfileChangeEvent; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts new file mode 100644 index 0000000..d84158a --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -0,0 +1,33 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class TraderSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt trader prapor rep 100 + * spt trader mechanic spend 1000000 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/HttpServerHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/ItemHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/ItemHelper.d.ts index 3e91ef7..9195579 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/ItemHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/ItemHelper.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; +import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { CompareUtil } from "@spt-aki/utils/CompareUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; @@ -28,8 +29,33 @@ export declare class ItemHelper { protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; + protected compareUtil: CompareUtil; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil); + /** + * 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 + * @param item1 first item with all its children to compare + * @param item2 second item with all its children to compare + * @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; + /** + * This method will compare two items and see if the are equivalent. + * This method will NOT compare IDs on the items + * @param item1 first item to compare + * @param item2 second item to compare + * @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; + /** + * 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; /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl @@ -363,10 +389,11 @@ export declare class ItemHelper { * Chose a randomly weighted cartridge that fits * @param caliber Desired caliber * @param staticAmmoDist Cartridges and thier weights + * @param fallbackCartridgeTpl If a cartridge cannot be found in the above staticAmmoDist param, use this instead * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -401,7 +428,7 @@ export declare class ItemHelper { addChildSlotItems(itemToAdd: Item[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): Item[]; /** * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter - * @param possibleTpls Tpls to randomply choose from + * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow * @returns Chosen tpl or null */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/PresetHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/PresetHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotType.d.ts index db6e56e..2a00af9 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,9 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/dialog/IAcceptFriendRequestData.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/dialog/IAcceptFriendRequestData.d.ts index 87461aa..0913eb5 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/dialog/IAcceptFriendRequestData.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/dialog/IAcceptFriendRequestData.d.ts @@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest { } export interface ICancelFriendRequestData extends IBaseFriendRequest { } -export interface IBaseFriendRequest { - request_id: string; +export interface IDeclineFriendRequestData extends IBaseFriendRequest { +} +export interface IBaseFriendRequest { + profileId: string; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/dialog/IFriendRequestSendResponse.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/dialog/IFriendRequestSendResponse.d.ts index 06c40f3..fc311eb 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/dialog/IFriendRequestSendResponse.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/dialog/IFriendRequestSendResponse.d.ts @@ -1,5 +1,5 @@ export interface IFriendRequestSendResponse { status: number; - requestid: string; + requestId: string; retryAfter: number; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 6c3c9eb..26e43ac 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -1,5 +1,5 @@ import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item } from "../common/tables/IItem"; +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; export interface IGetOtherProfileResponse { id: string; aid: number; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/ISearchFriendResponse.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/ISearchFriendResponse.d.ts index 96d88b2..d3cc7df 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/ISearchFriendResponse.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/ISearchFriendResponse.d.ts @@ -1,9 +1,11 @@ export interface ISearchFriendResponse { _id: string; + aid: number; Info: Info; } export interface Info { Nickname: string; Side: string; Level: number; + MemberCategory: number; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/AmmoTypes.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/WeaponTypes.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..529c2cd 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,9 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +23,8 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IPmcConfig.d.ts index 65da29b..f17d3e4 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IPmcConfig.d.ts @@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig { /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; allPMCsHavePlayerNameWithRandomPrefixChance: number; + /** Should secure container loot from usec.json/bear.json be added to pmc bots secure */ + addSecureContainerLootFromBotConfig: boolean; } export interface PmcTypes { usec: string; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/dialog/ISendMessageDetails.d.ts index 2068ede..05b3bcd 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -30,7 +30,15 @@ export interface ISendMessageDetails { } export interface IProfileChangeEvent { _id: string; - Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + Type: ProfileChangeEventType; value: number; entity?: string; } +export declare enum ProfileChangeEventType { + TRADER_SALES_SUM = "TraderSalesSum", + TRADER_STANDING = "TraderStanding", + PROFILE_LEVEL = "ProfileLevel", + SKILL_POINTS = "SkillPoints", + EXAMINE_ALL_ITEMS = "ExamineAllItems", + UNLOCK_TRADER = "UnlockTrader" +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/servers/HttpServer.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/servers/HttpServer.d.ts index 8574cdd..bcd740f 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/servers/HttpServer.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/servers/HttpServer.d.ts @@ -19,11 +19,19 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/BotLootCacheService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/BotLootCacheService.d.ts index b013e5e..7f79bfe 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/BotLootCacheService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/BotLootCacheService.d.ts @@ -69,6 +69,9 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/FenceService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/FenceService.d.ts index bb1d035..75c4b28 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/FenceService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,14 +38,30 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; + protected fenceItemUpdCompareProperties: Set; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with */ setFenceAssort(assort: ITraderAssort): void; + /** + * Replace discount fence assort with new assort + * @param assort New assorts to replace old with + */ + setDiscountFenceAssort(assort: ITraderAssort): void; + /** + * Get main fence assort + * @return ITraderAssort + */ + getMainFenceAssort(): ITraderAssort; + /** + * Get discount fence assort + * @return ITraderAssort + */ + getDiscountFenceAssort(): ITraderAssort; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -57,6 +74,26 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adds to fence assort a single item (with its children) + * @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; + /** + * 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; + /** + * 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; /** * Adjust all items contained inside an assort by a multiplier * @param assort (clone)Assort that contains items with prices to adjust @@ -93,17 +130,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -112,8 +155,8 @@ export declare class FenceService { protected deleteRandomAssorts(itemCountToReplace: number, assort: ITraderAssort): void; /** * Choose an item at random and remove it + mods from assorts - * @param assort Items to remove from - * @param rootItems Assort root items to pick from to remove + * @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; /** @@ -132,6 +175,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +196,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +205,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +214,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +225,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +247,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/ItemBaseClassService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/MailSendService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/MailSendService.d.ts index 08752bf..e5643f9 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/MailSendService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/MailSendService.d.ts @@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { Traders } from "@spt-aki/models/enums/Traders"; -import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -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?: any): void; + sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], 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?: any[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], 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 diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/PaymentService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/PaymentService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileActivityService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileFixerService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileFixerService.d.ts index 804b3bf..1045d0a 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileFixerService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @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 @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @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 @@ -165,4 +183,9 @@ export declare class ProfileFixerService { * @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 null + */ + protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairPriceService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairPriceService.d.ts index 5649751..0fefdd8 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairPriceService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], 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 diff --git a/TypeScript/17AsyncImporterWithDependency2/types/utils/App.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/utils/App.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/utils/CompareUtil.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/utils/CompareUtil.d.ts new file mode 100644 index 0000000..a5b94d5 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/utils/CompareUtil.d.ts @@ -0,0 +1,11 @@ +export declare class CompareUtil { + private static typesToCheckAgainst; + /** + * This function does an object comparison, equivalent to applying reflections + * and scanning for all possible properties including arrays. + * @param v1 value 1 to compare + * @param v2 value 2 to compare + * @returns true if equal, false if not + */ + recursiveCompare(v1: any, v2: any): boolean; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/utils/RagfairOfferHolder.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/utils/RagfairOfferHolder.d.ts index 3942ed1..b95e54a 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/utils/RagfairOfferHolder.d.ts @@ -1,9 +1,12 @@ +import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { + protected maxOffersPerTemplate: number; + protected ragfairServerHelper: RagfairServerHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(); + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); getOfferById(id: string): IRagfairOffer; getOffersByTemplate(templateId: string): Array; getOffersByTrader(traderId: string): Array; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/18CustomItemService/README.md b/TypeScript/18CustomItemService/README.md index 48c742b..e760f8b 100644 --- a/TypeScript/18CustomItemService/README.md +++ b/TypeScript/18CustomItemService/README.md @@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an ## **NodeJS Setup** -Before you begin, ensure to install NodeJS version `v18.15.0`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). +Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). After installation, it's advised to reboot your system. diff --git a/TypeScript/18CustomItemService/types/callbacks/BotCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/18CustomItemService/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/18CustomItemService/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/DialogueCallbacks.d.ts index 7ed60b9..2de57cb 100644 --- a/TypeScript/18CustomItemService/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/DialogueCallbacks.d.ts @@ -1,7 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; -import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; +import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest"; @@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/friend/request/send */ sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/accept-all + */ + acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; /** * Handle client/friend/request/accept */ acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/decline + */ + declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/friend/request/cancel */ diff --git a/TypeScript/18CustomItemService/types/callbacks/InraidCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/18CustomItemService/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/18CustomItemService/types/controllers/BotController.d.ts b/TypeScript/18CustomItemService/types/controllers/BotController.d.ts index d148abc..556cc5d 100644 --- a/TypeScript/18CustomItemService/types/controllers/BotController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/BotController.d.ts @@ -51,12 +51,14 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * 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 ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string): Difficulty; + getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/18CustomItemService/types/controllers/BuildController.d.ts b/TypeScript/18CustomItemService/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/18CustomItemService/types/controllers/BuildController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/18CustomItemService/types/controllers/GameController.d.ts b/TypeScript/18CustomItemService/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/18CustomItemService/types/controllers/GameController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, 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); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/18CustomItemService/types/controllers/HideoutController.d.ts b/TypeScript/18CustomItemService/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/18CustomItemService/types/controllers/HideoutController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/18CustomItemService/types/controllers/InsuranceController.d.ts b/TypeScript/18CustomItemService/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/18CustomItemService/types/controllers/InsuranceController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/18CustomItemService/types/controllers/LauncherController.d.ts b/TypeScript/18CustomItemService/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/18CustomItemService/types/controllers/LauncherController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/18CustomItemService/types/controllers/MatchController.d.ts b/TypeScript/18CustomItemService/types/controllers/MatchController.d.ts index 6b1a7c3..708cee2 100644 --- a/TypeScript/18CustomItemService/types/controllers/MatchController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/MatchController.d.ts @@ -75,10 +75,11 @@ export declare class MatchController { 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(pmcData: IPmcData, extractName: string): void; + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; /** * Was extract by car * @param extractName name of extract diff --git a/TypeScript/18CustomItemService/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/BotEquipmentModGenerator.d.ts index dd1dcce..f850eea 100644 --- a/TypeScript/18CustomItemService/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/BotEquipmentModGenerator.d.ts @@ -187,12 +187,12 @@ export declare class BotEquipmentModGenerator { */ protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param slotAddedToTemplate slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate template of the mods being added - * @param botRole + * Check if mod exists in db + is for a required slot + * @param modToAdd Db template of mod to check + * @param slotAddedToTemplate Slot object the item will be placed as child into + * @param modSlot Slot the mod will fill + * @param parentTemplate Db template of the mods being added + * @param botRole Bots wildspawntype (assault/pmcBot etc) * @returns true if valid */ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; diff --git a/TypeScript/18CustomItemService/types/generators/BotGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/18CustomItemService/types/generators/BotGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: 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/TypeScript/18CustomItemService/types/generators/BotLootGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/BotLootGenerator.d.ts index 014617e..ca5d1bd 100644 --- a/TypeScript/18CustomItemService/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/BotLootGenerator.d.ts @@ -82,7 +82,7 @@ export declare class BotLootGenerator { * @param totalValueLimitRub Total value of loot allowed in roubles * @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): void; + 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[][]; /** * Some items need child items to function, add them to the itemToAddChildrenTo array @@ -101,7 +101,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): void; + protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, 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 diff --git a/TypeScript/18CustomItemService/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..5ca8ed7 100644 --- a/TypeScript/18CustomItemService/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/FenceBaseAssortGenerator.d.ts @@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { FenceService } from "@spt-aki/services/FenceService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -22,14 +23,25 @@ export declare class FenceBaseAssortGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; + protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; - protected getItemPrice(itemTpl: string, items: Item[]): number; - protected getAmmoBoxPrice(items: Item[]): number; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * Get the penetration power value of an ammo, works with ammo boxes and raw ammos + * @param rootItemDb Ammo box or ammo item from items.db + * @returns Penetration power of passed in item, null if it doesnt have a power + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/18CustomItemService/types/generators/LootGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/18CustomItemService/types/generators/LootGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/18CustomItemService/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/18CustomItemService/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/18CustomItemService/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/BotGeneratorHelper.d.ts index 7f7555b..c756725 100644 --- a/TypeScript/18CustomItemService/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/BotGeneratorHelper.d.ts @@ -92,7 +92,7 @@ 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): ItemAddedResult; + addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set): ItemAddedResult; /** * Is the provided item allowed inside a container * @param slotGrid Items sub-grid we want to place item inside diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/18CustomItemService/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts new file mode 100644 index 0000000..26958ca --- /dev/null +++ b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -0,0 +1,39 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected itemFilterService: ItemFilterService; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en espaƱol" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: Map; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts deleted file mode 100644 index 33d05de..0000000 --- a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; -import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; -import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -export declare class GiveSptCommand implements ISptCommand { - protected logger: ILogger; - protected itemHelper: ItemHelper; - protected hashUtil: HashUtil; - protected jsonUtil: JsonUtil; - protected presetHelper: PresetHelper; - protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); - getCommand(): string; - getCommandHelp(): string; - performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts new file mode 100644 index 0000000..8ec2ada --- /dev/null +++ b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts @@ -0,0 +1,38 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class ProfileSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected profileHelper: ProfileHelper; + /** + * Regex to account for all these cases: + * spt profile level 20 + * spt profile skill metabolism 10 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent; + protected handleLevelCommand(level: number): IProfileChangeEvent; +} diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts new file mode 100644 index 0000000..d84158a --- /dev/null +++ b/TypeScript/18CustomItemService/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -0,0 +1,33 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class TraderSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt trader prapor rep 100 + * spt trader mechanic spend 1000000 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/18CustomItemService/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/18CustomItemService/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/18CustomItemService/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/18CustomItemService/types/helpers/HideoutHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/18CustomItemService/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/18CustomItemService/types/helpers/HttpServerHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/18CustomItemService/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/18CustomItemService/types/helpers/ItemHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/ItemHelper.d.ts index 3e91ef7..9195579 100644 --- a/TypeScript/18CustomItemService/types/helpers/ItemHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/ItemHelper.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; +import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { CompareUtil } from "@spt-aki/utils/CompareUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; @@ -28,8 +29,33 @@ export declare class ItemHelper { protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; + protected compareUtil: CompareUtil; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil); + /** + * 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 + * @param item1 first item with all its children to compare + * @param item2 second item with all its children to compare + * @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; + /** + * This method will compare two items and see if the are equivalent. + * This method will NOT compare IDs on the items + * @param item1 first item to compare + * @param item2 second item to compare + * @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; + /** + * 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; /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl @@ -363,10 +389,11 @@ export declare class ItemHelper { * Chose a randomly weighted cartridge that fits * @param caliber Desired caliber * @param staticAmmoDist Cartridges and thier weights + * @param fallbackCartridgeTpl If a cartridge cannot be found in the above staticAmmoDist param, use this instead * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -401,7 +428,7 @@ export declare class ItemHelper { addChildSlotItems(itemToAdd: Item[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): Item[]; /** * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter - * @param possibleTpls Tpls to randomply choose from + * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow * @returns Chosen tpl or null */ diff --git a/TypeScript/18CustomItemService/types/helpers/PresetHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/18CustomItemService/types/helpers/PresetHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotType.d.ts index db6e56e..2a00af9 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,9 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/18CustomItemService/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/18CustomItemService/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/18CustomItemService/types/models/eft/dialog/IAcceptFriendRequestData.d.ts b/TypeScript/18CustomItemService/types/models/eft/dialog/IAcceptFriendRequestData.d.ts index 87461aa..0913eb5 100644 --- a/TypeScript/18CustomItemService/types/models/eft/dialog/IAcceptFriendRequestData.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/dialog/IAcceptFriendRequestData.d.ts @@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest { } export interface ICancelFriendRequestData extends IBaseFriendRequest { } -export interface IBaseFriendRequest { - request_id: string; +export interface IDeclineFriendRequestData extends IBaseFriendRequest { +} +export interface IBaseFriendRequest { + profileId: string; } diff --git a/TypeScript/18CustomItemService/types/models/eft/dialog/IFriendRequestSendResponse.d.ts b/TypeScript/18CustomItemService/types/models/eft/dialog/IFriendRequestSendResponse.d.ts index 06c40f3..fc311eb 100644 --- a/TypeScript/18CustomItemService/types/models/eft/dialog/IFriendRequestSendResponse.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/dialog/IFriendRequestSendResponse.d.ts @@ -1,5 +1,5 @@ export interface IFriendRequestSendResponse { status: number; - requestid: string; + requestId: string; retryAfter: number; } diff --git a/TypeScript/18CustomItemService/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/TypeScript/18CustomItemService/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 6c3c9eb..26e43ac 100644 --- a/TypeScript/18CustomItemService/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -1,5 +1,5 @@ import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item } from "../common/tables/IItem"; +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; export interface IGetOtherProfileResponse { id: string; aid: number; diff --git a/TypeScript/18CustomItemService/types/models/eft/profile/ISearchFriendResponse.d.ts b/TypeScript/18CustomItemService/types/models/eft/profile/ISearchFriendResponse.d.ts index 96d88b2..d3cc7df 100644 --- a/TypeScript/18CustomItemService/types/models/eft/profile/ISearchFriendResponse.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/profile/ISearchFriendResponse.d.ts @@ -1,9 +1,11 @@ export interface ISearchFriendResponse { _id: string; + aid: number; Info: Info; } export interface Info { Nickname: string; Side: string; Level: number; + MemberCategory: number; } diff --git a/TypeScript/18CustomItemService/types/models/enums/AmmoTypes.d.ts b/TypeScript/18CustomItemService/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/18CustomItemService/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/18CustomItemService/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/18CustomItemService/types/models/enums/WeaponTypes.d.ts b/TypeScript/18CustomItemService/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/18CustomItemService/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/18CustomItemService/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/18CustomItemService/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/18CustomItemService/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..529c2cd 100644 --- a/TypeScript/18CustomItemService/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,9 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +23,8 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/18CustomItemService/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/18CustomItemService/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IPmcConfig.d.ts index 65da29b..f17d3e4 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IPmcConfig.d.ts @@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig { /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; allPMCsHavePlayerNameWithRandomPrefixChance: number; + /** Should secure container loot from usec.json/bear.json be added to pmc bots secure */ + addSecureContainerLootFromBotConfig: boolean; } export interface PmcTypes { usec: string; diff --git a/TypeScript/18CustomItemService/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/18CustomItemService/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/18CustomItemService/types/models/spt/dialog/ISendMessageDetails.d.ts index 2068ede..05b3bcd 100644 --- a/TypeScript/18CustomItemService/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -30,7 +30,15 @@ export interface ISendMessageDetails { } export interface IProfileChangeEvent { _id: string; - Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + Type: ProfileChangeEventType; value: number; entity?: string; } +export declare enum ProfileChangeEventType { + TRADER_SALES_SUM = "TraderSalesSum", + TRADER_STANDING = "TraderStanding", + PROFILE_LEVEL = "ProfileLevel", + SKILL_POINTS = "SkillPoints", + EXAMINE_ALL_ITEMS = "ExamineAllItems", + UNLOCK_TRADER = "UnlockTrader" +} diff --git a/TypeScript/18CustomItemService/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/18CustomItemService/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/18CustomItemService/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/18CustomItemService/types/servers/HttpServer.d.ts b/TypeScript/18CustomItemService/types/servers/HttpServer.d.ts index 8574cdd..bcd740f 100644 --- a/TypeScript/18CustomItemService/types/servers/HttpServer.d.ts +++ b/TypeScript/18CustomItemService/types/servers/HttpServer.d.ts @@ -19,11 +19,19 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/18CustomItemService/types/services/BotLootCacheService.d.ts b/TypeScript/18CustomItemService/types/services/BotLootCacheService.d.ts index b013e5e..7f79bfe 100644 --- a/TypeScript/18CustomItemService/types/services/BotLootCacheService.d.ts +++ b/TypeScript/18CustomItemService/types/services/BotLootCacheService.d.ts @@ -69,6 +69,9 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/18CustomItemService/types/services/FenceService.d.ts b/TypeScript/18CustomItemService/types/services/FenceService.d.ts index bb1d035..75c4b28 100644 --- a/TypeScript/18CustomItemService/types/services/FenceService.d.ts +++ b/TypeScript/18CustomItemService/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,14 +38,30 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; + protected fenceItemUpdCompareProperties: Set; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with */ setFenceAssort(assort: ITraderAssort): void; + /** + * Replace discount fence assort with new assort + * @param assort New assorts to replace old with + */ + setDiscountFenceAssort(assort: ITraderAssort): void; + /** + * Get main fence assort + * @return ITraderAssort + */ + getMainFenceAssort(): ITraderAssort; + /** + * Get discount fence assort + * @return ITraderAssort + */ + getDiscountFenceAssort(): ITraderAssort; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -57,6 +74,26 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adds to fence assort a single item (with its children) + * @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; + /** + * 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; + /** + * 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; /** * Adjust all items contained inside an assort by a multiplier * @param assort (clone)Assort that contains items with prices to adjust @@ -93,17 +130,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -112,8 +155,8 @@ export declare class FenceService { protected deleteRandomAssorts(itemCountToReplace: number, assort: ITraderAssort): void; /** * Choose an item at random and remove it + mods from assorts - * @param assort Items to remove from - * @param rootItems Assort root items to pick from to remove + * @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; /** @@ -132,6 +175,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +196,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +205,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +214,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +225,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +247,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/18CustomItemService/types/services/ItemBaseClassService.d.ts b/TypeScript/18CustomItemService/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/18CustomItemService/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/18CustomItemService/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/18CustomItemService/types/services/MailSendService.d.ts b/TypeScript/18CustomItemService/types/services/MailSendService.d.ts index 08752bf..e5643f9 100644 --- a/TypeScript/18CustomItemService/types/services/MailSendService.d.ts +++ b/TypeScript/18CustomItemService/types/services/MailSendService.d.ts @@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { Traders } from "@spt-aki/models/enums/Traders"; -import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -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?: any): void; + sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], 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?: any[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], 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 diff --git a/TypeScript/18CustomItemService/types/services/PaymentService.d.ts b/TypeScript/18CustomItemService/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/18CustomItemService/types/services/PaymentService.d.ts +++ b/TypeScript/18CustomItemService/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/18CustomItemService/types/services/ProfileActivityService.d.ts b/TypeScript/18CustomItemService/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/18CustomItemService/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/18CustomItemService/types/services/ProfileFixerService.d.ts b/TypeScript/18CustomItemService/types/services/ProfileFixerService.d.ts index 804b3bf..1045d0a 100644 --- a/TypeScript/18CustomItemService/types/services/ProfileFixerService.d.ts +++ b/TypeScript/18CustomItemService/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @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 @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @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 @@ -165,4 +183,9 @@ export declare class ProfileFixerService { * @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 null + */ + protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/18CustomItemService/types/services/RagfairPriceService.d.ts b/TypeScript/18CustomItemService/types/services/RagfairPriceService.d.ts index 5649751..0fefdd8 100644 --- a/TypeScript/18CustomItemService/types/services/RagfairPriceService.d.ts +++ b/TypeScript/18CustomItemService/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], 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 diff --git a/TypeScript/18CustomItemService/types/utils/App.d.ts b/TypeScript/18CustomItemService/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/18CustomItemService/types/utils/App.d.ts +++ b/TypeScript/18CustomItemService/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/18CustomItemService/types/utils/CompareUtil.d.ts b/TypeScript/18CustomItemService/types/utils/CompareUtil.d.ts new file mode 100644 index 0000000..a5b94d5 --- /dev/null +++ b/TypeScript/18CustomItemService/types/utils/CompareUtil.d.ts @@ -0,0 +1,11 @@ +export declare class CompareUtil { + private static typesToCheckAgainst; + /** + * This function does an object comparison, equivalent to applying reflections + * and scanning for all possible properties including arrays. + * @param v1 value 1 to compare + * @param v2 value 2 to compare + * @returns true if equal, false if not + */ + recursiveCompare(v1: any, v2: any): boolean; +} diff --git a/TypeScript/18CustomItemService/types/utils/RagfairOfferHolder.d.ts b/TypeScript/18CustomItemService/types/utils/RagfairOfferHolder.d.ts index 3942ed1..b95e54a 100644 --- a/TypeScript/18CustomItemService/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/18CustomItemService/types/utils/RagfairOfferHolder.d.ts @@ -1,9 +1,12 @@ +import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { + protected maxOffersPerTemplate: number; + protected ragfairServerHelper: RagfairServerHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(); + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); getOfferById(id: string): IRagfairOffer; getOffersByTemplate(templateId: string): Array; getOffersByTrader(traderId: string): Array; diff --git a/TypeScript/18CustomItemService/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/18CustomItemService/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/18CustomItemService/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/18CustomItemService/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/19UseExternalLibraries/README.md b/TypeScript/19UseExternalLibraries/README.md index 48c742b..e760f8b 100644 --- a/TypeScript/19UseExternalLibraries/README.md +++ b/TypeScript/19UseExternalLibraries/README.md @@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an ## **NodeJS Setup** -Before you begin, ensure to install NodeJS version `v18.15.0`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). +Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). After installation, it's advised to reboot your system. diff --git a/TypeScript/19UseExternalLibraries/types/callbacks/BotCallbacks.d.ts b/TypeScript/19UseExternalLibraries/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/19UseExternalLibraries/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/19UseExternalLibraries/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/19UseExternalLibraries/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/19UseExternalLibraries/types/callbacks/DialogueCallbacks.d.ts index 7ed60b9..2de57cb 100644 --- a/TypeScript/19UseExternalLibraries/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/19UseExternalLibraries/types/callbacks/DialogueCallbacks.d.ts @@ -1,7 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; -import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; +import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest"; @@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/friend/request/send */ sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/accept-all + */ + acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; /** * Handle client/friend/request/accept */ acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/decline + */ + declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/friend/request/cancel */ diff --git a/TypeScript/19UseExternalLibraries/types/callbacks/InraidCallbacks.d.ts b/TypeScript/19UseExternalLibraries/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/19UseExternalLibraries/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/19UseExternalLibraries/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/19UseExternalLibraries/types/controllers/BotController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/BotController.d.ts index d148abc..556cc5d 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/BotController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/BotController.d.ts @@ -51,12 +51,14 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * 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 ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string): Difficulty; + getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/19UseExternalLibraries/types/controllers/BuildController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/BuildController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/19UseExternalLibraries/types/controllers/GameController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/GameController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, 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); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/19UseExternalLibraries/types/controllers/HideoutController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/HideoutController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/19UseExternalLibraries/types/controllers/InsuranceController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/InsuranceController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/19UseExternalLibraries/types/controllers/LauncherController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/LauncherController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/19UseExternalLibraries/types/controllers/MatchController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/MatchController.d.ts index 6b1a7c3..708cee2 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/MatchController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/MatchController.d.ts @@ -75,10 +75,11 @@ export declare class MatchController { 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(pmcData: IPmcData, extractName: string): void; + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; /** * Was extract by car * @param extractName name of extract diff --git a/TypeScript/19UseExternalLibraries/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/BotEquipmentModGenerator.d.ts index dd1dcce..f850eea 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/BotEquipmentModGenerator.d.ts @@ -187,12 +187,12 @@ export declare class BotEquipmentModGenerator { */ protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param slotAddedToTemplate slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate template of the mods being added - * @param botRole + * Check if mod exists in db + is for a required slot + * @param modToAdd Db template of mod to check + * @param slotAddedToTemplate Slot object the item will be placed as child into + * @param modSlot Slot the mod will fill + * @param parentTemplate Db template of the mods being added + * @param botRole Bots wildspawntype (assault/pmcBot etc) * @returns true if valid */ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; diff --git a/TypeScript/19UseExternalLibraries/types/generators/BotGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/BotGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: 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/TypeScript/19UseExternalLibraries/types/generators/BotLootGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/BotLootGenerator.d.ts index 014617e..ca5d1bd 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/BotLootGenerator.d.ts @@ -82,7 +82,7 @@ export declare class BotLootGenerator { * @param totalValueLimitRub Total value of loot allowed in roubles * @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): void; + 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[][]; /** * Some items need child items to function, add them to the itemToAddChildrenTo array @@ -101,7 +101,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): void; + protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, 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 diff --git a/TypeScript/19UseExternalLibraries/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..5ca8ed7 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/FenceBaseAssortGenerator.d.ts @@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { FenceService } from "@spt-aki/services/FenceService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -22,14 +23,25 @@ export declare class FenceBaseAssortGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; + protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; - protected getItemPrice(itemTpl: string, items: Item[]): number; - protected getAmmoBoxPrice(items: Item[]): number; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * Get the penetration power value of an ammo, works with ammo boxes and raw ammos + * @param rootItemDb Ammo box or ammo item from items.db + * @returns Penetration power of passed in item, null if it doesnt have a power + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/19UseExternalLibraries/types/generators/LootGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/LootGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/19UseExternalLibraries/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/19UseExternalLibraries/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/BotGeneratorHelper.d.ts index 7f7555b..c756725 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/BotGeneratorHelper.d.ts @@ -92,7 +92,7 @@ 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): ItemAddedResult; + addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set): ItemAddedResult; /** * Is the provided item allowed inside a container * @param slotGrid Items sub-grid we want to place item inside diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts new file mode 100644 index 0000000..26958ca --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -0,0 +1,39 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected itemFilterService: ItemFilterService; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en espaƱol" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: Map; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts deleted file mode 100644 index 33d05de..0000000 --- a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; -import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; -import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -export declare class GiveSptCommand implements ISptCommand { - protected logger: ILogger; - protected itemHelper: ItemHelper; - protected hashUtil: HashUtil; - protected jsonUtil: JsonUtil; - protected presetHelper: PresetHelper; - protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); - getCommand(): string; - getCommandHelp(): string; - performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts new file mode 100644 index 0000000..8ec2ada --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts @@ -0,0 +1,38 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class ProfileSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected profileHelper: ProfileHelper; + /** + * Regex to account for all these cases: + * spt profile level 20 + * spt profile skill metabolism 10 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent; + protected handleLevelCommand(level: number): IProfileChangeEvent; +} diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts new file mode 100644 index 0000000..d84158a --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -0,0 +1,33 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class TraderSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt trader prapor rep 100 + * spt trader mechanic spend 1000000 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/19UseExternalLibraries/types/helpers/HideoutHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/19UseExternalLibraries/types/helpers/HttpServerHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/19UseExternalLibraries/types/helpers/ItemHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/ItemHelper.d.ts index 3e91ef7..9195579 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/ItemHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/ItemHelper.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; +import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { CompareUtil } from "@spt-aki/utils/CompareUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; @@ -28,8 +29,33 @@ export declare class ItemHelper { protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; + protected compareUtil: CompareUtil; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil); + /** + * 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 + * @param item1 first item with all its children to compare + * @param item2 second item with all its children to compare + * @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; + /** + * This method will compare two items and see if the are equivalent. + * This method will NOT compare IDs on the items + * @param item1 first item to compare + * @param item2 second item to compare + * @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; + /** + * 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; /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl @@ -363,10 +389,11 @@ export declare class ItemHelper { * Chose a randomly weighted cartridge that fits * @param caliber Desired caliber * @param staticAmmoDist Cartridges and thier weights + * @param fallbackCartridgeTpl If a cartridge cannot be found in the above staticAmmoDist param, use this instead * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -401,7 +428,7 @@ export declare class ItemHelper { addChildSlotItems(itemToAdd: Item[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): Item[]; /** * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter - * @param possibleTpls Tpls to randomply choose from + * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow * @returns Chosen tpl or null */ diff --git a/TypeScript/19UseExternalLibraries/types/helpers/PresetHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/PresetHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IBotType.d.ts index db6e56e..2a00af9 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,9 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/dialog/IAcceptFriendRequestData.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/dialog/IAcceptFriendRequestData.d.ts index 87461aa..0913eb5 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/dialog/IAcceptFriendRequestData.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/dialog/IAcceptFriendRequestData.d.ts @@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest { } export interface ICancelFriendRequestData extends IBaseFriendRequest { } -export interface IBaseFriendRequest { - request_id: string; +export interface IDeclineFriendRequestData extends IBaseFriendRequest { +} +export interface IBaseFriendRequest { + profileId: string; } diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/dialog/IFriendRequestSendResponse.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/dialog/IFriendRequestSendResponse.d.ts index 06c40f3..fc311eb 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/dialog/IFriendRequestSendResponse.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/dialog/IFriendRequestSendResponse.d.ts @@ -1,5 +1,5 @@ export interface IFriendRequestSendResponse { status: number; - requestid: string; + requestId: string; retryAfter: number; } diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 6c3c9eb..26e43ac 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -1,5 +1,5 @@ import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item } from "../common/tables/IItem"; +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; export interface IGetOtherProfileResponse { id: string; aid: number; diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/profile/ISearchFriendResponse.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/profile/ISearchFriendResponse.d.ts index 96d88b2..d3cc7df 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/profile/ISearchFriendResponse.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/profile/ISearchFriendResponse.d.ts @@ -1,9 +1,11 @@ export interface ISearchFriendResponse { _id: string; + aid: number; Info: Info; } export interface Info { Nickname: string; Side: string; Level: number; + MemberCategory: number; } diff --git a/TypeScript/19UseExternalLibraries/types/models/enums/AmmoTypes.d.ts b/TypeScript/19UseExternalLibraries/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/19UseExternalLibraries/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/19UseExternalLibraries/types/models/enums/WeaponTypes.d.ts b/TypeScript/19UseExternalLibraries/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/19UseExternalLibraries/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..529c2cd 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,9 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +23,8 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/IBotConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/IPmcConfig.d.ts index 65da29b..f17d3e4 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/IPmcConfig.d.ts @@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig { /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; allPMCsHavePlayerNameWithRandomPrefixChance: number; + /** Should secure container loot from usec.json/bear.json be added to pmc bots secure */ + addSecureContainerLootFromBotConfig: boolean; } export interface PmcTypes { usec: string; diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/dialog/ISendMessageDetails.d.ts index 2068ede..05b3bcd 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -30,7 +30,15 @@ export interface ISendMessageDetails { } export interface IProfileChangeEvent { _id: string; - Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + Type: ProfileChangeEventType; value: number; entity?: string; } +export declare enum ProfileChangeEventType { + TRADER_SALES_SUM = "TraderSalesSum", + TRADER_STANDING = "TraderStanding", + PROFILE_LEVEL = "ProfileLevel", + SKILL_POINTS = "SkillPoints", + EXAMINE_ALL_ITEMS = "ExamineAllItems", + UNLOCK_TRADER = "UnlockTrader" +} diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/19UseExternalLibraries/types/servers/HttpServer.d.ts b/TypeScript/19UseExternalLibraries/types/servers/HttpServer.d.ts index 8574cdd..bcd740f 100644 --- a/TypeScript/19UseExternalLibraries/types/servers/HttpServer.d.ts +++ b/TypeScript/19UseExternalLibraries/types/servers/HttpServer.d.ts @@ -19,11 +19,19 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/19UseExternalLibraries/types/services/BotLootCacheService.d.ts b/TypeScript/19UseExternalLibraries/types/services/BotLootCacheService.d.ts index b013e5e..7f79bfe 100644 --- a/TypeScript/19UseExternalLibraries/types/services/BotLootCacheService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/BotLootCacheService.d.ts @@ -69,6 +69,9 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/19UseExternalLibraries/types/services/FenceService.d.ts b/TypeScript/19UseExternalLibraries/types/services/FenceService.d.ts index bb1d035..75c4b28 100644 --- a/TypeScript/19UseExternalLibraries/types/services/FenceService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,14 +38,30 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; + protected fenceItemUpdCompareProperties: Set; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with */ setFenceAssort(assort: ITraderAssort): void; + /** + * Replace discount fence assort with new assort + * @param assort New assorts to replace old with + */ + setDiscountFenceAssort(assort: ITraderAssort): void; + /** + * Get main fence assort + * @return ITraderAssort + */ + getMainFenceAssort(): ITraderAssort; + /** + * Get discount fence assort + * @return ITraderAssort + */ + getDiscountFenceAssort(): ITraderAssort; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -57,6 +74,26 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adds to fence assort a single item (with its children) + * @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; + /** + * 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; + /** + * 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; /** * Adjust all items contained inside an assort by a multiplier * @param assort (clone)Assort that contains items with prices to adjust @@ -93,17 +130,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -112,8 +155,8 @@ export declare class FenceService { protected deleteRandomAssorts(itemCountToReplace: number, assort: ITraderAssort): void; /** * Choose an item at random and remove it + mods from assorts - * @param assort Items to remove from - * @param rootItems Assort root items to pick from to remove + * @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; /** @@ -132,6 +175,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +196,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +205,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +214,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +225,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +247,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/19UseExternalLibraries/types/services/ItemBaseClassService.d.ts b/TypeScript/19UseExternalLibraries/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/19UseExternalLibraries/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/19UseExternalLibraries/types/services/MailSendService.d.ts b/TypeScript/19UseExternalLibraries/types/services/MailSendService.d.ts index 08752bf..e5643f9 100644 --- a/TypeScript/19UseExternalLibraries/types/services/MailSendService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/MailSendService.d.ts @@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { Traders } from "@spt-aki/models/enums/Traders"; -import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -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?: any): void; + sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], 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?: any[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], 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 diff --git a/TypeScript/19UseExternalLibraries/types/services/PaymentService.d.ts b/TypeScript/19UseExternalLibraries/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/19UseExternalLibraries/types/services/PaymentService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/19UseExternalLibraries/types/services/ProfileActivityService.d.ts b/TypeScript/19UseExternalLibraries/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/19UseExternalLibraries/types/services/ProfileFixerService.d.ts b/TypeScript/19UseExternalLibraries/types/services/ProfileFixerService.d.ts index 804b3bf..1045d0a 100644 --- a/TypeScript/19UseExternalLibraries/types/services/ProfileFixerService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @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 @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @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 @@ -165,4 +183,9 @@ export declare class ProfileFixerService { * @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 null + */ + protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/19UseExternalLibraries/types/services/RagfairPriceService.d.ts b/TypeScript/19UseExternalLibraries/types/services/RagfairPriceService.d.ts index 5649751..0fefdd8 100644 --- a/TypeScript/19UseExternalLibraries/types/services/RagfairPriceService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], 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 diff --git a/TypeScript/19UseExternalLibraries/types/utils/App.d.ts b/TypeScript/19UseExternalLibraries/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/19UseExternalLibraries/types/utils/App.d.ts +++ b/TypeScript/19UseExternalLibraries/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/19UseExternalLibraries/types/utils/CompareUtil.d.ts b/TypeScript/19UseExternalLibraries/types/utils/CompareUtil.d.ts new file mode 100644 index 0000000..a5b94d5 --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/utils/CompareUtil.d.ts @@ -0,0 +1,11 @@ +export declare class CompareUtil { + private static typesToCheckAgainst; + /** + * This function does an object comparison, equivalent to applying reflections + * and scanning for all possible properties including arrays. + * @param v1 value 1 to compare + * @param v2 value 2 to compare + * @returns true if equal, false if not + */ + recursiveCompare(v1: any, v2: any): boolean; +} diff --git a/TypeScript/19UseExternalLibraries/types/utils/RagfairOfferHolder.d.ts b/TypeScript/19UseExternalLibraries/types/utils/RagfairOfferHolder.d.ts index 3942ed1..b95e54a 100644 --- a/TypeScript/19UseExternalLibraries/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/19UseExternalLibraries/types/utils/RagfairOfferHolder.d.ts @@ -1,9 +1,12 @@ +import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { + protected maxOffersPerTemplate: number; + protected ragfairServerHelper: RagfairServerHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(); + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); getOfferById(id: string): IRagfairOffer; getOffersByTemplate(templateId: string): Array; getOffersByTrader(traderId: string): Array; diff --git a/TypeScript/19UseExternalLibraries/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/19UseExternalLibraries/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/19UseExternalLibraries/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/19UseExternalLibraries/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/1LogToConsole/README.md b/TypeScript/1LogToConsole/README.md index 48c742b..e760f8b 100644 --- a/TypeScript/1LogToConsole/README.md +++ b/TypeScript/1LogToConsole/README.md @@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an ## **NodeJS Setup** -Before you begin, ensure to install NodeJS version `v18.15.0`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). +Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). After installation, it's advised to reboot your system. diff --git a/TypeScript/1LogToConsole/types/callbacks/BotCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/1LogToConsole/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/1LogToConsole/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/DialogueCallbacks.d.ts index 7ed60b9..2de57cb 100644 --- a/TypeScript/1LogToConsole/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/DialogueCallbacks.d.ts @@ -1,7 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; -import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; +import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest"; @@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/friend/request/send */ sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/accept-all + */ + acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; /** * Handle client/friend/request/accept */ acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/decline + */ + declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/friend/request/cancel */ diff --git a/TypeScript/1LogToConsole/types/callbacks/InraidCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/1LogToConsole/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/1LogToConsole/types/controllers/BotController.d.ts b/TypeScript/1LogToConsole/types/controllers/BotController.d.ts index d148abc..556cc5d 100644 --- a/TypeScript/1LogToConsole/types/controllers/BotController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/BotController.d.ts @@ -51,12 +51,14 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * 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 ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string): Difficulty; + getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/1LogToConsole/types/controllers/BuildController.d.ts b/TypeScript/1LogToConsole/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/1LogToConsole/types/controllers/BuildController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/1LogToConsole/types/controllers/GameController.d.ts b/TypeScript/1LogToConsole/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/1LogToConsole/types/controllers/GameController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, 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); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts b/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts b/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/1LogToConsole/types/controllers/LauncherController.d.ts b/TypeScript/1LogToConsole/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/1LogToConsole/types/controllers/LauncherController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/1LogToConsole/types/controllers/MatchController.d.ts b/TypeScript/1LogToConsole/types/controllers/MatchController.d.ts index 6b1a7c3..708cee2 100644 --- a/TypeScript/1LogToConsole/types/controllers/MatchController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/MatchController.d.ts @@ -75,10 +75,11 @@ export declare class MatchController { 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(pmcData: IPmcData, extractName: string): void; + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; /** * Was extract by car * @param extractName name of extract diff --git a/TypeScript/1LogToConsole/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/BotEquipmentModGenerator.d.ts index dd1dcce..f850eea 100644 --- a/TypeScript/1LogToConsole/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/BotEquipmentModGenerator.d.ts @@ -187,12 +187,12 @@ export declare class BotEquipmentModGenerator { */ protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param slotAddedToTemplate slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate template of the mods being added - * @param botRole + * Check if mod exists in db + is for a required slot + * @param modToAdd Db template of mod to check + * @param slotAddedToTemplate Slot object the item will be placed as child into + * @param modSlot Slot the mod will fill + * @param parentTemplate Db template of the mods being added + * @param botRole Bots wildspawntype (assault/pmcBot etc) * @returns true if valid */ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; diff --git a/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: 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/TypeScript/1LogToConsole/types/generators/BotLootGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/BotLootGenerator.d.ts index 014617e..ca5d1bd 100644 --- a/TypeScript/1LogToConsole/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/BotLootGenerator.d.ts @@ -82,7 +82,7 @@ export declare class BotLootGenerator { * @param totalValueLimitRub Total value of loot allowed in roubles * @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): void; + 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[][]; /** * Some items need child items to function, add them to the itemToAddChildrenTo array @@ -101,7 +101,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): void; + protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, 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 diff --git a/TypeScript/1LogToConsole/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..5ca8ed7 100644 --- a/TypeScript/1LogToConsole/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/FenceBaseAssortGenerator.d.ts @@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { FenceService } from "@spt-aki/services/FenceService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -22,14 +23,25 @@ export declare class FenceBaseAssortGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; + protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; - protected getItemPrice(itemTpl: string, items: Item[]): number; - protected getAmmoBoxPrice(items: Item[]): number; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * Get the penetration power value of an ammo, works with ammo boxes and raw ammos + * @param rootItemDb Ammo box or ammo item from items.db + * @returns Penetration power of passed in item, null if it doesnt have a power + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/1LogToConsole/types/generators/LootGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/1LogToConsole/types/generators/LootGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/1LogToConsole/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/1LogToConsole/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/1LogToConsole/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/BotGeneratorHelper.d.ts index 7f7555b..c756725 100644 --- a/TypeScript/1LogToConsole/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/BotGeneratorHelper.d.ts @@ -92,7 +92,7 @@ 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): ItemAddedResult; + addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set): ItemAddedResult; /** * Is the provided item allowed inside a container * @param slotGrid Items sub-grid we want to place item inside diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/1LogToConsole/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts new file mode 100644 index 0000000..26958ca --- /dev/null +++ b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -0,0 +1,39 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected itemFilterService: ItemFilterService; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en espaƱol" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: Map; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts deleted file mode 100644 index 33d05de..0000000 --- a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; -import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; -import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -export declare class GiveSptCommand implements ISptCommand { - protected logger: ILogger; - protected itemHelper: ItemHelper; - protected hashUtil: HashUtil; - protected jsonUtil: JsonUtil; - protected presetHelper: PresetHelper; - protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); - getCommand(): string; - getCommandHelp(): string; - performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts new file mode 100644 index 0000000..8ec2ada --- /dev/null +++ b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts @@ -0,0 +1,38 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class ProfileSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected profileHelper: ProfileHelper; + /** + * Regex to account for all these cases: + * spt profile level 20 + * spt profile skill metabolism 10 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent; + protected handleLevelCommand(level: number): IProfileChangeEvent; +} diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts new file mode 100644 index 0000000..d84158a --- /dev/null +++ b/TypeScript/1LogToConsole/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -0,0 +1,33 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class TraderSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt trader prapor rep 100 + * spt trader mechanic spend 1000000 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/1LogToConsole/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/1LogToConsole/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/1LogToConsole/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/1LogToConsole/types/helpers/HttpServerHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/1LogToConsole/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts index 3e91ef7..9195579 100644 --- a/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; +import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { CompareUtil } from "@spt-aki/utils/CompareUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; @@ -28,8 +29,33 @@ export declare class ItemHelper { protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; + protected compareUtil: CompareUtil; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil); + /** + * 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 + * @param item1 first item with all its children to compare + * @param item2 second item with all its children to compare + * @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; + /** + * This method will compare two items and see if the are equivalent. + * This method will NOT compare IDs on the items + * @param item1 first item to compare + * @param item2 second item to compare + * @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; + /** + * 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; /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl @@ -363,10 +389,11 @@ export declare class ItemHelper { * Chose a randomly weighted cartridge that fits * @param caliber Desired caliber * @param staticAmmoDist Cartridges and thier weights + * @param fallbackCartridgeTpl If a cartridge cannot be found in the above staticAmmoDist param, use this instead * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -401,7 +428,7 @@ export declare class ItemHelper { addChildSlotItems(itemToAdd: Item[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): Item[]; /** * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter - * @param possibleTpls Tpls to randomply choose from + * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow * @returns Chosen tpl or null */ diff --git a/TypeScript/1LogToConsole/types/helpers/PresetHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/1LogToConsole/types/helpers/PresetHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotType.d.ts index db6e56e..2a00af9 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,9 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/1LogToConsole/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/1LogToConsole/types/models/eft/dialog/IAcceptFriendRequestData.d.ts b/TypeScript/1LogToConsole/types/models/eft/dialog/IAcceptFriendRequestData.d.ts index 87461aa..0913eb5 100644 --- a/TypeScript/1LogToConsole/types/models/eft/dialog/IAcceptFriendRequestData.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/dialog/IAcceptFriendRequestData.d.ts @@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest { } export interface ICancelFriendRequestData extends IBaseFriendRequest { } -export interface IBaseFriendRequest { - request_id: string; +export interface IDeclineFriendRequestData extends IBaseFriendRequest { +} +export interface IBaseFriendRequest { + profileId: string; } diff --git a/TypeScript/1LogToConsole/types/models/eft/dialog/IFriendRequestSendResponse.d.ts b/TypeScript/1LogToConsole/types/models/eft/dialog/IFriendRequestSendResponse.d.ts index 06c40f3..fc311eb 100644 --- a/TypeScript/1LogToConsole/types/models/eft/dialog/IFriendRequestSendResponse.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/dialog/IFriendRequestSendResponse.d.ts @@ -1,5 +1,5 @@ export interface IFriendRequestSendResponse { status: number; - requestid: string; + requestId: string; retryAfter: number; } diff --git a/TypeScript/1LogToConsole/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/TypeScript/1LogToConsole/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 6c3c9eb..26e43ac 100644 --- a/TypeScript/1LogToConsole/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -1,5 +1,5 @@ import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item } from "../common/tables/IItem"; +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; export interface IGetOtherProfileResponse { id: string; aid: number; diff --git a/TypeScript/1LogToConsole/types/models/eft/profile/ISearchFriendResponse.d.ts b/TypeScript/1LogToConsole/types/models/eft/profile/ISearchFriendResponse.d.ts index 96d88b2..d3cc7df 100644 --- a/TypeScript/1LogToConsole/types/models/eft/profile/ISearchFriendResponse.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/profile/ISearchFriendResponse.d.ts @@ -1,9 +1,11 @@ export interface ISearchFriendResponse { _id: string; + aid: number; Info: Info; } export interface Info { Nickname: string; Side: string; Level: number; + MemberCategory: number; } diff --git a/TypeScript/1LogToConsole/types/models/enums/AmmoTypes.d.ts b/TypeScript/1LogToConsole/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/1LogToConsole/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/1LogToConsole/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/1LogToConsole/types/models/enums/WeaponTypes.d.ts b/TypeScript/1LogToConsole/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/1LogToConsole/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/1LogToConsole/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/1LogToConsole/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/1LogToConsole/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..529c2cd 100644 --- a/TypeScript/1LogToConsole/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,9 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +23,8 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/1LogToConsole/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IPmcConfig.d.ts index 65da29b..f17d3e4 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IPmcConfig.d.ts @@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig { /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; allPMCsHavePlayerNameWithRandomPrefixChance: number; + /** Should secure container loot from usec.json/bear.json be added to pmc bots secure */ + addSecureContainerLootFromBotConfig: boolean; } export interface PmcTypes { usec: string; diff --git a/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/1LogToConsole/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/1LogToConsole/types/models/spt/dialog/ISendMessageDetails.d.ts index 2068ede..05b3bcd 100644 --- a/TypeScript/1LogToConsole/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -30,7 +30,15 @@ export interface ISendMessageDetails { } export interface IProfileChangeEvent { _id: string; - Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + Type: ProfileChangeEventType; value: number; entity?: string; } +export declare enum ProfileChangeEventType { + TRADER_SALES_SUM = "TraderSalesSum", + TRADER_STANDING = "TraderStanding", + PROFILE_LEVEL = "ProfileLevel", + SKILL_POINTS = "SkillPoints", + EXAMINE_ALL_ITEMS = "ExamineAllItems", + UNLOCK_TRADER = "UnlockTrader" +} diff --git a/TypeScript/1LogToConsole/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/1LogToConsole/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/1LogToConsole/types/servers/HttpServer.d.ts b/TypeScript/1LogToConsole/types/servers/HttpServer.d.ts index 8574cdd..bcd740f 100644 --- a/TypeScript/1LogToConsole/types/servers/HttpServer.d.ts +++ b/TypeScript/1LogToConsole/types/servers/HttpServer.d.ts @@ -19,11 +19,19 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/1LogToConsole/types/services/BotLootCacheService.d.ts b/TypeScript/1LogToConsole/types/services/BotLootCacheService.d.ts index b013e5e..7f79bfe 100644 --- a/TypeScript/1LogToConsole/types/services/BotLootCacheService.d.ts +++ b/TypeScript/1LogToConsole/types/services/BotLootCacheService.d.ts @@ -69,6 +69,9 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/1LogToConsole/types/services/FenceService.d.ts b/TypeScript/1LogToConsole/types/services/FenceService.d.ts index bb1d035..75c4b28 100644 --- a/TypeScript/1LogToConsole/types/services/FenceService.d.ts +++ b/TypeScript/1LogToConsole/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,14 +38,30 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; + protected fenceItemUpdCompareProperties: Set; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with */ setFenceAssort(assort: ITraderAssort): void; + /** + * Replace discount fence assort with new assort + * @param assort New assorts to replace old with + */ + setDiscountFenceAssort(assort: ITraderAssort): void; + /** + * Get main fence assort + * @return ITraderAssort + */ + getMainFenceAssort(): ITraderAssort; + /** + * Get discount fence assort + * @return ITraderAssort + */ + getDiscountFenceAssort(): ITraderAssort; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -57,6 +74,26 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adds to fence assort a single item (with its children) + * @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; + /** + * 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; + /** + * 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; /** * Adjust all items contained inside an assort by a multiplier * @param assort (clone)Assort that contains items with prices to adjust @@ -93,17 +130,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -112,8 +155,8 @@ export declare class FenceService { protected deleteRandomAssorts(itemCountToReplace: number, assort: ITraderAssort): void; /** * Choose an item at random and remove it + mods from assorts - * @param assort Items to remove from - * @param rootItems Assort root items to pick from to remove + * @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; /** @@ -132,6 +175,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +196,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +205,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +214,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +225,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +247,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/1LogToConsole/types/services/ItemBaseClassService.d.ts b/TypeScript/1LogToConsole/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/1LogToConsole/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/1LogToConsole/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/1LogToConsole/types/services/MailSendService.d.ts b/TypeScript/1LogToConsole/types/services/MailSendService.d.ts index 08752bf..e5643f9 100644 --- a/TypeScript/1LogToConsole/types/services/MailSendService.d.ts +++ b/TypeScript/1LogToConsole/types/services/MailSendService.d.ts @@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { Traders } from "@spt-aki/models/enums/Traders"; -import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -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?: any): void; + sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], 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?: any[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], 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 diff --git a/TypeScript/1LogToConsole/types/services/PaymentService.d.ts b/TypeScript/1LogToConsole/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/1LogToConsole/types/services/PaymentService.d.ts +++ b/TypeScript/1LogToConsole/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/1LogToConsole/types/services/ProfileActivityService.d.ts b/TypeScript/1LogToConsole/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/1LogToConsole/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts b/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts index 804b3bf..1045d0a 100644 --- a/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts +++ b/TypeScript/1LogToConsole/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @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 @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @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 @@ -165,4 +183,9 @@ export declare class ProfileFixerService { * @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 null + */ + protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts b/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts index 5649751..0fefdd8 100644 --- a/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts +++ b/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], 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 diff --git a/TypeScript/1LogToConsole/types/utils/App.d.ts b/TypeScript/1LogToConsole/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/1LogToConsole/types/utils/App.d.ts +++ b/TypeScript/1LogToConsole/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/1LogToConsole/types/utils/CompareUtil.d.ts b/TypeScript/1LogToConsole/types/utils/CompareUtil.d.ts new file mode 100644 index 0000000..a5b94d5 --- /dev/null +++ b/TypeScript/1LogToConsole/types/utils/CompareUtil.d.ts @@ -0,0 +1,11 @@ +export declare class CompareUtil { + private static typesToCheckAgainst; + /** + * This function does an object comparison, equivalent to applying reflections + * and scanning for all possible properties including arrays. + * @param v1 value 1 to compare + * @param v2 value 2 to compare + * @returns true if equal, false if not + */ + recursiveCompare(v1: any, v2: any): boolean; +} diff --git a/TypeScript/1LogToConsole/types/utils/RagfairOfferHolder.d.ts b/TypeScript/1LogToConsole/types/utils/RagfairOfferHolder.d.ts index 3942ed1..b95e54a 100644 --- a/TypeScript/1LogToConsole/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/1LogToConsole/types/utils/RagfairOfferHolder.d.ts @@ -1,9 +1,12 @@ +import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { + protected maxOffersPerTemplate: number; + protected ragfairServerHelper: RagfairServerHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(); + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); getOfferById(id: string): IRagfairOffer; getOffersByTemplate(templateId: string): Array; getOffersByTrader(traderId: string): Array; diff --git a/TypeScript/1LogToConsole/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/1LogToConsole/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/1LogToConsole/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/1LogToConsole/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/20CustomChatBot/README.md b/TypeScript/20CustomChatBot/README.md index 48c742b..e760f8b 100644 --- a/TypeScript/20CustomChatBot/README.md +++ b/TypeScript/20CustomChatBot/README.md @@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an ## **NodeJS Setup** -Before you begin, ensure to install NodeJS version `v18.15.0`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). +Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). After installation, it's advised to reboot your system. diff --git a/TypeScript/20CustomChatBot/types/callbacks/BotCallbacks.d.ts b/TypeScript/20CustomChatBot/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/20CustomChatBot/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/20CustomChatBot/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/20CustomChatBot/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/20CustomChatBot/types/callbacks/DialogueCallbacks.d.ts index 7ed60b9..2de57cb 100644 --- a/TypeScript/20CustomChatBot/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/20CustomChatBot/types/callbacks/DialogueCallbacks.d.ts @@ -1,7 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; -import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; +import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest"; @@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/friend/request/send */ sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/accept-all + */ + acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; /** * Handle client/friend/request/accept */ acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/decline + */ + declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/friend/request/cancel */ diff --git a/TypeScript/20CustomChatBot/types/callbacks/InraidCallbacks.d.ts b/TypeScript/20CustomChatBot/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/20CustomChatBot/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/20CustomChatBot/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/20CustomChatBot/types/controllers/BotController.d.ts b/TypeScript/20CustomChatBot/types/controllers/BotController.d.ts index d148abc..556cc5d 100644 --- a/TypeScript/20CustomChatBot/types/controllers/BotController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/BotController.d.ts @@ -51,12 +51,14 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * 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 ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string): Difficulty; + getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/20CustomChatBot/types/controllers/BuildController.d.ts b/TypeScript/20CustomChatBot/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/20CustomChatBot/types/controllers/BuildController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/20CustomChatBot/types/controllers/GameController.d.ts b/TypeScript/20CustomChatBot/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/20CustomChatBot/types/controllers/GameController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, 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); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/20CustomChatBot/types/controllers/HideoutController.d.ts b/TypeScript/20CustomChatBot/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/20CustomChatBot/types/controllers/HideoutController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/20CustomChatBot/types/controllers/InsuranceController.d.ts b/TypeScript/20CustomChatBot/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/20CustomChatBot/types/controllers/InsuranceController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/20CustomChatBot/types/controllers/LauncherController.d.ts b/TypeScript/20CustomChatBot/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/20CustomChatBot/types/controllers/LauncherController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/20CustomChatBot/types/controllers/MatchController.d.ts b/TypeScript/20CustomChatBot/types/controllers/MatchController.d.ts index 6b1a7c3..708cee2 100644 --- a/TypeScript/20CustomChatBot/types/controllers/MatchController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/MatchController.d.ts @@ -75,10 +75,11 @@ export declare class MatchController { 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(pmcData: IPmcData, extractName: string): void; + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; /** * Was extract by car * @param extractName name of extract diff --git a/TypeScript/20CustomChatBot/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/BotEquipmentModGenerator.d.ts index dd1dcce..f850eea 100644 --- a/TypeScript/20CustomChatBot/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/BotEquipmentModGenerator.d.ts @@ -187,12 +187,12 @@ export declare class BotEquipmentModGenerator { */ protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param slotAddedToTemplate slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate template of the mods being added - * @param botRole + * Check if mod exists in db + is for a required slot + * @param modToAdd Db template of mod to check + * @param slotAddedToTemplate Slot object the item will be placed as child into + * @param modSlot Slot the mod will fill + * @param parentTemplate Db template of the mods being added + * @param botRole Bots wildspawntype (assault/pmcBot etc) * @returns true if valid */ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; diff --git a/TypeScript/20CustomChatBot/types/generators/BotGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/20CustomChatBot/types/generators/BotGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: 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/TypeScript/20CustomChatBot/types/generators/BotLootGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/BotLootGenerator.d.ts index 014617e..ca5d1bd 100644 --- a/TypeScript/20CustomChatBot/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/BotLootGenerator.d.ts @@ -82,7 +82,7 @@ export declare class BotLootGenerator { * @param totalValueLimitRub Total value of loot allowed in roubles * @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): void; + 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[][]; /** * Some items need child items to function, add them to the itemToAddChildrenTo array @@ -101,7 +101,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): void; + protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, 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 diff --git a/TypeScript/20CustomChatBot/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..5ca8ed7 100644 --- a/TypeScript/20CustomChatBot/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/FenceBaseAssortGenerator.d.ts @@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { FenceService } from "@spt-aki/services/FenceService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -22,14 +23,25 @@ export declare class FenceBaseAssortGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; + protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; - protected getItemPrice(itemTpl: string, items: Item[]): number; - protected getAmmoBoxPrice(items: Item[]): number; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * Get the penetration power value of an ammo, works with ammo boxes and raw ammos + * @param rootItemDb Ammo box or ammo item from items.db + * @returns Penetration power of passed in item, null if it doesnt have a power + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/20CustomChatBot/types/generators/LootGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/20CustomChatBot/types/generators/LootGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/20CustomChatBot/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/20CustomChatBot/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/20CustomChatBot/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/BotGeneratorHelper.d.ts index 7f7555b..c756725 100644 --- a/TypeScript/20CustomChatBot/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/BotGeneratorHelper.d.ts @@ -92,7 +92,7 @@ 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): ItemAddedResult; + addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set): ItemAddedResult; /** * Is the provided item allowed inside a container * @param slotGrid Items sub-grid we want to place item inside diff --git a/TypeScript/20CustomChatBot/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/20CustomChatBot/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/20CustomChatBot/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts new file mode 100644 index 0000000..26958ca --- /dev/null +++ b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -0,0 +1,39 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected itemFilterService: ItemFilterService; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en espaƱol" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: Map; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts deleted file mode 100644 index 33d05de..0000000 --- a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; -import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; -import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -export declare class GiveSptCommand implements ISptCommand { - protected logger: ILogger; - protected itemHelper: ItemHelper; - protected hashUtil: HashUtil; - protected jsonUtil: JsonUtil; - protected presetHelper: PresetHelper; - protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); - getCommand(): string; - getCommandHelp(): string; - performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts new file mode 100644 index 0000000..8ec2ada --- /dev/null +++ b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts @@ -0,0 +1,38 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class ProfileSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected profileHelper: ProfileHelper; + /** + * Regex to account for all these cases: + * spt profile level 20 + * spt profile skill metabolism 10 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent; + protected handleLevelCommand(level: number): IProfileChangeEvent; +} diff --git a/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts new file mode 100644 index 0000000..d84158a --- /dev/null +++ b/TypeScript/20CustomChatBot/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -0,0 +1,33 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class TraderSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt trader prapor rep 100 + * spt trader mechanic spend 1000000 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/20CustomChatBot/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/20CustomChatBot/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/20CustomChatBot/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/20CustomChatBot/types/helpers/HideoutHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/20CustomChatBot/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/20CustomChatBot/types/helpers/HttpServerHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/20CustomChatBot/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/20CustomChatBot/types/helpers/ItemHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/ItemHelper.d.ts index 3e91ef7..9195579 100644 --- a/TypeScript/20CustomChatBot/types/helpers/ItemHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/ItemHelper.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; +import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { CompareUtil } from "@spt-aki/utils/CompareUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; @@ -28,8 +29,33 @@ export declare class ItemHelper { protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; + protected compareUtil: CompareUtil; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil); + /** + * 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 + * @param item1 first item with all its children to compare + * @param item2 second item with all its children to compare + * @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; + /** + * This method will compare two items and see if the are equivalent. + * This method will NOT compare IDs on the items + * @param item1 first item to compare + * @param item2 second item to compare + * @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; + /** + * 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; /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl @@ -363,10 +389,11 @@ export declare class ItemHelper { * Chose a randomly weighted cartridge that fits * @param caliber Desired caliber * @param staticAmmoDist Cartridges and thier weights + * @param fallbackCartridgeTpl If a cartridge cannot be found in the above staticAmmoDist param, use this instead * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -401,7 +428,7 @@ export declare class ItemHelper { addChildSlotItems(itemToAdd: Item[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): Item[]; /** * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter - * @param possibleTpls Tpls to randomply choose from + * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow * @returns Chosen tpl or null */ diff --git a/TypeScript/20CustomChatBot/types/helpers/PresetHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/20CustomChatBot/types/helpers/PresetHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/20CustomChatBot/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/20CustomChatBot/types/models/eft/common/tables/IBotType.d.ts index db6e56e..2a00af9 100644 --- a/TypeScript/20CustomChatBot/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/20CustomChatBot/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,9 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/20CustomChatBot/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/20CustomChatBot/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/20CustomChatBot/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/20CustomChatBot/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/20CustomChatBot/types/models/eft/dialog/IAcceptFriendRequestData.d.ts b/TypeScript/20CustomChatBot/types/models/eft/dialog/IAcceptFriendRequestData.d.ts index 87461aa..0913eb5 100644 --- a/TypeScript/20CustomChatBot/types/models/eft/dialog/IAcceptFriendRequestData.d.ts +++ b/TypeScript/20CustomChatBot/types/models/eft/dialog/IAcceptFriendRequestData.d.ts @@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest { } export interface ICancelFriendRequestData extends IBaseFriendRequest { } -export interface IBaseFriendRequest { - request_id: string; +export interface IDeclineFriendRequestData extends IBaseFriendRequest { +} +export interface IBaseFriendRequest { + profileId: string; } diff --git a/TypeScript/20CustomChatBot/types/models/eft/dialog/IFriendRequestSendResponse.d.ts b/TypeScript/20CustomChatBot/types/models/eft/dialog/IFriendRequestSendResponse.d.ts index 06c40f3..fc311eb 100644 --- a/TypeScript/20CustomChatBot/types/models/eft/dialog/IFriendRequestSendResponse.d.ts +++ b/TypeScript/20CustomChatBot/types/models/eft/dialog/IFriendRequestSendResponse.d.ts @@ -1,5 +1,5 @@ export interface IFriendRequestSendResponse { status: number; - requestid: string; + requestId: string; retryAfter: number; } diff --git a/TypeScript/20CustomChatBot/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/TypeScript/20CustomChatBot/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 6c3c9eb..26e43ac 100644 --- a/TypeScript/20CustomChatBot/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/TypeScript/20CustomChatBot/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -1,5 +1,5 @@ import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item } from "../common/tables/IItem"; +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; export interface IGetOtherProfileResponse { id: string; aid: number; diff --git a/TypeScript/20CustomChatBot/types/models/eft/profile/ISearchFriendResponse.d.ts b/TypeScript/20CustomChatBot/types/models/eft/profile/ISearchFriendResponse.d.ts index 96d88b2..d3cc7df 100644 --- a/TypeScript/20CustomChatBot/types/models/eft/profile/ISearchFriendResponse.d.ts +++ b/TypeScript/20CustomChatBot/types/models/eft/profile/ISearchFriendResponse.d.ts @@ -1,9 +1,11 @@ export interface ISearchFriendResponse { _id: string; + aid: number; Info: Info; } export interface Info { Nickname: string; Side: string; Level: number; + MemberCategory: number; } diff --git a/TypeScript/20CustomChatBot/types/models/enums/AmmoTypes.d.ts b/TypeScript/20CustomChatBot/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/20CustomChatBot/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/20CustomChatBot/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/20CustomChatBot/types/models/enums/WeaponTypes.d.ts b/TypeScript/20CustomChatBot/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/20CustomChatBot/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/20CustomChatBot/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/20CustomChatBot/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/20CustomChatBot/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..529c2cd 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,9 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +23,8 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/IBotConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/IPmcConfig.d.ts index 65da29b..f17d3e4 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/IPmcConfig.d.ts @@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig { /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; allPMCsHavePlayerNameWithRandomPrefixChance: number; + /** Should secure container loot from usec.json/bear.json be added to pmc bots secure */ + addSecureContainerLootFromBotConfig: boolean; } export interface PmcTypes { usec: string; diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/20CustomChatBot/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/20CustomChatBot/types/models/spt/dialog/ISendMessageDetails.d.ts index 2068ede..05b3bcd 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -30,7 +30,15 @@ export interface ISendMessageDetails { } export interface IProfileChangeEvent { _id: string; - Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + Type: ProfileChangeEventType; value: number; entity?: string; } +export declare enum ProfileChangeEventType { + TRADER_SALES_SUM = "TraderSalesSum", + TRADER_STANDING = "TraderStanding", + PROFILE_LEVEL = "ProfileLevel", + SKILL_POINTS = "SkillPoints", + EXAMINE_ALL_ITEMS = "ExamineAllItems", + UNLOCK_TRADER = "UnlockTrader" +} diff --git a/TypeScript/20CustomChatBot/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/20CustomChatBot/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/20CustomChatBot/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/20CustomChatBot/types/servers/HttpServer.d.ts b/TypeScript/20CustomChatBot/types/servers/HttpServer.d.ts index 8574cdd..bcd740f 100644 --- a/TypeScript/20CustomChatBot/types/servers/HttpServer.d.ts +++ b/TypeScript/20CustomChatBot/types/servers/HttpServer.d.ts @@ -19,11 +19,19 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/20CustomChatBot/types/services/BotLootCacheService.d.ts b/TypeScript/20CustomChatBot/types/services/BotLootCacheService.d.ts index b013e5e..7f79bfe 100644 --- a/TypeScript/20CustomChatBot/types/services/BotLootCacheService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/BotLootCacheService.d.ts @@ -69,6 +69,9 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/20CustomChatBot/types/services/FenceService.d.ts b/TypeScript/20CustomChatBot/types/services/FenceService.d.ts index bb1d035..75c4b28 100644 --- a/TypeScript/20CustomChatBot/types/services/FenceService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,14 +38,30 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; + protected fenceItemUpdCompareProperties: Set; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with */ setFenceAssort(assort: ITraderAssort): void; + /** + * Replace discount fence assort with new assort + * @param assort New assorts to replace old with + */ + setDiscountFenceAssort(assort: ITraderAssort): void; + /** + * Get main fence assort + * @return ITraderAssort + */ + getMainFenceAssort(): ITraderAssort; + /** + * Get discount fence assort + * @return ITraderAssort + */ + getDiscountFenceAssort(): ITraderAssort; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -57,6 +74,26 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adds to fence assort a single item (with its children) + * @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; + /** + * 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; + /** + * 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; /** * Adjust all items contained inside an assort by a multiplier * @param assort (clone)Assort that contains items with prices to adjust @@ -93,17 +130,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -112,8 +155,8 @@ export declare class FenceService { protected deleteRandomAssorts(itemCountToReplace: number, assort: ITraderAssort): void; /** * Choose an item at random and remove it + mods from assorts - * @param assort Items to remove from - * @param rootItems Assort root items to pick from to remove + * @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; /** @@ -132,6 +175,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +196,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +205,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +214,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +225,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +247,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/20CustomChatBot/types/services/ItemBaseClassService.d.ts b/TypeScript/20CustomChatBot/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/20CustomChatBot/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/20CustomChatBot/types/services/MailSendService.d.ts b/TypeScript/20CustomChatBot/types/services/MailSendService.d.ts index 08752bf..e5643f9 100644 --- a/TypeScript/20CustomChatBot/types/services/MailSendService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/MailSendService.d.ts @@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { Traders } from "@spt-aki/models/enums/Traders"; -import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -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?: any): void; + sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], 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?: any[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], 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 diff --git a/TypeScript/20CustomChatBot/types/services/PaymentService.d.ts b/TypeScript/20CustomChatBot/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/20CustomChatBot/types/services/PaymentService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/20CustomChatBot/types/services/ProfileActivityService.d.ts b/TypeScript/20CustomChatBot/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/20CustomChatBot/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/20CustomChatBot/types/services/ProfileFixerService.d.ts b/TypeScript/20CustomChatBot/types/services/ProfileFixerService.d.ts index 804b3bf..1045d0a 100644 --- a/TypeScript/20CustomChatBot/types/services/ProfileFixerService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @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 @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @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 @@ -165,4 +183,9 @@ export declare class ProfileFixerService { * @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 null + */ + protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/20CustomChatBot/types/services/RagfairPriceService.d.ts b/TypeScript/20CustomChatBot/types/services/RagfairPriceService.d.ts index 5649751..0fefdd8 100644 --- a/TypeScript/20CustomChatBot/types/services/RagfairPriceService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], 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 diff --git a/TypeScript/20CustomChatBot/types/utils/App.d.ts b/TypeScript/20CustomChatBot/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/20CustomChatBot/types/utils/App.d.ts +++ b/TypeScript/20CustomChatBot/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/20CustomChatBot/types/utils/CompareUtil.d.ts b/TypeScript/20CustomChatBot/types/utils/CompareUtil.d.ts new file mode 100644 index 0000000..a5b94d5 --- /dev/null +++ b/TypeScript/20CustomChatBot/types/utils/CompareUtil.d.ts @@ -0,0 +1,11 @@ +export declare class CompareUtil { + private static typesToCheckAgainst; + /** + * This function does an object comparison, equivalent to applying reflections + * and scanning for all possible properties including arrays. + * @param v1 value 1 to compare + * @param v2 value 2 to compare + * @returns true if equal, false if not + */ + recursiveCompare(v1: any, v2: any): boolean; +} diff --git a/TypeScript/20CustomChatBot/types/utils/RagfairOfferHolder.d.ts b/TypeScript/20CustomChatBot/types/utils/RagfairOfferHolder.d.ts index 3942ed1..b95e54a 100644 --- a/TypeScript/20CustomChatBot/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/20CustomChatBot/types/utils/RagfairOfferHolder.d.ts @@ -1,9 +1,12 @@ +import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { + protected maxOffersPerTemplate: number; + protected ragfairServerHelper: RagfairServerHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(); + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); getOfferById(id: string): IRagfairOffer; getOffersByTemplate(templateId: string): Array; getOffersByTrader(traderId: string): Array; diff --git a/TypeScript/20CustomChatBot/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/20CustomChatBot/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/20CustomChatBot/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/20CustomChatBot/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/21CustomCommandoCommand/README.md b/TypeScript/21CustomCommandoCommand/README.md index 48c742b..e760f8b 100644 --- a/TypeScript/21CustomCommandoCommand/README.md +++ b/TypeScript/21CustomCommandoCommand/README.md @@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an ## **NodeJS Setup** -Before you begin, ensure to install NodeJS version `v18.15.0`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). +Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). After installation, it's advised to reboot your system. diff --git a/TypeScript/21CustomCommandoCommand/types/callbacks/BotCallbacks.d.ts b/TypeScript/21CustomCommandoCommand/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/21CustomCommandoCommand/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/21CustomCommandoCommand/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/21CustomCommandoCommand/types/callbacks/DialogueCallbacks.d.ts index 7ed60b9..2de57cb 100644 --- a/TypeScript/21CustomCommandoCommand/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/callbacks/DialogueCallbacks.d.ts @@ -1,7 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; -import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; +import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest"; @@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/friend/request/send */ sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/accept-all + */ + acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; /** * Handle client/friend/request/accept */ acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/decline + */ + declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/friend/request/cancel */ diff --git a/TypeScript/21CustomCommandoCommand/types/callbacks/InraidCallbacks.d.ts b/TypeScript/21CustomCommandoCommand/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/21CustomCommandoCommand/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/BotController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/BotController.d.ts index d148abc..556cc5d 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/BotController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/BotController.d.ts @@ -51,12 +51,14 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * 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 ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string): Difficulty; + getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/BuildController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/BuildController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/GameController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/GameController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, 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); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/HideoutController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/HideoutController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/InsuranceController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/InsuranceController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/LauncherController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/LauncherController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/MatchController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/MatchController.d.ts index 6b1a7c3..708cee2 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/MatchController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/MatchController.d.ts @@ -75,10 +75,11 @@ export declare class MatchController { 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(pmcData: IPmcData, extractName: string): void; + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; /** * Was extract by car * @param extractName name of extract diff --git a/TypeScript/21CustomCommandoCommand/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/BotEquipmentModGenerator.d.ts index dd1dcce..f850eea 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/BotEquipmentModGenerator.d.ts @@ -187,12 +187,12 @@ export declare class BotEquipmentModGenerator { */ protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param slotAddedToTemplate slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate template of the mods being added - * @param botRole + * Check if mod exists in db + is for a required slot + * @param modToAdd Db template of mod to check + * @param slotAddedToTemplate Slot object the item will be placed as child into + * @param modSlot Slot the mod will fill + * @param parentTemplate Db template of the mods being added + * @param botRole Bots wildspawntype (assault/pmcBot etc) * @returns true if valid */ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; diff --git a/TypeScript/21CustomCommandoCommand/types/generators/BotGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/BotGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: 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/TypeScript/21CustomCommandoCommand/types/generators/BotLootGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/BotLootGenerator.d.ts index 014617e..ca5d1bd 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/BotLootGenerator.d.ts @@ -82,7 +82,7 @@ export declare class BotLootGenerator { * @param totalValueLimitRub Total value of loot allowed in roubles * @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): void; + 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[][]; /** * Some items need child items to function, add them to the itemToAddChildrenTo array @@ -101,7 +101,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): void; + protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, 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 diff --git a/TypeScript/21CustomCommandoCommand/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..5ca8ed7 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/FenceBaseAssortGenerator.d.ts @@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { FenceService } from "@spt-aki/services/FenceService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -22,14 +23,25 @@ export declare class FenceBaseAssortGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; + protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; - protected getItemPrice(itemTpl: string, items: Item[]): number; - protected getAmmoBoxPrice(items: Item[]): number; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * Get the penetration power value of an ammo, works with ammo boxes and raw ammos + * @param rootItemDb Ammo box or ammo item from items.db + * @returns Penetration power of passed in item, null if it doesnt have a power + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/21CustomCommandoCommand/types/generators/LootGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/LootGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/21CustomCommandoCommand/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/BotGeneratorHelper.d.ts index 7f7555b..c756725 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/BotGeneratorHelper.d.ts @@ -92,7 +92,7 @@ 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): ItemAddedResult; + addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set): ItemAddedResult; /** * Is the provided item allowed inside a container * @param slotGrid Items sub-grid we want to place item inside diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts new file mode 100644 index 0000000..26958ca --- /dev/null +++ b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -0,0 +1,39 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected itemFilterService: ItemFilterService; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en espaƱol" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: Map; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts deleted file mode 100644 index 33d05de..0000000 --- a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; -import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; -import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -export declare class GiveSptCommand implements ISptCommand { - protected logger: ILogger; - protected itemHelper: ItemHelper; - protected hashUtil: HashUtil; - protected jsonUtil: JsonUtil; - protected presetHelper: PresetHelper; - protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); - getCommand(): string; - getCommandHelp(): string; - performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts new file mode 100644 index 0000000..8ec2ada --- /dev/null +++ b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts @@ -0,0 +1,38 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class ProfileSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected profileHelper: ProfileHelper; + /** + * Regex to account for all these cases: + * spt profile level 20 + * spt profile skill metabolism 10 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent; + protected handleLevelCommand(level: number): IProfileChangeEvent; +} diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts new file mode 100644 index 0000000..d84158a --- /dev/null +++ b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -0,0 +1,33 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class TraderSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt trader prapor rep 100 + * spt trader mechanic spend 1000000 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/HideoutHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/HttpServerHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/ItemHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/ItemHelper.d.ts index 3e91ef7..9195579 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/ItemHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/ItemHelper.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; +import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { CompareUtil } from "@spt-aki/utils/CompareUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; @@ -28,8 +29,33 @@ export declare class ItemHelper { protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; + protected compareUtil: CompareUtil; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil); + /** + * 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 + * @param item1 first item with all its children to compare + * @param item2 second item with all its children to compare + * @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; + /** + * This method will compare two items and see if the are equivalent. + * This method will NOT compare IDs on the items + * @param item1 first item to compare + * @param item2 second item to compare + * @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; + /** + * 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; /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl @@ -363,10 +389,11 @@ export declare class ItemHelper { * Chose a randomly weighted cartridge that fits * @param caliber Desired caliber * @param staticAmmoDist Cartridges and thier weights + * @param fallbackCartridgeTpl If a cartridge cannot be found in the above staticAmmoDist param, use this instead * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -401,7 +428,7 @@ export declare class ItemHelper { addChildSlotItems(itemToAdd: Item[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): Item[]; /** * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter - * @param possibleTpls Tpls to randomply choose from + * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow * @returns Chosen tpl or null */ diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/PresetHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/PresetHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IBotType.d.ts index db6e56e..2a00af9 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,9 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/dialog/IAcceptFriendRequestData.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/dialog/IAcceptFriendRequestData.d.ts index 87461aa..0913eb5 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/dialog/IAcceptFriendRequestData.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/dialog/IAcceptFriendRequestData.d.ts @@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest { } export interface ICancelFriendRequestData extends IBaseFriendRequest { } -export interface IBaseFriendRequest { - request_id: string; +export interface IDeclineFriendRequestData extends IBaseFriendRequest { +} +export interface IBaseFriendRequest { + profileId: string; } diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/dialog/IFriendRequestSendResponse.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/dialog/IFriendRequestSendResponse.d.ts index 06c40f3..fc311eb 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/dialog/IFriendRequestSendResponse.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/dialog/IFriendRequestSendResponse.d.ts @@ -1,5 +1,5 @@ export interface IFriendRequestSendResponse { status: number; - requestid: string; + requestId: string; retryAfter: number; } diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 6c3c9eb..26e43ac 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -1,5 +1,5 @@ import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item } from "../common/tables/IItem"; +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; export interface IGetOtherProfileResponse { id: string; aid: number; diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/profile/ISearchFriendResponse.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/profile/ISearchFriendResponse.d.ts index 96d88b2..d3cc7df 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/profile/ISearchFriendResponse.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/profile/ISearchFriendResponse.d.ts @@ -1,9 +1,11 @@ export interface ISearchFriendResponse { _id: string; + aid: number; Info: Info; } export interface Info { Nickname: string; Side: string; Level: number; + MemberCategory: number; } diff --git a/TypeScript/21CustomCommandoCommand/types/models/enums/AmmoTypes.d.ts b/TypeScript/21CustomCommandoCommand/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/21CustomCommandoCommand/types/models/enums/WeaponTypes.d.ts b/TypeScript/21CustomCommandoCommand/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..529c2cd 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,9 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +23,8 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IBotConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IPmcConfig.d.ts index 65da29b..f17d3e4 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IPmcConfig.d.ts @@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig { /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; allPMCsHavePlayerNameWithRandomPrefixChance: number; + /** Should secure container loot from usec.json/bear.json be added to pmc bots secure */ + addSecureContainerLootFromBotConfig: boolean; } export interface PmcTypes { usec: string; diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/dialog/ISendMessageDetails.d.ts index 2068ede..05b3bcd 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -30,7 +30,15 @@ export interface ISendMessageDetails { } export interface IProfileChangeEvent { _id: string; - Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + Type: ProfileChangeEventType; value: number; entity?: string; } +export declare enum ProfileChangeEventType { + TRADER_SALES_SUM = "TraderSalesSum", + TRADER_STANDING = "TraderStanding", + PROFILE_LEVEL = "ProfileLevel", + SKILL_POINTS = "SkillPoints", + EXAMINE_ALL_ITEMS = "ExamineAllItems", + UNLOCK_TRADER = "UnlockTrader" +} diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/21CustomCommandoCommand/types/servers/HttpServer.d.ts b/TypeScript/21CustomCommandoCommand/types/servers/HttpServer.d.ts index 8574cdd..bcd740f 100644 --- a/TypeScript/21CustomCommandoCommand/types/servers/HttpServer.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/servers/HttpServer.d.ts @@ -19,11 +19,19 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/21CustomCommandoCommand/types/services/BotLootCacheService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/BotLootCacheService.d.ts index b013e5e..7f79bfe 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/BotLootCacheService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/BotLootCacheService.d.ts @@ -69,6 +69,9 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/21CustomCommandoCommand/types/services/FenceService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/FenceService.d.ts index bb1d035..75c4b28 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/FenceService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,14 +38,30 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; + protected fenceItemUpdCompareProperties: Set; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with */ setFenceAssort(assort: ITraderAssort): void; + /** + * Replace discount fence assort with new assort + * @param assort New assorts to replace old with + */ + setDiscountFenceAssort(assort: ITraderAssort): void; + /** + * Get main fence assort + * @return ITraderAssort + */ + getMainFenceAssort(): ITraderAssort; + /** + * Get discount fence assort + * @return ITraderAssort + */ + getDiscountFenceAssort(): ITraderAssort; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -57,6 +74,26 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adds to fence assort a single item (with its children) + * @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; + /** + * 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; + /** + * 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; /** * Adjust all items contained inside an assort by a multiplier * @param assort (clone)Assort that contains items with prices to adjust @@ -93,17 +130,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -112,8 +155,8 @@ export declare class FenceService { protected deleteRandomAssorts(itemCountToReplace: number, assort: ITraderAssort): void; /** * Choose an item at random and remove it + mods from assorts - * @param assort Items to remove from - * @param rootItems Assort root items to pick from to remove + * @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; /** @@ -132,6 +175,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +196,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +205,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +214,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +225,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +247,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/21CustomCommandoCommand/types/services/ItemBaseClassService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/21CustomCommandoCommand/types/services/MailSendService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/MailSendService.d.ts index 08752bf..e5643f9 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/MailSendService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/MailSendService.d.ts @@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { Traders } from "@spt-aki/models/enums/Traders"; -import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -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?: any): void; + sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], 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?: any[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], 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 diff --git a/TypeScript/21CustomCommandoCommand/types/services/PaymentService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/PaymentService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/21CustomCommandoCommand/types/services/ProfileActivityService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/21CustomCommandoCommand/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/21CustomCommandoCommand/types/services/ProfileFixerService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/ProfileFixerService.d.ts index 804b3bf..1045d0a 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/ProfileFixerService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @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 @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @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 @@ -165,4 +183,9 @@ export declare class ProfileFixerService { * @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 null + */ + protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/21CustomCommandoCommand/types/services/RagfairPriceService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/RagfairPriceService.d.ts index 5649751..0fefdd8 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/RagfairPriceService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], 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 diff --git a/TypeScript/21CustomCommandoCommand/types/utils/App.d.ts b/TypeScript/21CustomCommandoCommand/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/21CustomCommandoCommand/types/utils/App.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/21CustomCommandoCommand/types/utils/CompareUtil.d.ts b/TypeScript/21CustomCommandoCommand/types/utils/CompareUtil.d.ts new file mode 100644 index 0000000..a5b94d5 --- /dev/null +++ b/TypeScript/21CustomCommandoCommand/types/utils/CompareUtil.d.ts @@ -0,0 +1,11 @@ +export declare class CompareUtil { + private static typesToCheckAgainst; + /** + * This function does an object comparison, equivalent to applying reflections + * and scanning for all possible properties including arrays. + * @param v1 value 1 to compare + * @param v2 value 2 to compare + * @returns true if equal, false if not + */ + recursiveCompare(v1: any, v2: any): boolean; +} diff --git a/TypeScript/21CustomCommandoCommand/types/utils/RagfairOfferHolder.d.ts b/TypeScript/21CustomCommandoCommand/types/utils/RagfairOfferHolder.d.ts index 3942ed1..b95e54a 100644 --- a/TypeScript/21CustomCommandoCommand/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/utils/RagfairOfferHolder.d.ts @@ -1,9 +1,12 @@ +import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { + protected maxOffersPerTemplate: number; + protected ragfairServerHelper: RagfairServerHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(); + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); getOfferById(id: string): IRagfairOffer; getOffersByTemplate(templateId: string): Array; getOffersByTrader(traderId: string): Array; diff --git a/TypeScript/21CustomCommandoCommand/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/21CustomCommandoCommand/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/21CustomCommandoCommand/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/22CustomAkiCommand/README.md b/TypeScript/22CustomAkiCommand/README.md index 48c742b..e760f8b 100644 --- a/TypeScript/22CustomAkiCommand/README.md +++ b/TypeScript/22CustomAkiCommand/README.md @@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an ## **NodeJS Setup** -Before you begin, ensure to install NodeJS version `v18.15.0`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). +Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). After installation, it's advised to reboot your system. diff --git a/TypeScript/22CustomAkiCommand/types/callbacks/BotCallbacks.d.ts b/TypeScript/22CustomAkiCommand/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/22CustomAkiCommand/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/22CustomAkiCommand/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/22CustomAkiCommand/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/22CustomAkiCommand/types/callbacks/DialogueCallbacks.d.ts index 7ed60b9..2de57cb 100644 --- a/TypeScript/22CustomAkiCommand/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/22CustomAkiCommand/types/callbacks/DialogueCallbacks.d.ts @@ -1,7 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; -import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; +import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest"; @@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/friend/request/send */ sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/accept-all + */ + acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; /** * Handle client/friend/request/accept */ acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/decline + */ + declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/friend/request/cancel */ diff --git a/TypeScript/22CustomAkiCommand/types/callbacks/InraidCallbacks.d.ts b/TypeScript/22CustomAkiCommand/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/22CustomAkiCommand/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/22CustomAkiCommand/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/22CustomAkiCommand/types/controllers/BotController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/BotController.d.ts index d148abc..556cc5d 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/BotController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/BotController.d.ts @@ -51,12 +51,14 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * 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 ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string): Difficulty; + getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/22CustomAkiCommand/types/controllers/BuildController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/BuildController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/22CustomAkiCommand/types/controllers/GameController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/GameController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, 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); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/22CustomAkiCommand/types/controllers/HideoutController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/HideoutController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/22CustomAkiCommand/types/controllers/InsuranceController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/InsuranceController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/22CustomAkiCommand/types/controllers/LauncherController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/LauncherController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/22CustomAkiCommand/types/controllers/MatchController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/MatchController.d.ts index 6b1a7c3..708cee2 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/MatchController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/MatchController.d.ts @@ -75,10 +75,11 @@ export declare class MatchController { 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(pmcData: IPmcData, extractName: string): void; + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; /** * Was extract by car * @param extractName name of extract diff --git a/TypeScript/22CustomAkiCommand/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/BotEquipmentModGenerator.d.ts index dd1dcce..f850eea 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/BotEquipmentModGenerator.d.ts @@ -187,12 +187,12 @@ export declare class BotEquipmentModGenerator { */ protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param slotAddedToTemplate slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate template of the mods being added - * @param botRole + * Check if mod exists in db + is for a required slot + * @param modToAdd Db template of mod to check + * @param slotAddedToTemplate Slot object the item will be placed as child into + * @param modSlot Slot the mod will fill + * @param parentTemplate Db template of the mods being added + * @param botRole Bots wildspawntype (assault/pmcBot etc) * @returns true if valid */ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; diff --git a/TypeScript/22CustomAkiCommand/types/generators/BotGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/BotGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: 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/TypeScript/22CustomAkiCommand/types/generators/BotLootGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/BotLootGenerator.d.ts index 014617e..ca5d1bd 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/BotLootGenerator.d.ts @@ -82,7 +82,7 @@ export declare class BotLootGenerator { * @param totalValueLimitRub Total value of loot allowed in roubles * @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): void; + 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[][]; /** * Some items need child items to function, add them to the itemToAddChildrenTo array @@ -101,7 +101,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): void; + protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, 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 diff --git a/TypeScript/22CustomAkiCommand/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..5ca8ed7 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/FenceBaseAssortGenerator.d.ts @@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { FenceService } from "@spt-aki/services/FenceService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -22,14 +23,25 @@ export declare class FenceBaseAssortGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; + protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; - protected getItemPrice(itemTpl: string, items: Item[]): number; - protected getAmmoBoxPrice(items: Item[]): number; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * Get the penetration power value of an ammo, works with ammo boxes and raw ammos + * @param rootItemDb Ammo box or ammo item from items.db + * @returns Penetration power of passed in item, null if it doesnt have a power + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/22CustomAkiCommand/types/generators/LootGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/LootGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/22CustomAkiCommand/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/22CustomAkiCommand/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/BotGeneratorHelper.d.ts index 7f7555b..c756725 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/BotGeneratorHelper.d.ts @@ -92,7 +92,7 @@ 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): ItemAddedResult; + addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set): ItemAddedResult; /** * Is the provided item allowed inside a container * @param slotGrid Items sub-grid we want to place item inside diff --git a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts new file mode 100644 index 0000000..26958ca --- /dev/null +++ b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -0,0 +1,39 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected itemFilterService: ItemFilterService; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en espaƱol" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: Map; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts deleted file mode 100644 index 33d05de..0000000 --- a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; -import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; -import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -export declare class GiveSptCommand implements ISptCommand { - protected logger: ILogger; - protected itemHelper: ItemHelper; - protected hashUtil: HashUtil; - protected jsonUtil: JsonUtil; - protected presetHelper: PresetHelper; - protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); - getCommand(): string; - getCommandHelp(): string; - performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts new file mode 100644 index 0000000..8ec2ada --- /dev/null +++ b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts @@ -0,0 +1,38 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class ProfileSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected profileHelper: ProfileHelper; + /** + * Regex to account for all these cases: + * spt profile level 20 + * spt profile skill metabolism 10 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent; + protected handleLevelCommand(level: number): IProfileChangeEvent; +} diff --git a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts new file mode 100644 index 0000000..d84158a --- /dev/null +++ b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -0,0 +1,33 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class TraderSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt trader prapor rep 100 + * spt trader mechanic spend 1000000 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/22CustomAkiCommand/types/helpers/HideoutHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/22CustomAkiCommand/types/helpers/HttpServerHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/22CustomAkiCommand/types/helpers/ItemHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/ItemHelper.d.ts index 3e91ef7..9195579 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/ItemHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/ItemHelper.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; +import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { CompareUtil } from "@spt-aki/utils/CompareUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; @@ -28,8 +29,33 @@ export declare class ItemHelper { protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; + protected compareUtil: CompareUtil; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil); + /** + * 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 + * @param item1 first item with all its children to compare + * @param item2 second item with all its children to compare + * @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; + /** + * This method will compare two items and see if the are equivalent. + * This method will NOT compare IDs on the items + * @param item1 first item to compare + * @param item2 second item to compare + * @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; + /** + * 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; /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl @@ -363,10 +389,11 @@ export declare class ItemHelper { * Chose a randomly weighted cartridge that fits * @param caliber Desired caliber * @param staticAmmoDist Cartridges and thier weights + * @param fallbackCartridgeTpl If a cartridge cannot be found in the above staticAmmoDist param, use this instead * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -401,7 +428,7 @@ export declare class ItemHelper { addChildSlotItems(itemToAdd: Item[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): Item[]; /** * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter - * @param possibleTpls Tpls to randomply choose from + * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow * @returns Chosen tpl or null */ diff --git a/TypeScript/22CustomAkiCommand/types/helpers/PresetHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/PresetHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IBotType.d.ts index db6e56e..2a00af9 100644 --- a/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,9 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/dialog/IAcceptFriendRequestData.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/dialog/IAcceptFriendRequestData.d.ts index 87461aa..0913eb5 100644 --- a/TypeScript/22CustomAkiCommand/types/models/eft/dialog/IAcceptFriendRequestData.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/eft/dialog/IAcceptFriendRequestData.d.ts @@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest { } export interface ICancelFriendRequestData extends IBaseFriendRequest { } -export interface IBaseFriendRequest { - request_id: string; +export interface IDeclineFriendRequestData extends IBaseFriendRequest { +} +export interface IBaseFriendRequest { + profileId: string; } diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/dialog/IFriendRequestSendResponse.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/dialog/IFriendRequestSendResponse.d.ts index 06c40f3..fc311eb 100644 --- a/TypeScript/22CustomAkiCommand/types/models/eft/dialog/IFriendRequestSendResponse.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/eft/dialog/IFriendRequestSendResponse.d.ts @@ -1,5 +1,5 @@ export interface IFriendRequestSendResponse { status: number; - requestid: string; + requestId: string; retryAfter: number; } diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 6c3c9eb..26e43ac 100644 --- a/TypeScript/22CustomAkiCommand/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -1,5 +1,5 @@ import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item } from "../common/tables/IItem"; +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; export interface IGetOtherProfileResponse { id: string; aid: number; diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/profile/ISearchFriendResponse.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/profile/ISearchFriendResponse.d.ts index 96d88b2..d3cc7df 100644 --- a/TypeScript/22CustomAkiCommand/types/models/eft/profile/ISearchFriendResponse.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/eft/profile/ISearchFriendResponse.d.ts @@ -1,9 +1,11 @@ export interface ISearchFriendResponse { _id: string; + aid: number; Info: Info; } export interface Info { Nickname: string; Side: string; Level: number; + MemberCategory: number; } diff --git a/TypeScript/22CustomAkiCommand/types/models/enums/AmmoTypes.d.ts b/TypeScript/22CustomAkiCommand/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/22CustomAkiCommand/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/22CustomAkiCommand/types/models/enums/WeaponTypes.d.ts b/TypeScript/22CustomAkiCommand/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/22CustomAkiCommand/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..529c2cd 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,9 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +23,8 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/IBotConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/IPmcConfig.d.ts index 65da29b..f17d3e4 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/IPmcConfig.d.ts @@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig { /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; allPMCsHavePlayerNameWithRandomPrefixChance: number; + /** Should secure container loot from usec.json/bear.json be added to pmc bots secure */ + addSecureContainerLootFromBotConfig: boolean; } export interface PmcTypes { usec: string; diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/dialog/ISendMessageDetails.d.ts index 2068ede..05b3bcd 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -30,7 +30,15 @@ export interface ISendMessageDetails { } export interface IProfileChangeEvent { _id: string; - Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + Type: ProfileChangeEventType; value: number; entity?: string; } +export declare enum ProfileChangeEventType { + TRADER_SALES_SUM = "TraderSalesSum", + TRADER_STANDING = "TraderStanding", + PROFILE_LEVEL = "ProfileLevel", + SKILL_POINTS = "SkillPoints", + EXAMINE_ALL_ITEMS = "ExamineAllItems", + UNLOCK_TRADER = "UnlockTrader" +} diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/22CustomAkiCommand/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/22CustomAkiCommand/types/servers/HttpServer.d.ts b/TypeScript/22CustomAkiCommand/types/servers/HttpServer.d.ts index 8574cdd..bcd740f 100644 --- a/TypeScript/22CustomAkiCommand/types/servers/HttpServer.d.ts +++ b/TypeScript/22CustomAkiCommand/types/servers/HttpServer.d.ts @@ -19,11 +19,19 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/22CustomAkiCommand/types/services/BotLootCacheService.d.ts b/TypeScript/22CustomAkiCommand/types/services/BotLootCacheService.d.ts index b013e5e..7f79bfe 100644 --- a/TypeScript/22CustomAkiCommand/types/services/BotLootCacheService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/BotLootCacheService.d.ts @@ -69,6 +69,9 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/22CustomAkiCommand/types/services/FenceService.d.ts b/TypeScript/22CustomAkiCommand/types/services/FenceService.d.ts index bb1d035..75c4b28 100644 --- a/TypeScript/22CustomAkiCommand/types/services/FenceService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,14 +38,30 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; + protected fenceItemUpdCompareProperties: Set; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with */ setFenceAssort(assort: ITraderAssort): void; + /** + * Replace discount fence assort with new assort + * @param assort New assorts to replace old with + */ + setDiscountFenceAssort(assort: ITraderAssort): void; + /** + * Get main fence assort + * @return ITraderAssort + */ + getMainFenceAssort(): ITraderAssort; + /** + * Get discount fence assort + * @return ITraderAssort + */ + getDiscountFenceAssort(): ITraderAssort; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -57,6 +74,26 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adds to fence assort a single item (with its children) + * @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; + /** + * 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; + /** + * 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; /** * Adjust all items contained inside an assort by a multiplier * @param assort (clone)Assort that contains items with prices to adjust @@ -93,17 +130,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -112,8 +155,8 @@ export declare class FenceService { protected deleteRandomAssorts(itemCountToReplace: number, assort: ITraderAssort): void; /** * Choose an item at random and remove it + mods from assorts - * @param assort Items to remove from - * @param rootItems Assort root items to pick from to remove + * @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; /** @@ -132,6 +175,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +196,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +205,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +214,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +225,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +247,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/22CustomAkiCommand/types/services/ItemBaseClassService.d.ts b/TypeScript/22CustomAkiCommand/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/22CustomAkiCommand/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/22CustomAkiCommand/types/services/MailSendService.d.ts b/TypeScript/22CustomAkiCommand/types/services/MailSendService.d.ts index 08752bf..e5643f9 100644 --- a/TypeScript/22CustomAkiCommand/types/services/MailSendService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/MailSendService.d.ts @@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { Traders } from "@spt-aki/models/enums/Traders"; -import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -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?: any): void; + sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], 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?: any[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], 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 diff --git a/TypeScript/22CustomAkiCommand/types/services/PaymentService.d.ts b/TypeScript/22CustomAkiCommand/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/22CustomAkiCommand/types/services/PaymentService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/22CustomAkiCommand/types/services/ProfileActivityService.d.ts b/TypeScript/22CustomAkiCommand/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/22CustomAkiCommand/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/22CustomAkiCommand/types/services/ProfileFixerService.d.ts b/TypeScript/22CustomAkiCommand/types/services/ProfileFixerService.d.ts index 804b3bf..1045d0a 100644 --- a/TypeScript/22CustomAkiCommand/types/services/ProfileFixerService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @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 @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @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 @@ -165,4 +183,9 @@ export declare class ProfileFixerService { * @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 null + */ + protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/22CustomAkiCommand/types/services/RagfairPriceService.d.ts b/TypeScript/22CustomAkiCommand/types/services/RagfairPriceService.d.ts index 5649751..0fefdd8 100644 --- a/TypeScript/22CustomAkiCommand/types/services/RagfairPriceService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], 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 diff --git a/TypeScript/22CustomAkiCommand/types/utils/App.d.ts b/TypeScript/22CustomAkiCommand/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/22CustomAkiCommand/types/utils/App.d.ts +++ b/TypeScript/22CustomAkiCommand/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/22CustomAkiCommand/types/utils/CompareUtil.d.ts b/TypeScript/22CustomAkiCommand/types/utils/CompareUtil.d.ts new file mode 100644 index 0000000..a5b94d5 --- /dev/null +++ b/TypeScript/22CustomAkiCommand/types/utils/CompareUtil.d.ts @@ -0,0 +1,11 @@ +export declare class CompareUtil { + private static typesToCheckAgainst; + /** + * This function does an object comparison, equivalent to applying reflections + * and scanning for all possible properties including arrays. + * @param v1 value 1 to compare + * @param v2 value 2 to compare + * @returns true if equal, false if not + */ + recursiveCompare(v1: any, v2: any): boolean; +} diff --git a/TypeScript/22CustomAkiCommand/types/utils/RagfairOfferHolder.d.ts b/TypeScript/22CustomAkiCommand/types/utils/RagfairOfferHolder.d.ts index 3942ed1..b95e54a 100644 --- a/TypeScript/22CustomAkiCommand/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/22CustomAkiCommand/types/utils/RagfairOfferHolder.d.ts @@ -1,9 +1,12 @@ +import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { + protected maxOffersPerTemplate: number; + protected ragfairServerHelper: RagfairServerHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(); + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); getOfferById(id: string): IRagfairOffer; getOffersByTemplate(templateId: string): Array; getOffersByTrader(traderId: string): Array; diff --git a/TypeScript/22CustomAkiCommand/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/22CustomAkiCommand/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/22CustomAkiCommand/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/22CustomAkiCommand/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/23CustomAbstractChatBot/README.md b/TypeScript/23CustomAbstractChatBot/README.md index 48c742b..e760f8b 100644 --- a/TypeScript/23CustomAbstractChatBot/README.md +++ b/TypeScript/23CustomAbstractChatBot/README.md @@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an ## **NodeJS Setup** -Before you begin, ensure to install NodeJS version `v18.15.0`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). +Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). After installation, it's advised to reboot your system. diff --git a/TypeScript/2EditDatabase/README.md b/TypeScript/2EditDatabase/README.md index 48c742b..e760f8b 100644 --- a/TypeScript/2EditDatabase/README.md +++ b/TypeScript/2EditDatabase/README.md @@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an ## **NodeJS Setup** -Before you begin, ensure to install NodeJS version `v18.15.0`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). +Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). After installation, it's advised to reboot your system. diff --git a/TypeScript/2EditDatabase/types/callbacks/BotCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/2EditDatabase/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/2EditDatabase/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/DialogueCallbacks.d.ts index 7ed60b9..2de57cb 100644 --- a/TypeScript/2EditDatabase/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/DialogueCallbacks.d.ts @@ -1,7 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; -import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; +import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest"; @@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/friend/request/send */ sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/accept-all + */ + acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; /** * Handle client/friend/request/accept */ acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/decline + */ + declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/friend/request/cancel */ diff --git a/TypeScript/2EditDatabase/types/callbacks/InraidCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/2EditDatabase/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/2EditDatabase/types/controllers/BotController.d.ts b/TypeScript/2EditDatabase/types/controllers/BotController.d.ts index d148abc..556cc5d 100644 --- a/TypeScript/2EditDatabase/types/controllers/BotController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/BotController.d.ts @@ -51,12 +51,14 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * 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 ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string): Difficulty; + getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/2EditDatabase/types/controllers/BuildController.d.ts b/TypeScript/2EditDatabase/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/2EditDatabase/types/controllers/BuildController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/2EditDatabase/types/controllers/GameController.d.ts b/TypeScript/2EditDatabase/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/2EditDatabase/types/controllers/GameController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, 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); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/2EditDatabase/types/controllers/HideoutController.d.ts b/TypeScript/2EditDatabase/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/2EditDatabase/types/controllers/HideoutController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts b/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/2EditDatabase/types/controllers/LauncherController.d.ts b/TypeScript/2EditDatabase/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/2EditDatabase/types/controllers/LauncherController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/2EditDatabase/types/controllers/MatchController.d.ts b/TypeScript/2EditDatabase/types/controllers/MatchController.d.ts index 6b1a7c3..708cee2 100644 --- a/TypeScript/2EditDatabase/types/controllers/MatchController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/MatchController.d.ts @@ -75,10 +75,11 @@ export declare class MatchController { 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(pmcData: IPmcData, extractName: string): void; + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; /** * Was extract by car * @param extractName name of extract diff --git a/TypeScript/2EditDatabase/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/BotEquipmentModGenerator.d.ts index dd1dcce..f850eea 100644 --- a/TypeScript/2EditDatabase/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/BotEquipmentModGenerator.d.ts @@ -187,12 +187,12 @@ export declare class BotEquipmentModGenerator { */ protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param slotAddedToTemplate slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate template of the mods being added - * @param botRole + * Check if mod exists in db + is for a required slot + * @param modToAdd Db template of mod to check + * @param slotAddedToTemplate Slot object the item will be placed as child into + * @param modSlot Slot the mod will fill + * @param parentTemplate Db template of the mods being added + * @param botRole Bots wildspawntype (assault/pmcBot etc) * @returns true if valid */ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; diff --git a/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: 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/TypeScript/2EditDatabase/types/generators/BotLootGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/BotLootGenerator.d.ts index 014617e..ca5d1bd 100644 --- a/TypeScript/2EditDatabase/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/BotLootGenerator.d.ts @@ -82,7 +82,7 @@ export declare class BotLootGenerator { * @param totalValueLimitRub Total value of loot allowed in roubles * @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): void; + 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[][]; /** * Some items need child items to function, add them to the itemToAddChildrenTo array @@ -101,7 +101,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): void; + protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, 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 diff --git a/TypeScript/2EditDatabase/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..5ca8ed7 100644 --- a/TypeScript/2EditDatabase/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/FenceBaseAssortGenerator.d.ts @@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { FenceService } from "@spt-aki/services/FenceService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -22,14 +23,25 @@ export declare class FenceBaseAssortGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; + protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; - protected getItemPrice(itemTpl: string, items: Item[]): number; - protected getAmmoBoxPrice(items: Item[]): number; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * Get the penetration power value of an ammo, works with ammo boxes and raw ammos + * @param rootItemDb Ammo box or ammo item from items.db + * @returns Penetration power of passed in item, null if it doesnt have a power + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/2EditDatabase/types/generators/LootGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/2EditDatabase/types/generators/LootGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/2EditDatabase/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/2EditDatabase/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/2EditDatabase/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/BotGeneratorHelper.d.ts index 7f7555b..c756725 100644 --- a/TypeScript/2EditDatabase/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/BotGeneratorHelper.d.ts @@ -92,7 +92,7 @@ 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): ItemAddedResult; + addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set): ItemAddedResult; /** * Is the provided item allowed inside a container * @param slotGrid Items sub-grid we want to place item inside diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/2EditDatabase/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts new file mode 100644 index 0000000..26958ca --- /dev/null +++ b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -0,0 +1,39 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected itemFilterService: ItemFilterService; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en espaƱol" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: Map; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts deleted file mode 100644 index 33d05de..0000000 --- a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; -import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; -import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -export declare class GiveSptCommand implements ISptCommand { - protected logger: ILogger; - protected itemHelper: ItemHelper; - protected hashUtil: HashUtil; - protected jsonUtil: JsonUtil; - protected presetHelper: PresetHelper; - protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); - getCommand(): string; - getCommandHelp(): string; - performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts new file mode 100644 index 0000000..8ec2ada --- /dev/null +++ b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts @@ -0,0 +1,38 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class ProfileSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected profileHelper: ProfileHelper; + /** + * Regex to account for all these cases: + * spt profile level 20 + * spt profile skill metabolism 10 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent; + protected handleLevelCommand(level: number): IProfileChangeEvent; +} diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts new file mode 100644 index 0000000..d84158a --- /dev/null +++ b/TypeScript/2EditDatabase/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -0,0 +1,33 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class TraderSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt trader prapor rep 100 + * spt trader mechanic spend 1000000 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/2EditDatabase/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/2EditDatabase/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/2EditDatabase/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/2EditDatabase/types/helpers/HttpServerHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/2EditDatabase/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts index 3e91ef7..9195579 100644 --- a/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; +import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { CompareUtil } from "@spt-aki/utils/CompareUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; @@ -28,8 +29,33 @@ export declare class ItemHelper { protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; + protected compareUtil: CompareUtil; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil); + /** + * 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 + * @param item1 first item with all its children to compare + * @param item2 second item with all its children to compare + * @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; + /** + * This method will compare two items and see if the are equivalent. + * This method will NOT compare IDs on the items + * @param item1 first item to compare + * @param item2 second item to compare + * @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; + /** + * 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; /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl @@ -363,10 +389,11 @@ export declare class ItemHelper { * Chose a randomly weighted cartridge that fits * @param caliber Desired caliber * @param staticAmmoDist Cartridges and thier weights + * @param fallbackCartridgeTpl If a cartridge cannot be found in the above staticAmmoDist param, use this instead * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -401,7 +428,7 @@ export declare class ItemHelper { addChildSlotItems(itemToAdd: Item[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): Item[]; /** * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter - * @param possibleTpls Tpls to randomply choose from + * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow * @returns Chosen tpl or null */ diff --git a/TypeScript/2EditDatabase/types/helpers/PresetHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/2EditDatabase/types/helpers/PresetHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotType.d.ts index db6e56e..2a00af9 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,9 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/2EditDatabase/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/2EditDatabase/types/models/eft/dialog/IAcceptFriendRequestData.d.ts b/TypeScript/2EditDatabase/types/models/eft/dialog/IAcceptFriendRequestData.d.ts index 87461aa..0913eb5 100644 --- a/TypeScript/2EditDatabase/types/models/eft/dialog/IAcceptFriendRequestData.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/dialog/IAcceptFriendRequestData.d.ts @@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest { } export interface ICancelFriendRequestData extends IBaseFriendRequest { } -export interface IBaseFriendRequest { - request_id: string; +export interface IDeclineFriendRequestData extends IBaseFriendRequest { +} +export interface IBaseFriendRequest { + profileId: string; } diff --git a/TypeScript/2EditDatabase/types/models/eft/dialog/IFriendRequestSendResponse.d.ts b/TypeScript/2EditDatabase/types/models/eft/dialog/IFriendRequestSendResponse.d.ts index 06c40f3..fc311eb 100644 --- a/TypeScript/2EditDatabase/types/models/eft/dialog/IFriendRequestSendResponse.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/dialog/IFriendRequestSendResponse.d.ts @@ -1,5 +1,5 @@ export interface IFriendRequestSendResponse { status: number; - requestid: string; + requestId: string; retryAfter: number; } diff --git a/TypeScript/2EditDatabase/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/TypeScript/2EditDatabase/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 6c3c9eb..26e43ac 100644 --- a/TypeScript/2EditDatabase/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -1,5 +1,5 @@ import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item } from "../common/tables/IItem"; +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; export interface IGetOtherProfileResponse { id: string; aid: number; diff --git a/TypeScript/2EditDatabase/types/models/eft/profile/ISearchFriendResponse.d.ts b/TypeScript/2EditDatabase/types/models/eft/profile/ISearchFriendResponse.d.ts index 96d88b2..d3cc7df 100644 --- a/TypeScript/2EditDatabase/types/models/eft/profile/ISearchFriendResponse.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/profile/ISearchFriendResponse.d.ts @@ -1,9 +1,11 @@ export interface ISearchFriendResponse { _id: string; + aid: number; Info: Info; } export interface Info { Nickname: string; Side: string; Level: number; + MemberCategory: number; } diff --git a/TypeScript/2EditDatabase/types/models/enums/AmmoTypes.d.ts b/TypeScript/2EditDatabase/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/2EditDatabase/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/2EditDatabase/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/2EditDatabase/types/models/enums/WeaponTypes.d.ts b/TypeScript/2EditDatabase/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/2EditDatabase/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/2EditDatabase/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/2EditDatabase/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/2EditDatabase/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..529c2cd 100644 --- a/TypeScript/2EditDatabase/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,9 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +23,8 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/2EditDatabase/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/2EditDatabase/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IPmcConfig.d.ts index 65da29b..f17d3e4 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IPmcConfig.d.ts @@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig { /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; allPMCsHavePlayerNameWithRandomPrefixChance: number; + /** Should secure container loot from usec.json/bear.json be added to pmc bots secure */ + addSecureContainerLootFromBotConfig: boolean; } export interface PmcTypes { usec: string; diff --git a/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/2EditDatabase/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/2EditDatabase/types/models/spt/dialog/ISendMessageDetails.d.ts index 2068ede..05b3bcd 100644 --- a/TypeScript/2EditDatabase/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -30,7 +30,15 @@ export interface ISendMessageDetails { } export interface IProfileChangeEvent { _id: string; - Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + Type: ProfileChangeEventType; value: number; entity?: string; } +export declare enum ProfileChangeEventType { + TRADER_SALES_SUM = "TraderSalesSum", + TRADER_STANDING = "TraderStanding", + PROFILE_LEVEL = "ProfileLevel", + SKILL_POINTS = "SkillPoints", + EXAMINE_ALL_ITEMS = "ExamineAllItems", + UNLOCK_TRADER = "UnlockTrader" +} diff --git a/TypeScript/2EditDatabase/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/2EditDatabase/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/2EditDatabase/types/servers/HttpServer.d.ts b/TypeScript/2EditDatabase/types/servers/HttpServer.d.ts index 8574cdd..bcd740f 100644 --- a/TypeScript/2EditDatabase/types/servers/HttpServer.d.ts +++ b/TypeScript/2EditDatabase/types/servers/HttpServer.d.ts @@ -19,11 +19,19 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/2EditDatabase/types/services/BotLootCacheService.d.ts b/TypeScript/2EditDatabase/types/services/BotLootCacheService.d.ts index b013e5e..7f79bfe 100644 --- a/TypeScript/2EditDatabase/types/services/BotLootCacheService.d.ts +++ b/TypeScript/2EditDatabase/types/services/BotLootCacheService.d.ts @@ -69,6 +69,9 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/2EditDatabase/types/services/FenceService.d.ts b/TypeScript/2EditDatabase/types/services/FenceService.d.ts index bb1d035..75c4b28 100644 --- a/TypeScript/2EditDatabase/types/services/FenceService.d.ts +++ b/TypeScript/2EditDatabase/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,14 +38,30 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; + protected fenceItemUpdCompareProperties: Set; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with */ setFenceAssort(assort: ITraderAssort): void; + /** + * Replace discount fence assort with new assort + * @param assort New assorts to replace old with + */ + setDiscountFenceAssort(assort: ITraderAssort): void; + /** + * Get main fence assort + * @return ITraderAssort + */ + getMainFenceAssort(): ITraderAssort; + /** + * Get discount fence assort + * @return ITraderAssort + */ + getDiscountFenceAssort(): ITraderAssort; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -57,6 +74,26 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adds to fence assort a single item (with its children) + * @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; + /** + * 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; + /** + * 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; /** * Adjust all items contained inside an assort by a multiplier * @param assort (clone)Assort that contains items with prices to adjust @@ -93,17 +130,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -112,8 +155,8 @@ export declare class FenceService { protected deleteRandomAssorts(itemCountToReplace: number, assort: ITraderAssort): void; /** * Choose an item at random and remove it + mods from assorts - * @param assort Items to remove from - * @param rootItems Assort root items to pick from to remove + * @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; /** @@ -132,6 +175,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +196,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +205,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +214,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +225,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +247,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/2EditDatabase/types/services/ItemBaseClassService.d.ts b/TypeScript/2EditDatabase/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/2EditDatabase/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/2EditDatabase/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/2EditDatabase/types/services/MailSendService.d.ts b/TypeScript/2EditDatabase/types/services/MailSendService.d.ts index 08752bf..e5643f9 100644 --- a/TypeScript/2EditDatabase/types/services/MailSendService.d.ts +++ b/TypeScript/2EditDatabase/types/services/MailSendService.d.ts @@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { Traders } from "@spt-aki/models/enums/Traders"; -import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -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?: any): void; + sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], 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?: any[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], 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 diff --git a/TypeScript/2EditDatabase/types/services/PaymentService.d.ts b/TypeScript/2EditDatabase/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/2EditDatabase/types/services/PaymentService.d.ts +++ b/TypeScript/2EditDatabase/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/2EditDatabase/types/services/ProfileActivityService.d.ts b/TypeScript/2EditDatabase/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/2EditDatabase/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/2EditDatabase/types/services/ProfileFixerService.d.ts b/TypeScript/2EditDatabase/types/services/ProfileFixerService.d.ts index 804b3bf..1045d0a 100644 --- a/TypeScript/2EditDatabase/types/services/ProfileFixerService.d.ts +++ b/TypeScript/2EditDatabase/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @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 @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @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 @@ -165,4 +183,9 @@ export declare class ProfileFixerService { * @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 null + */ + protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/2EditDatabase/types/services/RagfairPriceService.d.ts b/TypeScript/2EditDatabase/types/services/RagfairPriceService.d.ts index 5649751..0fefdd8 100644 --- a/TypeScript/2EditDatabase/types/services/RagfairPriceService.d.ts +++ b/TypeScript/2EditDatabase/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], 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 diff --git a/TypeScript/2EditDatabase/types/utils/App.d.ts b/TypeScript/2EditDatabase/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/2EditDatabase/types/utils/App.d.ts +++ b/TypeScript/2EditDatabase/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/2EditDatabase/types/utils/CompareUtil.d.ts b/TypeScript/2EditDatabase/types/utils/CompareUtil.d.ts new file mode 100644 index 0000000..a5b94d5 --- /dev/null +++ b/TypeScript/2EditDatabase/types/utils/CompareUtil.d.ts @@ -0,0 +1,11 @@ +export declare class CompareUtil { + private static typesToCheckAgainst; + /** + * This function does an object comparison, equivalent to applying reflections + * and scanning for all possible properties including arrays. + * @param v1 value 1 to compare + * @param v2 value 2 to compare + * @returns true if equal, false if not + */ + recursiveCompare(v1: any, v2: any): boolean; +} diff --git a/TypeScript/2EditDatabase/types/utils/RagfairOfferHolder.d.ts b/TypeScript/2EditDatabase/types/utils/RagfairOfferHolder.d.ts index 3942ed1..b95e54a 100644 --- a/TypeScript/2EditDatabase/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/2EditDatabase/types/utils/RagfairOfferHolder.d.ts @@ -1,9 +1,12 @@ +import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { + protected maxOffersPerTemplate: number; + protected ragfairServerHelper: RagfairServerHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(); + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); getOfferById(id: string): IRagfairOffer; getOffersByTemplate(templateId: string): Array; getOffersByTrader(traderId: string): Array; diff --git a/TypeScript/2EditDatabase/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/2EditDatabase/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/2EditDatabase/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/2EditDatabase/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/3GetSptConfigFile/README.md b/TypeScript/3GetSptConfigFile/README.md index 48c742b..e760f8b 100644 --- a/TypeScript/3GetSptConfigFile/README.md +++ b/TypeScript/3GetSptConfigFile/README.md @@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an ## **NodeJS Setup** -Before you begin, ensure to install NodeJS version `v18.15.0`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). +Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). After installation, it's advised to reboot your system. diff --git a/TypeScript/3GetSptConfigFile/src/mod.ts b/TypeScript/3GetSptConfigFile/src/mod.ts index a0ceabe..ecf1229 100644 --- a/TypeScript/3GetSptConfigFile/src/mod.ts +++ b/TypeScript/3GetSptConfigFile/src/mod.ts @@ -4,29 +4,30 @@ import { IPostAkiLoadMod } from "@spt-aki/models/external/IPostAkiLoadMod"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes"; -import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig"; +import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig"; class Mod implements IPostAkiLoadMod { - public postAkiLoad(container: DependencyContainer): void { + public postAkiLoad(container: DependencyContainer): void + { // get logger const logger = container.resolve("WinstonLogger"); - // get the config server + // get the config server so we can get a config with it const configServer = container.resolve("ConfigServer"); - // Request bot config - // Required - ConfigTypes.BOT is the enum of the config we want, others include ConfigTypes.Airdrop - const botConfig = configServer.getConfig(ConfigTypes.BOT); + // Request the map location config + // Required - ConfigTypes.LOCATION is the enum of the config we want, others include ConfigTypes.Airdrop + const locationConfig: ILocationConfig = configServer.getConfig(ConfigTypes.LOCATION); - // log the original pmc difficulty - logger.info(`here is the original bot pmc difficulty: ${botConfig.pmc.difficulty}`) + // Log the original customs loose loot multipler + logger.info(`Here is the original customs map loose loot multipler: ${locationConfig.looseLootMultiplier.bigmap}`) - // adjust the difficulty - botConfig.pmc.difficulty = "easy"; + // Adjust the multipler (customs is called bigmap in bsg land) + locationConfig.looseLootMultiplier.bigmap = 10; - // log the new pmc difficulty - logger.info(`here is the altered bot pmc difficulty: ${botConfig.pmc.difficulty}`) + // Log the new multipler + logger.info(`Here is the altered customs map loose loot multipler: ${locationConfig.looseLootMultiplier.bigmap}`) } } diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/BotCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/DialogueCallbacks.d.ts index 7ed60b9..2de57cb 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/DialogueCallbacks.d.ts @@ -1,7 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; -import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; +import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest"; @@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/friend/request/send */ sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/accept-all + */ + acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; /** * Handle client/friend/request/accept */ acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/decline + */ + declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/friend/request/cancel */ diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/InraidCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/3GetSptConfigFile/types/controllers/BotController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/BotController.d.ts index d148abc..556cc5d 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/BotController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/BotController.d.ts @@ -51,12 +51,14 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * 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 ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string): Difficulty; + getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/3GetSptConfigFile/types/controllers/BuildController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/BuildController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, 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); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/3GetSptConfigFile/types/controllers/HideoutController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/HideoutController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/3GetSptConfigFile/types/controllers/LauncherController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/LauncherController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/3GetSptConfigFile/types/controllers/MatchController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/MatchController.d.ts index 6b1a7c3..708cee2 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/MatchController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/MatchController.d.ts @@ -75,10 +75,11 @@ export declare class MatchController { 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(pmcData: IPmcData, extractName: string): void; + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; /** * Was extract by car * @param extractName name of extract diff --git a/TypeScript/3GetSptConfigFile/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/BotEquipmentModGenerator.d.ts index dd1dcce..f850eea 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/BotEquipmentModGenerator.d.ts @@ -187,12 +187,12 @@ export declare class BotEquipmentModGenerator { */ protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param slotAddedToTemplate slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate template of the mods being added - * @param botRole + * Check if mod exists in db + is for a required slot + * @param modToAdd Db template of mod to check + * @param slotAddedToTemplate Slot object the item will be placed as child into + * @param modSlot Slot the mod will fill + * @param parentTemplate Db template of the mods being added + * @param botRole Bots wildspawntype (assault/pmcBot etc) * @returns true if valid */ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; diff --git a/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: 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/TypeScript/3GetSptConfigFile/types/generators/BotLootGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/BotLootGenerator.d.ts index 014617e..ca5d1bd 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/BotLootGenerator.d.ts @@ -82,7 +82,7 @@ export declare class BotLootGenerator { * @param totalValueLimitRub Total value of loot allowed in roubles * @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): void; + 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[][]; /** * Some items need child items to function, add them to the itemToAddChildrenTo array @@ -101,7 +101,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): void; + protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, 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 diff --git a/TypeScript/3GetSptConfigFile/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..5ca8ed7 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/FenceBaseAssortGenerator.d.ts @@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { FenceService } from "@spt-aki/services/FenceService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -22,14 +23,25 @@ export declare class FenceBaseAssortGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; + protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; - protected getItemPrice(itemTpl: string, items: Item[]): number; - protected getAmmoBoxPrice(items: Item[]): number; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * Get the penetration power value of an ammo, works with ammo boxes and raw ammos + * @param rootItemDb Ammo box or ammo item from items.db + * @returns Penetration power of passed in item, null if it doesnt have a power + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/3GetSptConfigFile/types/generators/LootGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/LootGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/3GetSptConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/3GetSptConfigFile/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/BotGeneratorHelper.d.ts index 7f7555b..c756725 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/BotGeneratorHelper.d.ts @@ -92,7 +92,7 @@ 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): ItemAddedResult; + addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set): ItemAddedResult; /** * Is the provided item allowed inside a container * @param slotGrid Items sub-grid we want to place item inside diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts new file mode 100644 index 0000000..26958ca --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -0,0 +1,39 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected itemFilterService: ItemFilterService; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en espaƱol" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: Map; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts deleted file mode 100644 index 33d05de..0000000 --- a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; -import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; -import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -export declare class GiveSptCommand implements ISptCommand { - protected logger: ILogger; - protected itemHelper: ItemHelper; - protected hashUtil: HashUtil; - protected jsonUtil: JsonUtil; - protected presetHelper: PresetHelper; - protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); - getCommand(): string; - getCommandHelp(): string; - performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts new file mode 100644 index 0000000..8ec2ada --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts @@ -0,0 +1,38 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class ProfileSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected profileHelper: ProfileHelper; + /** + * Regex to account for all these cases: + * spt profile level 20 + * spt profile skill metabolism 10 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent; + protected handleLevelCommand(level: number): IProfileChangeEvent; +} diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts new file mode 100644 index 0000000..d84158a --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -0,0 +1,33 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class TraderSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt trader prapor rep 100 + * spt trader mechanic spend 1000000 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/3GetSptConfigFile/types/helpers/HttpServerHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts index 3e91ef7..9195579 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; +import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { CompareUtil } from "@spt-aki/utils/CompareUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; @@ -28,8 +29,33 @@ export declare class ItemHelper { protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; + protected compareUtil: CompareUtil; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil); + /** + * 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 + * @param item1 first item with all its children to compare + * @param item2 second item with all its children to compare + * @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; + /** + * This method will compare two items and see if the are equivalent. + * This method will NOT compare IDs on the items + * @param item1 first item to compare + * @param item2 second item to compare + * @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; + /** + * 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; /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl @@ -363,10 +389,11 @@ export declare class ItemHelper { * Chose a randomly weighted cartridge that fits * @param caliber Desired caliber * @param staticAmmoDist Cartridges and thier weights + * @param fallbackCartridgeTpl If a cartridge cannot be found in the above staticAmmoDist param, use this instead * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -401,7 +428,7 @@ export declare class ItemHelper { addChildSlotItems(itemToAdd: Item[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): Item[]; /** * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter - * @param possibleTpls Tpls to randomply choose from + * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow * @returns Chosen tpl or null */ diff --git a/TypeScript/3GetSptConfigFile/types/helpers/PresetHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/PresetHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotType.d.ts index db6e56e..2a00af9 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,9 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/dialog/IAcceptFriendRequestData.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/dialog/IAcceptFriendRequestData.d.ts index 87461aa..0913eb5 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/dialog/IAcceptFriendRequestData.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/dialog/IAcceptFriendRequestData.d.ts @@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest { } export interface ICancelFriendRequestData extends IBaseFriendRequest { } -export interface IBaseFriendRequest { - request_id: string; +export interface IDeclineFriendRequestData extends IBaseFriendRequest { +} +export interface IBaseFriendRequest { + profileId: string; } diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/dialog/IFriendRequestSendResponse.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/dialog/IFriendRequestSendResponse.d.ts index 06c40f3..fc311eb 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/dialog/IFriendRequestSendResponse.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/dialog/IFriendRequestSendResponse.d.ts @@ -1,5 +1,5 @@ export interface IFriendRequestSendResponse { status: number; - requestid: string; + requestId: string; retryAfter: number; } diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 6c3c9eb..26e43ac 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -1,5 +1,5 @@ import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item } from "../common/tables/IItem"; +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; export interface IGetOtherProfileResponse { id: string; aid: number; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/profile/ISearchFriendResponse.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/profile/ISearchFriendResponse.d.ts index 96d88b2..d3cc7df 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/profile/ISearchFriendResponse.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/profile/ISearchFriendResponse.d.ts @@ -1,9 +1,11 @@ export interface ISearchFriendResponse { _id: string; + aid: number; Info: Info; } export interface Info { Nickname: string; Side: string; Level: number; + MemberCategory: number; } diff --git a/TypeScript/3GetSptConfigFile/types/models/enums/AmmoTypes.d.ts b/TypeScript/3GetSptConfigFile/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/3GetSptConfigFile/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/3GetSptConfigFile/types/models/enums/WeaponTypes.d.ts b/TypeScript/3GetSptConfigFile/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/3GetSptConfigFile/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..529c2cd 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,9 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +23,8 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IPmcConfig.d.ts index 65da29b..f17d3e4 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IPmcConfig.d.ts @@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig { /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; allPMCsHavePlayerNameWithRandomPrefixChance: number; + /** Should secure container loot from usec.json/bear.json be added to pmc bots secure */ + addSecureContainerLootFromBotConfig: boolean; } export interface PmcTypes { usec: string; diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts index 2068ede..05b3bcd 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -30,7 +30,15 @@ export interface ISendMessageDetails { } export interface IProfileChangeEvent { _id: string; - Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + Type: ProfileChangeEventType; value: number; entity?: string; } +export declare enum ProfileChangeEventType { + TRADER_SALES_SUM = "TraderSalesSum", + TRADER_STANDING = "TraderStanding", + PROFILE_LEVEL = "ProfileLevel", + SKILL_POINTS = "SkillPoints", + EXAMINE_ALL_ITEMS = "ExamineAllItems", + UNLOCK_TRADER = "UnlockTrader" +} diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/3GetSptConfigFile/types/servers/HttpServer.d.ts b/TypeScript/3GetSptConfigFile/types/servers/HttpServer.d.ts index 8574cdd..bcd740f 100644 --- a/TypeScript/3GetSptConfigFile/types/servers/HttpServer.d.ts +++ b/TypeScript/3GetSptConfigFile/types/servers/HttpServer.d.ts @@ -19,11 +19,19 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/3GetSptConfigFile/types/services/BotLootCacheService.d.ts b/TypeScript/3GetSptConfigFile/types/services/BotLootCacheService.d.ts index b013e5e..7f79bfe 100644 --- a/TypeScript/3GetSptConfigFile/types/services/BotLootCacheService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/BotLootCacheService.d.ts @@ -69,6 +69,9 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/3GetSptConfigFile/types/services/FenceService.d.ts b/TypeScript/3GetSptConfigFile/types/services/FenceService.d.ts index bb1d035..75c4b28 100644 --- a/TypeScript/3GetSptConfigFile/types/services/FenceService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,14 +38,30 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; + protected fenceItemUpdCompareProperties: Set; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with */ setFenceAssort(assort: ITraderAssort): void; + /** + * Replace discount fence assort with new assort + * @param assort New assorts to replace old with + */ + setDiscountFenceAssort(assort: ITraderAssort): void; + /** + * Get main fence assort + * @return ITraderAssort + */ + getMainFenceAssort(): ITraderAssort; + /** + * Get discount fence assort + * @return ITraderAssort + */ + getDiscountFenceAssort(): ITraderAssort; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -57,6 +74,26 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adds to fence assort a single item (with its children) + * @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; + /** + * 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; + /** + * 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; /** * Adjust all items contained inside an assort by a multiplier * @param assort (clone)Assort that contains items with prices to adjust @@ -93,17 +130,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -112,8 +155,8 @@ export declare class FenceService { protected deleteRandomAssorts(itemCountToReplace: number, assort: ITraderAssort): void; /** * Choose an item at random and remove it + mods from assorts - * @param assort Items to remove from - * @param rootItems Assort root items to pick from to remove + * @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; /** @@ -132,6 +175,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +196,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +205,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +214,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +225,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +247,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/3GetSptConfigFile/types/services/ItemBaseClassService.d.ts b/TypeScript/3GetSptConfigFile/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/3GetSptConfigFile/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/3GetSptConfigFile/types/services/MailSendService.d.ts b/TypeScript/3GetSptConfigFile/types/services/MailSendService.d.ts index 08752bf..e5643f9 100644 --- a/TypeScript/3GetSptConfigFile/types/services/MailSendService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/MailSendService.d.ts @@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { Traders } from "@spt-aki/models/enums/Traders"; -import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -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?: any): void; + sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], 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?: any[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], 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 diff --git a/TypeScript/3GetSptConfigFile/types/services/PaymentService.d.ts b/TypeScript/3GetSptConfigFile/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/3GetSptConfigFile/types/services/PaymentService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/3GetSptConfigFile/types/services/ProfileActivityService.d.ts b/TypeScript/3GetSptConfigFile/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/3GetSptConfigFile/types/services/ProfileFixerService.d.ts b/TypeScript/3GetSptConfigFile/types/services/ProfileFixerService.d.ts index 804b3bf..1045d0a 100644 --- a/TypeScript/3GetSptConfigFile/types/services/ProfileFixerService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @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 @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @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 @@ -165,4 +183,9 @@ export declare class ProfileFixerService { * @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 null + */ + protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/3GetSptConfigFile/types/services/RagfairPriceService.d.ts b/TypeScript/3GetSptConfigFile/types/services/RagfairPriceService.d.ts index 5649751..0fefdd8 100644 --- a/TypeScript/3GetSptConfigFile/types/services/RagfairPriceService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], 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 diff --git a/TypeScript/3GetSptConfigFile/types/utils/App.d.ts b/TypeScript/3GetSptConfigFile/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/3GetSptConfigFile/types/utils/App.d.ts +++ b/TypeScript/3GetSptConfigFile/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/3GetSptConfigFile/types/utils/CompareUtil.d.ts b/TypeScript/3GetSptConfigFile/types/utils/CompareUtil.d.ts new file mode 100644 index 0000000..a5b94d5 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/utils/CompareUtil.d.ts @@ -0,0 +1,11 @@ +export declare class CompareUtil { + private static typesToCheckAgainst; + /** + * This function does an object comparison, equivalent to applying reflections + * and scanning for all possible properties including arrays. + * @param v1 value 1 to compare + * @param v2 value 2 to compare + * @returns true if equal, false if not + */ + recursiveCompare(v1: any, v2: any): boolean; +} diff --git a/TypeScript/3GetSptConfigFile/types/utils/RagfairOfferHolder.d.ts b/TypeScript/3GetSptConfigFile/types/utils/RagfairOfferHolder.d.ts index 3942ed1..b95e54a 100644 --- a/TypeScript/3GetSptConfigFile/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/3GetSptConfigFile/types/utils/RagfairOfferHolder.d.ts @@ -1,9 +1,12 @@ +import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { + protected maxOffersPerTemplate: number; + protected ragfairServerHelper: RagfairServerHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(); + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); getOfferById(id: string): IRagfairOffer; getOffersByTemplate(templateId: string): Array; getOffersByTrader(traderId: string): Array; diff --git a/TypeScript/3GetSptConfigFile/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/3GetSptConfigFile/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/3GetSptConfigFile/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/3GetSptConfigFile/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/README.md b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/README.md index 48c742b..e760f8b 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/README.md +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/README.md @@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an ## **NodeJS Setup** -Before you begin, ensure to install NodeJS version `v18.15.0`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). +Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). After installation, it's advised to reboot your system. diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/BotCallbacks.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DialogueCallbacks.d.ts index 7ed60b9..2de57cb 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DialogueCallbacks.d.ts @@ -1,7 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; -import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; +import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest"; @@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/friend/request/send */ sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/accept-all + */ + acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; /** * Handle client/friend/request/accept */ acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/decline + */ + declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/friend/request/cancel */ diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/InraidCallbacks.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BotController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BotController.d.ts index d148abc..556cc5d 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BotController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BotController.d.ts @@ -51,12 +51,14 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * 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 ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string): Difficulty; + getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BuildController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BuildController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/GameController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/GameController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, 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); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/HideoutController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/HideoutController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InsuranceController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InsuranceController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/LauncherController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/LauncherController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/MatchController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/MatchController.d.ts index 6b1a7c3..708cee2 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/MatchController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/MatchController.d.ts @@ -75,10 +75,11 @@ export declare class MatchController { 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(pmcData: IPmcData, extractName: string): void; + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; /** * Was extract by car * @param extractName name of extract diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotEquipmentModGenerator.d.ts index dd1dcce..f850eea 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotEquipmentModGenerator.d.ts @@ -187,12 +187,12 @@ export declare class BotEquipmentModGenerator { */ protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param slotAddedToTemplate slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate template of the mods being added - * @param botRole + * Check if mod exists in db + is for a required slot + * @param modToAdd Db template of mod to check + * @param slotAddedToTemplate Slot object the item will be placed as child into + * @param modSlot Slot the mod will fill + * @param parentTemplate Db template of the mods being added + * @param botRole Bots wildspawntype (assault/pmcBot etc) * @returns true if valid */ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: 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/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotLootGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotLootGenerator.d.ts index 014617e..ca5d1bd 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotLootGenerator.d.ts @@ -82,7 +82,7 @@ export declare class BotLootGenerator { * @param totalValueLimitRub Total value of loot allowed in roubles * @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): void; + 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[][]; /** * Some items need child items to function, add them to the itemToAddChildrenTo array @@ -101,7 +101,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): void; + protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, 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 diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..5ca8ed7 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/FenceBaseAssortGenerator.d.ts @@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { FenceService } from "@spt-aki/services/FenceService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -22,14 +23,25 @@ export declare class FenceBaseAssortGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; + protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; - protected getItemPrice(itemTpl: string, items: Item[]): number; - protected getAmmoBoxPrice(items: Item[]): number; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * Get the penetration power value of an ammo, works with ammo boxes and raw ammos + * @param rootItemDb Ammo box or ammo item from items.db + * @returns Penetration power of passed in item, null if it doesnt have a power + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/LootGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/LootGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotGeneratorHelper.d.ts index 7f7555b..c756725 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotGeneratorHelper.d.ts @@ -92,7 +92,7 @@ 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): ItemAddedResult; + addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set): ItemAddedResult; /** * Is the provided item allowed inside a container * @param slotGrid Items sub-grid we want to place item inside diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts new file mode 100644 index 0000000..26958ca --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -0,0 +1,39 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected itemFilterService: ItemFilterService; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en espaƱol" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: Map; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts deleted file mode 100644 index 33d05de..0000000 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; -import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; -import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -export declare class GiveSptCommand implements ISptCommand { - protected logger: ILogger; - protected itemHelper: ItemHelper; - protected hashUtil: HashUtil; - protected jsonUtil: JsonUtil; - protected presetHelper: PresetHelper; - protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); - getCommand(): string; - getCommandHelp(): string; - performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts new file mode 100644 index 0000000..8ec2ada --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts @@ -0,0 +1,38 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class ProfileSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected profileHelper: ProfileHelper; + /** + * Regex to account for all these cases: + * spt profile level 20 + * spt profile skill metabolism 10 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent; + protected handleLevelCommand(level: number): IProfileChangeEvent; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts new file mode 100644 index 0000000..d84158a --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -0,0 +1,33 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class TraderSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt trader prapor rep 100 + * spt trader mechanic spend 1000000 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HideoutHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HttpServerHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ItemHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ItemHelper.d.ts index 3e91ef7..9195579 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ItemHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ItemHelper.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; +import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { CompareUtil } from "@spt-aki/utils/CompareUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; @@ -28,8 +29,33 @@ export declare class ItemHelper { protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; + protected compareUtil: CompareUtil; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil); + /** + * 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 + * @param item1 first item with all its children to compare + * @param item2 second item with all its children to compare + * @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; + /** + * This method will compare two items and see if the are equivalent. + * This method will NOT compare IDs on the items + * @param item1 first item to compare + * @param item2 second item to compare + * @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; + /** + * 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; /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl @@ -363,10 +389,11 @@ export declare class ItemHelper { * Chose a randomly weighted cartridge that fits * @param caliber Desired caliber * @param staticAmmoDist Cartridges and thier weights + * @param fallbackCartridgeTpl If a cartridge cannot be found in the above staticAmmoDist param, use this instead * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -401,7 +428,7 @@ export declare class ItemHelper { addChildSlotItems(itemToAdd: Item[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): Item[]; /** * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter - * @param possibleTpls Tpls to randomply choose from + * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow * @returns Chosen tpl or null */ diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/PresetHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/PresetHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IBotType.d.ts index db6e56e..2a00af9 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,9 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/dialog/IAcceptFriendRequestData.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/dialog/IAcceptFriendRequestData.d.ts index 87461aa..0913eb5 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/dialog/IAcceptFriendRequestData.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/dialog/IAcceptFriendRequestData.d.ts @@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest { } export interface ICancelFriendRequestData extends IBaseFriendRequest { } -export interface IBaseFriendRequest { - request_id: string; +export interface IDeclineFriendRequestData extends IBaseFriendRequest { +} +export interface IBaseFriendRequest { + profileId: string; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/dialog/IFriendRequestSendResponse.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/dialog/IFriendRequestSendResponse.d.ts index 06c40f3..fc311eb 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/dialog/IFriendRequestSendResponse.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/dialog/IFriendRequestSendResponse.d.ts @@ -1,5 +1,5 @@ export interface IFriendRequestSendResponse { status: number; - requestid: string; + requestId: string; retryAfter: number; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 6c3c9eb..26e43ac 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -1,5 +1,5 @@ import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item } from "../common/tables/IItem"; +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; export interface IGetOtherProfileResponse { id: string; aid: number; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/ISearchFriendResponse.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/ISearchFriendResponse.d.ts index 96d88b2..d3cc7df 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/ISearchFriendResponse.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/ISearchFriendResponse.d.ts @@ -1,9 +1,11 @@ export interface ISearchFriendResponse { _id: string; + aid: number; Info: Info; } export interface Info { Nickname: string; Side: string; Level: number; + MemberCategory: number; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/AmmoTypes.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/WeaponTypes.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..529c2cd 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,9 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +23,8 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IBotConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IPmcConfig.d.ts index 65da29b..f17d3e4 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IPmcConfig.d.ts @@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig { /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; allPMCsHavePlayerNameWithRandomPrefixChance: number; + /** Should secure container loot from usec.json/bear.json be added to pmc bots secure */ + addSecureContainerLootFromBotConfig: boolean; } export interface PmcTypes { usec: string; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts index 2068ede..05b3bcd 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -30,7 +30,15 @@ export interface ISendMessageDetails { } export interface IProfileChangeEvent { _id: string; - Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + Type: ProfileChangeEventType; value: number; entity?: string; } +export declare enum ProfileChangeEventType { + TRADER_SALES_SUM = "TraderSalesSum", + TRADER_STANDING = "TraderStanding", + PROFILE_LEVEL = "ProfileLevel", + SKILL_POINTS = "SkillPoints", + EXAMINE_ALL_ITEMS = "ExamineAllItems", + UNLOCK_TRADER = "UnlockTrader" +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/HttpServer.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/HttpServer.d.ts index 8574cdd..bcd740f 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/HttpServer.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/servers/HttpServer.d.ts @@ -19,11 +19,19 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/BotLootCacheService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/BotLootCacheService.d.ts index b013e5e..7f79bfe 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/BotLootCacheService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/BotLootCacheService.d.ts @@ -69,6 +69,9 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/FenceService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/FenceService.d.ts index bb1d035..75c4b28 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/FenceService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,14 +38,30 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; + protected fenceItemUpdCompareProperties: Set; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with */ setFenceAssort(assort: ITraderAssort): void; + /** + * Replace discount fence assort with new assort + * @param assort New assorts to replace old with + */ + setDiscountFenceAssort(assort: ITraderAssort): void; + /** + * Get main fence assort + * @return ITraderAssort + */ + getMainFenceAssort(): ITraderAssort; + /** + * Get discount fence assort + * @return ITraderAssort + */ + getDiscountFenceAssort(): ITraderAssort; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -57,6 +74,26 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adds to fence assort a single item (with its children) + * @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; + /** + * 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; + /** + * 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; /** * Adjust all items contained inside an assort by a multiplier * @param assort (clone)Assort that contains items with prices to adjust @@ -93,17 +130,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -112,8 +155,8 @@ export declare class FenceService { protected deleteRandomAssorts(itemCountToReplace: number, assort: ITraderAssort): void; /** * Choose an item at random and remove it + mods from assorts - * @param assort Items to remove from - * @param rootItems Assort root items to pick from to remove + * @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; /** @@ -132,6 +175,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +196,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +205,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +214,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +225,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +247,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ItemBaseClassService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/MailSendService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/MailSendService.d.ts index 08752bf..e5643f9 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/MailSendService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/MailSendService.d.ts @@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { Traders } from "@spt-aki/models/enums/Traders"; -import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -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?: any): void; + sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], 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?: any[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], 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 diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/PaymentService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/PaymentService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ProfileActivityService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ProfileFixerService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ProfileFixerService.d.ts index 804b3bf..1045d0a 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ProfileFixerService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @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 @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @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 @@ -165,4 +183,9 @@ export declare class ProfileFixerService { * @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 null + */ + protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairPriceService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairPriceService.d.ts index 5649751..0fefdd8 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairPriceService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], 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 diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/App.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/App.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/CompareUtil.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/CompareUtil.d.ts new file mode 100644 index 0000000..a5b94d5 --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/CompareUtil.d.ts @@ -0,0 +1,11 @@ +export declare class CompareUtil { + private static typesToCheckAgainst; + /** + * This function does an object comparison, equivalent to applying reflections + * and scanning for all possible properties including arrays. + * @param v1 value 1 to compare + * @param v2 value 2 to compare + * @returns true if equal, false if not + */ + recursiveCompare(v1: any, v2: any): boolean; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/RagfairOfferHolder.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/RagfairOfferHolder.d.ts index 3942ed1..b95e54a 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/RagfairOfferHolder.d.ts @@ -1,9 +1,12 @@ +import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { + protected maxOffersPerTemplate: number; + protected ragfairServerHelper: RagfairServerHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(); + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); getOfferById(id: string): IRagfairOffer; getOffersByTemplate(templateId: string): Array; getOffersByTrader(traderId: string): Array; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/4UseACustomConfigFile/README.md b/TypeScript/4UseACustomConfigFile/README.md index 48c742b..e760f8b 100644 --- a/TypeScript/4UseACustomConfigFile/README.md +++ b/TypeScript/4UseACustomConfigFile/README.md @@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an ## **NodeJS Setup** -Before you begin, ensure to install NodeJS version `v18.15.0`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). +Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). After installation, it's advised to reboot your system. diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/BotCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/DialogueCallbacks.d.ts index 7ed60b9..2de57cb 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/DialogueCallbacks.d.ts @@ -1,7 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; -import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; +import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest"; @@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/friend/request/send */ sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/accept-all + */ + acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; /** * Handle client/friend/request/accept */ acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/decline + */ + declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/friend/request/cancel */ diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/InraidCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/BotController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/BotController.d.ts index d148abc..556cc5d 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/BotController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/BotController.d.ts @@ -51,12 +51,14 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * 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 ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string): Difficulty; + getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/BuildController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/BuildController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, 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); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/HideoutController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/HideoutController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/LauncherController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/LauncherController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/MatchController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/MatchController.d.ts index 6b1a7c3..708cee2 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/MatchController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/MatchController.d.ts @@ -75,10 +75,11 @@ export declare class MatchController { 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(pmcData: IPmcData, extractName: string): void; + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; /** * Was extract by car * @param extractName name of extract diff --git a/TypeScript/4UseACustomConfigFile/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/BotEquipmentModGenerator.d.ts index dd1dcce..f850eea 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/BotEquipmentModGenerator.d.ts @@ -187,12 +187,12 @@ export declare class BotEquipmentModGenerator { */ protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param slotAddedToTemplate slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate template of the mods being added - * @param botRole + * Check if mod exists in db + is for a required slot + * @param modToAdd Db template of mod to check + * @param slotAddedToTemplate Slot object the item will be placed as child into + * @param modSlot Slot the mod will fill + * @param parentTemplate Db template of the mods being added + * @param botRole Bots wildspawntype (assault/pmcBot etc) * @returns true if valid */ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; diff --git a/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: 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/TypeScript/4UseACustomConfigFile/types/generators/BotLootGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/BotLootGenerator.d.ts index 014617e..ca5d1bd 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/BotLootGenerator.d.ts @@ -82,7 +82,7 @@ export declare class BotLootGenerator { * @param totalValueLimitRub Total value of loot allowed in roubles * @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): void; + 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[][]; /** * Some items need child items to function, add them to the itemToAddChildrenTo array @@ -101,7 +101,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): void; + protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, 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 diff --git a/TypeScript/4UseACustomConfigFile/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..5ca8ed7 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/FenceBaseAssortGenerator.d.ts @@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { FenceService } from "@spt-aki/services/FenceService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -22,14 +23,25 @@ export declare class FenceBaseAssortGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; + protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; - protected getItemPrice(itemTpl: string, items: Item[]): number; - protected getAmmoBoxPrice(items: Item[]): number; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * Get the penetration power value of an ammo, works with ammo boxes and raw ammos + * @param rootItemDb Ammo box or ammo item from items.db + * @returns Penetration power of passed in item, null if it doesnt have a power + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/4UseACustomConfigFile/types/generators/LootGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/LootGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/4UseACustomConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/BotGeneratorHelper.d.ts index 7f7555b..c756725 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/BotGeneratorHelper.d.ts @@ -92,7 +92,7 @@ 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): ItemAddedResult; + addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set): ItemAddedResult; /** * Is the provided item allowed inside a container * @param slotGrid Items sub-grid we want to place item inside diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts new file mode 100644 index 0000000..26958ca --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -0,0 +1,39 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected itemFilterService: ItemFilterService; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en espaƱol" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: Map; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts deleted file mode 100644 index 33d05de..0000000 --- a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; -import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; -import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -export declare class GiveSptCommand implements ISptCommand { - protected logger: ILogger; - protected itemHelper: ItemHelper; - protected hashUtil: HashUtil; - protected jsonUtil: JsonUtil; - protected presetHelper: PresetHelper; - protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); - getCommand(): string; - getCommandHelp(): string; - performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts new file mode 100644 index 0000000..8ec2ada --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts @@ -0,0 +1,38 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class ProfileSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected profileHelper: ProfileHelper; + /** + * Regex to account for all these cases: + * spt profile level 20 + * spt profile skill metabolism 10 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent; + protected handleLevelCommand(level: number): IProfileChangeEvent; +} diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts new file mode 100644 index 0000000..d84158a --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -0,0 +1,33 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class TraderSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt trader prapor rep 100 + * spt trader mechanic spend 1000000 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/HttpServerHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts index 3e91ef7..9195579 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; +import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { CompareUtil } from "@spt-aki/utils/CompareUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; @@ -28,8 +29,33 @@ export declare class ItemHelper { protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; + protected compareUtil: CompareUtil; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil); + /** + * 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 + * @param item1 first item with all its children to compare + * @param item2 second item with all its children to compare + * @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; + /** + * This method will compare two items and see if the are equivalent. + * This method will NOT compare IDs on the items + * @param item1 first item to compare + * @param item2 second item to compare + * @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; + /** + * 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; /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl @@ -363,10 +389,11 @@ export declare class ItemHelper { * Chose a randomly weighted cartridge that fits * @param caliber Desired caliber * @param staticAmmoDist Cartridges and thier weights + * @param fallbackCartridgeTpl If a cartridge cannot be found in the above staticAmmoDist param, use this instead * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -401,7 +428,7 @@ export declare class ItemHelper { addChildSlotItems(itemToAdd: Item[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): Item[]; /** * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter - * @param possibleTpls Tpls to randomply choose from + * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow * @returns Chosen tpl or null */ diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/PresetHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/PresetHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotType.d.ts index db6e56e..2a00af9 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,9 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/dialog/IAcceptFriendRequestData.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/dialog/IAcceptFriendRequestData.d.ts index 87461aa..0913eb5 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/dialog/IAcceptFriendRequestData.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/dialog/IAcceptFriendRequestData.d.ts @@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest { } export interface ICancelFriendRequestData extends IBaseFriendRequest { } -export interface IBaseFriendRequest { - request_id: string; +export interface IDeclineFriendRequestData extends IBaseFriendRequest { +} +export interface IBaseFriendRequest { + profileId: string; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/dialog/IFriendRequestSendResponse.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/dialog/IFriendRequestSendResponse.d.ts index 06c40f3..fc311eb 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/dialog/IFriendRequestSendResponse.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/dialog/IFriendRequestSendResponse.d.ts @@ -1,5 +1,5 @@ export interface IFriendRequestSendResponse { status: number; - requestid: string; + requestId: string; retryAfter: number; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 6c3c9eb..26e43ac 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -1,5 +1,5 @@ import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item } from "../common/tables/IItem"; +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; export interface IGetOtherProfileResponse { id: string; aid: number; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/profile/ISearchFriendResponse.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/profile/ISearchFriendResponse.d.ts index 96d88b2..d3cc7df 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/profile/ISearchFriendResponse.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/profile/ISearchFriendResponse.d.ts @@ -1,9 +1,11 @@ export interface ISearchFriendResponse { _id: string; + aid: number; Info: Info; } export interface Info { Nickname: string; Side: string; Level: number; + MemberCategory: number; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/enums/AmmoTypes.d.ts b/TypeScript/4UseACustomConfigFile/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/enums/WeaponTypes.d.ts b/TypeScript/4UseACustomConfigFile/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..529c2cd 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,9 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +23,8 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IPmcConfig.d.ts index 65da29b..f17d3e4 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IPmcConfig.d.ts @@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig { /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; allPMCsHavePlayerNameWithRandomPrefixChance: number; + /** Should secure container loot from usec.json/bear.json be added to pmc bots secure */ + addSecureContainerLootFromBotConfig: boolean; } export interface PmcTypes { usec: string; diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts index 2068ede..05b3bcd 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -30,7 +30,15 @@ export interface ISendMessageDetails { } export interface IProfileChangeEvent { _id: string; - Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + Type: ProfileChangeEventType; value: number; entity?: string; } +export declare enum ProfileChangeEventType { + TRADER_SALES_SUM = "TraderSalesSum", + TRADER_STANDING = "TraderStanding", + PROFILE_LEVEL = "ProfileLevel", + SKILL_POINTS = "SkillPoints", + EXAMINE_ALL_ITEMS = "ExamineAllItems", + UNLOCK_TRADER = "UnlockTrader" +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/4UseACustomConfigFile/types/servers/HttpServer.d.ts b/TypeScript/4UseACustomConfigFile/types/servers/HttpServer.d.ts index 8574cdd..bcd740f 100644 --- a/TypeScript/4UseACustomConfigFile/types/servers/HttpServer.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/servers/HttpServer.d.ts @@ -19,11 +19,19 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/4UseACustomConfigFile/types/services/BotLootCacheService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/BotLootCacheService.d.ts index b013e5e..7f79bfe 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/BotLootCacheService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/BotLootCacheService.d.ts @@ -69,6 +69,9 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/4UseACustomConfigFile/types/services/FenceService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/FenceService.d.ts index bb1d035..75c4b28 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/FenceService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,14 +38,30 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; + protected fenceItemUpdCompareProperties: Set; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with */ setFenceAssort(assort: ITraderAssort): void; + /** + * Replace discount fence assort with new assort + * @param assort New assorts to replace old with + */ + setDiscountFenceAssort(assort: ITraderAssort): void; + /** + * Get main fence assort + * @return ITraderAssort + */ + getMainFenceAssort(): ITraderAssort; + /** + * Get discount fence assort + * @return ITraderAssort + */ + getDiscountFenceAssort(): ITraderAssort; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -57,6 +74,26 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adds to fence assort a single item (with its children) + * @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; + /** + * 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; + /** + * 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; /** * Adjust all items contained inside an assort by a multiplier * @param assort (clone)Assort that contains items with prices to adjust @@ -93,17 +130,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -112,8 +155,8 @@ export declare class FenceService { protected deleteRandomAssorts(itemCountToReplace: number, assort: ITraderAssort): void; /** * Choose an item at random and remove it + mods from assorts - * @param assort Items to remove from - * @param rootItems Assort root items to pick from to remove + * @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; /** @@ -132,6 +175,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +196,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +205,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +214,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +225,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +247,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/4UseACustomConfigFile/types/services/ItemBaseClassService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/4UseACustomConfigFile/types/services/MailSendService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/MailSendService.d.ts index 08752bf..e5643f9 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/MailSendService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/MailSendService.d.ts @@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { Traders } from "@spt-aki/models/enums/Traders"; -import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -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?: any): void; + sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], 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?: any[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], 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 diff --git a/TypeScript/4UseACustomConfigFile/types/services/PaymentService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/PaymentService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/4UseACustomConfigFile/types/services/ProfileActivityService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/4UseACustomConfigFile/types/services/ProfileFixerService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/ProfileFixerService.d.ts index 804b3bf..1045d0a 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/ProfileFixerService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @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 @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @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 @@ -165,4 +183,9 @@ export declare class ProfileFixerService { * @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 null + */ + protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/4UseACustomConfigFile/types/services/RagfairPriceService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/RagfairPriceService.d.ts index 5649751..0fefdd8 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/RagfairPriceService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], 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 diff --git a/TypeScript/4UseACustomConfigFile/types/utils/App.d.ts b/TypeScript/4UseACustomConfigFile/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/4UseACustomConfigFile/types/utils/App.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/4UseACustomConfigFile/types/utils/CompareUtil.d.ts b/TypeScript/4UseACustomConfigFile/types/utils/CompareUtil.d.ts new file mode 100644 index 0000000..a5b94d5 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/utils/CompareUtil.d.ts @@ -0,0 +1,11 @@ +export declare class CompareUtil { + private static typesToCheckAgainst; + /** + * This function does an object comparison, equivalent to applying reflections + * and scanning for all possible properties including arrays. + * @param v1 value 1 to compare + * @param v2 value 2 to compare + * @returns true if equal, false if not + */ + recursiveCompare(v1: any, v2: any): boolean; +} diff --git a/TypeScript/4UseACustomConfigFile/types/utils/RagfairOfferHolder.d.ts b/TypeScript/4UseACustomConfigFile/types/utils/RagfairOfferHolder.d.ts index 3942ed1..b95e54a 100644 --- a/TypeScript/4UseACustomConfigFile/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/utils/RagfairOfferHolder.d.ts @@ -1,9 +1,12 @@ +import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { + protected maxOffersPerTemplate: number; + protected ragfairServerHelper: RagfairServerHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(); + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); getOfferById(id: string): IRagfairOffer; getOffersByTemplate(templateId: string): Array; getOffersByTrader(traderId: string): Array; diff --git a/TypeScript/4UseACustomConfigFile/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/4UseACustomConfigFile/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/4UseACustomConfigFile/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/5ReplaceMethod/README.md b/TypeScript/5ReplaceMethod/README.md index 48c742b..e760f8b 100644 --- a/TypeScript/5ReplaceMethod/README.md +++ b/TypeScript/5ReplaceMethod/README.md @@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an ## **NodeJS Setup** -Before you begin, ensure to install NodeJS version `v18.15.0`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). +Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). After installation, it's advised to reboot your system. diff --git a/TypeScript/5ReplaceMethod/types/callbacks/BotCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/5ReplaceMethod/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/DialogueCallbacks.d.ts index 7ed60b9..2de57cb 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/DialogueCallbacks.d.ts @@ -1,7 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; -import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; +import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest"; @@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/friend/request/send */ sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/accept-all + */ + acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; /** * Handle client/friend/request/accept */ acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/decline + */ + declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/friend/request/cancel */ diff --git a/TypeScript/5ReplaceMethod/types/callbacks/InraidCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/5ReplaceMethod/types/controllers/BotController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/BotController.d.ts index d148abc..556cc5d 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/BotController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/BotController.d.ts @@ -51,12 +51,14 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * 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 ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string): Difficulty; + getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/5ReplaceMethod/types/controllers/BuildController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/BuildController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, 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); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/5ReplaceMethod/types/controllers/HideoutController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/HideoutController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/5ReplaceMethod/types/controllers/LauncherController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/LauncherController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/5ReplaceMethod/types/controllers/MatchController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/MatchController.d.ts index 6b1a7c3..708cee2 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/MatchController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/MatchController.d.ts @@ -75,10 +75,11 @@ export declare class MatchController { 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(pmcData: IPmcData, extractName: string): void; + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; /** * Was extract by car * @param extractName name of extract diff --git a/TypeScript/5ReplaceMethod/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/BotEquipmentModGenerator.d.ts index dd1dcce..f850eea 100644 --- a/TypeScript/5ReplaceMethod/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/BotEquipmentModGenerator.d.ts @@ -187,12 +187,12 @@ export declare class BotEquipmentModGenerator { */ protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param slotAddedToTemplate slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate template of the mods being added - * @param botRole + * Check if mod exists in db + is for a required slot + * @param modToAdd Db template of mod to check + * @param slotAddedToTemplate Slot object the item will be placed as child into + * @param modSlot Slot the mod will fill + * @param parentTemplate Db template of the mods being added + * @param botRole Bots wildspawntype (assault/pmcBot etc) * @returns true if valid */ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; diff --git a/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: 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/TypeScript/5ReplaceMethod/types/generators/BotLootGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/BotLootGenerator.d.ts index 014617e..ca5d1bd 100644 --- a/TypeScript/5ReplaceMethod/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/BotLootGenerator.d.ts @@ -82,7 +82,7 @@ export declare class BotLootGenerator { * @param totalValueLimitRub Total value of loot allowed in roubles * @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): void; + 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[][]; /** * Some items need child items to function, add them to the itemToAddChildrenTo array @@ -101,7 +101,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): void; + protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, 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 diff --git a/TypeScript/5ReplaceMethod/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..5ca8ed7 100644 --- a/TypeScript/5ReplaceMethod/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/FenceBaseAssortGenerator.d.ts @@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { FenceService } from "@spt-aki/services/FenceService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -22,14 +23,25 @@ export declare class FenceBaseAssortGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; + protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; - protected getItemPrice(itemTpl: string, items: Item[]): number; - protected getAmmoBoxPrice(items: Item[]): number; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * Get the penetration power value of an ammo, works with ammo boxes and raw ammos + * @param rootItemDb Ammo box or ammo item from items.db + * @returns Penetration power of passed in item, null if it doesnt have a power + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/5ReplaceMethod/types/generators/LootGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/5ReplaceMethod/types/generators/LootGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/5ReplaceMethod/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/5ReplaceMethod/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/5ReplaceMethod/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/BotGeneratorHelper.d.ts index 7f7555b..c756725 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/BotGeneratorHelper.d.ts @@ -92,7 +92,7 @@ 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): ItemAddedResult; + addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set): ItemAddedResult; /** * Is the provided item allowed inside a container * @param slotGrid Items sub-grid we want to place item inside diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts new file mode 100644 index 0000000..26958ca --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -0,0 +1,39 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected itemFilterService: ItemFilterService; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en espaƱol" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: Map; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts deleted file mode 100644 index 33d05de..0000000 --- a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; -import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; -import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -export declare class GiveSptCommand implements ISptCommand { - protected logger: ILogger; - protected itemHelper: ItemHelper; - protected hashUtil: HashUtil; - protected jsonUtil: JsonUtil; - protected presetHelper: PresetHelper; - protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); - getCommand(): string; - getCommandHelp(): string; - performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts new file mode 100644 index 0000000..8ec2ada --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts @@ -0,0 +1,38 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class ProfileSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected profileHelper: ProfileHelper; + /** + * Regex to account for all these cases: + * spt profile level 20 + * spt profile skill metabolism 10 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent; + protected handleLevelCommand(level: number): IProfileChangeEvent; +} diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts new file mode 100644 index 0000000..d84158a --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -0,0 +1,33 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class TraderSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt trader prapor rep 100 + * spt trader mechanic spend 1000000 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/5ReplaceMethod/types/helpers/HttpServerHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts index 3e91ef7..9195579 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; +import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { CompareUtil } from "@spt-aki/utils/CompareUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; @@ -28,8 +29,33 @@ export declare class ItemHelper { protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; + protected compareUtil: CompareUtil; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil); + /** + * 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 + * @param item1 first item with all its children to compare + * @param item2 second item with all its children to compare + * @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; + /** + * This method will compare two items and see if the are equivalent. + * This method will NOT compare IDs on the items + * @param item1 first item to compare + * @param item2 second item to compare + * @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; + /** + * 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; /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl @@ -363,10 +389,11 @@ export declare class ItemHelper { * Chose a randomly weighted cartridge that fits * @param caliber Desired caliber * @param staticAmmoDist Cartridges and thier weights + * @param fallbackCartridgeTpl If a cartridge cannot be found in the above staticAmmoDist param, use this instead * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -401,7 +428,7 @@ export declare class ItemHelper { addChildSlotItems(itemToAdd: Item[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): Item[]; /** * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter - * @param possibleTpls Tpls to randomply choose from + * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow * @returns Chosen tpl or null */ diff --git a/TypeScript/5ReplaceMethod/types/helpers/PresetHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/PresetHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotType.d.ts index db6e56e..2a00af9 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,9 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/dialog/IAcceptFriendRequestData.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/dialog/IAcceptFriendRequestData.d.ts index 87461aa..0913eb5 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/dialog/IAcceptFriendRequestData.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/dialog/IAcceptFriendRequestData.d.ts @@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest { } export interface ICancelFriendRequestData extends IBaseFriendRequest { } -export interface IBaseFriendRequest { - request_id: string; +export interface IDeclineFriendRequestData extends IBaseFriendRequest { +} +export interface IBaseFriendRequest { + profileId: string; } diff --git a/TypeScript/5ReplaceMethod/types/models/eft/dialog/IFriendRequestSendResponse.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/dialog/IFriendRequestSendResponse.d.ts index 06c40f3..fc311eb 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/dialog/IFriendRequestSendResponse.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/dialog/IFriendRequestSendResponse.d.ts @@ -1,5 +1,5 @@ export interface IFriendRequestSendResponse { status: number; - requestid: string; + requestId: string; retryAfter: number; } diff --git a/TypeScript/5ReplaceMethod/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 6c3c9eb..26e43ac 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -1,5 +1,5 @@ import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item } from "../common/tables/IItem"; +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; export interface IGetOtherProfileResponse { id: string; aid: number; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/profile/ISearchFriendResponse.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/profile/ISearchFriendResponse.d.ts index 96d88b2..d3cc7df 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/profile/ISearchFriendResponse.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/profile/ISearchFriendResponse.d.ts @@ -1,9 +1,11 @@ export interface ISearchFriendResponse { _id: string; + aid: number; Info: Info; } export interface Info { Nickname: string; Side: string; Level: number; + MemberCategory: number; } diff --git a/TypeScript/5ReplaceMethod/types/models/enums/AmmoTypes.d.ts b/TypeScript/5ReplaceMethod/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/5ReplaceMethod/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/5ReplaceMethod/types/models/enums/WeaponTypes.d.ts b/TypeScript/5ReplaceMethod/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/5ReplaceMethod/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/5ReplaceMethod/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..529c2cd 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,9 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +23,8 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IPmcConfig.d.ts index 65da29b..f17d3e4 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IPmcConfig.d.ts @@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig { /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; allPMCsHavePlayerNameWithRandomPrefixChance: number; + /** Should secure container loot from usec.json/bear.json be added to pmc bots secure */ + addSecureContainerLootFromBotConfig: boolean; } export interface PmcTypes { usec: string; diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/5ReplaceMethod/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/dialog/ISendMessageDetails.d.ts index 2068ede..05b3bcd 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -30,7 +30,15 @@ export interface ISendMessageDetails { } export interface IProfileChangeEvent { _id: string; - Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + Type: ProfileChangeEventType; value: number; entity?: string; } +export declare enum ProfileChangeEventType { + TRADER_SALES_SUM = "TraderSalesSum", + TRADER_STANDING = "TraderStanding", + PROFILE_LEVEL = "ProfileLevel", + SKILL_POINTS = "SkillPoints", + EXAMINE_ALL_ITEMS = "ExamineAllItems", + UNLOCK_TRADER = "UnlockTrader" +} diff --git a/TypeScript/5ReplaceMethod/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/5ReplaceMethod/types/servers/HttpServer.d.ts b/TypeScript/5ReplaceMethod/types/servers/HttpServer.d.ts index 8574cdd..bcd740f 100644 --- a/TypeScript/5ReplaceMethod/types/servers/HttpServer.d.ts +++ b/TypeScript/5ReplaceMethod/types/servers/HttpServer.d.ts @@ -19,11 +19,19 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/5ReplaceMethod/types/services/BotLootCacheService.d.ts b/TypeScript/5ReplaceMethod/types/services/BotLootCacheService.d.ts index b013e5e..7f79bfe 100644 --- a/TypeScript/5ReplaceMethod/types/services/BotLootCacheService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/BotLootCacheService.d.ts @@ -69,6 +69,9 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/5ReplaceMethod/types/services/FenceService.d.ts b/TypeScript/5ReplaceMethod/types/services/FenceService.d.ts index bb1d035..75c4b28 100644 --- a/TypeScript/5ReplaceMethod/types/services/FenceService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,14 +38,30 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; + protected fenceItemUpdCompareProperties: Set; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with */ setFenceAssort(assort: ITraderAssort): void; + /** + * Replace discount fence assort with new assort + * @param assort New assorts to replace old with + */ + setDiscountFenceAssort(assort: ITraderAssort): void; + /** + * Get main fence assort + * @return ITraderAssort + */ + getMainFenceAssort(): ITraderAssort; + /** + * Get discount fence assort + * @return ITraderAssort + */ + getDiscountFenceAssort(): ITraderAssort; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -57,6 +74,26 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adds to fence assort a single item (with its children) + * @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; + /** + * 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; + /** + * 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; /** * Adjust all items contained inside an assort by a multiplier * @param assort (clone)Assort that contains items with prices to adjust @@ -93,17 +130,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -112,8 +155,8 @@ export declare class FenceService { protected deleteRandomAssorts(itemCountToReplace: number, assort: ITraderAssort): void; /** * Choose an item at random and remove it + mods from assorts - * @param assort Items to remove from - * @param rootItems Assort root items to pick from to remove + * @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; /** @@ -132,6 +175,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +196,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +205,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +214,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +225,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +247,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/5ReplaceMethod/types/services/ItemBaseClassService.d.ts b/TypeScript/5ReplaceMethod/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/5ReplaceMethod/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/5ReplaceMethod/types/services/MailSendService.d.ts b/TypeScript/5ReplaceMethod/types/services/MailSendService.d.ts index 08752bf..e5643f9 100644 --- a/TypeScript/5ReplaceMethod/types/services/MailSendService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/MailSendService.d.ts @@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { Traders } from "@spt-aki/models/enums/Traders"; -import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -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?: any): void; + sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], 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?: any[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], 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 diff --git a/TypeScript/5ReplaceMethod/types/services/PaymentService.d.ts b/TypeScript/5ReplaceMethod/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/5ReplaceMethod/types/services/PaymentService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/5ReplaceMethod/types/services/ProfileActivityService.d.ts b/TypeScript/5ReplaceMethod/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/5ReplaceMethod/types/services/ProfileFixerService.d.ts b/TypeScript/5ReplaceMethod/types/services/ProfileFixerService.d.ts index 804b3bf..1045d0a 100644 --- a/TypeScript/5ReplaceMethod/types/services/ProfileFixerService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @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 @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @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 @@ -165,4 +183,9 @@ export declare class ProfileFixerService { * @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 null + */ + protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/5ReplaceMethod/types/services/RagfairPriceService.d.ts b/TypeScript/5ReplaceMethod/types/services/RagfairPriceService.d.ts index 5649751..0fefdd8 100644 --- a/TypeScript/5ReplaceMethod/types/services/RagfairPriceService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], 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 diff --git a/TypeScript/5ReplaceMethod/types/utils/App.d.ts b/TypeScript/5ReplaceMethod/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/5ReplaceMethod/types/utils/App.d.ts +++ b/TypeScript/5ReplaceMethod/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/5ReplaceMethod/types/utils/CompareUtil.d.ts b/TypeScript/5ReplaceMethod/types/utils/CompareUtil.d.ts new file mode 100644 index 0000000..a5b94d5 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/utils/CompareUtil.d.ts @@ -0,0 +1,11 @@ +export declare class CompareUtil { + private static typesToCheckAgainst; + /** + * This function does an object comparison, equivalent to applying reflections + * and scanning for all possible properties including arrays. + * @param v1 value 1 to compare + * @param v2 value 2 to compare + * @returns true if equal, false if not + */ + recursiveCompare(v1: any, v2: any): boolean; +} diff --git a/TypeScript/5ReplaceMethod/types/utils/RagfairOfferHolder.d.ts b/TypeScript/5ReplaceMethod/types/utils/RagfairOfferHolder.d.ts index 3942ed1..b95e54a 100644 --- a/TypeScript/5ReplaceMethod/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/5ReplaceMethod/types/utils/RagfairOfferHolder.d.ts @@ -1,9 +1,12 @@ +import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { + protected maxOffersPerTemplate: number; + protected ragfairServerHelper: RagfairServerHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(); + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); getOfferById(id: string): IRagfairOffer; getOffersByTemplate(templateId: string): Array; getOffersByTrader(traderId: string): Array; diff --git a/TypeScript/5ReplaceMethod/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/5ReplaceMethod/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/5ReplaceMethod/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/5ReplaceMethod/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/6ReferenceAnotherClass/README.md b/TypeScript/6ReferenceAnotherClass/README.md index 48c742b..e760f8b 100644 --- a/TypeScript/6ReferenceAnotherClass/README.md +++ b/TypeScript/6ReferenceAnotherClass/README.md @@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an ## **NodeJS Setup** -Before you begin, ensure to install NodeJS version `v18.15.0`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). +Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). After installation, it's advised to reboot your system. diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/BotCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/DialogueCallbacks.d.ts index 7ed60b9..2de57cb 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/DialogueCallbacks.d.ts @@ -1,7 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; -import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; +import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest"; @@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/friend/request/send */ sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/accept-all + */ + acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; /** * Handle client/friend/request/accept */ acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/decline + */ + declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/friend/request/cancel */ diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/InraidCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/BotController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/BotController.d.ts index d148abc..556cc5d 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/BotController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/BotController.d.ts @@ -51,12 +51,14 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * 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 ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string): Difficulty; + getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/BuildController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/BuildController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/GameController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/GameController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, 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); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/HideoutController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/HideoutController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/LauncherController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/LauncherController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/MatchController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/MatchController.d.ts index 6b1a7c3..708cee2 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/MatchController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/MatchController.d.ts @@ -75,10 +75,11 @@ export declare class MatchController { 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(pmcData: IPmcData, extractName: string): void; + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; /** * Was extract by car * @param extractName name of extract diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/BotEquipmentModGenerator.d.ts index dd1dcce..f850eea 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/BotEquipmentModGenerator.d.ts @@ -187,12 +187,12 @@ export declare class BotEquipmentModGenerator { */ protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param slotAddedToTemplate slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate template of the mods being added - * @param botRole + * Check if mod exists in db + is for a required slot + * @param modToAdd Db template of mod to check + * @param slotAddedToTemplate Slot object the item will be placed as child into + * @param modSlot Slot the mod will fill + * @param parentTemplate Db template of the mods being added + * @param botRole Bots wildspawntype (assault/pmcBot etc) * @returns true if valid */ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: 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/TypeScript/6ReferenceAnotherClass/types/generators/BotLootGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/BotLootGenerator.d.ts index 014617e..ca5d1bd 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/BotLootGenerator.d.ts @@ -82,7 +82,7 @@ export declare class BotLootGenerator { * @param totalValueLimitRub Total value of loot allowed in roubles * @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): void; + 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[][]; /** * Some items need child items to function, add them to the itemToAddChildrenTo array @@ -101,7 +101,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): void; + protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, 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 diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..5ca8ed7 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/FenceBaseAssortGenerator.d.ts @@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { FenceService } from "@spt-aki/services/FenceService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -22,14 +23,25 @@ export declare class FenceBaseAssortGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; + protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; - protected getItemPrice(itemTpl: string, items: Item[]): number; - protected getAmmoBoxPrice(items: Item[]): number; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * Get the penetration power value of an ammo, works with ammo boxes and raw ammos + * @param rootItemDb Ammo box or ammo item from items.db + * @returns Penetration power of passed in item, null if it doesnt have a power + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/LootGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/LootGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/BotGeneratorHelper.d.ts index 7f7555b..c756725 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/BotGeneratorHelper.d.ts @@ -92,7 +92,7 @@ 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): ItemAddedResult; + addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set): ItemAddedResult; /** * Is the provided item allowed inside a container * @param slotGrid Items sub-grid we want to place item inside diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts new file mode 100644 index 0000000..26958ca --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -0,0 +1,39 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected itemFilterService: ItemFilterService; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en espaƱol" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: Map; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts deleted file mode 100644 index 33d05de..0000000 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; -import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; -import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -export declare class GiveSptCommand implements ISptCommand { - protected logger: ILogger; - protected itemHelper: ItemHelper; - protected hashUtil: HashUtil; - protected jsonUtil: JsonUtil; - protected presetHelper: PresetHelper; - protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); - getCommand(): string; - getCommandHelp(): string; - performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts new file mode 100644 index 0000000..8ec2ada --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts @@ -0,0 +1,38 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class ProfileSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected profileHelper: ProfileHelper; + /** + * Regex to account for all these cases: + * spt profile level 20 + * spt profile skill metabolism 10 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent; + protected handleLevelCommand(level: number): IProfileChangeEvent; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts new file mode 100644 index 0000000..d84158a --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -0,0 +1,33 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class TraderSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt trader prapor rep 100 + * spt trader mechanic spend 1000000 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/HttpServerHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts index 3e91ef7..9195579 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; +import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { CompareUtil } from "@spt-aki/utils/CompareUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; @@ -28,8 +29,33 @@ export declare class ItemHelper { protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; + protected compareUtil: CompareUtil; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil); + /** + * 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 + * @param item1 first item with all its children to compare + * @param item2 second item with all its children to compare + * @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; + /** + * This method will compare two items and see if the are equivalent. + * This method will NOT compare IDs on the items + * @param item1 first item to compare + * @param item2 second item to compare + * @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; + /** + * 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; /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl @@ -363,10 +389,11 @@ export declare class ItemHelper { * Chose a randomly weighted cartridge that fits * @param caliber Desired caliber * @param staticAmmoDist Cartridges and thier weights + * @param fallbackCartridgeTpl If a cartridge cannot be found in the above staticAmmoDist param, use this instead * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -401,7 +428,7 @@ export declare class ItemHelper { addChildSlotItems(itemToAdd: Item[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): Item[]; /** * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter - * @param possibleTpls Tpls to randomply choose from + * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow * @returns Chosen tpl or null */ diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/PresetHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/PresetHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotType.d.ts index db6e56e..2a00af9 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,9 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/dialog/IAcceptFriendRequestData.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/dialog/IAcceptFriendRequestData.d.ts index 87461aa..0913eb5 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/dialog/IAcceptFriendRequestData.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/dialog/IAcceptFriendRequestData.d.ts @@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest { } export interface ICancelFriendRequestData extends IBaseFriendRequest { } -export interface IBaseFriendRequest { - request_id: string; +export interface IDeclineFriendRequestData extends IBaseFriendRequest { +} +export interface IBaseFriendRequest { + profileId: string; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/dialog/IFriendRequestSendResponse.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/dialog/IFriendRequestSendResponse.d.ts index 06c40f3..fc311eb 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/dialog/IFriendRequestSendResponse.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/dialog/IFriendRequestSendResponse.d.ts @@ -1,5 +1,5 @@ export interface IFriendRequestSendResponse { status: number; - requestid: string; + requestId: string; retryAfter: number; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 6c3c9eb..26e43ac 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -1,5 +1,5 @@ import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item } from "../common/tables/IItem"; +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; export interface IGetOtherProfileResponse { id: string; aid: number; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/ISearchFriendResponse.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/ISearchFriendResponse.d.ts index 96d88b2..d3cc7df 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/ISearchFriendResponse.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/ISearchFriendResponse.d.ts @@ -1,9 +1,11 @@ export interface ISearchFriendResponse { _id: string; + aid: number; Info: Info; } export interface Info { Nickname: string; Side: string; Level: number; + MemberCategory: number; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/enums/AmmoTypes.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/enums/WeaponTypes.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..529c2cd 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,9 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +23,8 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IPmcConfig.d.ts index 65da29b..f17d3e4 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IPmcConfig.d.ts @@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig { /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; allPMCsHavePlayerNameWithRandomPrefixChance: number; + /** Should secure container loot from usec.json/bear.json be added to pmc bots secure */ + addSecureContainerLootFromBotConfig: boolean; } export interface PmcTypes { usec: string; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/dialog/ISendMessageDetails.d.ts index 2068ede..05b3bcd 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -30,7 +30,15 @@ export interface ISendMessageDetails { } export interface IProfileChangeEvent { _id: string; - Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + Type: ProfileChangeEventType; value: number; entity?: string; } +export declare enum ProfileChangeEventType { + TRADER_SALES_SUM = "TraderSalesSum", + TRADER_STANDING = "TraderStanding", + PROFILE_LEVEL = "ProfileLevel", + SKILL_POINTS = "SkillPoints", + EXAMINE_ALL_ITEMS = "ExamineAllItems", + UNLOCK_TRADER = "UnlockTrader" +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/servers/HttpServer.d.ts b/TypeScript/6ReferenceAnotherClass/types/servers/HttpServer.d.ts index 8574cdd..bcd740f 100644 --- a/TypeScript/6ReferenceAnotherClass/types/servers/HttpServer.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/servers/HttpServer.d.ts @@ -19,11 +19,19 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/6ReferenceAnotherClass/types/services/BotLootCacheService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/BotLootCacheService.d.ts index b013e5e..7f79bfe 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/BotLootCacheService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/BotLootCacheService.d.ts @@ -69,6 +69,9 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/6ReferenceAnotherClass/types/services/FenceService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/FenceService.d.ts index bb1d035..75c4b28 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/FenceService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,14 +38,30 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; + protected fenceItemUpdCompareProperties: Set; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with */ setFenceAssort(assort: ITraderAssort): void; + /** + * Replace discount fence assort with new assort + * @param assort New assorts to replace old with + */ + setDiscountFenceAssort(assort: ITraderAssort): void; + /** + * Get main fence assort + * @return ITraderAssort + */ + getMainFenceAssort(): ITraderAssort; + /** + * Get discount fence assort + * @return ITraderAssort + */ + getDiscountFenceAssort(): ITraderAssort; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -57,6 +74,26 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adds to fence assort a single item (with its children) + * @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; + /** + * 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; + /** + * 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; /** * Adjust all items contained inside an assort by a multiplier * @param assort (clone)Assort that contains items with prices to adjust @@ -93,17 +130,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -112,8 +155,8 @@ export declare class FenceService { protected deleteRandomAssorts(itemCountToReplace: number, assort: ITraderAssort): void; /** * Choose an item at random and remove it + mods from assorts - * @param assort Items to remove from - * @param rootItems Assort root items to pick from to remove + * @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; /** @@ -132,6 +175,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +196,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +205,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +214,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +225,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +247,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/6ReferenceAnotherClass/types/services/ItemBaseClassService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/6ReferenceAnotherClass/types/services/MailSendService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/MailSendService.d.ts index 08752bf..e5643f9 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/MailSendService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/MailSendService.d.ts @@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { Traders } from "@spt-aki/models/enums/Traders"; -import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -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?: any): void; + sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], 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?: any[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], 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 diff --git a/TypeScript/6ReferenceAnotherClass/types/services/PaymentService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/PaymentService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/6ReferenceAnotherClass/types/services/ProfileActivityService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/services/ProfileFixerService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/ProfileFixerService.d.ts index 804b3bf..1045d0a 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/ProfileFixerService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @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 @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @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 @@ -165,4 +183,9 @@ export declare class ProfileFixerService { * @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 null + */ + protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/6ReferenceAnotherClass/types/services/RagfairPriceService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/RagfairPriceService.d.ts index 5649751..0fefdd8 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/RagfairPriceService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], 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 diff --git a/TypeScript/6ReferenceAnotherClass/types/utils/App.d.ts b/TypeScript/6ReferenceAnotherClass/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/6ReferenceAnotherClass/types/utils/App.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/6ReferenceAnotherClass/types/utils/CompareUtil.d.ts b/TypeScript/6ReferenceAnotherClass/types/utils/CompareUtil.d.ts new file mode 100644 index 0000000..a5b94d5 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/utils/CompareUtil.d.ts @@ -0,0 +1,11 @@ +export declare class CompareUtil { + private static typesToCheckAgainst; + /** + * This function does an object comparison, equivalent to applying reflections + * and scanning for all possible properties including arrays. + * @param v1 value 1 to compare + * @param v2 value 2 to compare + * @returns true if equal, false if not + */ + recursiveCompare(v1: any, v2: any): boolean; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/utils/RagfairOfferHolder.d.ts b/TypeScript/6ReferenceAnotherClass/types/utils/RagfairOfferHolder.d.ts index 3942ed1..b95e54a 100644 --- a/TypeScript/6ReferenceAnotherClass/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/utils/RagfairOfferHolder.d.ts @@ -1,9 +1,12 @@ +import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { + protected maxOffersPerTemplate: number; + protected ragfairServerHelper: RagfairServerHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(); + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); getOfferById(id: string): IRagfairOffer; getOffersByTemplate(templateId: string): Array; getOffersByTrader(traderId: string): Array; diff --git a/TypeScript/6ReferenceAnotherClass/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/6ReferenceAnotherClass/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/6ReferenceAnotherClass/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/7OnLoadHook/README.md b/TypeScript/7OnLoadHook/README.md index 48c742b..e760f8b 100644 --- a/TypeScript/7OnLoadHook/README.md +++ b/TypeScript/7OnLoadHook/README.md @@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an ## **NodeJS Setup** -Before you begin, ensure to install NodeJS version `v18.15.0`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). +Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). After installation, it's advised to reboot your system. diff --git a/TypeScript/7OnLoadHook/types/callbacks/BotCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/7OnLoadHook/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/DialogueCallbacks.d.ts index 7ed60b9..2de57cb 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/DialogueCallbacks.d.ts @@ -1,7 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; -import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; +import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest"; @@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/friend/request/send */ sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/accept-all + */ + acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; /** * Handle client/friend/request/accept */ acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/decline + */ + declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/friend/request/cancel */ diff --git a/TypeScript/7OnLoadHook/types/callbacks/InraidCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/7OnLoadHook/types/controllers/BotController.d.ts b/TypeScript/7OnLoadHook/types/controllers/BotController.d.ts index d148abc..556cc5d 100644 --- a/TypeScript/7OnLoadHook/types/controllers/BotController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/BotController.d.ts @@ -51,12 +51,14 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * 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 ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string): Difficulty; + getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/7OnLoadHook/types/controllers/BuildController.d.ts b/TypeScript/7OnLoadHook/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/7OnLoadHook/types/controllers/BuildController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts b/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, 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); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/7OnLoadHook/types/controllers/HideoutController.d.ts b/TypeScript/7OnLoadHook/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/7OnLoadHook/types/controllers/HideoutController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts b/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/7OnLoadHook/types/controllers/LauncherController.d.ts b/TypeScript/7OnLoadHook/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/7OnLoadHook/types/controllers/LauncherController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/7OnLoadHook/types/controllers/MatchController.d.ts b/TypeScript/7OnLoadHook/types/controllers/MatchController.d.ts index 6b1a7c3..708cee2 100644 --- a/TypeScript/7OnLoadHook/types/controllers/MatchController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/MatchController.d.ts @@ -75,10 +75,11 @@ export declare class MatchController { 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(pmcData: IPmcData, extractName: string): void; + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; /** * Was extract by car * @param extractName name of extract diff --git a/TypeScript/7OnLoadHook/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/BotEquipmentModGenerator.d.ts index dd1dcce..f850eea 100644 --- a/TypeScript/7OnLoadHook/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/BotEquipmentModGenerator.d.ts @@ -187,12 +187,12 @@ export declare class BotEquipmentModGenerator { */ protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param slotAddedToTemplate slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate template of the mods being added - * @param botRole + * Check if mod exists in db + is for a required slot + * @param modToAdd Db template of mod to check + * @param slotAddedToTemplate Slot object the item will be placed as child into + * @param modSlot Slot the mod will fill + * @param parentTemplate Db template of the mods being added + * @param botRole Bots wildspawntype (assault/pmcBot etc) * @returns true if valid */ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; diff --git a/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: 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/TypeScript/7OnLoadHook/types/generators/BotLootGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/BotLootGenerator.d.ts index 014617e..ca5d1bd 100644 --- a/TypeScript/7OnLoadHook/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/BotLootGenerator.d.ts @@ -82,7 +82,7 @@ export declare class BotLootGenerator { * @param totalValueLimitRub Total value of loot allowed in roubles * @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): void; + 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[][]; /** * Some items need child items to function, add them to the itemToAddChildrenTo array @@ -101,7 +101,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): void; + protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, 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 diff --git a/TypeScript/7OnLoadHook/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..5ca8ed7 100644 --- a/TypeScript/7OnLoadHook/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/FenceBaseAssortGenerator.d.ts @@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { FenceService } from "@spt-aki/services/FenceService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -22,14 +23,25 @@ export declare class FenceBaseAssortGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; + protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; - protected getItemPrice(itemTpl: string, items: Item[]): number; - protected getAmmoBoxPrice(items: Item[]): number; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * Get the penetration power value of an ammo, works with ammo boxes and raw ammos + * @param rootItemDb Ammo box or ammo item from items.db + * @returns Penetration power of passed in item, null if it doesnt have a power + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/7OnLoadHook/types/generators/LootGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/7OnLoadHook/types/generators/LootGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/7OnLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/7OnLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/7OnLoadHook/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/BotGeneratorHelper.d.ts index 7f7555b..c756725 100644 --- a/TypeScript/7OnLoadHook/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/BotGeneratorHelper.d.ts @@ -92,7 +92,7 @@ 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): ItemAddedResult; + addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set): ItemAddedResult; /** * Is the provided item allowed inside a container * @param slotGrid Items sub-grid we want to place item inside diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts new file mode 100644 index 0000000..26958ca --- /dev/null +++ b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -0,0 +1,39 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected itemFilterService: ItemFilterService; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en espaƱol" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: Map; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts deleted file mode 100644 index 33d05de..0000000 --- a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; -import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; -import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -export declare class GiveSptCommand implements ISptCommand { - protected logger: ILogger; - protected itemHelper: ItemHelper; - protected hashUtil: HashUtil; - protected jsonUtil: JsonUtil; - protected presetHelper: PresetHelper; - protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); - getCommand(): string; - getCommandHelp(): string; - performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts new file mode 100644 index 0000000..8ec2ada --- /dev/null +++ b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts @@ -0,0 +1,38 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class ProfileSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected profileHelper: ProfileHelper; + /** + * Regex to account for all these cases: + * spt profile level 20 + * spt profile skill metabolism 10 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent; + protected handleLevelCommand(level: number): IProfileChangeEvent; +} diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts new file mode 100644 index 0000000..d84158a --- /dev/null +++ b/TypeScript/7OnLoadHook/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -0,0 +1,33 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class TraderSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt trader prapor rep 100 + * spt trader mechanic spend 1000000 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/7OnLoadHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/7OnLoadHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/7OnLoadHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/7OnLoadHook/types/helpers/HttpServerHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/7OnLoadHook/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts index 3e91ef7..9195579 100644 --- a/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; +import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { CompareUtil } from "@spt-aki/utils/CompareUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; @@ -28,8 +29,33 @@ export declare class ItemHelper { protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; + protected compareUtil: CompareUtil; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil); + /** + * 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 + * @param item1 first item with all its children to compare + * @param item2 second item with all its children to compare + * @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; + /** + * This method will compare two items and see if the are equivalent. + * This method will NOT compare IDs on the items + * @param item1 first item to compare + * @param item2 second item to compare + * @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; + /** + * 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; /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl @@ -363,10 +389,11 @@ export declare class ItemHelper { * Chose a randomly weighted cartridge that fits * @param caliber Desired caliber * @param staticAmmoDist Cartridges and thier weights + * @param fallbackCartridgeTpl If a cartridge cannot be found in the above staticAmmoDist param, use this instead * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -401,7 +428,7 @@ export declare class ItemHelper { addChildSlotItems(itemToAdd: Item[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): Item[]; /** * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter - * @param possibleTpls Tpls to randomply choose from + * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow * @returns Chosen tpl or null */ diff --git a/TypeScript/7OnLoadHook/types/helpers/PresetHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/7OnLoadHook/types/helpers/PresetHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotType.d.ts index db6e56e..2a00af9 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,9 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/7OnLoadHook/types/models/eft/dialog/IAcceptFriendRequestData.d.ts b/TypeScript/7OnLoadHook/types/models/eft/dialog/IAcceptFriendRequestData.d.ts index 87461aa..0913eb5 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/dialog/IAcceptFriendRequestData.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/dialog/IAcceptFriendRequestData.d.ts @@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest { } export interface ICancelFriendRequestData extends IBaseFriendRequest { } -export interface IBaseFriendRequest { - request_id: string; +export interface IDeclineFriendRequestData extends IBaseFriendRequest { +} +export interface IBaseFriendRequest { + profileId: string; } diff --git a/TypeScript/7OnLoadHook/types/models/eft/dialog/IFriendRequestSendResponse.d.ts b/TypeScript/7OnLoadHook/types/models/eft/dialog/IFriendRequestSendResponse.d.ts index 06c40f3..fc311eb 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/dialog/IFriendRequestSendResponse.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/dialog/IFriendRequestSendResponse.d.ts @@ -1,5 +1,5 @@ export interface IFriendRequestSendResponse { status: number; - requestid: string; + requestId: string; retryAfter: number; } diff --git a/TypeScript/7OnLoadHook/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/TypeScript/7OnLoadHook/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 6c3c9eb..26e43ac 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -1,5 +1,5 @@ import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item } from "../common/tables/IItem"; +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; export interface IGetOtherProfileResponse { id: string; aid: number; diff --git a/TypeScript/7OnLoadHook/types/models/eft/profile/ISearchFriendResponse.d.ts b/TypeScript/7OnLoadHook/types/models/eft/profile/ISearchFriendResponse.d.ts index 96d88b2..d3cc7df 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/profile/ISearchFriendResponse.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/profile/ISearchFriendResponse.d.ts @@ -1,9 +1,11 @@ export interface ISearchFriendResponse { _id: string; + aid: number; Info: Info; } export interface Info { Nickname: string; Side: string; Level: number; + MemberCategory: number; } diff --git a/TypeScript/7OnLoadHook/types/models/enums/AmmoTypes.d.ts b/TypeScript/7OnLoadHook/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/7OnLoadHook/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/7OnLoadHook/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/7OnLoadHook/types/models/enums/WeaponTypes.d.ts b/TypeScript/7OnLoadHook/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/7OnLoadHook/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/7OnLoadHook/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/7OnLoadHook/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/7OnLoadHook/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..529c2cd 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,9 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +23,8 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IPmcConfig.d.ts index 65da29b..f17d3e4 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IPmcConfig.d.ts @@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig { /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; allPMCsHavePlayerNameWithRandomPrefixChance: number; + /** Should secure container loot from usec.json/bear.json be added to pmc bots secure */ + addSecureContainerLootFromBotConfig: boolean; } export interface PmcTypes { usec: string; diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/7OnLoadHook/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/7OnLoadHook/types/models/spt/dialog/ISendMessageDetails.d.ts index 2068ede..05b3bcd 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -30,7 +30,15 @@ export interface ISendMessageDetails { } export interface IProfileChangeEvent { _id: string; - Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + Type: ProfileChangeEventType; value: number; entity?: string; } +export declare enum ProfileChangeEventType { + TRADER_SALES_SUM = "TraderSalesSum", + TRADER_STANDING = "TraderStanding", + PROFILE_LEVEL = "ProfileLevel", + SKILL_POINTS = "SkillPoints", + EXAMINE_ALL_ITEMS = "ExamineAllItems", + UNLOCK_TRADER = "UnlockTrader" +} diff --git a/TypeScript/7OnLoadHook/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/7OnLoadHook/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/7OnLoadHook/types/servers/HttpServer.d.ts b/TypeScript/7OnLoadHook/types/servers/HttpServer.d.ts index 8574cdd..bcd740f 100644 --- a/TypeScript/7OnLoadHook/types/servers/HttpServer.d.ts +++ b/TypeScript/7OnLoadHook/types/servers/HttpServer.d.ts @@ -19,11 +19,19 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/7OnLoadHook/types/services/BotLootCacheService.d.ts b/TypeScript/7OnLoadHook/types/services/BotLootCacheService.d.ts index b013e5e..7f79bfe 100644 --- a/TypeScript/7OnLoadHook/types/services/BotLootCacheService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/BotLootCacheService.d.ts @@ -69,6 +69,9 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/7OnLoadHook/types/services/FenceService.d.ts b/TypeScript/7OnLoadHook/types/services/FenceService.d.ts index bb1d035..75c4b28 100644 --- a/TypeScript/7OnLoadHook/types/services/FenceService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,14 +38,30 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; + protected fenceItemUpdCompareProperties: Set; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with */ setFenceAssort(assort: ITraderAssort): void; + /** + * Replace discount fence assort with new assort + * @param assort New assorts to replace old with + */ + setDiscountFenceAssort(assort: ITraderAssort): void; + /** + * Get main fence assort + * @return ITraderAssort + */ + getMainFenceAssort(): ITraderAssort; + /** + * Get discount fence assort + * @return ITraderAssort + */ + getDiscountFenceAssort(): ITraderAssort; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -57,6 +74,26 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adds to fence assort a single item (with its children) + * @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; + /** + * 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; + /** + * 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; /** * Adjust all items contained inside an assort by a multiplier * @param assort (clone)Assort that contains items with prices to adjust @@ -93,17 +130,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -112,8 +155,8 @@ export declare class FenceService { protected deleteRandomAssorts(itemCountToReplace: number, assort: ITraderAssort): void; /** * Choose an item at random and remove it + mods from assorts - * @param assort Items to remove from - * @param rootItems Assort root items to pick from to remove + * @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; /** @@ -132,6 +175,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +196,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +205,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +214,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +225,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +247,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/7OnLoadHook/types/services/ItemBaseClassService.d.ts b/TypeScript/7OnLoadHook/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/7OnLoadHook/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/7OnLoadHook/types/services/MailSendService.d.ts b/TypeScript/7OnLoadHook/types/services/MailSendService.d.ts index 08752bf..e5643f9 100644 --- a/TypeScript/7OnLoadHook/types/services/MailSendService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/MailSendService.d.ts @@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { Traders } from "@spt-aki/models/enums/Traders"; -import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -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?: any): void; + sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], 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?: any[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], 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 diff --git a/TypeScript/7OnLoadHook/types/services/PaymentService.d.ts b/TypeScript/7OnLoadHook/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/7OnLoadHook/types/services/PaymentService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/7OnLoadHook/types/services/ProfileActivityService.d.ts b/TypeScript/7OnLoadHook/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/7OnLoadHook/types/services/ProfileFixerService.d.ts b/TypeScript/7OnLoadHook/types/services/ProfileFixerService.d.ts index 804b3bf..1045d0a 100644 --- a/TypeScript/7OnLoadHook/types/services/ProfileFixerService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @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 @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @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 @@ -165,4 +183,9 @@ export declare class ProfileFixerService { * @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 null + */ + protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/7OnLoadHook/types/services/RagfairPriceService.d.ts b/TypeScript/7OnLoadHook/types/services/RagfairPriceService.d.ts index 5649751..0fefdd8 100644 --- a/TypeScript/7OnLoadHook/types/services/RagfairPriceService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], 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 diff --git a/TypeScript/7OnLoadHook/types/utils/App.d.ts b/TypeScript/7OnLoadHook/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/7OnLoadHook/types/utils/App.d.ts +++ b/TypeScript/7OnLoadHook/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/7OnLoadHook/types/utils/CompareUtil.d.ts b/TypeScript/7OnLoadHook/types/utils/CompareUtil.d.ts new file mode 100644 index 0000000..a5b94d5 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/utils/CompareUtil.d.ts @@ -0,0 +1,11 @@ +export declare class CompareUtil { + private static typesToCheckAgainst; + /** + * This function does an object comparison, equivalent to applying reflections + * and scanning for all possible properties including arrays. + * @param v1 value 1 to compare + * @param v2 value 2 to compare + * @returns true if equal, false if not + */ + recursiveCompare(v1: any, v2: any): boolean; +} diff --git a/TypeScript/7OnLoadHook/types/utils/RagfairOfferHolder.d.ts b/TypeScript/7OnLoadHook/types/utils/RagfairOfferHolder.d.ts index 3942ed1..b95e54a 100644 --- a/TypeScript/7OnLoadHook/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/7OnLoadHook/types/utils/RagfairOfferHolder.d.ts @@ -1,9 +1,12 @@ +import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { + protected maxOffersPerTemplate: number; + protected ragfairServerHelper: RagfairServerHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(); + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); getOfferById(id: string): IRagfairOffer; getOffersByTemplate(templateId: string): Array; getOffersByTrader(traderId: string): Array; diff --git a/TypeScript/7OnLoadHook/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/7OnLoadHook/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/7OnLoadHook/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/7OnLoadHook/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/8OnUpdateHook/README.md b/TypeScript/8OnUpdateHook/README.md index 48c742b..e760f8b 100644 --- a/TypeScript/8OnUpdateHook/README.md +++ b/TypeScript/8OnUpdateHook/README.md @@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an ## **NodeJS Setup** -Before you begin, ensure to install NodeJS version `v18.15.0`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). +Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). After installation, it's advised to reboot your system. diff --git a/TypeScript/8OnUpdateHook/types/callbacks/BotCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/8OnUpdateHook/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/DialogueCallbacks.d.ts index 7ed60b9..2de57cb 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/DialogueCallbacks.d.ts @@ -1,7 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; -import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; +import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest"; @@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/friend/request/send */ sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/accept-all + */ + acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; /** * Handle client/friend/request/accept */ acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/decline + */ + declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/friend/request/cancel */ diff --git a/TypeScript/8OnUpdateHook/types/callbacks/InraidCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/8OnUpdateHook/types/controllers/BotController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/BotController.d.ts index d148abc..556cc5d 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/BotController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/BotController.d.ts @@ -51,12 +51,14 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * 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 ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string): Difficulty; + getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/8OnUpdateHook/types/controllers/BuildController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/BuildController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, 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); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/8OnUpdateHook/types/controllers/HideoutController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/HideoutController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/8OnUpdateHook/types/controllers/LauncherController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/LauncherController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/8OnUpdateHook/types/controllers/MatchController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/MatchController.d.ts index 6b1a7c3..708cee2 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/MatchController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/MatchController.d.ts @@ -75,10 +75,11 @@ export declare class MatchController { 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(pmcData: IPmcData, extractName: string): void; + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; /** * Was extract by car * @param extractName name of extract diff --git a/TypeScript/8OnUpdateHook/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/BotEquipmentModGenerator.d.ts index dd1dcce..f850eea 100644 --- a/TypeScript/8OnUpdateHook/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/BotEquipmentModGenerator.d.ts @@ -187,12 +187,12 @@ export declare class BotEquipmentModGenerator { */ protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param slotAddedToTemplate slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate template of the mods being added - * @param botRole + * Check if mod exists in db + is for a required slot + * @param modToAdd Db template of mod to check + * @param slotAddedToTemplate Slot object the item will be placed as child into + * @param modSlot Slot the mod will fill + * @param parentTemplate Db template of the mods being added + * @param botRole Bots wildspawntype (assault/pmcBot etc) * @returns true if valid */ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; diff --git a/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: 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/TypeScript/8OnUpdateHook/types/generators/BotLootGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/BotLootGenerator.d.ts index 014617e..ca5d1bd 100644 --- a/TypeScript/8OnUpdateHook/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/BotLootGenerator.d.ts @@ -82,7 +82,7 @@ export declare class BotLootGenerator { * @param totalValueLimitRub Total value of loot allowed in roubles * @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): void; + 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[][]; /** * Some items need child items to function, add them to the itemToAddChildrenTo array @@ -101,7 +101,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): void; + protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, 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 diff --git a/TypeScript/8OnUpdateHook/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..5ca8ed7 100644 --- a/TypeScript/8OnUpdateHook/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/FenceBaseAssortGenerator.d.ts @@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { FenceService } from "@spt-aki/services/FenceService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -22,14 +23,25 @@ export declare class FenceBaseAssortGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; + protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; - protected getItemPrice(itemTpl: string, items: Item[]): number; - protected getAmmoBoxPrice(items: Item[]): number; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * Get the penetration power value of an ammo, works with ammo boxes and raw ammos + * @param rootItemDb Ammo box or ammo item from items.db + * @returns Penetration power of passed in item, null if it doesnt have a power + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/8OnUpdateHook/types/generators/LootGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/8OnUpdateHook/types/generators/LootGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/8OnUpdateHook/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/8OnUpdateHook/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/8OnUpdateHook/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/BotGeneratorHelper.d.ts index 7f7555b..c756725 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/BotGeneratorHelper.d.ts @@ -92,7 +92,7 @@ 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): ItemAddedResult; + addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set): ItemAddedResult; /** * Is the provided item allowed inside a container * @param slotGrid Items sub-grid we want to place item inside diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts new file mode 100644 index 0000000..26958ca --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -0,0 +1,39 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected itemFilterService: ItemFilterService; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en espaƱol" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: Map; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts deleted file mode 100644 index 33d05de..0000000 --- a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; -import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; -import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -export declare class GiveSptCommand implements ISptCommand { - protected logger: ILogger; - protected itemHelper: ItemHelper; - protected hashUtil: HashUtil; - protected jsonUtil: JsonUtil; - protected presetHelper: PresetHelper; - protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); - getCommand(): string; - getCommandHelp(): string; - performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts new file mode 100644 index 0000000..8ec2ada --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts @@ -0,0 +1,38 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class ProfileSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected profileHelper: ProfileHelper; + /** + * Regex to account for all these cases: + * spt profile level 20 + * spt profile skill metabolism 10 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent; + protected handleLevelCommand(level: number): IProfileChangeEvent; +} diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts new file mode 100644 index 0000000..d84158a --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -0,0 +1,33 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class TraderSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt trader prapor rep 100 + * spt trader mechanic spend 1000000 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/8OnUpdateHook/types/helpers/HttpServerHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts index 3e91ef7..9195579 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; +import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { CompareUtil } from "@spt-aki/utils/CompareUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; @@ -28,8 +29,33 @@ export declare class ItemHelper { protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; + protected compareUtil: CompareUtil; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil); + /** + * 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 + * @param item1 first item with all its children to compare + * @param item2 second item with all its children to compare + * @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; + /** + * This method will compare two items and see if the are equivalent. + * This method will NOT compare IDs on the items + * @param item1 first item to compare + * @param item2 second item to compare + * @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; + /** + * 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; /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl @@ -363,10 +389,11 @@ export declare class ItemHelper { * Chose a randomly weighted cartridge that fits * @param caliber Desired caliber * @param staticAmmoDist Cartridges and thier weights + * @param fallbackCartridgeTpl If a cartridge cannot be found in the above staticAmmoDist param, use this instead * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -401,7 +428,7 @@ export declare class ItemHelper { addChildSlotItems(itemToAdd: Item[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): Item[]; /** * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter - * @param possibleTpls Tpls to randomply choose from + * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow * @returns Chosen tpl or null */ diff --git a/TypeScript/8OnUpdateHook/types/helpers/PresetHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/PresetHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotType.d.ts index db6e56e..2a00af9 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,9 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/dialog/IAcceptFriendRequestData.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/dialog/IAcceptFriendRequestData.d.ts index 87461aa..0913eb5 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/dialog/IAcceptFriendRequestData.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/dialog/IAcceptFriendRequestData.d.ts @@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest { } export interface ICancelFriendRequestData extends IBaseFriendRequest { } -export interface IBaseFriendRequest { - request_id: string; +export interface IDeclineFriendRequestData extends IBaseFriendRequest { +} +export interface IBaseFriendRequest { + profileId: string; } diff --git a/TypeScript/8OnUpdateHook/types/models/eft/dialog/IFriendRequestSendResponse.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/dialog/IFriendRequestSendResponse.d.ts index 06c40f3..fc311eb 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/dialog/IFriendRequestSendResponse.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/dialog/IFriendRequestSendResponse.d.ts @@ -1,5 +1,5 @@ export interface IFriendRequestSendResponse { status: number; - requestid: string; + requestId: string; retryAfter: number; } diff --git a/TypeScript/8OnUpdateHook/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 6c3c9eb..26e43ac 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -1,5 +1,5 @@ import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item } from "../common/tables/IItem"; +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; export interface IGetOtherProfileResponse { id: string; aid: number; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/profile/ISearchFriendResponse.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/profile/ISearchFriendResponse.d.ts index 96d88b2..d3cc7df 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/profile/ISearchFriendResponse.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/profile/ISearchFriendResponse.d.ts @@ -1,9 +1,11 @@ export interface ISearchFriendResponse { _id: string; + aid: number; Info: Info; } export interface Info { Nickname: string; Side: string; Level: number; + MemberCategory: number; } diff --git a/TypeScript/8OnUpdateHook/types/models/enums/AmmoTypes.d.ts b/TypeScript/8OnUpdateHook/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/8OnUpdateHook/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/8OnUpdateHook/types/models/enums/WeaponTypes.d.ts b/TypeScript/8OnUpdateHook/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/8OnUpdateHook/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/8OnUpdateHook/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..529c2cd 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,9 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +23,8 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IPmcConfig.d.ts index 65da29b..f17d3e4 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IPmcConfig.d.ts @@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig { /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; allPMCsHavePlayerNameWithRandomPrefixChance: number; + /** Should secure container loot from usec.json/bear.json be added to pmc bots secure */ + addSecureContainerLootFromBotConfig: boolean; } export interface PmcTypes { usec: string; diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/8OnUpdateHook/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/dialog/ISendMessageDetails.d.ts index 2068ede..05b3bcd 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -30,7 +30,15 @@ export interface ISendMessageDetails { } export interface IProfileChangeEvent { _id: string; - Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + Type: ProfileChangeEventType; value: number; entity?: string; } +export declare enum ProfileChangeEventType { + TRADER_SALES_SUM = "TraderSalesSum", + TRADER_STANDING = "TraderStanding", + PROFILE_LEVEL = "ProfileLevel", + SKILL_POINTS = "SkillPoints", + EXAMINE_ALL_ITEMS = "ExamineAllItems", + UNLOCK_TRADER = "UnlockTrader" +} diff --git a/TypeScript/8OnUpdateHook/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/8OnUpdateHook/types/servers/HttpServer.d.ts b/TypeScript/8OnUpdateHook/types/servers/HttpServer.d.ts index 8574cdd..bcd740f 100644 --- a/TypeScript/8OnUpdateHook/types/servers/HttpServer.d.ts +++ b/TypeScript/8OnUpdateHook/types/servers/HttpServer.d.ts @@ -19,11 +19,19 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/8OnUpdateHook/types/services/BotLootCacheService.d.ts b/TypeScript/8OnUpdateHook/types/services/BotLootCacheService.d.ts index b013e5e..7f79bfe 100644 --- a/TypeScript/8OnUpdateHook/types/services/BotLootCacheService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/BotLootCacheService.d.ts @@ -69,6 +69,9 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/8OnUpdateHook/types/services/FenceService.d.ts b/TypeScript/8OnUpdateHook/types/services/FenceService.d.ts index bb1d035..75c4b28 100644 --- a/TypeScript/8OnUpdateHook/types/services/FenceService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,14 +38,30 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; + protected fenceItemUpdCompareProperties: Set; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with */ setFenceAssort(assort: ITraderAssort): void; + /** + * Replace discount fence assort with new assort + * @param assort New assorts to replace old with + */ + setDiscountFenceAssort(assort: ITraderAssort): void; + /** + * Get main fence assort + * @return ITraderAssort + */ + getMainFenceAssort(): ITraderAssort; + /** + * Get discount fence assort + * @return ITraderAssort + */ + getDiscountFenceAssort(): ITraderAssort; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -57,6 +74,26 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adds to fence assort a single item (with its children) + * @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; + /** + * 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; + /** + * 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; /** * Adjust all items contained inside an assort by a multiplier * @param assort (clone)Assort that contains items with prices to adjust @@ -93,17 +130,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -112,8 +155,8 @@ export declare class FenceService { protected deleteRandomAssorts(itemCountToReplace: number, assort: ITraderAssort): void; /** * Choose an item at random and remove it + mods from assorts - * @param assort Items to remove from - * @param rootItems Assort root items to pick from to remove + * @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; /** @@ -132,6 +175,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +196,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +205,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +214,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +225,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +247,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/8OnUpdateHook/types/services/ItemBaseClassService.d.ts b/TypeScript/8OnUpdateHook/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/8OnUpdateHook/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/8OnUpdateHook/types/services/MailSendService.d.ts b/TypeScript/8OnUpdateHook/types/services/MailSendService.d.ts index 08752bf..e5643f9 100644 --- a/TypeScript/8OnUpdateHook/types/services/MailSendService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/MailSendService.d.ts @@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { Traders } from "@spt-aki/models/enums/Traders"; -import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -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?: any): void; + sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], 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?: any[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], 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 diff --git a/TypeScript/8OnUpdateHook/types/services/PaymentService.d.ts b/TypeScript/8OnUpdateHook/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/8OnUpdateHook/types/services/PaymentService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/8OnUpdateHook/types/services/ProfileActivityService.d.ts b/TypeScript/8OnUpdateHook/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/8OnUpdateHook/types/services/ProfileFixerService.d.ts b/TypeScript/8OnUpdateHook/types/services/ProfileFixerService.d.ts index 804b3bf..1045d0a 100644 --- a/TypeScript/8OnUpdateHook/types/services/ProfileFixerService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @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 @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @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 @@ -165,4 +183,9 @@ export declare class ProfileFixerService { * @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 null + */ + protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/8OnUpdateHook/types/services/RagfairPriceService.d.ts b/TypeScript/8OnUpdateHook/types/services/RagfairPriceService.d.ts index 5649751..0fefdd8 100644 --- a/TypeScript/8OnUpdateHook/types/services/RagfairPriceService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], 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 diff --git a/TypeScript/8OnUpdateHook/types/utils/App.d.ts b/TypeScript/8OnUpdateHook/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/8OnUpdateHook/types/utils/App.d.ts +++ b/TypeScript/8OnUpdateHook/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/8OnUpdateHook/types/utils/CompareUtil.d.ts b/TypeScript/8OnUpdateHook/types/utils/CompareUtil.d.ts new file mode 100644 index 0000000..a5b94d5 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/utils/CompareUtil.d.ts @@ -0,0 +1,11 @@ +export declare class CompareUtil { + private static typesToCheckAgainst; + /** + * This function does an object comparison, equivalent to applying reflections + * and scanning for all possible properties including arrays. + * @param v1 value 1 to compare + * @param v2 value 2 to compare + * @returns true if equal, false if not + */ + recursiveCompare(v1: any, v2: any): boolean; +} diff --git a/TypeScript/8OnUpdateHook/types/utils/RagfairOfferHolder.d.ts b/TypeScript/8OnUpdateHook/types/utils/RagfairOfferHolder.d.ts index 3942ed1..b95e54a 100644 --- a/TypeScript/8OnUpdateHook/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/8OnUpdateHook/types/utils/RagfairOfferHolder.d.ts @@ -1,9 +1,12 @@ +import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { + protected maxOffersPerTemplate: number; + protected ragfairServerHelper: RagfairServerHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(); + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); getOfferById(id: string): IRagfairOffer; getOffersByTemplate(templateId: string): Array; getOffersByTrader(traderId: string): Array; diff --git a/TypeScript/8OnUpdateHook/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/8OnUpdateHook/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/8OnUpdateHook/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/8OnUpdateHook/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise; diff --git a/TypeScript/9RouterHooks/README.md b/TypeScript/9RouterHooks/README.md index 48c742b..e760f8b 100644 --- a/TypeScript/9RouterHooks/README.md +++ b/TypeScript/9RouterHooks/README.md @@ -13,7 +13,7 @@ This project is designed to streamline the initial setup process for building an ## **NodeJS Setup** -Before you begin, ensure to install NodeJS version `v18.15.0`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). +Before you begin, ensure to install NodeJS version `v20.11.1`, which has been tested thoroughly with our mod templates and build scripts. Download it from the [official NodeJS website](https://nodejs.org/). After installation, it's advised to reboot your system. diff --git a/TypeScript/9RouterHooks/types/callbacks/BotCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/BotCallbacks.d.ts index d406147..1e7a55e 100644 --- a/TypeScript/9RouterHooks/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/BotCallbacks.d.ts @@ -2,6 +2,7 @@ import { BotController } from "@spt-aki/controllers/BotController"; import { IGenerateBotsRequestData } from "@spt-aki/models/eft/bot/IGenerateBotsRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IBotBase } from "@spt-aki/models/eft/common/tables/IBotBase"; +import { Difficulties } from "@spt-aki/models/eft/common/tables/IBotType"; import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; export declare class BotCallbacks { @@ -19,6 +20,11 @@ export declare class BotCallbacks { * @returns string */ getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string; + /** + * Handle singleplayer/settings/bot/difficulties + * @returns dictionary of every bot and its diffiulty settings + */ + getAllBotDifficulties(url: string, info: IEmptyRequestData, sessionID: string): Record; /** * Handle client/game/bot/generate * @returns IGetBodyResponseData diff --git a/TypeScript/9RouterHooks/types/callbacks/DialogueCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/DialogueCallbacks.d.ts index 7ed60b9..2de57cb 100644 --- a/TypeScript/9RouterHooks/types/callbacks/DialogueCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/DialogueCallbacks.d.ts @@ -1,7 +1,7 @@ import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; -import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; +import { IAcceptFriendRequestData, ICancelFriendRequestData, IDeclineFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest"; @@ -73,10 +73,18 @@ export declare class DialogueCallbacks implements OnUpdate { * Handle client/friend/request/send */ sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/accept-all + */ + acceptAllFriendRequests(url: string, request: IEmptyRequestData, sessionID: string): INullResponseData; /** * Handle client/friend/request/accept */ acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData; + /** + * Handle client/friend/request/decline + */ + declineFriendRequest(url: string, request: IDeclineFriendRequestData, sessionID: string): IGetBodyResponseData; /** * Handle client/friend/request/cancel */ diff --git a/TypeScript/9RouterHooks/types/callbacks/InraidCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/InraidCallbacks.d.ts index 29e2c96..2bffa77 100644 --- a/TypeScript/9RouterHooks/types/callbacks/InraidCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/InraidCallbacks.d.ts @@ -39,11 +39,6 @@ export declare class InraidCallbacks { * @returns JSON as string */ getRaidMenuSettings(): string; - /** - * Handle singleplayer/settings/weapon/durability - * @returns - */ - getWeaponDurability(): string; /** * Handle singleplayer/airdrop/config * @returns JSON as string diff --git a/TypeScript/9RouterHooks/types/controllers/BotController.d.ts b/TypeScript/9RouterHooks/types/controllers/BotController.d.ts index d148abc..556cc5d 100644 --- a/TypeScript/9RouterHooks/types/controllers/BotController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/BotController.d.ts @@ -51,12 +51,14 @@ export declare class BotController { getBotCoreDifficulty(): IBotCore; /** * Get bot difficulty settings - * adjust PMC settings to ensure they engage the correct bot types + * 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 ignoreRaidSettings should raid settings chosen pre-raid be ignored * @returns Difficulty object */ - getBotDifficulty(type: string, diffLevel: string): Difficulty; + getBotDifficulty(type: string, diffLevel: string, ignoreRaidSettings?: boolean): Difficulty; + getAllBotDifficulties(): Record; /** * Generate bot profiles and store in cache * @param sessionId Session id diff --git a/TypeScript/9RouterHooks/types/controllers/BuildController.d.ts b/TypeScript/9RouterHooks/types/controllers/BuildController.d.ts index dd954a7..b0e222f 100644 --- a/TypeScript/9RouterHooks/types/controllers/BuildController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/BuildController.d.ts @@ -28,7 +28,7 @@ export declare class BuildController { saveEquipmentBuild(sessionID: string, request: IPresetBuildActionRequestData): void; /** Handle client/builds/delete*/ removeBuild(sessionID: string, request: IRemoveBuildRequestData): void; - protected removePlayerBuild(id: string, sessionID: string): void; + protected removePlayerBuild(idToRemove: string, sessionID: string): void; /** * Handle client/builds/magazine/save */ diff --git a/TypeScript/9RouterHooks/types/controllers/GameController.d.ts b/TypeScript/9RouterHooks/types/controllers/GameController.d.ts index 9feb6cc..cf61d29 100644 --- a/TypeScript/9RouterHooks/types/controllers/GameController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/GameController.d.ts @@ -29,6 +29,7 @@ import { GiftService } from "@spt-aki/services/GiftService"; import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { OpenZoneService } from "@spt-aki/services/OpenZoneService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { ProfileFixerService } from "@spt-aki/services/ProfileFixerService"; import { RaidTimeAdjustmentService } from "@spt-aki/services/RaidTimeAdjustmentService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; @@ -55,6 +56,7 @@ export declare class GameController { protected itemBaseClassService: ItemBaseClassService; protected giftService: GiftService; protected raidTimeAdjustmentService: RaidTimeAdjustmentService; + protected profileActivityService: ProfileActivityService; protected applicationContext: ApplicationContext; protected configServer: ConfigServer; protected httpConfig: IHttpConfig; @@ -65,12 +67,14 @@ export declare class GameController { protected pmcConfig: IPmcConfig; protected lootConfig: ILootConfig; protected botConfig: IBotConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, randomUtil: RandomUtil, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, itemBaseClassService: ItemBaseClassService, giftService: GiftService, raidTimeAdjustmentService: RaidTimeAdjustmentService, applicationContext: ApplicationContext, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, preAkiModLoader: PreAkiModLoader, 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); load(): void; /** * Handle client/game/start */ gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void; + protected adjustHideoutCraftTimes(): void; + protected adjustHideoutBuildTimes(): void; protected adjustLocationBotValues(): void; /** * Out of date/incorrectly made trader mods forget this data diff --git a/TypeScript/9RouterHooks/types/controllers/HideoutController.d.ts b/TypeScript/9RouterHooks/types/controllers/HideoutController.d.ts index 23bdd1e..c7e6872 100644 --- a/TypeScript/9RouterHooks/types/controllers/HideoutController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/HideoutController.d.ts @@ -34,6 +34,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { FenceService } from "@spt-aki/services/FenceService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { PlayerService } from "@spt-aki/services/PlayerService"; +import { ProfileActivityService } from "@spt-aki/services/ProfileActivityService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; @@ -57,13 +58,14 @@ export declare class HideoutController { protected hideoutHelper: HideoutHelper; protected scavCaseRewardGenerator: ScavCaseRewardGenerator; protected localisationService: LocalisationService; + protected profileActivityService: ProfileActivityService; protected configServer: ConfigServer; protected jsonUtil: JsonUtil; protected fenceService: FenceService; /** Key used in TaskConditionCounters array */ protected static nameTaskConditionCountersCrafting: string; protected hideoutConfig: IHideoutConfig; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService); + constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, 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, jsonUtil: JsonUtil, fenceService: FenceService); /** * Handle HideoutUpgrade event * Start a hideout area upgrade diff --git a/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts b/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts index e9e377d..b3d7079 100644 --- a/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/InsuranceController.d.ts @@ -18,6 +18,7 @@ import { SaveServer } from "@spt-aki/servers/SaveServer"; import { InsuranceService } from "@spt-aki/services/InsuranceService"; import { MailSendService } from "@spt-aki/services/MailSendService"; import { PaymentService } from "@spt-aki/services/PaymentService"; +import { RagfairPriceService } from "@spt-aki/services/RagfairPriceService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; import { RandomUtil } from "@spt-aki/utils/RandomUtil"; @@ -38,10 +39,11 @@ export declare class InsuranceController { protected paymentService: PaymentService; protected insuranceService: InsuranceService; protected mailSendService: MailSendService; + protected ragfairPriceService: RagfairPriceService; protected configServer: ConfigServer; protected insuranceConfig: IInsuranceConfig; protected roubleTpl: string; - constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, configServer: ConfigServer); + constructor(logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, traderHelper: TraderHelper, paymentService: PaymentService, insuranceService: InsuranceService, mailSendService: MailSendService, ragfairPriceService: RagfairPriceService, configServer: ConfigServer); /** * Process insurance items of all profiles prior to being given back to the player through the mail service. * @@ -145,7 +147,7 @@ export declare class InsuranceController { */ protected processAttachmentByParent(attachments: Item[], traderId: string, toDelete: Set): void; /** - * Sorts the attachment items by their max price in descending order. + * Sorts the attachment items by their dynamic price in descending order. * * @param attachments The array of attachments items. * @returns An array of items enriched with their max price and common locale-name. @@ -220,6 +222,6 @@ export declare class InsuranceController { } interface EnrichedItem extends Item { name: string; - maxPrice: number; + dynamicPrice: number; } export {}; diff --git a/TypeScript/9RouterHooks/types/controllers/LauncherController.d.ts b/TypeScript/9RouterHooks/types/controllers/LauncherController.d.ts index cfed796..5a5d4b7 100644 --- a/TypeScript/9RouterHooks/types/controllers/LauncherController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/LauncherController.d.ts @@ -44,6 +44,11 @@ export declare class LauncherController { protected formatID(timeStamp: number, counter: number): string; changeUsername(info: IChangeRequestData): string; changePassword(info: IChangeRequestData): string; + /** + * Handle launcher requesting profile be wiped + * @param info IRegisterData + * @returns Session id + */ wipe(info: IRegisterData): string; getCompatibleTarkovVersion(): string; /** diff --git a/TypeScript/9RouterHooks/types/controllers/MatchController.d.ts b/TypeScript/9RouterHooks/types/controllers/MatchController.d.ts index 6b1a7c3..708cee2 100644 --- a/TypeScript/9RouterHooks/types/controllers/MatchController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/MatchController.d.ts @@ -75,10 +75,11 @@ export declare class MatchController { 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(pmcData: IPmcData, extractName: string): void; + protected handleCoopExtract(sessionId: string, pmcData: IPmcData, extractName: string): void; /** * Was extract by car * @param extractName name of extract diff --git a/TypeScript/9RouterHooks/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/BotEquipmentModGenerator.d.ts index dd1dcce..f850eea 100644 --- a/TypeScript/9RouterHooks/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/BotEquipmentModGenerator.d.ts @@ -187,12 +187,12 @@ export declare class BotEquipmentModGenerator { */ protected getRandomModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string; /** - * Log errors if mod is not compatible with slot - * @param modToAdd template of mod to check - * @param slotAddedToTemplate slot the item will be placed in - * @param modSlot slot the mod will fill - * @param parentTemplate template of the mods being added - * @param botRole + * Check if mod exists in db + is for a required slot + * @param modToAdd Db template of mod to check + * @param slotAddedToTemplate Slot object the item will be placed as child into + * @param modSlot Slot the mod will fill + * @param parentTemplate Db template of the mods being added + * @param botRole Bots wildspawntype (assault/pmcBot etc) * @returns true if valid */ protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], slotAddedToTemplate: Slot, modSlot: string, parentTemplate: ITemplateItem, botRole: string): boolean; diff --git a/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts index 520c75d..7a10c36 100644 --- a/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts @@ -80,9 +80,10 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault + * @param sessionId profile session id * @returns Nickname for bot */ - protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId: string): string; + protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: 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/TypeScript/9RouterHooks/types/generators/BotLootGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/BotLootGenerator.d.ts index 014617e..ca5d1bd 100644 --- a/TypeScript/9RouterHooks/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/BotLootGenerator.d.ts @@ -82,7 +82,7 @@ export declare class BotLootGenerator { * @param totalValueLimitRub Total value of loot allowed in roubles * @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): void; + 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[][]; /** * Some items need child items to function, add them to the itemToAddChildrenTo array @@ -101,7 +101,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): void; + protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, 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 diff --git a/TypeScript/9RouterHooks/types/generators/FenceBaseAssortGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/FenceBaseAssortGenerator.d.ts index c1eabde..5ca8ed7 100644 --- a/TypeScript/9RouterHooks/types/generators/FenceBaseAssortGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/FenceBaseAssortGenerator.d.ts @@ -7,6 +7,7 @@ import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { FenceService } from "@spt-aki/services/FenceService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { SeasonalEventService } from "@spt-aki/services/SeasonalEventService"; import { HashUtil } from "@spt-aki/utils/HashUtil"; @@ -22,14 +23,25 @@ export declare class FenceBaseAssortGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; + protected fenceService: FenceService; protected traderConfig: ITraderConfig; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService, configServer: ConfigServer, fenceService: FenceService); /** * Create base fence assorts dynamically and store in memory */ generateFenceBaseAssorts(): void; - protected getItemPrice(itemTpl: string, items: Item[]): number; - protected getAmmoBoxPrice(items: Item[]): number; + /** + * Check ammo in boxes + loose ammos has a penetration value above the configured value in trader.json / ammoMaxPenLimit + * @param rootItemDb Ammo box or ammo item from items.db + * @returns True if penetration value is above limit set in config + */ + protected isAmmoAbovePenetrationLimit(rootItemDb: ITemplateItem): boolean; + /** + * Get the penetration power value of an ammo, works with ammo boxes and raw ammos + * @param rootItemDb Ammo box or ammo item from items.db + * @returns Penetration power of passed in item, null if it doesnt have a power + */ + protected getAmmoPenetrationPower(rootItemDb: ITemplateItem): number; /** * Add soft inserts + armor plates to an armor * @param armor Armor item array to add mods into diff --git a/TypeScript/9RouterHooks/types/generators/LootGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/LootGenerator.d.ts index 6af5c3a..965d3b9 100644 --- a/TypeScript/9RouterHooks/types/generators/LootGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/LootGenerator.d.ts @@ -41,10 +41,10 @@ export declare class LootGenerator { */ createRandomLoot(options: LootRequest): LootItem[]; /** - * Filter armor items by their main plates protection level - * @param armor Armor preset - * @param options Loot request options - * @returns True item passes checks + * Filter armor items by their front plates protection level - top if its a helmet + * @param armor Armor preset to check + * @param options Loot request options - armor level etc + * @returns True if item has desired armor level */ protected armorIsDesiredProtectionLevel(armor: IPreset, options: LootRequest): boolean; /** @@ -74,13 +74,13 @@ export declare class LootGenerator { protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number; /** * Find a random item in items.json and add to result array - * @param globalDefaultPresets presets to choose from - * @param itemTypeCounts item limit counts - * @param itemBlacklist items to skip - * @param result array to add found preset to + * @param presetPool Presets to choose from + * @param itemTypeCounts Item limit counts + * @param itemBlacklist Items to skip + * @param result Array to add chosen preset to * @returns true if preset was valid and added to pool */ - protected findAndAddRandomPresetToLoot(globalDefaultPresets: IPreset[], itemTypeCounts: Record, itemBlacklist: string[], result: LootItem[]): boolean; diff --git a/TypeScript/9RouterHooks/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/RepeatableQuestRewardGenerator.d.ts index d994996..9ac6341 100644 --- a/TypeScript/9RouterHooks/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -58,7 +58,7 @@ export declare class RepeatableQuestRewardGenerator { * @param minPrice The minimum priced item to include * @returns True if any items remain in `rewardItems`, false otherwise */ - protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): boolean; + protected filterRewardPoolWithinBudget(rewardItems: ITemplateItem[], roublesBudget: number, minPrice: number): ITemplateItem[]; /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for diff --git a/TypeScript/9RouterHooks/types/helpers/BotGeneratorHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/BotGeneratorHelper.d.ts index 7f7555b..c756725 100644 --- a/TypeScript/9RouterHooks/types/helpers/BotGeneratorHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/BotGeneratorHelper.d.ts @@ -92,7 +92,7 @@ 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): ItemAddedResult; + addItemWithChildrenToEquipmentSlot(equipmentSlots: string[], rootItemId: string, rootItemTplId: string, itemWithChildren: Item[], inventory: Inventory, containersIdFull?: Set): ItemAddedResult; /** * Is the provided item allowed inside a container * @param slotGrid Items sub-grid we want to place item inside diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts new file mode 100644 index 0000000..b9bc597 --- /dev/null +++ b/TypeScript/9RouterHooks/types/helpers/Dialogue/AbstractDialogueChatBot.d.ts @@ -0,0 +1,20 @@ +import { IChatCommand, ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; +import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +export declare abstract class AbstractDialogueChatBot implements IDialogueChatBot { + protected logger: ILogger; + protected mailSendService: MailSendService; + protected chatCommands: IChatCommand[] | ICommandoCommand[]; + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[] | ICommandoCommand[]); + /** + * @deprecated As of v3.7.6. Use registerChatCommand. + */ + registerCommandoCommand(chatCommand: IChatCommand | ICommandoCommand): void; + registerChatCommand(chatCommand: IChatCommand | ICommandoCommand): void; + abstract getChatBot(): IUserDialogInfo; + protected abstract getUnrecognizedCommandMessage(): string; + handleMessage(sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/IChatCommand.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/IChatCommand.d.ts new file mode 100644 index 0000000..ade0adc --- /dev/null +++ b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/IChatCommand.d.ts @@ -0,0 +1,12 @@ +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +/** + * @deprecated As of v3.7.6. Use IChatCommand. Will be removed in v3.9.0. + */ +export type ICommandoCommand = IChatCommand; +export interface IChatCommand { + getCommandPrefix(): string; + getCommandHelp(command: string): string; + getCommands(): Set; + handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts deleted file mode 100644 index cca1fb3..0000000 --- a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/ICommandoCommand.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -export interface ICommandoCommand { - getCommandPrefix(): string; - getCommandHelp(command: string): string; - getCommands(): Set; - handle(command: string, commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts index 62fb63e..8626984 100644 --- a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommandoCommands.d.ts @@ -1,9 +1,9 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; -export declare class SptCommandoCommands implements ICommandoCommand { +export declare class SptCommandoCommands implements IChatCommand { protected configServer: ConfigServer; protected sptCommands: ISptCommand[]; constructor(configServer: ConfigServer, sptCommands: ISptCommand[]); diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts new file mode 100644 index 0000000..26958ca --- /dev/null +++ b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/GiveSptCommand.d.ts @@ -0,0 +1,39 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class GiveSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected itemFilterService: ItemFilterService; + /** + * Regex to account for all these cases: + * spt give "item name" 5 + * spt give templateId 5 + * spt give en "item name in english" 5 + * spt give es "nombre en espaƱol" 5 + * spt give 5 <== this is the reply when the algo isn't sure about an item + */ + private static commandRegex; + private static maxAllowedDistance; + protected savedCommand: Map; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, itemFilterService: ItemFilterService); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts new file mode 100644 index 0000000..5f8d3a1 --- /dev/null +++ b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand.d.ts @@ -0,0 +1,6 @@ +export declare class SavedCommand { + quantity: number; + potentialItemNames: string[]; + locale: string; + constructor(quantity: number, potentialItemNames: string[], locale: string); +} diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts deleted file mode 100644 index 33d05de..0000000 --- a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/GiveSptCommand.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; -import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; -import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; -import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; -import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; -import { MailSendService } from "@spt-aki/services/MailSendService"; -import { HashUtil } from "@spt-aki/utils/HashUtil"; -import { JsonUtil } from "@spt-aki/utils/JsonUtil"; -export declare class GiveSptCommand implements ISptCommand { - protected logger: ILogger; - protected itemHelper: ItemHelper; - protected hashUtil: HashUtil; - protected jsonUtil: JsonUtil; - protected presetHelper: PresetHelper; - protected mailSendService: MailSendService; - constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService); - getCommand(): string; - getCommandHelp(): string; - performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; -} diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts new file mode 100644 index 0000000..8ec2ada --- /dev/null +++ b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/ProfileCommand/ProfileSptCommand.d.ts @@ -0,0 +1,38 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IProfileChangeEvent } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class ProfileSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + protected profileHelper: ProfileHelper; + /** + * Regex to account for all these cases: + * spt profile level 20 + * spt profile skill metabolism 10 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer, profileHelper: ProfileHelper); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; + protected handleSkillCommand(skill: string, level: number): IProfileChangeEvent; + protected handleLevelCommand(level: number): IProfileChangeEvent; +} diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts new file mode 100644 index 0000000..d84158a --- /dev/null +++ b/TypeScript/9RouterHooks/types/helpers/Dialogue/Commando/SptCommands/TraderCommand/TraderSptCommand.d.ts @@ -0,0 +1,33 @@ +import { SavedCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/GiveCommand/SavedCommand"; +import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand"; +import { ItemHelper } from "@spt-aki/helpers/ItemHelper"; +import { PresetHelper } from "@spt-aki/helpers/PresetHelper"; +import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { LocaleService } from "@spt-aki/services/LocaleService"; +import { MailSendService } from "@spt-aki/services/MailSendService"; +import { HashUtil } from "@spt-aki/utils/HashUtil"; +import { JsonUtil } from "@spt-aki/utils/JsonUtil"; +export declare class TraderSptCommand implements ISptCommand { + protected logger: ILogger; + protected itemHelper: ItemHelper; + protected hashUtil: HashUtil; + protected jsonUtil: JsonUtil; + protected presetHelper: PresetHelper; + protected mailSendService: MailSendService; + protected localeService: LocaleService; + protected databaseServer: DatabaseServer; + /** + * Regex to account for all these cases: + * spt trader prapor rep 100 + * spt trader mechanic spend 1000000 + */ + private static commandRegex; + protected savedCommand: SavedCommand; + constructor(logger: ILogger, itemHelper: ItemHelper, hashUtil: HashUtil, jsonUtil: JsonUtil, presetHelper: PresetHelper, mailSendService: MailSendService, localeService: LocaleService, databaseServer: DatabaseServer); + getCommand(): string; + getCommandHelp(): string; + performAction(commandHandler: IUserDialogInfo, sessionId: string, request: ISendMessageRequest): string; +} diff --git a/TypeScript/9RouterHooks/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts b/TypeScript/9RouterHooks/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts index e1213a2..34c3a79 100644 --- a/TypeScript/9RouterHooks/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/Dialogue/CommandoDialogueChatBot.d.ts @@ -1,15 +1,10 @@ -import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand"; -import { IDialogueChatBot } from "@spt-aki/helpers/Dialogue/IDialogueChatBot"; -import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest"; +import { AbstractDialogueChatBot } from "@spt-aki/helpers/Dialogue/AbstractDialogueChatBot"; +import { IChatCommand } from "@spt-aki/helpers/Dialogue/Commando/IChatCommand"; import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { MailSendService } from "@spt-aki/services/MailSendService"; -export declare class CommandoDialogueChatBot implements IDialogueChatBot { - protected logger: ILogger; - protected mailSendService: MailSendService; - protected commandoCommands: ICommandoCommand[]; - constructor(logger: ILogger, mailSendService: MailSendService, commandoCommands: ICommandoCommand[]); - registerCommandoCommand(commandoCommand: ICommandoCommand): void; +export declare class CommandoDialogueChatBot extends AbstractDialogueChatBot { + constructor(logger: ILogger, mailSendService: MailSendService, chatCommands: IChatCommand[]); getChatBot(): IUserDialogInfo; - handleMessage(sessionId: string, request: ISendMessageRequest): string; + protected getUnrecognizedCommandMessage(): string; } diff --git a/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts index 282b2f0..cd5c2d6 100644 --- a/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/HideoutHelper.d.ts @@ -162,7 +162,7 @@ export declare class HideoutHelper { * @param applyHideoutManagementBonus should the hideout mgmt bonus be appled to the calculation * @returns Items craft time with bonuses subtracted */ - protected getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; + getAdjustedCraftTimeWithSkills(pmcData: IPmcData, recipeId: string, applyHideoutManagementBonus?: boolean): number; /** * Adjust water filter objects resourceValue or delete when they reach 0 resource * @param waterFilterArea water filter area to update diff --git a/TypeScript/9RouterHooks/types/helpers/HttpServerHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/HttpServerHelper.d.ts index d67b4ec..feeaf85 100644 --- a/TypeScript/9RouterHooks/types/helpers/HttpServerHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/HttpServerHelper.d.ts @@ -17,7 +17,7 @@ export declare class HttpServerHelper { constructor(configServer: ConfigServer); getMimeText(key: string): string; /** - * Combine ip and port into url + * Combine ip and port into address * @returns url */ buildUrl(): string; diff --git a/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts index 3e91ef7..9195579 100644 --- a/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts @@ -1,7 +1,7 @@ import { HandbookHelper } from "@spt-aki/helpers/HandbookHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { InsuredItem } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; +import { Item, Repairable, Upd } from "@spt-aki/models/eft/common/tables/IItem"; import { IStaticAmmoDetails } from "@spt-aki/models/eft/common/tables/ILootBase"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; @@ -10,6 +10,7 @@ import { ItemBaseClassService } from "@spt-aki/services/ItemBaseClassService"; import { ItemFilterService } from "@spt-aki/services/ItemFilterService"; import { LocaleService } from "@spt-aki/services/LocaleService"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; +import { CompareUtil } from "@spt-aki/utils/CompareUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { MathUtil } from "@spt-aki/utils/MathUtil"; @@ -28,8 +29,33 @@ export declare class ItemHelper { protected itemFilterService: ItemFilterService; protected localisationService: LocalisationService; protected localeService: LocaleService; + protected compareUtil: CompareUtil; protected readonly defaultInvalidBaseTypes: string[]; - constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService); + constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, objectId: ObjectId, mathUtil: MathUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, localisationService: LocalisationService, localeService: LocaleService, compareUtil: CompareUtil); + /** + * 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 + * @param item1 first item with all its children to compare + * @param item2 second item with all its children to compare + * @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; + /** + * This method will compare two items and see if the are equivalent. + * This method will NOT compare IDs on the items + * @param item1 first item to compare + * @param item2 second item to compare + * @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; + /** + * 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; /** * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash * @param {string} tpl the template id / tpl @@ -363,10 +389,11 @@ export declare class ItemHelper { * Chose a randomly weighted cartridge that fits * @param caliber Desired caliber * @param staticAmmoDist Cartridges and thier weights + * @param fallbackCartridgeTpl If a cartridge cannot be found in the above staticAmmoDist param, use this instead * @param cartridgeWhitelist OPTIONAL whitelist for cartridges * @returns Tpl of cartridge */ - protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, cartridgeWhitelist?: string[]): string; + protected drawAmmoTpl(caliber: string, staticAmmoDist: Record, fallbackCartridgeTpl: string, cartridgeWhitelist?: string[]): string; /** * Create a basic cartrige object * @param parentId container cartridges will be placed in @@ -401,7 +428,7 @@ export declare class ItemHelper { addChildSlotItems(itemToAdd: Item[], itemToAddTemplate: ITemplateItem, modSpawnChanceDict?: Record, requiredOnly?: boolean): Item[]; /** * Get a compatible tpl from the array provided where it is not found in the provided incompatible mod tpls parameter - * @param possibleTpls Tpls to randomply choose from + * @param possibleTpls Tpls to randomly choose from * @param incompatibleModTpls Incompatible tpls to not allow * @returns Chosen tpl or null */ diff --git a/TypeScript/9RouterHooks/types/helpers/PresetHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/PresetHelper.d.ts index 8864999..55a2c12 100644 --- a/TypeScript/9RouterHooks/types/helpers/PresetHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/PresetHelper.d.ts @@ -1,4 +1,5 @@ import { IPreset } from "@spt-aki/models/eft/common/IGlobals"; +import { BaseClasses } from "@spt-aki/models/enums/BaseClasses"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { JsonUtil } from "@spt-aki/utils/JsonUtil"; import { ItemHelper } from "./ItemHelper"; @@ -27,6 +28,13 @@ export declare class PresetHelper { */ getDefaultEquipmentPresets(): Record; isPreset(id: string): boolean; + /** + * Checks to see if the preset is of the given base class. + * @param id The id of the preset + * @param baseClass The BaseClasses enum to check against + * @returns True if the preset is of the given base class, false otherwise + */ + isPresetBaseClass(id: string, baseClass: BaseClasses): boolean; hasPreset(templateId: string): boolean; getPreset(id: string): IPreset; getAllPresets(): IPreset[]; diff --git a/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotType.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotType.d.ts index db6e56e..2a00af9 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotType.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotType.d.ts @@ -109,6 +109,9 @@ export interface GenerationWeightingItems { grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; + currency: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/TypeScript/9RouterHooks/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/tables/IQuest.d.ts index 7e576ce..74af5ef 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/tables/IQuest.d.ts @@ -145,6 +145,7 @@ export interface IQuestReward { target?: string; items?: Item[]; loyaltyLevel?: number; + /** Hideout area id */ traderId?: string; unknown?: boolean; findInRaid?: boolean; diff --git a/TypeScript/9RouterHooks/types/models/eft/dialog/IAcceptFriendRequestData.d.ts b/TypeScript/9RouterHooks/types/models/eft/dialog/IAcceptFriendRequestData.d.ts index 87461aa..0913eb5 100644 --- a/TypeScript/9RouterHooks/types/models/eft/dialog/IAcceptFriendRequestData.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/dialog/IAcceptFriendRequestData.d.ts @@ -2,6 +2,8 @@ export interface IAcceptFriendRequestData extends IBaseFriendRequest { } export interface ICancelFriendRequestData extends IBaseFriendRequest { } -export interface IBaseFriendRequest { - request_id: string; +export interface IDeclineFriendRequestData extends IBaseFriendRequest { +} +export interface IBaseFriendRequest { + profileId: string; } diff --git a/TypeScript/9RouterHooks/types/models/eft/dialog/IFriendRequestSendResponse.d.ts b/TypeScript/9RouterHooks/types/models/eft/dialog/IFriendRequestSendResponse.d.ts index 06c40f3..fc311eb 100644 --- a/TypeScript/9RouterHooks/types/models/eft/dialog/IFriendRequestSendResponse.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/dialog/IFriendRequestSendResponse.d.ts @@ -1,5 +1,5 @@ export interface IFriendRequestSendResponse { status: number; - requestid: string; + requestId: string; retryAfter: number; } diff --git a/TypeScript/9RouterHooks/types/models/eft/profile/IGetOtherProfileResponse.d.ts b/TypeScript/9RouterHooks/types/models/eft/profile/IGetOtherProfileResponse.d.ts index 6c3c9eb..26e43ac 100644 --- a/TypeScript/9RouterHooks/types/models/eft/profile/IGetOtherProfileResponse.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/profile/IGetOtherProfileResponse.d.ts @@ -1,5 +1,5 @@ import { OverallCounters, Skills } from "@spt-aki/models/eft/common/tables/IBotBase"; -import { Item } from "../common/tables/IItem"; +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; export interface IGetOtherProfileResponse { id: string; aid: number; diff --git a/TypeScript/9RouterHooks/types/models/eft/profile/ISearchFriendResponse.d.ts b/TypeScript/9RouterHooks/types/models/eft/profile/ISearchFriendResponse.d.ts index 96d88b2..d3cc7df 100644 --- a/TypeScript/9RouterHooks/types/models/eft/profile/ISearchFriendResponse.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/profile/ISearchFriendResponse.d.ts @@ -1,9 +1,11 @@ export interface ISearchFriendResponse { _id: string; + aid: number; Info: Info; } export interface Info { Nickname: string; Side: string; Level: number; + MemberCategory: number; } diff --git a/TypeScript/9RouterHooks/types/models/enums/AmmoTypes.d.ts b/TypeScript/9RouterHooks/types/models/enums/AmmoTypes.d.ts index 6aa332b..51ea4bb 100644 --- a/TypeScript/9RouterHooks/types/models/enums/AmmoTypes.d.ts +++ b/TypeScript/9RouterHooks/types/models/enums/AmmoTypes.d.ts @@ -216,3 +216,7 @@ export declare enum Ammo26x75 { WHITE_FLARE = "62389bc9423ed1685422dc57", YELLOW_FLARE = "62389be94d5d474bf712e709" } +export declare enum Ammo68x51 { + SIG_FMJ = "6529302b8c26af6326029fb7", + SIG_HYBRID = "6529243824cbe3c74a05e5c1" +} diff --git a/TypeScript/9RouterHooks/types/models/enums/WeaponTypes.d.ts b/TypeScript/9RouterHooks/types/models/enums/WeaponTypes.d.ts index 867b052..b01dd66 100644 --- a/TypeScript/9RouterHooks/types/models/enums/WeaponTypes.d.ts +++ b/TypeScript/9RouterHooks/types/models/enums/WeaponTypes.d.ts @@ -1,5 +1,6 @@ export declare enum Weapons127x55 { - ASH_12 = "5cadfbf7ae92152ac412eeef" + ASH_12 = "5cadfbf7ae92152ac412eeef", + RSH_12 = "633ec7c2a6918cb895019c6c" } export declare enum Weapons86x70 { MK_18 = "5fc22d7c187fea44d52eda44", @@ -7,14 +8,20 @@ export declare enum Weapons86x70 { } export declare enum Weapons9x39 { AS_VAL = "57c44b372459772d2b39b8ce", - VSS_VINTOREZ = "57838ad32459774a17445cd2" + VSS_VINTOREZ = "57838ad32459774a17445cd2", + KBP_9A_91 = "644674a13d52156624001fbc", + VSK_94 = "645e0c6b3b381ede770e1cc9" } export declare enum Weapons762x54R { SVDS = "5c46fbd72e2216398b5a8c9c", MP_18 = "61f7c9e189e6fb1a5e3ea78d", MOSIN_INFANTRY = "5bfd297f0db834001a669119", MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1", - SV_98 = "55801eed4bdc2d89578b4588" + SV_98 = "55801eed4bdc2d89578b4588", + AVT_40 = "6410733d5dd49d77bd07847e", + SVT_40 = "643ea5b23db6f9f57107d9fd", + PKM = "64637076203536ad5600c990", + PKP = "64ca3d3954fc657e230529cc" } export declare enum Weapons762x51 { VPO_101 = "5c501a4d2e221602b412b540", @@ -46,7 +53,9 @@ export declare enum Weapons762x39 { AKMSN = "5abcbc27d8ce8700182eceeb", MK47_MUTANT = "606587252535c57a13424cfd", RD_704 = "628a60ae6b1d481ff772e9c8", - VPO_136 = "59e6152586f77473dc057aa1" + VPO_136 = "59e6152586f77473dc057aa1", + RPD = "6513ef33e06849f06c0957ca", + RPDN = "65268d8ecb944ff1e90ea385" } export declare enum Weapons762x35 { MCX = "5fbcc1d9016cce60e8341ab3" @@ -61,7 +70,9 @@ export declare enum Weapons556x45 { M4A1 = "5447a9cd4bdc2dbd208b4567", SCARL_BLACK = "6184055050224f204c1da540", SCARL_FDE = "618428466ef05c2ce828f218", - TX15_DML = "5d43021ca4b9362eab4b5e25" + TX15_DML = "5d43021ca4b9362eab4b5e25", + AUG_A1 = "62e7c4fba689e8c9c50dfc38", + AUG_A3 = "63171672192e68c5460cebc5" } export declare enum Weapons545x39 { AK_105 = "5ac66d9b5acfc4001633997a", @@ -75,7 +86,8 @@ export declare enum Weapons545x39 { AKS_74UN = "583990e32459771419544dd2", SAG_AK = "628b5638ad252a16da6dd245", SAG_AK_SHORT = "628b9c37a733087d0d7fe84b", - RPK_16 = "5beed0f50db834001c062b12" + RPK_16 = "5beed0f50db834001c062b12", + AK_12 = "6499849fc93611967b034949" } export declare enum Weapons57x28FN { FN_57_BLACK = "5d3eb3b0a4b93615055e84d2", @@ -97,7 +109,8 @@ export declare enum Weapons9x33R { CR_50DS = "61a4c8884f95bc3b2c5dc96f" } export declare enum Weapons9x21 { - SR_1MP = "59f98b4986f7746f546d2cef" + SR_1MP = "59f98b4986f7746f546d2cef", + SR_2M = "62e14904c2699c0ec93adc47" } export declare enum Weapons9x19 { GLOCK_17 = "5a7ae0c351dfba0017554310", @@ -115,7 +128,8 @@ export declare enum Weapons9x19 { PP_19_01 = "59984ab886f7743e98271174", SAIGA_9 = "59f9cabd86f7743a10721f46", STM_9 = "60339954d62c9b14ed777c06", - VECTOR_9MM = "5fc3f2d5900b1d5091531e57" + VECTOR_9MM = "5fc3f2d5900b1d5091531e57", + GLOCK_19X = "63088377b5cd696784087147" } export declare enum Weapons9x18 { APB = "5abccb7dd8ce87001773e277", @@ -149,3 +163,10 @@ export declare enum Weapons20Gauge { export declare enum Weapons23x75 { KS_23M = "5e848cc2988a8701445df1e8" } +export declare enum Weapons68x51 { + MCX_SPEAR = "65290f395ae2ae97b80fdf2d" +} +export declare enum Weapons40x46 { + M32A1 = "6275303a9f372d6ea97f9ec7", + FN40GL = "5e81ebcd8e146c7080625e15" +} diff --git a/TypeScript/9RouterHooks/types/models/spt/bots/IBotLootCache.d.ts b/TypeScript/9RouterHooks/types/models/spt/bots/IBotLootCache.d.ts index 54c9ff7..529c2cd 100644 --- a/TypeScript/9RouterHooks/types/models/spt/bots/IBotLootCache.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/bots/IBotLootCache.d.ts @@ -7,6 +7,9 @@ export interface IBotLootCache { specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; + currencyItems: Record; stimItems: Record; grenadeItems: Record; } @@ -20,5 +23,8 @@ export declare enum LootCacheType { HEALING_ITEMS = "HealingItems", DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", - GRENADE_ITEMS = "GrenadeItems" + GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems", + CURRENCY_ITEMS = "CurrencyItems" } diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts index d326b38..8edc3df 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts @@ -167,11 +167,8 @@ export interface IAdjustmentDetails { add: Record>; edit: Record>; } -export interface IArmorPlateWeights { +export interface IArmorPlateWeights extends Record { levelRange: MinMax; - frontPlateWeights: Record; - backPlateWeights: Record; - sidePlateWeights: Record; } export interface IRandomisedResourceDetails { food: IRandomisedResourceValues; diff --git a/TypeScript/9RouterHooks/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/ICoreConfig.d.ts index 74604b0..c3bd01c 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/ICoreConfig.d.ts @@ -7,6 +7,7 @@ export interface ICoreConfig extends IBaseConfig { serverName: string; profileSaveIntervalSeconds: number; sptFriendNickname: string; + allowProfileWipe: boolean; bsgLogging: IBsgLogging; release: IRelease; fixes: IGameFixes; diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IHideoutConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IHideoutConfig.d.ts index 249c79a..6b07c34 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IHideoutConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IHideoutConfig.d.ts @@ -7,4 +7,8 @@ export interface IHideoutConfig extends IBaseConfig { runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; + /** Only process a profiles hideout crafts when it has been active in the last x minutes */ + updateProfileHideoutWhenActiveWithinMinutes: number; } diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IHttpConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IHttpConfig.d.ts index 9007245..e7123fc 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IHttpConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IHttpConfig.d.ts @@ -1,9 +1,13 @@ import { IBaseConfig } from "@spt-aki/models/spt/config/IBaseConfig"; export interface IHttpConfig extends IBaseConfig { - webSocketPingDelayMs: number; kind: "aki-http"; + /** Address used by webserver */ ip: string; port: number; + /** Address used by game client to connect to */ + backendIp: string; + backendPort: string; + webSocketPingDelayMs: number; logRequests: boolean; /** e.g. "Aki_Data/Server/images/traders/579dc571d53a0658a154fbec.png": "Aki_Data/Server/images/traders/NewTraderImage.png" */ serverImagePathOverride: Record; diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IInRaidConfig.d.ts index cc6feca..47023bf 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IInRaidConfig.d.ts @@ -36,5 +36,4 @@ export interface RaidMenuSettings { export interface Save { /** Should loot gained from raid be saved */ loot: boolean; - durability: boolean; } diff --git a/TypeScript/9RouterHooks/types/models/spt/config/ILocationConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/ILocationConfig.d.ts index 407bef4..400284c 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/ILocationConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/ILocationConfig.d.ts @@ -34,8 +34,10 @@ export interface ILocationConfig extends IBaseConfig { /** How full must a random static magazine be %*/ minFillStaticMagazinePercent: number; allowDuplicateItemsInStaticContainers: boolean; - /** Chance loose/static magazines have ammo in them */ + /** Chance loose magazines have ammo in them TODO - rename to dynamicMagazineLootHasAmmoChancePercent */ magazineLootHasAmmoChancePercent: number; + /** Chance static magazines have ammo in them */ + staticMagazineLootHasAmmoChancePercent: number; /** Key: map, value: loose loot ids to ignore */ looseLootBlacklist: Record; /** Key: map, value: settings to control how long scav raids are*/ diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IPmcConfig.d.ts index 65da29b..f17d3e4 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IPmcConfig.d.ts @@ -46,6 +46,8 @@ export interface IPmcConfig extends IBaseConfig { /** Force a number of healing items into PMCs secure container to ensure they can heal */ forceHealingItemsIntoSecure: boolean; allPMCsHavePlayerNameWithRandomPrefixChance: number; + /** Should secure container loot from usec.json/bear.json be added to pmc bots secure */ + addSecureContainerLootFromBotConfig: boolean; } export interface PmcTypes { usec: string; diff --git a/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts index 73bd5a8..aca6452 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts @@ -40,6 +40,8 @@ export interface FenceConfig { presetSlotsToRemoveChancePercent: Record; /** Block seasonal items from appearing when season is inactive */ blacklistSeasonalItems: boolean; + /** Max pen value allowed to be listed on flea - affects ammo + ammo boxes */ + ammoMaxPenLimit: number; blacklist: string[]; coopExtractGift: CoopExtractReward; btrDeliveryExpireHours: number; diff --git a/TypeScript/9RouterHooks/types/models/spt/dialog/ISendMessageDetails.d.ts b/TypeScript/9RouterHooks/types/models/spt/dialog/ISendMessageDetails.d.ts index 2068ede..05b3bcd 100644 --- a/TypeScript/9RouterHooks/types/models/spt/dialog/ISendMessageDetails.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/dialog/ISendMessageDetails.d.ts @@ -30,7 +30,15 @@ export interface ISendMessageDetails { } export interface IProfileChangeEvent { _id: string; - Type: "TraderSalesSum" | "TraderStanding" | "ProfileLevel" | "SkillPoints" | "ExamineAllItems" | "UnlockTrader"; + Type: ProfileChangeEventType; value: number; entity?: string; } +export declare enum ProfileChangeEventType { + TRADER_SALES_SUM = "TraderSalesSum", + TRADER_STANDING = "TraderStanding", + PROFILE_LEVEL = "ProfileLevel", + SKILL_POINTS = "SkillPoints", + EXAMINE_ALL_ITEMS = "ExamineAllItems", + UNLOCK_TRADER = "UnlockTrader" +} diff --git a/TypeScript/9RouterHooks/types/models/spt/fence/ICreateFenceAssortsResult.d.ts b/TypeScript/9RouterHooks/types/models/spt/fence/ICreateFenceAssortsResult.d.ts new file mode 100644 index 0000000..8b90799 --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/spt/fence/ICreateFenceAssortsResult.d.ts @@ -0,0 +1,7 @@ +import { Item } from "@spt-aki/models/eft/common/tables/IItem"; +import { IBarterScheme } from "@spt-aki/models/eft/common/tables/ITrader"; +export interface ICreateFenceAssortsResult { + sptItems: Item[][]; + barter_scheme: Record; + loyal_level_items: Record; +} diff --git a/TypeScript/9RouterHooks/types/servers/HttpServer.d.ts b/TypeScript/9RouterHooks/types/servers/HttpServer.d.ts index 8574cdd..bcd740f 100644 --- a/TypeScript/9RouterHooks/types/servers/HttpServer.d.ts +++ b/TypeScript/9RouterHooks/types/servers/HttpServer.d.ts @@ -19,11 +19,19 @@ export declare class HttpServer { protected applicationContext: ApplicationContext; protected webSocketServer: WebSocketServer; protected httpConfig: IHttpConfig; + protected started: boolean; constructor(logger: ILogger, databaseServer: DatabaseServer, httpServerHelper: HttpServerHelper, localisationService: LocalisationService, httpListeners: IHttpListener[], configServer: ConfigServer, applicationContext: ApplicationContext, webSocketServer: WebSocketServer); /** * Handle server loading event */ load(): void; protected handleRequest(req: IncomingMessage, resp: ServerResponse): void; + /** + * Check against hardcoded values that determine its from a local address + * @param remoteAddress Address to check + * @returns True if its local + */ + protected isLocalRequest(remoteAddress: string): boolean; protected getCookies(req: IncomingMessage): Record; + isStarted(): boolean; } diff --git a/TypeScript/9RouterHooks/types/services/BotLootCacheService.d.ts b/TypeScript/9RouterHooks/types/services/BotLootCacheService.d.ts index b013e5e..7f79bfe 100644 --- a/TypeScript/9RouterHooks/types/services/BotLootCacheService.d.ts +++ b/TypeScript/9RouterHooks/types/services/BotLootCacheService.d.ts @@ -69,6 +69,9 @@ export declare class BotLootCacheService { * @returns */ protected isGrenade(props: Props): boolean; + protected isFood(tpl: string): boolean; + protected isDrink(tpl: string): boolean; + protected isCurrency(tpl: string): boolean; /** * Check if a bot type exists inside the loot cache * @param botRole role to check for diff --git a/TypeScript/9RouterHooks/types/services/FenceService.d.ts b/TypeScript/9RouterHooks/types/services/FenceService.d.ts index bb1d035..75c4b28 100644 --- a/TypeScript/9RouterHooks/types/services/FenceService.d.ts +++ b/TypeScript/9RouterHooks/types/services/FenceService.d.ts @@ -7,6 +7,7 @@ import { Item, Repairable } from "@spt-aki/models/eft/common/tables/IItem"; import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { IBarterScheme, ITraderAssort } from "@spt-aki/models/eft/common/tables/ITrader"; import { IItemDurabilityCurrentMax, ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig"; +import { ICreateFenceAssortsResult } from "@spt-aki/models/spt/fence/ICreateFenceAssortsResult"; import { IFenceAssortGenerationValues, IGenerationAssortValues } from "@spt-aki/models/spt/fence/IFenceAssortGenerationValues"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; @@ -37,14 +38,30 @@ export declare class FenceService { protected fenceAssort: ITraderAssort; /** Assorts shown on a separate tab when you max out fence rep */ protected fenceDiscountAssort: ITraderAssort; - /** Hydrated on initial assort generation as part of generateFenceAssorts() */ + /** Desired baseline counts - Hydrated on initial assort generation as part of generateFenceAssorts() */ protected desiredAssortCounts: IFenceAssortGenerationValues; + protected fenceItemUpdCompareProperties: Set; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer); /** * Replace main fence assort with new assort * @param assort New assorts to replace old with */ setFenceAssort(assort: ITraderAssort): void; + /** + * Replace discount fence assort with new assort + * @param assort New assorts to replace old with + */ + setDiscountFenceAssort(assort: ITraderAssort): void; + /** + * Get main fence assort + * @return ITraderAssort + */ + getMainFenceAssort(): ITraderAssort; + /** + * Get discount fence assort + * @return ITraderAssort + */ + getDiscountFenceAssort(): ITraderAssort; /** * Replace high rep level fence assort with new assort * @param discountAssort New assorts to replace old with @@ -57,6 +74,26 @@ export declare class FenceService { * @returns ITraderAssort */ getFenceAssorts(pmcProfile: IPmcData): ITraderAssort; + /** + * Adds to fence assort a single item (with its children) + * @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; + /** + * 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; + /** + * 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; /** * Adjust all items contained inside an assort by a multiplier * @param assort (clone)Assort that contains items with prices to adjust @@ -93,17 +130,23 @@ export declare class FenceService { * Replace a percentage of fence assorts with freshly generated items */ performPartialRefresh(): void; + /** + * Handle the process of folding new assorts into existing assorts, when a new assort exists already, increment its StackObjectsCount instead + * @param newFenceAssorts Assorts to fold into existing fence assorts + * @param existingFenceAssorts Current fence assorts new assorts will be added to + */ + protected updateFenceAssorts(newFenceAssorts: ICreateFenceAssortsResult, existingFenceAssorts: ITraderAssort): void; /** * Increment fence next refresh timestamp by current timestamp + partialRefreshTimeSeconds from config */ protected incrementPartialRefreshTime(): void; /** - * Compare the current fence offer count to what the config wants it to be, - * If value is lower add extra count to value to generate more items to fill gap - * @param existingItemCountToReplace count of items to generate - * @returns number of items to generate + * Get values that will hydrate the passed in assorts back to the desired counts + * @param assortItems Current assorts after items have been removed + * @param generationValues Base counts assorts should be adjusted to + * @returns IGenerationAssortValues object with adjustments needed to reach desired state */ - protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues; + protected getItemCountsToGenerate(assortItems: Item[], generationValues: IGenerationAssortValues): IGenerationAssortValues; /** * Delete desired number of items from assort (including children) * @param itemCountToReplace @@ -112,8 +155,8 @@ export declare class FenceService { protected deleteRandomAssorts(itemCountToReplace: number, assort: ITraderAssort): void; /** * Choose an item at random and remove it + mods from assorts - * @param assort Items to remove from - * @param rootItems Assort root items to pick from to remove + * @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; /** @@ -132,6 +175,12 @@ export declare class FenceService { * Uses fence base cache generatedon server start as a base */ generateFenceAssorts(): void; + /** + * Convert the intermediary assort data generated into format client can process + * @param intermediaryAssorts Generated assorts that will be converted + * @returns ITraderAssort + */ + protected convertIntoFenceAssort(intermediaryAssorts: ICreateFenceAssortsResult): ITraderAssort; /** * Create object that contains calculated fence assort item values to make based on config * Stored in this.desiredAssortCounts @@ -147,7 +196,7 @@ export declare class FenceService { * @param assortCount Number of assorts to generate * @param assorts object to add created assorts to */ - protected createAssorts(itemCounts: IGenerationAssortValues, assorts: ITraderAssort, loyaltyLevel: number): void; + protected createAssorts(itemCounts: IGenerationAssortValues, loyaltyLevel: number): ICreateFenceAssortsResult; /** * Add item assorts to existing assort data * @param assortCount Number to add @@ -156,7 +205,7 @@ export declare class FenceService { * @param itemTypeLimits * @param loyaltyLevel Loyalty level to set new item to */ - protected addItemAssorts(assortCount: number, assorts: ITraderAssort, baseFenceAssortClone: ITraderAssort, itemTypeLimits: Record, loyaltyLevel: number): void; @@ -165,10 +214,10 @@ export declare class FenceService { * e.g. salewa hp resource units left * @param rootItemBeingAdded item to look for a match against * @param itemDbDetails Db details of matching item - * @param fenceItemAssorts Items to search through + * @param itemsWithChildren Items to search through * @returns Matching assort item */ - protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, fenceItemAssorts: Item[]): Item; + protected getMatchingItem(rootItemBeingAdded: Item, itemDbDetails: ITemplateItem, itemsWithChildren: Item[][]): Item; /** * Should this item be forced into only 1 stack on fence * @param existingItem Existing item from fence assort @@ -176,6 +225,7 @@ export declare class FenceService { * @returns True item should be force stacked */ protected itemShouldBeForceStacked(existingItem: Item, itemDbDetails: ITemplateItem): boolean; + protected itemInPreventDupeCategoryList(tpl: string): boolean; /** * Adjust price of item based on what is left to buy (resource/uses left) * @param barterSchemes All barter scheme for item having price adjusted @@ -197,7 +247,7 @@ export declare class FenceService { * @param baseFenceAssort Base data to draw from * @param loyaltyLevel Which loyalty level is required to see/buy item */ - protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ITraderAssort, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; + protected addPresetsToAssort(desiredWeaponPresetsCount: number, desiredEquipmentPresetsCount: number, assorts: ICreateFenceAssortsResult, baseFenceAssort: ITraderAssort, loyaltyLevel: number): void; /** * Adjust plate / soft insert durability values * @param armor Armor item array to add mods into diff --git a/TypeScript/9RouterHooks/types/services/ItemBaseClassService.d.ts b/TypeScript/9RouterHooks/types/services/ItemBaseClassService.d.ts index 83994ad..8a5b5c5 100644 --- a/TypeScript/9RouterHooks/types/services/ItemBaseClassService.d.ts +++ b/TypeScript/9RouterHooks/types/services/ItemBaseClassService.d.ts @@ -10,6 +10,7 @@ export declare class ItemBaseClassService { protected localisationService: LocalisationService; protected databaseServer: DatabaseServer; protected itemBaseClassesCache: Record; + protected items: Record; protected cacheGenerated: boolean; constructor(logger: ILogger, localisationService: LocalisationService, databaseServer: DatabaseServer); /** @@ -21,9 +22,8 @@ export declare class ItemBaseClassService { * Helper method, recursivly iterate through items parent items, finding and adding ids to dictionary * @param itemIdToUpdate item tpl to store base ids against in dictionary * @param item item being checked - * @param allDbItems all items in db */ - protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem, allDbItems: Record): void; + protected addBaseItems(itemIdToUpdate: string, item: ITemplateItem): void; /** * Does item tpl inherit from the requested base class * @param itemTpl item to check base classes of @@ -31,6 +31,12 @@ export declare class ItemBaseClassService { * @returns true if item inherits from base class passed in */ itemHasBaseClass(itemTpl: string, baseClasses: string[]): boolean; + /** + * Check if cached item template is of type Item + * @param itemTemplateId item to check + * @returns true if item is of type Item + */ + private cachedItemIsOfItemType; /** * Get base classes item inherits from * @param itemTpl item to get base classes for diff --git a/TypeScript/9RouterHooks/types/services/MailSendService.d.ts b/TypeScript/9RouterHooks/types/services/MailSendService.d.ts index 08752bf..e5643f9 100644 --- a/TypeScript/9RouterHooks/types/services/MailSendService.d.ts +++ b/TypeScript/9RouterHooks/types/services/MailSendService.d.ts @@ -7,7 +7,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Dialogue, IUserDialogInfo, Message, MessageItems } from "@spt-aki/models/eft/profile/IAkiProfile"; import { MessageType } from "@spt-aki/models/enums/MessageType"; import { Traders } from "@spt-aki/models/enums/Traders"; -import { ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; +import { IProfileChangeEvent, ISendMessageDetails } from "@spt-aki/models/spt/dialog/ISendMessageDetails"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { SaveServer } from "@spt-aki/servers/SaveServer"; @@ -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?: any): void; + sendSystemMessageToPlayer(sessionId: string, message: string, items?: Item[], 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?: any[], maxStorageTimeSeconds?: any): void; + sendLocalisedSystemMessageToPlayer(sessionId: string, messageLocaleId: string, items?: Item[], 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 diff --git a/TypeScript/9RouterHooks/types/services/PaymentService.d.ts b/TypeScript/9RouterHooks/types/services/PaymentService.d.ts index 84d9244..0df23b4 100644 --- a/TypeScript/9RouterHooks/types/services/PaymentService.d.ts +++ b/TypeScript/9RouterHooks/types/services/PaymentService.d.ts @@ -60,7 +60,7 @@ export declare class PaymentService { */ addPaymentToOutput(pmcData: IPmcData, currencyTpl: string, amountToPay: number, sessionID: string, output: IItemEventRouterResponse): void; /** - * Get all money stacks in inventory and prioritse items in stash + * Get all money stacks in inventory and prioritise items in stash * @param pmcData * @param currencyTpl * @param playerStashId Players stash id diff --git a/TypeScript/9RouterHooks/types/services/ProfileActivityService.d.ts b/TypeScript/9RouterHooks/types/services/ProfileActivityService.d.ts new file mode 100644 index 0000000..fdc86c7 --- /dev/null +++ b/TypeScript/9RouterHooks/types/services/ProfileActivityService.d.ts @@ -0,0 +1,21 @@ +export declare class ProfileActivityService { + protected profileActivityTimestamps: Record; + /** + * Was the requested profile active in the last requested minutes + * @param sessionId Profile to check + * @param minutes Minutes to check for activity in + * @returns True when profile was active within past x minutes + */ + activeWithinLastMinutes(sessionId: string, minutes: number): boolean; + /** + * Get an array of profile ids that were active in the last x minutes + * @param minutes How many minutes from now to search for profiles + * @returns String array of profile ids + */ + getActiveProfileIdsWithinMinutes(minutes: number): string[]; + /** + * Update the timestamp a profile was last observed active + * @param sessionId Profile to update + */ + setActivityTimestamp(sessionId: string): void; +} diff --git a/TypeScript/9RouterHooks/types/services/ProfileFixerService.d.ts b/TypeScript/9RouterHooks/types/services/ProfileFixerService.d.ts index 804b3bf..1045d0a 100644 --- a/TypeScript/9RouterHooks/types/services/ProfileFixerService.d.ts +++ b/TypeScript/9RouterHooks/types/services/ProfileFixerService.d.ts @@ -6,8 +6,9 @@ import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { Bonus, HideoutSlot } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; import { StageBonus } from "@spt-aki/models/eft/hideout/IHideoutArea"; -import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile"; +import { IAkiProfile, IEquipmentBuild, IMagazineBuild, IWeaponBuild } from "@spt-aki/models/eft/profile/IAkiProfile"; import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; @@ -119,6 +120,19 @@ export declare class ProfileFixerService { * @param pmcProfile Profile to check inventory of */ checkForOrphanedModdedItems(sessionId: string, fullProfile: IAkiProfile): void; + /** + * @param buildType The type of build, used for logging only + * @param build The build to check for invalid items + * @param itemsDb The items database to use for item lookup + * @returns True if the build should be removed from the build list, false otherwise + */ + protected shouldRemoveWeaponEquipmentBuild(buildType: string, build: IWeaponBuild | IEquipmentBuild, itemsDb: Record): boolean; + /** + * @param magazineBuild The magazine build to check for validity + * @param itemsDb The items database to use for item lookup + * @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 @@ -155,6 +169,10 @@ export declare class ProfileFixerService { * @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 @@ -165,4 +183,9 @@ export declare class ProfileFixerService { * @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 null + */ + protected fixNullTraderNextResupply(pmcProfile: IPmcData): void; } diff --git a/TypeScript/9RouterHooks/types/services/RagfairPriceService.d.ts b/TypeScript/9RouterHooks/types/services/RagfairPriceService.d.ts index 5649751..0fefdd8 100644 --- a/TypeScript/9RouterHooks/types/services/RagfairPriceService.d.ts +++ b/TypeScript/9RouterHooks/types/services/RagfairPriceService.d.ts @@ -45,7 +45,7 @@ export declare class RagfairPriceService implements OnLoad { /** * Create a dictionary and store prices from prices.json in it */ - protected generateDynamicPrices(): void; + generateDynamicPrices(): void; /** * Get the dynamic price for an item. If value doesn't exist, use static (handbook) value. * if no static value, return 1 @@ -99,6 +99,15 @@ export declare class RagfairPriceService implements OnLoad { * @returns cost of item in desired currency */ getDynamicOfferPriceForOffer(offerItems: Item[], desiredCurrency: string, isPackOffer: boolean): number; + /** + * @param itemTemplateId + * @param desiredCurrency + * @param item + * @param offerItems + * @param isPackOffer + * @returns + */ + getDynamicItemPrice(itemTemplateId: string, desiredCurrency: string, item?: Item, offerItems?: Item[], 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 diff --git a/TypeScript/9RouterHooks/types/utils/App.d.ts b/TypeScript/9RouterHooks/types/utils/App.d.ts index 64800ce..12a29bd 100644 --- a/TypeScript/9RouterHooks/types/utils/App.d.ts +++ b/TypeScript/9RouterHooks/types/utils/App.d.ts @@ -3,6 +3,7 @@ import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { ICoreConfig } from "@spt-aki/models/spt/config/ICoreConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { HttpServer } from "@spt-aki/servers/HttpServer"; import { LocalisationService } from "@spt-aki/services/LocalisationService"; import { EncodingUtil } from "@spt-aki/utils/EncodingUtil"; import { TimeUtil } from "@spt-aki/utils/TimeUtil"; @@ -12,11 +13,12 @@ export declare class App { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected encodingUtil: EncodingUtil; + protected httpServer: HttpServer; protected onLoadComponents: OnLoad[]; protected onUpdateComponents: OnUpdate[]; protected onUpdateLastRun: {}; protected coreConfig: ICoreConfig; - constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); + constructor(logger: ILogger, timeUtil: TimeUtil, localisationService: LocalisationService, configServer: ConfigServer, encodingUtil: EncodingUtil, httpServer: HttpServer, onLoadComponents: OnLoad[], onUpdateComponents: OnUpdate[]); load(): Promise; protected update(onUpdateComponents: OnUpdate[]): Promise; protected logUpdateException(err: any, updateable: OnUpdate): void; diff --git a/TypeScript/9RouterHooks/types/utils/CompareUtil.d.ts b/TypeScript/9RouterHooks/types/utils/CompareUtil.d.ts new file mode 100644 index 0000000..a5b94d5 --- /dev/null +++ b/TypeScript/9RouterHooks/types/utils/CompareUtil.d.ts @@ -0,0 +1,11 @@ +export declare class CompareUtil { + private static typesToCheckAgainst; + /** + * This function does an object comparison, equivalent to applying reflections + * and scanning for all possible properties including arrays. + * @param v1 value 1 to compare + * @param v2 value 2 to compare + * @returns true if equal, false if not + */ + recursiveCompare(v1: any, v2: any): boolean; +} diff --git a/TypeScript/9RouterHooks/types/utils/RagfairOfferHolder.d.ts b/TypeScript/9RouterHooks/types/utils/RagfairOfferHolder.d.ts index 3942ed1..b95e54a 100644 --- a/TypeScript/9RouterHooks/types/utils/RagfairOfferHolder.d.ts +++ b/TypeScript/9RouterHooks/types/utils/RagfairOfferHolder.d.ts @@ -1,9 +1,12 @@ +import { RagfairServerHelper } from "@spt-aki/helpers/RagfairServerHelper"; import { IRagfairOffer } from "@spt-aki/models/eft/ragfair/IRagfairOffer"; export declare class RagfairOfferHolder { + protected maxOffersPerTemplate: number; + protected ragfairServerHelper: RagfairServerHelper; protected offersById: Map; protected offersByTemplate: Map>; protected offersByTrader: Map>; - constructor(); + constructor(maxOffersPerTemplate: number, ragfairServerHelper: RagfairServerHelper); getOfferById(id: string): IRagfairOffer; getOffersByTemplate(templateId: string): Array; getOffersByTrader(traderId: string): Array; diff --git a/TypeScript/9RouterHooks/types/utils/logging/AbstractWinstonLogger.d.ts b/TypeScript/9RouterHooks/types/utils/logging/AbstractWinstonLogger.d.ts index 11179b0..05d5afe 100644 --- a/TypeScript/9RouterHooks/types/utils/logging/AbstractWinstonLogger.d.ts +++ b/TypeScript/9RouterHooks/types/utils/logging/AbstractWinstonLogger.d.ts @@ -48,6 +48,7 @@ export declare abstract class AbstractWinstonLogger implements ILogger { protected abstract isLogExceptions(): boolean; protected abstract getFilePath(): string; protected abstract getFileName(): string; + protected getLogFrequency(): string; protected getLogMaxSize(): string; protected getLogMaxFiles(): string; writeToLogFile(data: string | Daum): Promise;