From 82efbfc7db98b28e74d9d903c6aa21e48f992df5 Mon Sep 17 00:00:00 2001 From: R3ality Date: Sun, 27 Jul 2025 13:36:38 +0300 Subject: [PATCH] Refactor Json key name to offerCurrencyChancePercent --- .../SPTarkov.Server.Assets/SPT_Data/configs/ragfair.json | 3 +-- .../SPTarkov.Server.Core/Helpers/RagfairServerHelper.cs | 2 +- .../SPTarkov.Server.Core/Models/Spt/Config/RagfairConfig.cs | 6 +++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Libraries/SPTarkov.Server.Assets/SPT_Data/configs/ragfair.json b/Libraries/SPTarkov.Server.Assets/SPT_Data/configs/ragfair.json index 992b8dbc..faac4d8f 100644 --- a/Libraries/SPTarkov.Server.Assets/SPT_Data/configs/ragfair.json +++ b/Libraries/SPTarkov.Server.Assets/SPT_Data/configs/ragfair.json @@ -1,6 +1,5 @@ { "dynamic": { - "_currencies": "what percentage of the offers are in each currency", "armor": { "plateSlotIdToRemovePool": [ "front_plate", @@ -229,7 +228,7 @@ } } }, - "currencies": { + "offerCurrencyChancePercent": { "5449016a4bdc2d6f028b456f": 78, "5696686a4bdc2da3298b456a": 14, "569668774bdc2da2298b4568": 8 diff --git a/Libraries/SPTarkov.Server.Core/Helpers/RagfairServerHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/RagfairServerHelper.cs index 6faa08f4..f8a20be9 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/RagfairServerHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/RagfairServerHelper.cs @@ -199,7 +199,7 @@ public class RagfairServerHelper( /// Currency TPL public MongoId GetDynamicOfferCurrency() { - return weightedRandomHelper.GetWeightedValue(ragfairConfig.Dynamic.Currencies); + return weightedRandomHelper.GetWeightedValue(ragfairConfig.Dynamic.OfferCurrencyChangePercent); } /// diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/RagfairConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/RagfairConfig.cs index edf6d955..582fbdcd 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/RagfairConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/RagfairConfig.cs @@ -202,10 +202,10 @@ public record Dynamic public Dictionary? ItemPriceMultiplier { get; set; } /// - /// Percentages to sell offers in each currency + /// Percentage chance for offers to be listed in specified currency /// - [JsonPropertyName("currencies")] - public required Dictionary Currencies { get; set; } + [JsonPropertyName("offerCurrencyChancePercent")] + public required Dictionary OfferCurrencyChangePercent { get; set; } /// /// Item tpls that should be forced to sell as a single item