From 656d6efd177f889ddf7a865eada2105e0d378004 Mon Sep 17 00:00:00 2001 From: Chomp Date: Sat, 8 Nov 2025 21:01:54 +0000 Subject: [PATCH 01/26] Fixed seasonal events using UTC time instead of server local time --- Libraries/SPTarkov.Server.Core/Services/SeasonalEventService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/SPTarkov.Server.Core/Services/SeasonalEventService.cs b/Libraries/SPTarkov.Server.Core/Services/SeasonalEventService.cs index 3cabdb77..13345891 100644 --- a/Libraries/SPTarkov.Server.Core/Services/SeasonalEventService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/SeasonalEventService.cs @@ -279,7 +279,7 @@ public class SeasonalEventService( /// public void CacheActiveEvents() { - var currentDate = DateTimeOffset.UtcNow.DateTime; + var currentDate = DateTimeOffset.Now.DateTime; var seasonalEvents = GetEventDetails(); // reset existing data From b1d80b359bff4f1e9e6534eae591754cf74430da Mon Sep 17 00:00:00 2001 From: Chomp Date: Sat, 8 Nov 2025 22:13:31 +0000 Subject: [PATCH 02/26] Fixed issue with sell chance calculation --- Libraries/SPTarkov.Server.Core/Helpers/RagfairSellHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/SPTarkov.Server.Core/Helpers/RagfairSellHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/RagfairSellHelper.cs index 72bbc1c6..5590ecc0 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/RagfairSellHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/RagfairSellHelper.cs @@ -37,7 +37,7 @@ public class RagfairSellHelper( // Modifier gets applied twice to either penalize or incentivize over/under pricing (Probably a cleaner way to do this) var sellModifier = averageOfferPriceRub / playerListedPriceRub * sellConfig.SellMultiplier; - var sellChance = Math.Round(baseSellChancePercent * sellModifier * (Math.Pow(sellModifier, 3) + 10)); // Power of 3 + var sellChance = Math.Round(baseSellChancePercent * sellModifier * Math.Pow(sellModifier, 3)); // Power of 3 // Adjust sell chance if below config value if (sellChance < sellConfig.MinSellChancePercent) From fd02ac0f0bbf38c8ee100b8d282a29633fd8a43f Mon Sep 17 00:00:00 2001 From: Cj <161484149+CJ-SPT@users.noreply.github.com> Date: Sun, 9 Nov 2025 13:27:00 -0500 Subject: [PATCH 03/26] Fix bundle hash duplicate key error --- .../SPTarkov.Server.Core/Services/BundleHashCacheService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/SPTarkov.Server.Core/Services/BundleHashCacheService.cs b/Libraries/SPTarkov.Server.Core/Services/BundleHashCacheService.cs index 34d6f9f2..86f21806 100644 --- a/Libraries/SPTarkov.Server.Core/Services/BundleHashCacheService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/BundleHashCacheService.cs @@ -41,7 +41,7 @@ public class BundleHashCacheService(ISptLogger logger, J protected async Task StoreValue(string bundlePath, uint hash) { - _bundleHashes.Add(bundlePath, hash); + _bundleHashes[bundlePath] = hash; var bundleHashesSerialized = jsonUtil.Serialize(_bundleHashes); From abbb81474556f8dc2e71d3f156bef90cf5cc215b Mon Sep 17 00:00:00 2001 From: Chomp Date: Mon, 10 Nov 2025 10:54:48 +0000 Subject: [PATCH 04/26] Fixed `ShouldBuffItem` always returning false --- Libraries/SPTarkov.Server.Core/Services/RepairService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/SPTarkov.Server.Core/Services/RepairService.cs b/Libraries/SPTarkov.Server.Core/Services/RepairService.cs index 6b175ffc..302f14b5 100644 --- a/Libraries/SPTarkov.Server.Core/Services/RepairService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/RepairService.cs @@ -587,7 +587,7 @@ public class RepairService( var doBuff = commonBuffMinChanceValue + commonBuffChanceLevelBonus * skillLevel * durabilityMultiplier; var random = new Random(); - return random.Next() <= doBuff; + return random.NextDouble() <= doBuff; } /// From 4586390d68dd7a7d7db9d5ba48696dfb8951034e Mon Sep 17 00:00:00 2001 From: sp-tarkov-bot Date: Mon, 10 Nov 2025 10:55:39 +0000 Subject: [PATCH 05/26] Format Style Fixes --- .../Generators/BotLootGenerator.cs | 14 ++++------ .../Generators/LootGenerator.cs | 18 ++++++------ .../CompletionQuestGenerator.cs | 7 +++-- .../Commands/ForceChristmasMessageHandler.cs | 6 ++-- .../Commands/ForceHalloweenMessageHandler.cs | 6 ++-- .../SPTFriend/Commands/HelloMessageHandler.cs | 28 +++++++++---------- .../Commands/LoveYouChatMessageHandler.cs | 14 ++++------ .../Commands/NikitaMessageHandler.cs | 16 +++++------ .../Commands/SendGiftMessageHandler.cs | 16 +++++------ .../Helpers/HideoutHelper.cs | 18 ++++++------ .../Helpers/PrestigeHelper.cs | 6 ++-- Testing/UnitTests/DI.cs | 8 ++---- 12 files changed, 71 insertions(+), 86 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Generators/BotLootGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/BotLootGenerator.cs index 9bd1e433..bc6f8994 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/BotLootGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/BotLootGenerator.cs @@ -687,14 +687,12 @@ public class BotLootGenerator( Dictionary modChances ) { - var chosenWeaponType = randomUtil.GetArrayValue( - [ - nameof(EquipmentSlots.FirstPrimaryWeapon), - nameof(EquipmentSlots.FirstPrimaryWeapon), - nameof(EquipmentSlots.FirstPrimaryWeapon), - nameof(EquipmentSlots.Holster), - ] - ); + var chosenWeaponType = randomUtil.GetArrayValue([ + nameof(EquipmentSlots.FirstPrimaryWeapon), + nameof(EquipmentSlots.FirstPrimaryWeapon), + nameof(EquipmentSlots.FirstPrimaryWeapon), + nameof(EquipmentSlots.Holster), + ]); var randomisedWeaponCount = randomUtil.GetInt( PMCConfig.LooseWeaponInBackpackLootMinMax.Min, PMCConfig.LooseWeaponInBackpackLootMinMax.Max diff --git a/Libraries/SPTarkov.Server.Core/Generators/LootGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/LootGenerator.cs index e09ad6d9..856eb697 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/LootGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/LootGenerator.cs @@ -53,16 +53,14 @@ public class LootGenerator( { // Choose one at random + add to results array var chosenSealedContainer = randomUtil.GetArrayValue(sealedWeaponContainerPool); - result.Add( - [ - new Item - { - Id = new MongoId(), - Template = chosenSealedContainer.Id, - Upd = new Upd { StackObjectsCount = 1, SpawnedInSession = true }, - }, - ] - ); + result.Add([ + new Item + { + Id = new MongoId(), + Template = chosenSealedContainer.Id, + Upd = new Upd { StackObjectsCount = 1, SpawnedInSession = true }, + }, + ]); } } diff --git a/Libraries/SPTarkov.Server.Core/Generators/RepeatableQuestGeneration/CompletionQuestGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/RepeatableQuestGeneration/CompletionQuestGenerator.cs index 32d98145..0a25b95c 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/RepeatableQuestGeneration/CompletionQuestGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/RepeatableQuestGeneration/CompletionQuestGenerator.cs @@ -349,9 +349,10 @@ public class CompletionQuestGenerator( { var onlyFoundInRaid = completionConfig.RequiredItemsAreFiR; var minDurability = itemHelper.IsOfBaseclasses(itemTpl, [BaseClasses.WEAPON, BaseClasses.ARMOR]) - ? randomUtil.GetArrayValue( - [completionConfig.RequiredItemMinDurabilityMinMax.Min, completionConfig.RequiredItemMinDurabilityMinMax.Max] - ) + ? randomUtil.GetArrayValue([ + completionConfig.RequiredItemMinDurabilityMinMax.Min, + completionConfig.RequiredItemMinDurabilityMinMax.Max, + ]) : 0; // Dog tags MUST NOT be FiR for them to work diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceChristmasMessageHandler.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceChristmasMessageHandler.cs index 58e79a48..3c3a7da4 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceChristmasMessageHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceChristmasMessageHandler.cs @@ -34,9 +34,9 @@ public class ForceChristmasMessageHandler( _mailSendService.SendUserMessageToPlayer( sessionId, sptFriendUser, - _randomUtil.GetArrayValue( - [_serverLocalisationService.GetText("chatbot-forced_event_enabled", SeasonalEventType.Christmas)] - ), + _randomUtil.GetArrayValue([ + _serverLocalisationService.GetText("chatbot-forced_event_enabled", SeasonalEventType.Christmas), + ]), [], null ); diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceHalloweenMessageHandler.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceHalloweenMessageHandler.cs index 39671c11..14def840 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceHalloweenMessageHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/ForceHalloweenMessageHandler.cs @@ -34,9 +34,9 @@ public class ForceHalloweenMessageHandler( _mailSendService.SendUserMessageToPlayer( sessionId, sptFriendUser, - _randomUtil.GetArrayValue( - [_serverLocalisationService.GetText("chatbot-forced_event_enabled", SeasonalEventType.Halloween)] - ), + _randomUtil.GetArrayValue([ + _serverLocalisationService.GetText("chatbot-forced_event_enabled", SeasonalEventType.Halloween), + ]), [], null ); diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/HelloMessageHandler.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/HelloMessageHandler.cs index 043275e8..007a47cd 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/HelloMessageHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/HelloMessageHandler.cs @@ -29,21 +29,19 @@ public class HelloMessageHandler(MailSendService mailSendService, RandomUtil ran mailSendService.SendUserMessageToPlayer( sessionId, sptFriendUser, - randomUtil.GetArrayValue( - [ - "Howdy", - "Hi", - "Greetings", - "Hello", - "Bonjor", - "Yo", - "Sup", - "Heyyyyy", - "Hey there", - "OH its you", - $"Hello {sender?.Info?.Nickname}", - ] - ), + randomUtil.GetArrayValue([ + "Howdy", + "Hi", + "Greetings", + "Hello", + "Bonjor", + "Yo", + "Sup", + "Heyyyyy", + "Hey there", + "OH its you", + $"Hello {sender?.Info?.Nickname}", + ]), [], null ); diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/LoveYouChatMessageHandler.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/LoveYouChatMessageHandler.cs index c0e25745..7d29181a 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/LoveYouChatMessageHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/LoveYouChatMessageHandler.cs @@ -25,14 +25,12 @@ public class LoveYouChatMessageHandler(MailSendService _mailSendService, RandomU _mailSendService.SendUserMessageToPlayer( sessionId, sptFriendUser, - _randomUtil.GetArrayValue( - [ - "That's quite forward but i love you too in a purely chatbot-human way", - "I love you too buddy :3!", - "uwu", - $"love you too {sender?.Info?.Nickname}", - ] - ), + _randomUtil.GetArrayValue([ + "That's quite forward but i love you too in a purely chatbot-human way", + "I love you too buddy :3!", + "uwu", + $"love you too {sender?.Info?.Nickname}", + ]), [], null ); diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/NikitaMessageHandler.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/NikitaMessageHandler.cs index 9d63a85c..59bc1955 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/NikitaMessageHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/NikitaMessageHandler.cs @@ -25,15 +25,13 @@ public class NikitaMessageHandler(MailSendService _mailSendService, RandomUtil _ _mailSendService.SendUserMessageToPlayer( sessionId, sptFriendUser, - _randomUtil.GetArrayValue( - [ - "I know that guy!", - "Cool guy, he made EFT!", - "Legend", - "The mastermind of my suffering", - "Remember when he said webel-webel-webel-webel, classic Nikita moment", - ] - ), + _randomUtil.GetArrayValue([ + "I know that guy!", + "Cool guy, he made EFT!", + "Legend", + "The mastermind of my suffering", + "Remember when he said webel-webel-webel-webel, classic Nikita moment", + ]), [], null ); diff --git a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/SendGiftMessageHandler.cs b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/SendGiftMessageHandler.cs index ae42e32c..cb93bfaf 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/SendGiftMessageHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/Dialogue/SPTFriend/Commands/SendGiftMessageHandler.cs @@ -47,15 +47,13 @@ public class SendGiftMessageHandler( mailSendService.SendUserMessageToPlayer( sessionId, sptFriendUser, - randomUtil.GetArrayValue( - [ - "Hey! you got the right code!", - "A secret code, how exciting!", - "You found a gift code!", - "A gift code! incredible", - "A gift! what could it be!", - ] - ), + randomUtil.GetArrayValue([ + "Hey! you got the right code!", + "A secret code, how exciting!", + "You found a gift code!", + "A gift code! incredible", + "A gift! what could it be!", + ]), [], null ); diff --git a/Libraries/SPTarkov.Server.Core/Helpers/HideoutHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/HideoutHelper.cs index 0f25caaa..ce408040 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/HideoutHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/HideoutHelper.cs @@ -1371,16 +1371,14 @@ public class HideoutHelper( List> itemsToAdd = []; for (var index = 0; index < craftedCoinCount; index++) { - itemsToAdd.Add( - [ - new Item - { - Id = new MongoId(), - Template = ItemTpl.BARTER_PHYSICAL_BITCOIN, - Upd = new Upd { StackObjectsCount = 1 }, - }, - ] - ); + itemsToAdd.Add([ + new Item + { + Id = new MongoId(), + Template = ItemTpl.BARTER_PHYSICAL_BITCOIN, + Upd = new Upd { StackObjectsCount = 1 }, + }, + ]); } // Create request for what we want to add to stash diff --git a/Libraries/SPTarkov.Server.Core/Helpers/PrestigeHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/PrestigeHelper.cs index 550be953..ae025796 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/PrestigeHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/PrestigeHelper.cs @@ -65,9 +65,9 @@ public class PrestigeHelper( } else { - newProfile.CharacterData!.PmcData!.Skills!.Mastering = newProfile.CharacterData.PmcData.Skills.Mastering?.Union( - [skillToCopy] - ); + newProfile.CharacterData!.PmcData!.Skills!.Mastering = newProfile.CharacterData.PmcData.Skills.Mastering?.Union([ + skillToCopy, + ]); } } } diff --git a/Testing/UnitTests/DI.cs b/Testing/UnitTests/DI.cs index 825017ac..ce436c74 100644 --- a/Testing/UnitTests/DI.cs +++ b/Testing/UnitTests/DI.cs @@ -38,11 +38,9 @@ public class DI var diHandler = new DependencyInjectionHandler(services); diHandler.AddInjectableTypesFromTypeAssembly(typeof(App)); - diHandler.AddInjectableTypesFromTypeList( - [ - typeof(MockLogger<>), // TODO: this needs to be enabled but the randomizer needs to NOT be random, typeof(MockRandomUtil) - ] - ); + diHandler.AddInjectableTypesFromTypeList([ + typeof(MockLogger<>), // TODO: this needs to be enabled but the randomizer needs to NOT be random, typeof(MockRandomUtil) + ]); diHandler.InjectAll(); From 79da1611fb75f95c218cb4d7c4fdbf88c701c310 Mon Sep 17 00:00:00 2001 From: Chomp Date: Mon, 10 Nov 2025 11:10:30 +0000 Subject: [PATCH 06/26] Fixed `GetWeaponRepairSkillPoints` never applying crit success/failure --- Libraries/SPTarkov.Server.Core/Services/RepairService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Services/RepairService.cs b/Libraries/SPTarkov.Server.Core/Services/RepairService.cs index 302f14b5..137d0fed 100644 --- a/Libraries/SPTarkov.Server.Core/Services/RepairService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/RepairService.cs @@ -247,13 +247,13 @@ public class RepairService( // You can both crit fail and succeed at the same time, for fun (Balances out to 0 with default settings) // Add a random chance to crit-fail - if (random.Next() <= RepairConfig.WeaponTreatment.CritFailureChance) + if (random.NextDouble() <= RepairConfig.WeaponTreatment.CritFailureChance) { skillPoints -= RepairConfig.WeaponTreatment.CritFailureAmount; } // Add a random chance to crit-succeed - if (random.Next() <= RepairConfig.WeaponTreatment.CritSuccessChance) + if (random.NextDouble() <= RepairConfig.WeaponTreatment.CritSuccessChance) { skillPoints += RepairConfig.WeaponTreatment.CritSuccessAmount; } From 6218b6f6053c573cf00cf0439880a2dea6c33cfc Mon Sep 17 00:00:00 2001 From: Chomp Date: Mon, 10 Nov 2025 19:33:26 +0000 Subject: [PATCH 07/26] Added specific error handling for missing mod libs --- SPTarkov.Server/Program.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/SPTarkov.Server/Program.cs b/SPTarkov.Server/Program.cs index e18843c8..468b619e 100644 --- a/SPTarkov.Server/Program.cs +++ b/SPTarkov.Server/Program.cs @@ -42,6 +42,23 @@ public static class Program } catch (Exception e) { + if (e.Message.Contains("could not load file or assembly", StringComparison.InvariantCultureIgnoreCase)) + { + var requirementName = e.Message; + Console.WriteLine( + "=========================================================================================================" + ); + Console.BackgroundColor = ConsoleColor.DarkRed; + Console.ForegroundColor = ConsoleColor.Black; + Console.WriteLine( + "You may have forgotten to install a requirement for one of your mods, please check the mod page again and install any requirements listed. Read the error message below CAREFULLY for the name of the mod you need to install" + ); + Console.ResetColor(); + Console.WriteLine( + "=========================================================================================================" + ); + } + Console.WriteLine("========================================================================================================="); Console.WriteLine( "The server has unexpectedly stopped, reach out to #spt-support in discord, create a support thread by following the instructions found in #support-guidelines. Also include a screenshot of this message + the below error" From 14a4a3ba532db92218265df4cc905b0293b990ce Mon Sep 17 00:00:00 2001 From: SwiftXP <230956466+swiftxp-hub@users.noreply.github.com> Date: Mon, 10 Nov 2025 22:41:53 +0100 Subject: [PATCH 08/26] Only integers were used for the calculation for keys, which meant that only 1 or 0 could be the result. At least one value must be a double for the calculation to result in a double. --- Libraries/SPTarkov.Server.Core/Helpers/ItemHelper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Helpers/ItemHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/ItemHelper.cs index a30409f0..27cce0d6 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/ItemHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/ItemHelper.cs @@ -616,8 +616,8 @@ public class ItemHelper( else if (item.Upd.Key?.NumberOfUsages > 0 && itemDetails.Properties?.MaximumNumberOfUsage > 0) { // keys - keys count upwards, not down like everything else - var maxNumOfUsages = itemDetails.Properties.MaximumNumberOfUsage; - result = (maxNumOfUsages ?? 0 - item.Upd.Key.NumberOfUsages) / maxNumOfUsages ?? 0; + var maxNumOfUsages = itemDetails.Properties.MaximumNumberOfUsage ?? 0d; + result = (maxNumOfUsages - item.Upd.Key.NumberOfUsages) / maxNumOfUsages ?? 0; } else if (item.Upd.Resource?.UnitsConsumed > 0) // Item is less than 100% usage { From 964aad016bfb68e2c262ea019f69936a16ff2a41 Mon Sep 17 00:00:00 2001 From: SwiftXP <230956466+swiftxp-hub@users.noreply.github.com> Date: Mon, 10 Nov 2025 23:36:36 +0100 Subject: [PATCH 09/26] Little code refactorings. --- Libraries/SPTarkov.Server.Core/Helpers/ItemHelper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Helpers/ItemHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/ItemHelper.cs index 27cce0d6..a18c9e68 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/ItemHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/ItemHelper.cs @@ -616,8 +616,8 @@ public class ItemHelper( else if (item.Upd.Key?.NumberOfUsages > 0 && itemDetails.Properties?.MaximumNumberOfUsage > 0) { // keys - keys count upwards, not down like everything else - var maxNumOfUsages = itemDetails.Properties.MaximumNumberOfUsage ?? 0d; - result = (maxNumOfUsages - item.Upd.Key.NumberOfUsages) / maxNumOfUsages ?? 0; + double maxNumOfUsages = itemDetails.Properties.MaximumNumberOfUsage.GetValueOrDefault(0); + result = (maxNumOfUsages - item.Upd.Key.NumberOfUsages!.Value) / maxNumOfUsages; } else if (item.Upd.Resource?.UnitsConsumed > 0) // Item is less than 100% usage { From 1356f1fa6040e4a40fbf20bebb96788b71c0700b Mon Sep 17 00:00:00 2001 From: SwiftXP <230956466+swiftxp-hub@users.noreply.github.com> Date: Mon, 10 Nov 2025 23:54:24 +0100 Subject: [PATCH 10/26] Forgot csharpier. --- Build.props | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Build.props b/Build.props index 758a093c..8fedd051 100644 --- a/Build.props +++ b/Build.props @@ -5,9 +5,7 @@ a12b34 0000000000 LOCAL - - - + $(SptVersion)-$(SptBuildType)+$(SptCommit).$(SptBuildTime) $(SptVersion) $(SptVersion) From 5617cb1586bb7976c2bfefabdf8c0b91fd6c87ca Mon Sep 17 00:00:00 2001 From: Archangel Date: Tue, 11 Nov 2025 07:34:09 +0100 Subject: [PATCH 11/26] Migrate to SLNX --- server-csharp.sln | 137 --------------------------------------------- server-csharp.slnx | 28 +++++++++ 2 files changed, 28 insertions(+), 137 deletions(-) delete mode 100644 server-csharp.sln create mode 100644 server-csharp.slnx diff --git a/server-csharp.sln b/server-csharp.sln deleted file mode 100644 index 5905d812..00000000 --- a/server-csharp.sln +++ /dev/null @@ -1,137 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.12.35527.113 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SPTarkov.Server", "SPTarkov.Server\SPTarkov.Server.csproj", "{1F5ED9C6-8B1F-4776-85AB-B387CBBC5557}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SPTarkov.Server.Core", "Libraries\SPTarkov.Server.Core\SPTarkov.Server.Core.csproj", "{AC8643DC-8779-4B4A-BBDA-2D4CC466F765}" - ProjectSection(ProjectDependencies) = postProject - {20A5EBD3-75D1-4E06-8240-09EEF874017A} = {20A5EBD3-75D1-4E06-8240-09EEF874017A} - {5D09182A-B0B3-406C-AE88-EE0929F9260C} = {5D09182A-B0B3-406C-AE88-EE0929F9260C} - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{F084DDFD-89F3-44F9-89C3-5CA11F4CDEEF}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{587959C2-5AFA-4B77-B327-566610F9A289}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SPTarkov.DI", "Libraries\SPTarkov.DI\SPTarkov.DI.csproj", "{4B4AF50D-B2C6-47D1-B567-EA4560D8CBA1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MongoIdTplGenerator", "Tools\MongoIdTplGenerator\MongoIdTplGenerator.csproj", "{00897F10-1AB3-4DC7-8DF9-5EA1D0289ACF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SPTarkov.Common", "Libraries\SPTarkov.Common\SPTarkov.Common.csproj", "{DB049C81-DEC0-490D-AC06-7AF4DC8C0571}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SPTarkov.Server.Assets", "Libraries\SPTarkov.Server.Assets\SPTarkov.Server.Assets.csproj", "{4B973AC0-0C60-4853-9AF7-7CB69127473E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HideoutCraftQuestIdGenerator", "Tools\HideoutCraftQuestIdGenerator\HideoutCraftQuestIdGenerator.csproj", "{C24B1FEB-F8AC-434E-998D-5DA4D1687295}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SPTarkov.Reflection", "Libraries\SPTarkov.Reflection\SPTarkov.Reflection.csproj", "{9073A593-A2F5-471E-9678-B896A7226FD4}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JsonExtensionDataGenerator", "Tools\JsonExtensionDataGenerator\JsonExtensionDataGenerator.csproj", "{6F4670CD-6861-47A8-9A02-2B63AD73A929}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Patches", "Patches", "{9E41CD5A-271C-4294-AAF9-8EB379311416}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ceciler.Virtualizer", "Patches\Ceciler.Virtualizer\Ceciler.Virtualizer.csproj", "{20A5EBD3-75D1-4E06-8240-09EEF874017A}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Testing", "Testing", "{07B50C44-6D38-474E-87AF-68672D241EEB}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Benchmarks", "Testing\Benchmarks\Benchmarks.csproj", "{3E342BAC-EE44-44E4-8E99-393F0C9F787C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "Testing\UnitTests\UnitTests.csproj", "{28B90486-1436-4CD7-88D0-122B6963AB58}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestMod", "Testing\TestMod\TestMod.csproj", "{755E473C-14F2-40BC-9377-2FAB11CA91DC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ceciler.JsonExtensionData", "Patches\Ceciler.JsonExtensionData\Ceciler.JsonExtensionData.csproj", "{5D09182A-B0B3-406C-AE88-EE0929F9260C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SPTarkov.Server.Web", "Libraries\SPTarkov.Server.Web\SPTarkov.Server.Web.csproj", "{BB1EB56E-9D40-8497-5A6D-B2E35E83FA89}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1F5ED9C6-8B1F-4776-85AB-B387CBBC5557}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1F5ED9C6-8B1F-4776-85AB-B387CBBC5557}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1F5ED9C6-8B1F-4776-85AB-B387CBBC5557}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1F5ED9C6-8B1F-4776-85AB-B387CBBC5557}.Release|Any CPU.Build.0 = Release|Any CPU - {AC8643DC-8779-4B4A-BBDA-2D4CC466F765}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AC8643DC-8779-4B4A-BBDA-2D4CC466F765}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AC8643DC-8779-4B4A-BBDA-2D4CC466F765}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AC8643DC-8779-4B4A-BBDA-2D4CC466F765}.Release|Any CPU.Build.0 = Release|Any CPU - {4B4AF50D-B2C6-47D1-B567-EA4560D8CBA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4B4AF50D-B2C6-47D1-B567-EA4560D8CBA1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4B4AF50D-B2C6-47D1-B567-EA4560D8CBA1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4B4AF50D-B2C6-47D1-B567-EA4560D8CBA1}.Release|Any CPU.Build.0 = Release|Any CPU - {00897F10-1AB3-4DC7-8DF9-5EA1D0289ACF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {00897F10-1AB3-4DC7-8DF9-5EA1D0289ACF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {00897F10-1AB3-4DC7-8DF9-5EA1D0289ACF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {00897F10-1AB3-4DC7-8DF9-5EA1D0289ACF}.Release|Any CPU.Build.0 = Release|Any CPU - {DB049C81-DEC0-490D-AC06-7AF4DC8C0571}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DB049C81-DEC0-490D-AC06-7AF4DC8C0571}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DB049C81-DEC0-490D-AC06-7AF4DC8C0571}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DB049C81-DEC0-490D-AC06-7AF4DC8C0571}.Release|Any CPU.Build.0 = Release|Any CPU - {4B973AC0-0C60-4853-9AF7-7CB69127473E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4B973AC0-0C60-4853-9AF7-7CB69127473E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4B973AC0-0C60-4853-9AF7-7CB69127473E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4B973AC0-0C60-4853-9AF7-7CB69127473E}.Release|Any CPU.Build.0 = Release|Any CPU - {C24B1FEB-F8AC-434E-998D-5DA4D1687295}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C24B1FEB-F8AC-434E-998D-5DA4D1687295}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C24B1FEB-F8AC-434E-998D-5DA4D1687295}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C24B1FEB-F8AC-434E-998D-5DA4D1687295}.Release|Any CPU.Build.0 = Release|Any CPU - {9073A593-A2F5-471E-9678-B896A7226FD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9073A593-A2F5-471E-9678-B896A7226FD4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9073A593-A2F5-471E-9678-B896A7226FD4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9073A593-A2F5-471E-9678-B896A7226FD4}.Release|Any CPU.Build.0 = Release|Any CPU - {6F4670CD-6861-47A8-9A02-2B63AD73A929}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6F4670CD-6861-47A8-9A02-2B63AD73A929}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6F4670CD-6861-47A8-9A02-2B63AD73A929}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6F4670CD-6861-47A8-9A02-2B63AD73A929}.Release|Any CPU.Build.0 = Release|Any CPU - {20A5EBD3-75D1-4E06-8240-09EEF874017A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {20A5EBD3-75D1-4E06-8240-09EEF874017A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {20A5EBD3-75D1-4E06-8240-09EEF874017A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {20A5EBD3-75D1-4E06-8240-09EEF874017A}.Release|Any CPU.Build.0 = Release|Any CPU - {3E342BAC-EE44-44E4-8E99-393F0C9F787C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3E342BAC-EE44-44E4-8E99-393F0C9F787C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3E342BAC-EE44-44E4-8E99-393F0C9F787C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3E342BAC-EE44-44E4-8E99-393F0C9F787C}.Release|Any CPU.Build.0 = Release|Any CPU - {28B90486-1436-4CD7-88D0-122B6963AB58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {28B90486-1436-4CD7-88D0-122B6963AB58}.Debug|Any CPU.Build.0 = Debug|Any CPU - {28B90486-1436-4CD7-88D0-122B6963AB58}.Release|Any CPU.ActiveCfg = Release|Any CPU - {28B90486-1436-4CD7-88D0-122B6963AB58}.Release|Any CPU.Build.0 = Release|Any CPU - {755E473C-14F2-40BC-9377-2FAB11CA91DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {755E473C-14F2-40BC-9377-2FAB11CA91DC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {755E473C-14F2-40BC-9377-2FAB11CA91DC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {755E473C-14F2-40BC-9377-2FAB11CA91DC}.Release|Any CPU.Build.0 = Release|Any CPU - {5D09182A-B0B3-406C-AE88-EE0929F9260C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5D09182A-B0B3-406C-AE88-EE0929F9260C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5D09182A-B0B3-406C-AE88-EE0929F9260C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5D09182A-B0B3-406C-AE88-EE0929F9260C}.Release|Any CPU.Build.0 = Release|Any CPU - {BB1EB56E-9D40-8497-5A6D-B2E35E83FA89}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BB1EB56E-9D40-8497-5A6D-B2E35E83FA89}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BB1EB56E-9D40-8497-5A6D-B2E35E83FA89}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BB1EB56E-9D40-8497-5A6D-B2E35E83FA89}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {AC8643DC-8779-4B4A-BBDA-2D4CC466F765} = {F084DDFD-89F3-44F9-89C3-5CA11F4CDEEF} - {4B4AF50D-B2C6-47D1-B567-EA4560D8CBA1} = {F084DDFD-89F3-44F9-89C3-5CA11F4CDEEF} - {00897F10-1AB3-4DC7-8DF9-5EA1D0289ACF} = {587959C2-5AFA-4B77-B327-566610F9A289} - {DB049C81-DEC0-490D-AC06-7AF4DC8C0571} = {F084DDFD-89F3-44F9-89C3-5CA11F4CDEEF} - {4B973AC0-0C60-4853-9AF7-7CB69127473E} = {F084DDFD-89F3-44F9-89C3-5CA11F4CDEEF} - {C24B1FEB-F8AC-434E-998D-5DA4D1687295} = {587959C2-5AFA-4B77-B327-566610F9A289} - {9073A593-A2F5-471E-9678-B896A7226FD4} = {F084DDFD-89F3-44F9-89C3-5CA11F4CDEEF} - {6F4670CD-6861-47A8-9A02-2B63AD73A929} = {587959C2-5AFA-4B77-B327-566610F9A289} - {20A5EBD3-75D1-4E06-8240-09EEF874017A} = {9E41CD5A-271C-4294-AAF9-8EB379311416} - {3E342BAC-EE44-44E4-8E99-393F0C9F787C} = {07B50C44-6D38-474E-87AF-68672D241EEB} - {28B90486-1436-4CD7-88D0-122B6963AB58} = {07B50C44-6D38-474E-87AF-68672D241EEB} - {755E473C-14F2-40BC-9377-2FAB11CA91DC} = {07B50C44-6D38-474E-87AF-68672D241EEB} - {5D09182A-B0B3-406C-AE88-EE0929F9260C} = {9E41CD5A-271C-4294-AAF9-8EB379311416} - {BB1EB56E-9D40-8497-5A6D-B2E35E83FA89} = {F084DDFD-89F3-44F9-89C3-5CA11F4CDEEF} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {6F730FC0-94A8-40B8-8E0E-5D6558E8422A} - EndGlobalSection -EndGlobal diff --git a/server-csharp.slnx b/server-csharp.slnx new file mode 100644 index 00000000..f2924a0e --- /dev/null +++ b/server-csharp.slnx @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 924e00f0d20f01a878eaa9987141c4edfc4f9246 Mon Sep 17 00:00:00 2001 From: CWX Date: Tue, 11 Nov 2025 09:51:22 +0000 Subject: [PATCH 12/26] Remove Duplicate Prop --- .../SPTarkov.Server.Core/Models/Eft/Ws/WsNotificationPopup.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsNotificationPopup.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsNotificationPopup.cs index 71b9e17c..e7af069b 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsNotificationPopup.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Ws/WsNotificationPopup.cs @@ -5,9 +5,6 @@ namespace SPTarkov.Server.Core.Models.Eft.Ws; public record WsNotificationPopup : WsNotificationEvent { - [JsonPropertyName("eventId")] - public MongoId EventId { get; set; } - [JsonPropertyName("image")] public string Image { get; set; } From 3d5cc4ca038804f4aea2b1cd60ec09fe1e98e8b9 Mon Sep 17 00:00:00 2001 From: Chomp Date: Tue, 11 Nov 2025 09:52:33 +0000 Subject: [PATCH 13/26] Fixed `message_send_failed_with_error` log message --- .../Servers/Ws/SptWebSocketConnectionHandler.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Servers/Ws/SptWebSocketConnectionHandler.cs b/Libraries/SPTarkov.Server.Core/Servers/Ws/SptWebSocketConnectionHandler.cs index 1c66d586..b76c9266 100644 --- a/Libraries/SPTarkov.Server.Core/Servers/Ws/SptWebSocketConnectionHandler.cs +++ b/Libraries/SPTarkov.Server.Core/Servers/Ws/SptWebSocketConnectionHandler.cs @@ -202,13 +202,13 @@ public class SptWebSocketConnectionHandler( { if (logger.IsLogEnabled(LogLevel.Debug)) { - logger.Debug(serverLocalisationService.GetText("websocket-not_ready_message_not_sent", sessionID)); + logger.Debug(serverLocalisationService.GetText("websocket-not_ready_message_not_sent", sessionID.ToString())); } } } catch (Exception err) { - logger.Error(serverLocalisationService.GetText("websocket-message_send_failed_with_error"), err); + logger.Error(serverLocalisationService.GetText("websocket-message_send_failed_with_error", err.Message), err); } } From 1e94526b2031f71269a33945c06c1245b72ad246 Mon Sep 17 00:00:00 2001 From: CWX Date: Tue, 11 Nov 2025 10:04:42 +0000 Subject: [PATCH 14/26] Fix build --- Libraries/SPTarkov.Server.Core/Helpers/NotifierHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/SPTarkov.Server.Core/Helpers/NotifierHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/NotifierHelper.cs index 7945ccb1..eb584b0a 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/NotifierHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/NotifierHelper.cs @@ -45,7 +45,7 @@ public class NotifierHelper(HttpServerHelper httpServerHelper) return new WsNotificationPopup { EventType = NotificationEventType.NotificationPopup, - EventId = new MongoId(), + EventIdentifier = new MongoId(), Image = config.BigImage, Message = messageId, }; From 3aedde5acccb308e0f61380836bba4ae0ccab07f Mon Sep 17 00:00:00 2001 From: CWX Date: Tue, 11 Nov 2025 10:07:04 +0000 Subject: [PATCH 15/26] update build props to 4.0.4 --- Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build.props b/Build.props index 8fedd051..bc0e8bdd 100644 --- a/Build.props +++ b/Build.props @@ -1,7 +1,7 @@ - 4.0.3 + 4.0.4 a12b34 0000000000 LOCAL From 29ecdc5b89237080361d2ab441025f6978240a82 Mon Sep 17 00:00:00 2001 From: sheepy <39248026+sheepiest@users.noreply.github.com> Date: Tue, 11 Nov 2025 17:29:03 +0000 Subject: [PATCH 16/26] Revise server shutdown error message (#694) Updated the error message for server shutdown notification. --- SPTarkov.Server/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SPTarkov.Server/Program.cs b/SPTarkov.Server/Program.cs index 468b619e..baaa6f6c 100644 --- a/SPTarkov.Server/Program.cs +++ b/SPTarkov.Server/Program.cs @@ -61,7 +61,7 @@ public static class Program Console.WriteLine("========================================================================================================="); Console.WriteLine( - "The server has unexpectedly stopped, reach out to #spt-support in discord, create a support thread by following the instructions found in #support-guidelines. Also include a screenshot of this message + the below error" + "The server has unexpectedly stopped, reach out to #spt-support in our Discord server. Include a screenshot of this message + the below error" ); Console.WriteLine(e); Console.WriteLine("========================================================================================================="); From fb578fc54bd2242f03603775f0047728d5c05c6c Mon Sep 17 00:00:00 2001 From: Chomp Date: Wed, 12 Nov 2025 15:29:43 +0000 Subject: [PATCH 17/26] Fixed `ragfair-offer_not_found_in_profile` locale message missing profile id --- Libraries/SPTarkov.Server.Core/Controllers/RagfairController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/SPTarkov.Server.Core/Controllers/RagfairController.cs b/Libraries/SPTarkov.Server.Core/Controllers/RagfairController.cs index f7bb313d..cbd30a25 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/RagfairController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/RagfairController.cs @@ -1019,7 +1019,7 @@ public class RagfairController( var playerOffer = playerProfileOffers?.FirstOrDefault(x => x.Id == offerId); if (playerOffer is null) { - logger.Error(localisationService.GetText("ragfair-offer_not_found_in_profile", new { offerId })); + logger.Error(localisationService.GetText("ragfair-offer_not_found_in_profile", new { offerId, profileId = sessionId })); return httpResponseUtil.AppendErrorToOutput(output, localisationService.GetText("ragfair-offer_not_found_in_profile_short")); } From ec7dbdf2bc53456b149fb2f7df0d877b2ed4a4f6 Mon Sep 17 00:00:00 2001 From: Chomp Date: Wed, 12 Nov 2025 15:32:09 +0000 Subject: [PATCH 18/26] Include brackets for loop to improve clarity --- .../Services/CircleOfCultistService.cs | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Services/CircleOfCultistService.cs b/Libraries/SPTarkov.Server.Core/Services/CircleOfCultistService.cs index 6ce97fd9..d0d38f71 100644 --- a/Libraries/SPTarkov.Server.Core/Services/CircleOfCultistService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/CircleOfCultistService.cs @@ -689,19 +689,21 @@ public class CircleOfCultistService( var questData = questHelper.GetQuestFromDb(task.QId, pmcData); var handoverConditions = questData.Conditions.AvailableForFinish.Where(condition => condition.ConditionType == "HandoverItem"); foreach (var condition in handoverConditions) - foreach (var neededItem in condition.Target.List) { - if (itemRewardBlacklist.Contains(neededItem) || !itemHelper.IsValidItem(neededItem)) + foreach (var neededItem in condition.Target.List) { - continue; - } + if (itemRewardBlacklist.Contains(neededItem) || !itemHelper.IsValidItem(neededItem)) + { + continue; + } - if (logger.IsLogEnabled(LogLevel.Debug)) - { - logger.Debug($"Added Task Loot: {itemHelper.GetItemName(neededItem)}"); - } + if (logger.IsLogEnabled(LogLevel.Debug)) + { + logger.Debug($"Added Task Loot: {itemHelper.GetItemName(neededItem)}"); + } - rewardPool.Add(neededItem); + rewardPool.Add(neededItem); + } } } } From 969e10aa80d4054f8fdb5242ffd9c29cf11f596e Mon Sep 17 00:00:00 2001 From: Chomp Date: Wed, 12 Nov 2025 16:02:11 +0000 Subject: [PATCH 19/26] Fixed pre-raid locales that can be confusing to players --- .../SPT_Data/configs/core.json | 3 ++- .../Models/Spt/Config/CoreConfig.cs | 6 +++++ .../Services/PostDbLoadService.cs | 22 +++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/Libraries/SPTarkov.Server.Assets/SPT_Data/configs/core.json b/Libraries/SPTarkov.Server.Assets/SPT_Data/configs/core.json index 5b49e941..5816f087 100644 --- a/Libraries/SPTarkov.Server.Assets/SPT_Data/configs/core.json +++ b/Libraries/SPTarkov.Server.Assets/SPT_Data/configs/core.json @@ -25,7 +25,8 @@ ], "removeModItemsFromProfile": false, "removeInvalidTradersFromProfile": false, - "fixProfileBreakingInventoryItemIssues": false + "fixProfileBreakingInventoryItemIssues": false, + "renamePreRaidLocales": true }, "survey": { "locale": { diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/CoreConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/CoreConfig.cs index cb4a6171..c59a6303 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/CoreConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/CoreConfig.cs @@ -244,6 +244,12 @@ public record GameFixes /// [JsonPropertyName("fixProfileBreakingInventoryItemIssues")] public bool FixProfileBreakingInventoryItemIssues { get; set; } + + /// + /// Should pre-raid english locales be renamed during raid start + /// + [JsonPropertyName("renamePreRaidLocales")] + public bool RenamePreRaidLocales { get; set; } } public record ServerFeatures diff --git a/Libraries/SPTarkov.Server.Core/Services/PostDbLoadService.cs b/Libraries/SPTarkov.Server.Core/Services/PostDbLoadService.cs index a3392f79..5304ca37 100644 --- a/Libraries/SPTarkov.Server.Core/Services/PostDbLoadService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/PostDbLoadService.cs @@ -136,6 +136,28 @@ public class PostDbLoadService( { ReplaceScavWavesWithRole(BotConfig.ReplaceScavWith); } + + if (CoreConfig.Fixes.RenamePreRaidLocales) + { + RenamePreraidLocales(); + } + + } + + protected void RenamePreraidLocales() + { + if (databaseService.GetLocales().Global.TryGetValue("en", out var lazyloadedValue)) + { + // We have to add a transformer here, because locales are lazy loaded due to them taking up huge space in memory + // The transformer will make sure that each time the locales are requested, the ones changed or added below are included + lazyloadedValue.AddTransformer(lazyloadedLocaleData => + { + lazyloadedLocaleData["Offline raid test mode"] = "SPT"; + lazyloadedLocaleData["Offline raid description"] = " "; + + return lazyloadedLocaleData; + }); + } } protected void ReplaceScavWavesWithRole(WildSpawnType newScavRole) From 14477bbaaaed20d11d261bc259ee49af1ae583c9 Mon Sep 17 00:00:00 2001 From: sp-tarkov-bot Date: Wed, 12 Nov 2025 16:03:17 +0000 Subject: [PATCH 20/26] Format Style Fixes --- Libraries/SPTarkov.Server.Assets/SPT_Data/configs/core.json | 2 +- Libraries/SPTarkov.Server.Core/Services/PostDbLoadService.cs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Libraries/SPTarkov.Server.Assets/SPT_Data/configs/core.json b/Libraries/SPTarkov.Server.Assets/SPT_Data/configs/core.json index 5816f087..47196e06 100644 --- a/Libraries/SPTarkov.Server.Assets/SPT_Data/configs/core.json +++ b/Libraries/SPTarkov.Server.Assets/SPT_Data/configs/core.json @@ -26,7 +26,7 @@ "removeModItemsFromProfile": false, "removeInvalidTradersFromProfile": false, "fixProfileBreakingInventoryItemIssues": false, - "renamePreRaidLocales": true + "renamePreRaidLocales": true }, "survey": { "locale": { diff --git a/Libraries/SPTarkov.Server.Core/Services/PostDbLoadService.cs b/Libraries/SPTarkov.Server.Core/Services/PostDbLoadService.cs index 5304ca37..1ec37063 100644 --- a/Libraries/SPTarkov.Server.Core/Services/PostDbLoadService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/PostDbLoadService.cs @@ -141,7 +141,6 @@ public class PostDbLoadService( { RenamePreraidLocales(); } - } protected void RenamePreraidLocales() From 0f44746943b3a3019dca93f8ee8bba60d1dcec30 Mon Sep 17 00:00:00 2001 From: Chomp Date: Wed, 12 Nov 2025 18:03:00 +0000 Subject: [PATCH 21/26] Fixed broken logging messages --- .../Services/ItemBaseClassService.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Services/ItemBaseClassService.cs b/Libraries/SPTarkov.Server.Core/Services/ItemBaseClassService.cs index 5c2a55d2..fedb694b 100644 --- a/Libraries/SPTarkov.Server.Core/Services/ItemBaseClassService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/ItemBaseClassService.cs @@ -31,7 +31,7 @@ public class ItemBaseClassService( public void HydrateItemBaseClassCache() { // Clear existing cache - _itemBaseClassesCache = new Dictionary>(); + _itemBaseClassesCache = []; var items = databaseService.GetItems(); foreach (var item in items) @@ -104,7 +104,7 @@ public class ItemBaseClassService( // Not found if (logger.IsLogEnabled(LogLevel.Debug)) { - logger.Debug(serverLocalisationService.GetText("baseclass-item_not_found", itemTpl)); + logger.Debug(serverLocalisationService.GetText("baseclass-item_not_found", itemTpl.ToString())); } // Not found in cache, Hydrate again - some mods add items late in server startup lifecycle @@ -118,7 +118,7 @@ public class ItemBaseClassService( return baseClassList.Overlaps(baseClasses); } - logger.Warning(serverLocalisationService.GetText("baseclass-item_not_found_failed", itemTpl)); + logger.Warning(serverLocalisationService.GetText("baseclass-item_not_found_failed", itemTpl.ToString())); return false; } @@ -156,7 +156,7 @@ public class ItemBaseClassService( // Not found if (logger.IsLogEnabled(LogLevel.Debug)) { - logger.Debug(serverLocalisationService.GetText("baseclass-item_not_found", itemTpl)); + logger.Debug(serverLocalisationService.GetText("baseclass-item_not_found", itemTpl.ToString())); } // Not found in cache, Hydrate again - some mods add items late in server startup lifecycle @@ -170,7 +170,7 @@ public class ItemBaseClassService( return baseClassList.Contains(baseClasses); } - logger.Warning(serverLocalisationService.GetText("baseclass-item_not_found_failed", itemTpl)); + logger.Warning(serverLocalisationService.GetText("baseclass-item_not_found_failed", itemTpl.ToString())); return false; } From ee186fdf52d1f861fc79b780c24bbc767a3c4a29 Mon Sep 17 00:00:00 2001 From: Chomp Date: Fri, 14 Nov 2025 12:29:09 +0000 Subject: [PATCH 22/26] Added `Map piece` to `Programmer's diary (Copy)` sacrifice --- .../SPT_Data/configs/hideout.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Libraries/SPTarkov.Server.Assets/SPT_Data/configs/hideout.json b/Libraries/SPTarkov.Server.Assets/SPT_Data/configs/hideout.json index d73431a8..30f80bb8 100644 --- a/Libraries/SPTarkov.Server.Assets/SPT_Data/configs/hideout.json +++ b/Libraries/SPTarkov.Server.Assets/SPT_Data/configs/hideout.json @@ -378,6 +378,16 @@ ], "craftTimeSeconds": 66, "repeatable": true + }, + { + "reward": [ + "6866665cdf54e1190902df55" + ], + "requiredItems": [ + "686665484c6f39163e076c3d" + ], + "craftTimeSeconds": 66, + "repeatable": true } ], "directRewardStackSize": { From e1fb90644a082033dd4e45f373da9ff40d36b0ba Mon Sep 17 00:00:00 2001 From: Chomp Date: Fri, 14 Nov 2025 16:41:29 +0000 Subject: [PATCH 23/26] Optimised `PrioritiseStashSort` to reduce iterating over list, reduces time taken to purchase items when player has a LOT of money stacks in stash --- .../Services/PaymentService.cs | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Services/PaymentService.cs b/Libraries/SPTarkov.Server.Core/Services/PaymentService.cs index f45cefa9..29633cef 100644 --- a/Libraries/SPTarkov.Server.Core/Services/PaymentService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/PaymentService.cs @@ -370,8 +370,9 @@ public class PaymentService( moneyItemsInInventory = noLocked.ToList(); } - // Prioritise items in stash to top of array - moneyItemsInInventory.Sort((a, b) => PrioritiseStashSort(a, b, pmcData.Inventory.Items, itemsInStashCache)); + // Sort money stacks to prioritise items in stash and not in secure to top of array + var inventoryParent = pmcData.Inventory.Items.ToDictionary(item => item.Id.ToString(), item => item.Template); + moneyItemsInInventory.Sort((a, b) => PrioritiseStashSort(a, b, inventoryParent, itemsInStashCache)); return moneyItemsInInventory; } @@ -401,13 +402,13 @@ public class PaymentService( /// /// First money stack item /// Second money stack item - /// Players inventory items + /// item id (as string) and template id KvP /// Cache of item IDs and if they're in stash /// Sort order, -1 if A has priority, 1 if B has priority, 0 if they match protected int PrioritiseStashSort( Item a, Item b, - List inventoryItems, + Dictionary itemIdToTplCache, IReadOnlyDictionary itemInStashCache ) { @@ -441,11 +442,14 @@ public class PaymentService( if (aInContainer && bInContainer) { // Containers where taking money from would inconvenience player - var aImmediateParent = inventoryItems.FirstOrDefault(item => item.Id == a.ParentId); - var bImmediateParent = inventoryItems.FirstOrDefault(item => item.Id == b.ParentId); - var aInDeprioContainer = InventoryConfig.DeprioritisedMoneyContainers.Contains(aImmediateParent.Template); - var bInDeprioContainer = InventoryConfig.DeprioritisedMoneyContainers.Contains(bImmediateParent.Template); + // Get template Id of items' parent so we can see if items in a container we want to de prioritise + var aImmediateParentTemplate = itemIdToTplCache.FirstOrDefault(item => string.Equals(item.Key, a.ParentId, StringComparison.OrdinalIgnoreCase)); + var bImmediateParentTemplate = itemIdToTplCache.FirstOrDefault(item => string.Equals(item.Key, b.ParentId, StringComparison.OrdinalIgnoreCase)); + + // e.g. secure container + var aInDeprioContainer = InventoryConfig.DeprioritisedMoneyContainers.Contains(aImmediateParentTemplate.Value); + var bInDeprioContainer = InventoryConfig.DeprioritisedMoneyContainers.Contains(bImmediateParentTemplate.Value); // Prioritize B if (!aInDeprioContainer && bInDeprioContainer) From 8ad30734502a5c3be0450d4f9fcbfee59f60719a Mon Sep 17 00:00:00 2001 From: sp-tarkov-bot Date: Fri, 14 Nov 2025 16:42:34 +0000 Subject: [PATCH 24/26] Format Style Fixes --- Libraries/SPTarkov.Server.Core/Services/PaymentService.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Services/PaymentService.cs b/Libraries/SPTarkov.Server.Core/Services/PaymentService.cs index 29633cef..3e5defde 100644 --- a/Libraries/SPTarkov.Server.Core/Services/PaymentService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/PaymentService.cs @@ -444,8 +444,12 @@ public class PaymentService( // Containers where taking money from would inconvenience player // Get template Id of items' parent so we can see if items in a container we want to de prioritise - var aImmediateParentTemplate = itemIdToTplCache.FirstOrDefault(item => string.Equals(item.Key, a.ParentId, StringComparison.OrdinalIgnoreCase)); - var bImmediateParentTemplate = itemIdToTplCache.FirstOrDefault(item => string.Equals(item.Key, b.ParentId, StringComparison.OrdinalIgnoreCase)); + var aImmediateParentTemplate = itemIdToTplCache.FirstOrDefault(item => + string.Equals(item.Key, a.ParentId, StringComparison.OrdinalIgnoreCase) + ); + var bImmediateParentTemplate = itemIdToTplCache.FirstOrDefault(item => + string.Equals(item.Key, b.ParentId, StringComparison.OrdinalIgnoreCase) + ); // e.g. secure container var aInDeprioContainer = InventoryConfig.DeprioritisedMoneyContainers.Contains(aImmediateParentTemplate.Value); From 87b2597ebc6728a891896742b427299bd250bb37 Mon Sep 17 00:00:00 2001 From: Archangel Date: Fri, 14 Nov 2025 18:10:02 +0100 Subject: [PATCH 25/26] Add obsolete markers from 4.1 --- Libraries/SPTarkov.Server.Core/Servers/ConfigServer.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Libraries/SPTarkov.Server.Core/Servers/ConfigServer.cs b/Libraries/SPTarkov.Server.Core/Servers/ConfigServer.cs index 669c15d3..24558f51 100644 --- a/Libraries/SPTarkov.Server.Core/Servers/ConfigServer.cs +++ b/Libraries/SPTarkov.Server.Core/Servers/ConfigServer.cs @@ -10,6 +10,7 @@ using LogLevel = SPTarkov.Server.Core.Models.Spt.Logging.LogLevel; namespace SPTarkov.Server.Core.Servers; [Injectable(InjectionType.Singleton)] +[Obsolete("This class will be removed in SPT 4.2 in favor for directly injecting the configuration into classes")] public class ConfigServer { protected readonly FrozenSet acceptableFileExtensions = ["json", "jsonc"]; @@ -30,6 +31,7 @@ public class ConfigServer } } + [Obsolete("This method will be removed in SPT 4.2 in favor for directly injecting the configuration into classes")] public T GetConfig() where T : BaseConfig { From 1bba5081ea516219c11e6acdb0a51715b7815bbe Mon Sep 17 00:00:00 2001 From: Chomp Date: Mon, 17 Nov 2025 14:28:51 +0000 Subject: [PATCH 26/26] Force change to make release have new filename --- .../SPTarkov.Server.Core/Callbacks/AchievementCallbacks.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/SPTarkov.Server.Core/Callbacks/AchievementCallbacks.cs b/Libraries/SPTarkov.Server.Core/Callbacks/AchievementCallbacks.cs index 92775532..10f2e995 100644 --- a/Libraries/SPTarkov.Server.Core/Callbacks/AchievementCallbacks.cs +++ b/Libraries/SPTarkov.Server.Core/Callbacks/AchievementCallbacks.cs @@ -20,7 +20,7 @@ public class AchievementCallbacks(AchievementController achievementController, H } /// - /// Handle client/achievement/statistic + /// Handle client/achievement/statistic /// /// public ValueTask Statistic(string url, EmptyRequestData _, MongoId sessionID)