Added offerListingTaxMultiplier to ragfair config and wired up. Defaults to off
This commit is contained in:
@@ -462,5 +462,6 @@
|
||||
"5ac3b934156ae10c4430e83c": true,
|
||||
"5c0647fdd443bc2504c2d371": true,
|
||||
"6617beeaa9cfa777ca915b7c": true
|
||||
}
|
||||
},
|
||||
"offerListingTaxMultiplier": -1
|
||||
}
|
||||
|
||||
@@ -26,17 +26,23 @@ public record RagfairConfig : BaseConfig
|
||||
[JsonPropertyName("sell")]
|
||||
public required Sell Sell { get; set; }
|
||||
|
||||
[JsonPropertyName("dynamic")]
|
||||
public required Dynamic Dynamic { get; set; }
|
||||
|
||||
[JsonPropertyName("tieredFlea")]
|
||||
public required TieredFlea TieredFlea { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Trader ids + should their assorts be listed on flea
|
||||
/// </summary>
|
||||
[JsonPropertyName("traders")]
|
||||
public required Dictionary<MongoId, bool> Traders { get; set; }
|
||||
|
||||
[JsonPropertyName("dynamic")]
|
||||
public required Dynamic Dynamic { get; set; }
|
||||
|
||||
[JsonPropertyName("tieredFlea")]
|
||||
public required TieredFlea TieredFlea { get; set; }
|
||||
/// <summary>
|
||||
/// Flea tax multi, default is off (-1)
|
||||
/// </summary>
|
||||
[JsonPropertyName("offerListingTaxMultiplier")]
|
||||
public int OfferListingTaxMultiplier { get; set; }
|
||||
}
|
||||
|
||||
public record Sell
|
||||
|
||||
@@ -6,7 +6,9 @@ using SPTarkov.Server.Core.Models.Eft.Common;
|
||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||
using SPTarkov.Server.Core.Models.Eft.Ragfair;
|
||||
using SPTarkov.Server.Core.Models.Enums;
|
||||
using SPTarkov.Server.Core.Models.Spt.Config;
|
||||
using SPTarkov.Server.Core.Models.Utils;
|
||||
using SPTarkov.Server.Core.Servers;
|
||||
using SPTarkov.Server.Core.Utils.Cloners;
|
||||
using LogLevel = SPTarkov.Server.Core.Models.Spt.Logging.LogLevel;
|
||||
|
||||
@@ -18,11 +20,14 @@ public class RagfairTaxService(
|
||||
DatabaseService databaseService,
|
||||
RagfairPriceService ragfairPriceService,
|
||||
ItemHelper itemHelper,
|
||||
ConfigServer configServer,
|
||||
ICloner cloner
|
||||
)
|
||||
{
|
||||
protected readonly Dictionary<MongoId, StorePlayerOfferTaxAmountRequestData> _playerOfferTaxCache = new();
|
||||
|
||||
protected readonly RagfairConfig RagfairConfig = configServer.GetConfig<RagfairConfig>();
|
||||
|
||||
public void StoreClientOfferTaxValue(MongoId sessionId, StorePlayerOfferTaxAmountRequestData offer)
|
||||
{
|
||||
_playerOfferTaxCache[offer.Id.Value] = offer;
|
||||
@@ -113,6 +118,11 @@ public class RagfairTaxService(
|
||||
logger.Debug($"Tax Calculated to be: {taxValue}");
|
||||
}
|
||||
|
||||
if (RagfairConfig.OfferListingTaxMultiplier != -1)
|
||||
{
|
||||
taxValue *= RagfairConfig.OfferListingTaxMultiplier;
|
||||
}
|
||||
|
||||
return taxValue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user