From 0be02bc3f55a66eebae3c9eb34747d2afc57e922 Mon Sep 17 00:00:00 2001 From: Chomp Date: Sat, 28 Jun 2025 09:27:41 +0100 Subject: [PATCH] Created `ProfileExtensions` --- .../Controllers/GameController.cs | 8 +- .../Extensions/FullProfileExtensions.cs | 214 +++++++++++++++++- .../Extensions/ProfileExtensions.cs | 66 ++++++ .../Helpers/HideoutHelper.cs | 26 --- .../Helpers/PrestigeHelper.cs | 7 +- .../Helpers/ProfileHelper.cs | 32 --- .../Helpers/TraderHelper.cs | 33 +-- .../Services/CreateProfileService.cs | 172 +------------- .../Services/LocationLifecycleService.cs | 20 +- .../Services/ProfileFixerService.cs | 9 +- 10 files changed, 301 insertions(+), 286 deletions(-) create mode 100644 Libraries/SPTarkov.Server.Core/Extensions/ProfileExtensions.cs diff --git a/Libraries/SPTarkov.Server.Core/Controllers/GameController.cs b/Libraries/SPTarkov.Server.Core/Controllers/GameController.cs index 607b9882..7b91e529 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/GameController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/GameController.cs @@ -1,4 +1,5 @@ using SPTarkov.DI.Annotations; +using SPTarkov.Server.Core.Extensions; using SPTarkov.Server.Core.Helpers; using SPTarkov.Server.Core.Models.Eft.Common; using SPTarkov.Server.Core.Models.Eft.Game; @@ -135,9 +136,12 @@ public class GameController( if (pmcProfile.Hideout is not null) { - _profileFixerService.AddMissingHideoutBonusesToProfile(pmcProfile); + _profileFixerService.AddMissingHideoutBonusesToProfile( + pmcProfile, + _databaseService.GetHideout().Areas + ); _hideoutHelper.SetHideoutImprovementsToCompleted(pmcProfile); - _hideoutHelper.UnlockHideoutWallInProfile(pmcProfile); + pmcProfile.UnlockHideoutWallInProfile(); // Handle if player has been inactive for a long time, catch up on hideout update before the user goes to his hideout if ( diff --git a/Libraries/SPTarkov.Server.Core/Extensions/FullProfileExtensions.cs b/Libraries/SPTarkov.Server.Core/Extensions/FullProfileExtensions.cs index df5e8429..45db2338 100644 --- a/Libraries/SPTarkov.Server.Core/Extensions/FullProfileExtensions.cs +++ b/Libraries/SPTarkov.Server.Core/Extensions/FullProfileExtensions.cs @@ -1,4 +1,6 @@ -using SPTarkov.Server.Core.Models.Eft.Profile; +using SPTarkov.Server.Core.Models.Eft.Common.Tables; +using SPTarkov.Server.Core.Models.Eft.Profile; +using SPTarkov.Server.Core.Models.Enums; namespace SPTarkov.Server.Core.Extensions { @@ -15,5 +17,215 @@ namespace SPTarkov.Server.Core.Extensions fullProfile.VitalityData.Energy = energy; fullProfile.VitalityData.Temperature = temperature; } + + /// + /// Add a list of suit ids to a profiles suit list, no duplicates + /// + /// Profile to add clothing to + /// Clothing Ids to add to profile + public static void AddSuitsToProfile(this SptProfile fullProfile, List clothingIds) + { + fullProfile.CustomisationUnlocks ??= []; + + foreach (var suitId in clothingIds) + { + if ( + !fullProfile.CustomisationUnlocks.Exists(customisation => + customisation.Id == suitId + ) + ) + { + // Clothing item doesn't exist in profile, add it + fullProfile.CustomisationUnlocks.Add( + new CustomisationStorage + { + Id = suitId, + Source = CustomisationSource.UNLOCKED_IN_GAME, + Type = CustomisationType.SUITE, + } + ); + } + } + } + + /// + /// Add customisations to game profiles based on game edition + /// + /// Profile to add customisations to + public static void AddCustomisationUnlocksToProfile(this SptProfile fullProfile) + { + // Some game versions have additional customisation unlocks + var gameEdition = fullProfile.GetGameEdition(); + + switch (gameEdition) + { + case GameEditions.EDGE_OF_DARKNESS: + // Gets EoD tags + fullProfile.CustomisationUnlocks.Add( + new CustomisationStorage + { + Id = "6746fd09bafff85008048838", + Source = CustomisationSource.DEFAULT, + Type = CustomisationType.DOG_TAG, + } + ); + + fullProfile.CustomisationUnlocks.Add( + new CustomisationStorage + { + Id = "67471938bafff850080488b7", + Source = CustomisationSource.DEFAULT, + Type = CustomisationType.DOG_TAG, + } + ); + + break; + case GameEditions.UNHEARD: + // Gets EoD+Unheard tags + fullProfile.CustomisationUnlocks.Add( + new CustomisationStorage + { + Id = "6746fd09bafff85008048838", + Source = CustomisationSource.DEFAULT, + Type = CustomisationType.DOG_TAG, + } + ); + + fullProfile.CustomisationUnlocks.Add( + new CustomisationStorage + { + Id = "67471938bafff850080488b7", + Source = CustomisationSource.DEFAULT, + Type = CustomisationType.DOG_TAG, + } + ); + + fullProfile.CustomisationUnlocks.Add( + new CustomisationStorage + { + Id = "67471928d17d6431550563b5", + Source = CustomisationSource.DEFAULT, + Type = CustomisationType.DOG_TAG, + } + ); + + fullProfile.CustomisationUnlocks.Add( + new CustomisationStorage + { + Id = "6747193f170146228c0d2226", + Source = CustomisationSource.DEFAULT, + Type = CustomisationType.DOG_TAG, + } + ); + + // Unheard Clothing (Cultist Hood) + fullProfile.CustomisationUnlocks.Add( + new CustomisationStorage + { + Id = "666841a02537107dc508b704", + Source = CustomisationSource.DEFAULT, + Type = CustomisationType.SUITE, + } + ); + + // Unheard background + fullProfile.CustomisationUnlocks.Add( + new CustomisationStorage + { + Id = "675850ba33627edb710b0592", + Source = CustomisationSource.DEFAULT, + Type = CustomisationType.ENVIRONMENT, + } + ); + + break; + } + + var pretigeLevel = fullProfile?.CharacterData?.PmcData?.Info?.PrestigeLevel; + if (pretigeLevel is not null) + { + if (pretigeLevel >= 1) + { + fullProfile.CustomisationUnlocks.Add( + new CustomisationStorage + { + Id = "674dbf593bee1152d407f005", + Source = CustomisationSource.DEFAULT, + Type = CustomisationType.DOG_TAG, + } + ); + } + + if (pretigeLevel >= 2) + { + fullProfile.CustomisationUnlocks.Add( + new CustomisationStorage + { + Id = "675dcfea7ae1a8792107ca99", + Source = CustomisationSource.DEFAULT, + Type = CustomisationType.DOG_TAG, + } + ); + } + } + + // Dev profile additions + if (fullProfile.ProfileInfo.Edition.ToLower().Contains("developer")) + // CyberTark background + { + fullProfile.CustomisationUnlocks.Add( + new CustomisationStorage + { + Id = "67585108def253bd97084552", + Source = CustomisationSource.DEFAULT, + Type = CustomisationType.ENVIRONMENT, + } + ); + } + } + + /// + /// Get the game edition of a profile chosen on creation in Launcher + /// + public static string GetGameEdition(this SptProfile fullProfile) + { + var edition = fullProfile.CharacterData?.PmcData?.Info?.GameVersion; + if (edition is not null) + { + return edition; + } + + // Edge case - profile not created yet, fall back to what launcher has set + var launcherEdition = fullProfile.ProfileInfo.Edition; + switch (launcherEdition.ToLower()) + { + case "edge of darkness": + return GameEditions.EDGE_OF_DARKNESS; + case "unheard": + return GameEditions.UNHEARD; + default: + return GameEditions.STANDARD; + } + } + + /// + /// Add the given number of extra repeatable quests for the given type of repeatable to the users profile + /// + /// Profile to add the extra repeatable to + /// The ID of the type of repeatable to increase + /// The number of extra repeatables to add + public static void AddExtraRepeatableQuest( + this SptProfile fullProfile, + string repeatableId, + double rewardValue + ) + { + fullProfile.SptData.ExtraRepeatableQuests ??= new Dictionary(); + + if (!fullProfile.SptData.ExtraRepeatableQuests.TryAdd(repeatableId, 0)) + { + fullProfile.SptData.ExtraRepeatableQuests[repeatableId] += rewardValue; + } + } } } diff --git a/Libraries/SPTarkov.Server.Core/Extensions/ProfileExtensions.cs b/Libraries/SPTarkov.Server.Core/Extensions/ProfileExtensions.cs new file mode 100644 index 00000000..70e11eb7 --- /dev/null +++ b/Libraries/SPTarkov.Server.Core/Extensions/ProfileExtensions.cs @@ -0,0 +1,66 @@ +using SPTarkov.Server.Core.Models.Eft.Common; +using SPTarkov.Server.Core.Models.Eft.Common.Tables; +using SPTarkov.Server.Core.Models.Enums; + +namespace SPTarkov.Server.Core.Extensions +{ + public static class ProfileExtensions + { + /// + /// Return all quest items current in the supplied profile + /// + /// Profile to get quest items from + /// List of item objects + public static List GetQuestItemsInProfile(this PmcData profile) + { + return profile + ?.Inventory?.Items.Where(i => i.ParentId == profile.Inventory.QuestRaidItems) + .ToList(); + } + + /// + /// Upgrade hideout wall from starting level to interactable level if necessary stations have been upgraded + /// + /// Profile to upgrade wall in + public static void UnlockHideoutWallInProfile(this PmcData profile) + { + var profileHideoutAreas = profile.Hideout.Areas; + var waterCollector = profileHideoutAreas.FirstOrDefault(x => + x.Type == HideoutAreas.WaterCollector + ); + var medStation = profileHideoutAreas.FirstOrDefault(x => + x.Type == HideoutAreas.MedStation + ); + var wall = profileHideoutAreas.FirstOrDefault(x => + x.Type == HideoutAreas.EmergencyWall + ); + + // No collector or med station, skip + if (waterCollector is null && medStation is null) + { + return; + } + + // If med-station > level 1 AND water collector > level 1 AND wall is level 0 + if (waterCollector?.Level >= 1 && medStation?.Level >= 1 && wall?.Level <= 0) + { + wall.Level = 3; + } + } + + /// + /// Does the provided profile contain any condition counters + /// + /// Profile to check for condition counters + /// Profile has condition counters + public static bool ProfileHasConditionCounters(this PmcData profile) + { + if (profile.TaskConditionCounters is null) + { + return false; + } + + return profile.TaskConditionCounters.Count > 0; + } + } +} diff --git a/Libraries/SPTarkov.Server.Core/Helpers/HideoutHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/HideoutHelper.cs index 3cf982a2..eb4c5251 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/HideoutHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/HideoutHelper.cs @@ -1494,32 +1494,6 @@ public class HideoutHelper( pmcData.Hideout.Production[BitcoinFarm].Products = []; } - /// - /// Upgrade hideout wall from starting level to interactable level if necessary stations have been upgraded - /// - /// Profile to upgrade wall in - public void UnlockHideoutWallInProfile(PmcData profileData) - { - var profileHideoutAreas = profileData.Hideout.Areas; - var waterCollector = profileHideoutAreas.FirstOrDefault(x => - x.Type == HideoutAreas.WaterCollector - ); - var medStation = profileHideoutAreas.FirstOrDefault(x => x.Type == HideoutAreas.MedStation); - var wall = profileHideoutAreas.FirstOrDefault(x => x.Type == HideoutAreas.EmergencyWall); - - // No collector or med station, skip - if (waterCollector is null && medStation is null) - { - return; - } - - // If med-station > level 1 AND water collector > level 1 AND wall is level 0 - if (waterCollector?.Level >= 1 && medStation?.Level >= 1 && wall?.Level <= 0) - { - wall.Level = 3; - } - } - /// /// Hideout improvement is flagged as complete /// diff --git a/Libraries/SPTarkov.Server.Core/Helpers/PrestigeHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/PrestigeHelper.cs index ff5576f5..66cb5dfe 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/PrestigeHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/PrestigeHelper.cs @@ -1,4 +1,5 @@ using SPTarkov.DI.Annotations; +using SPTarkov.Server.Core.Extensions; using SPTarkov.Server.Core.Models.Eft.Common.Tables; using SPTarkov.Server.Core.Models.Eft.Profile; using SPTarkov.Server.Core.Models.Enums; @@ -176,11 +177,7 @@ public class PrestigeHelper } case RewardType.ExtraDailyQuest: { - _profileHelper.AddExtraRepeatableQuest( - newProfile, - reward.Target, - (double)reward.Value - ); + newProfile.AddExtraRepeatableQuest(reward.Target, (double)reward.Value); break; } default: diff --git a/Libraries/SPTarkov.Server.Core/Helpers/ProfileHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/ProfileHelper.cs index 76fcdae8..ed2ed23e 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/ProfileHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/ProfileHelper.cs @@ -685,18 +685,6 @@ public class ProfileHelper( } } - /// - /// Return all quest items current in the supplied profile - /// - /// Profile to get quest items from - /// List of item objects - public List GetQuestItemsInProfile(PmcData profile) - { - return profile - ?.Inventory?.Items.Where(i => i.ParentId == profile.Inventory.QuestRaidItems) - .ToList(); - } - /// /// Return a favorites list in the format expected by the GetOtherProfile call /// @@ -790,26 +778,6 @@ public class ProfileHelper( } } - /// - /// Add the given number of extra repeatable quests for the given type of repeatable to the users profile - /// - /// Profile to add the extra repeatable to - /// The ID of the type of repeatable to increase - /// The number of extra repeatables to add - public void AddExtraRepeatableQuest( - SptProfile fullProfile, - string repeatableId, - double rewardValue - ) - { - fullProfile.SptData.ExtraRepeatableQuests ??= new Dictionary(); - - if (!fullProfile.SptData.ExtraRepeatableQuests.TryAdd(repeatableId, 0)) - { - fullProfile.SptData.ExtraRepeatableQuests[repeatableId] += rewardValue; - } - } - /// /// Get a profile template by the account and side /// diff --git a/Libraries/SPTarkov.Server.Core/Helpers/TraderHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/TraderHelper.cs index 7a77505c..f6c26bbb 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/TraderHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/TraderHelper.cs @@ -1,4 +1,5 @@ using SPTarkov.DI.Annotations; +using SPTarkov.Server.Core.Extensions; using SPTarkov.Server.Core.Models.Common; using SPTarkov.Server.Core.Models.Eft.Common; using SPTarkov.Server.Core.Models.Eft.Common.Tables; @@ -192,7 +193,7 @@ public class TraderHelper( if (clothing?.Count > 0) // Force suit ids into profile { - AddSuitsToProfile(fullProfile, clothing.Select(suit => suit.SuiteId).ToList()); + fullProfile.AddSuitsToProfile(clothing.Select(suit => suit.SuiteId).ToList()); } } @@ -246,36 +247,6 @@ public class TraderHelper( return rawProfileTemplate.InitialStanding["default"]; } - /// - /// Add a list of suit ids to a profiles suit list, no duplicates - /// - /// Profile to add clothing to - /// Clothing Ids to add to profile - public void AddSuitsToProfile(SptProfile fullProfile, List clothingIds) - { - fullProfile.CustomisationUnlocks ??= []; - - foreach (var suitId in clothingIds) - { - if ( - !fullProfile.CustomisationUnlocks.Exists(customisation => - customisation.Id == suitId - ) - ) - { - // Clothing item doesn't exist in profile, add it - fullProfile.CustomisationUnlocks.Add( - new CustomisationStorage - { - Id = suitId, - Source = CustomisationSource.UNLOCKED_IN_GAME, - Type = CustomisationType.SUITE, - } - ); - } - } - } - /// /// Alter a traders unlocked status /// diff --git a/Libraries/SPTarkov.Server.Core/Services/CreateProfileService.cs b/Libraries/SPTarkov.Server.Core/Services/CreateProfileService.cs index b5e41013..4e90f288 100644 --- a/Libraries/SPTarkov.Server.Core/Services/CreateProfileService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/CreateProfileService.cs @@ -1,5 +1,6 @@ using System.Security.Cryptography; using SPTarkov.DI.Annotations; +using SPTarkov.Server.Core.Extensions; using SPTarkov.Server.Core.Generators; using SPTarkov.Server.Core.Helpers; using SPTarkov.Server.Core.Models.Eft.Common; @@ -122,9 +123,9 @@ public class CreateProfileService( CustomisationUnlocks = [], }; - AddCustomisationUnlocksToProfile(profileDetails); + profileDetails.AddCustomisationUnlocksToProfile(); - _traderHelper.AddSuitsToProfile(profileDetails, profileTemplateClone.Suits); + profileDetails.AddSuitsToProfile(profileTemplateClone.Suits); _profileFixerService.CheckForAndFixPmcProfileIssues(profileDetails.CharacterData.PmcData); @@ -339,173 +340,6 @@ public class CreateProfileService( } } - /// - /// Add customisations to game profiles based on game edition - /// - /// Profile to add customisations to - public void AddCustomisationUnlocksToProfile(SptProfile fullProfile) - { - // Some game versions have additional customisation unlocks - var gameEdition = GetGameEdition(fullProfile); - if (gameEdition is null) - { - _logger.Error( - $"Unable to get Game edition of profile: {fullProfile.ProfileInfo.ProfileId}, skipping customisation unlocks" - ); - return; - } - - switch (gameEdition) - { - case GameEditions.EDGE_OF_DARKNESS: - // Gets EoD tags - fullProfile.CustomisationUnlocks.Add( - new CustomisationStorage - { - Id = "6746fd09bafff85008048838", - Source = CustomisationSource.DEFAULT, - Type = CustomisationType.DOG_TAG, - } - ); - - fullProfile.CustomisationUnlocks.Add( - new CustomisationStorage - { - Id = "67471938bafff850080488b7", - Source = CustomisationSource.DEFAULT, - Type = CustomisationType.DOG_TAG, - } - ); - - break; - case GameEditions.UNHEARD: - // Gets EoD+Unheard tags - fullProfile.CustomisationUnlocks.Add( - new CustomisationStorage - { - Id = "6746fd09bafff85008048838", - Source = CustomisationSource.DEFAULT, - Type = CustomisationType.DOG_TAG, - } - ); - - fullProfile.CustomisationUnlocks.Add( - new CustomisationStorage - { - Id = "67471938bafff850080488b7", - Source = CustomisationSource.DEFAULT, - Type = CustomisationType.DOG_TAG, - } - ); - - fullProfile.CustomisationUnlocks.Add( - new CustomisationStorage - { - Id = "67471928d17d6431550563b5", - Source = CustomisationSource.DEFAULT, - Type = CustomisationType.DOG_TAG, - } - ); - - fullProfile.CustomisationUnlocks.Add( - new CustomisationStorage - { - Id = "6747193f170146228c0d2226", - Source = CustomisationSource.DEFAULT, - Type = CustomisationType.DOG_TAG, - } - ); - - // Unheard Clothing (Cultist Hood) - fullProfile.CustomisationUnlocks.Add( - new CustomisationStorage - { - Id = "666841a02537107dc508b704", - Source = CustomisationSource.DEFAULT, - Type = CustomisationType.SUITE, - } - ); - - // Unheard background - fullProfile.CustomisationUnlocks.Add( - new CustomisationStorage - { - Id = "675850ba33627edb710b0592", - Source = CustomisationSource.DEFAULT, - Type = CustomisationType.ENVIRONMENT, - } - ); - - break; - } - - var pretigeLevel = fullProfile?.CharacterData?.PmcData?.Info?.PrestigeLevel; - if (pretigeLevel is not null) - { - if (pretigeLevel >= 1) - { - fullProfile.CustomisationUnlocks.Add( - new CustomisationStorage - { - Id = "674dbf593bee1152d407f005", - Source = CustomisationSource.DEFAULT, - Type = CustomisationType.DOG_TAG, - } - ); - } - - if (pretigeLevel >= 2) - { - fullProfile.CustomisationUnlocks.Add( - new CustomisationStorage - { - Id = "675dcfea7ae1a8792107ca99", - Source = CustomisationSource.DEFAULT, - Type = CustomisationType.DOG_TAG, - } - ); - } - } - - // Dev profile additions - if (fullProfile.ProfileInfo.Edition.ToLower().Contains("developer")) - // CyberTark background - { - fullProfile.CustomisationUnlocks.Add( - new CustomisationStorage - { - Id = "67585108def253bd97084552", - Source = CustomisationSource.DEFAULT, - Type = CustomisationType.ENVIRONMENT, - } - ); - } - } - - /// - /// Get the game edition of a profile chosen on creation in Launcher - /// - private string? GetGameEdition(SptProfile profile) - { - var edition = profile.CharacterData?.PmcData?.Info?.GameVersion; - if (edition is not null) - { - return edition; - } - - // Edge case - profile not created yet, fall back to what launcher has set - var launcherEdition = profile.ProfileInfo.Edition; - switch (launcherEdition.ToLower()) - { - case "edge of darkness": - return GameEditions.EDGE_OF_DARKNESS; - case "unheard": - return GameEditions.UNHEARD; - default: - return GameEditions.STANDARD; - } - } - /// /// Iterate over all quests in player profile, inspect rewards for the quests current state (accepted/completed) /// and send rewards to them in mail diff --git a/Libraries/SPTarkov.Server.Core/Services/LocationLifecycleService.cs b/Libraries/SPTarkov.Server.Core/Services/LocationLifecycleService.cs index 2b9dca2b..8d221e2b 100644 --- a/Libraries/SPTarkov.Server.Core/Services/LocationLifecycleService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/LocationLifecycleService.cs @@ -1,4 +1,5 @@ using SPTarkov.DI.Annotations; +using SPTarkov.Server.Core.Extensions; using SPTarkov.Server.Core.Generators; using SPTarkov.Server.Core.Helpers; using SPTarkov.Server.Core.Models.Eft.Common; @@ -763,7 +764,7 @@ public class LocationLifecycleService // Copy scav fence values to PMC profile pmcProfile.TradersInfo[Traders.FENCE] = scavProfile.TradersInfo[Traders.FENCE]; - if (ProfileHasConditionCounters(scavProfile)) + if (scavProfile.ProfileHasConditionCounters()) // Scav quest progress needs to be moved to pmc so player can see it in menu / hand them in { MigrateScavQuestProgressToPmcProfile(scavProfile, pmcProfile); @@ -876,21 +877,6 @@ public class LocationLifecycleService } } - /// - /// Does the provided profile contain any condition counters - /// - /// Profile to check for condition counters - /// Profile has condition counters - protected bool ProfileHasConditionCounters(PmcData profile) - { - if (profile.TaskConditionCounters is null) - { - return false; - } - - return profile.TaskConditionCounters.Count > 0; - } - /// /// Handles PMC Profile after the raid /// @@ -919,7 +905,7 @@ public class LocationLifecycleService // MUST occur BEFORE inventory actions (setInventory()) occur // Player died, get quest items they lost for use later - var lostQuestItems = _profileHelper.GetQuestItemsInProfile(postRaidProfile); + var lostQuestItems = postRaidProfile.GetQuestItemsInProfile(); // Update inventory _inRaidHelper.SetInventory(sessionId, pmcProfile, postRaidProfile, isSurvived, isTransfer); diff --git a/Libraries/SPTarkov.Server.Core/Services/ProfileFixerService.cs b/Libraries/SPTarkov.Server.Core/Services/ProfileFixerService.cs index 7ce9ae5a..0416461d 100644 --- a/Libraries/SPTarkov.Server.Core/Services/ProfileFixerService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/ProfileFixerService.cs @@ -3,6 +3,7 @@ using SPTarkov.DI.Annotations; using SPTarkov.Server.Core.Helpers; using SPTarkov.Server.Core.Models.Eft.Common; using SPTarkov.Server.Core.Models.Eft.Common.Tables; +using SPTarkov.Server.Core.Models.Eft.Hideout; using SPTarkov.Server.Core.Models.Eft.Profile; using SPTarkov.Server.Core.Models.Enums; using SPTarkov.Server.Core.Models.Spt.Config; @@ -961,10 +962,12 @@ public class ProfileFixerService( /// Iterate over players hideout areas and find what's built, look for missing bonuses those areas give and add them if missing /// /// Profile to update - public void AddMissingHideoutBonusesToProfile(PmcData pmcProfile) + /// + public void AddMissingHideoutBonusesToProfile( + PmcData pmcProfile, + List? dbHideoutAreas + ) { - var dbHideoutAreas = _databaseService.GetHideout().Areas; - foreach (var profileArea in pmcProfile.Hideout?.Areas ?? []) { var areaType = profileArea.Type;