diff --git a/Libraries/SPTarkov.Server.Core/Controllers/RagfairController.cs b/Libraries/SPTarkov.Server.Core/Controllers/RagfairController.cs index 7f739727..86cf69a2 100644 --- a/Libraries/SPTarkov.Server.Core/Controllers/RagfairController.cs +++ b/Libraries/SPTarkov.Server.Core/Controllers/RagfairController.cs @@ -275,7 +275,7 @@ public class RagfairController( var playerHasFleaUnlocked = pmcProfile.Info.Level >= databaseService.GetGlobals().Configuration.RagFair.MinUserLevel; - List offerPool = []; + List offerPool; if (IsLinkedSearch(searchRequest) || IsRequiredSearch(searchRequest)) { offerPool = offers; diff --git a/Libraries/SPTarkov.Server.Core/Helpers/HideoutHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/HideoutHelper.cs index c5190fc2..35dabc70 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/HideoutHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/HideoutHelper.cs @@ -847,9 +847,6 @@ public class HideoutHelper( filterDrainRate ); - // Production hasn't completed - var pointsConsumed = 0D; - // Check progress against the productions craft time (don't use base time as it doesn't include any time bonuses profile has) if (production.Progress > production.ProductionTime) // Craft is complete nothing to do @@ -866,10 +863,11 @@ public class HideoutHelper( continue; } - var waterFilterItemInSlot = waterFilterArea.Slots[i].Items[0]; + var waterFilterItemInSlot = waterFilterArea.Slots[i].Items.FirstOrDefault(); // How many units of filter are left - var resourceValue = waterFilterItemInSlot.Upd?.Resource?.Value; + var resourceValue = waterFilterItemInSlot?.Upd?.Resource?.Value; + double pointsConsumed; if (resourceValue is null) { // Missing, is new filter, add default and subtract usage @@ -911,7 +909,7 @@ public class HideoutHelper( logger.Debug($"Water filter has: {resourceValue} units left in slot {i + 1}"); } - break; // Break here to avoid iterating other filters now w're done + break; // Break here to avoid iterating other filters now we're done } // Filter ran out / used up diff --git a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Trader.cs b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Trader.cs index 2637047c..279bdfd6 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Trader.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Eft/Common/Tables/Trader.cs @@ -12,13 +12,13 @@ public record Trader public Dictionary? ExtensionData { get; set; } [JsonPropertyName("assort")] - public TraderAssort? Assort { get; set; } + public TraderAssort Assort { get; set; } [JsonPropertyName("base")] - public TraderBase? Base { get; set; } + public TraderBase Base { get; set; } [JsonPropertyName("dialogue")] - public Dictionary?>? Dialogue { get; set; } + public Dictionary?> Dialogue { get; set; } [JsonPropertyName("questassort")] public Dictionary>? QuestAssort { get; set; } @@ -257,13 +257,13 @@ public record TraderAssort public double? NextResupply { get; set; } [JsonPropertyName("items")] - public List? Items { get; set; } + public List Items { get; set; } [JsonPropertyName("barter_scheme")] - public Dictionary>>? BarterScheme { get; set; } + public Dictionary>> BarterScheme { get; set; } [JsonPropertyName("loyal_level_items")] - public Dictionary? LoyalLevelItems { get; set; } + public Dictionary LoyalLevelItems { get; set; } } public record BarterScheme diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Hideout/Hideout.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Hideout/Hideout.cs index 9ec39dee..3d88eef2 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Hideout/Hideout.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Hideout/Hideout.cs @@ -9,20 +9,20 @@ public record Hideout public Dictionary? ExtensionData { get; set; } [JsonPropertyName("areas")] - public List? Areas { get; set; } + public List Areas { get; set; } [JsonPropertyName("customAreas")] public List? CustomAreas { get; set; } [JsonPropertyName("customisation")] - public HideoutCustomisation? Customisation { get; set; } + public HideoutCustomisation Customisation { get; set; } [JsonPropertyName("production")] - public HideoutProductionData? Production { get; set; } + public HideoutProductionData Production { get; set; } [JsonPropertyName("settings")] - public HideoutSettingsBase? Settings { get; set; } + public HideoutSettingsBase Settings { get; set; } [JsonPropertyName("qte")] - public List? Qte { get; set; } + public List Qte { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Server/DatabaseTables.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Server/DatabaseTables.cs index a1d14556..571df254 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Server/DatabaseTables.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Server/DatabaseTables.cs @@ -10,23 +10,23 @@ public record DatabaseTables [JsonExtensionData] public Dictionary? ExtensionData { get; set; } - public Bots.Bots? Bots { get; set; } + public Bots.Bots Bots { get; set; } - public Hideout.Hideout? Hideout { get; set; } + public Hideout.Hideout Hideout { get; set; } - public LocaleBase? Locales { get; set; } + public LocaleBase Locales { get; set; } - public Locations? Locations { get; set; } + public Locations Locations { get; set; } - public Match? Match { get; set; } + public Match Match { get; set; } - public Templates.Templates? Templates { get; set; } + public Templates.Templates Templates { get; set; } public Dictionary Traders { get; set; } - public Globals? Globals { get; set; } + public Globals Globals { get; set; } - public ServerBase? Server { get; set; } + public ServerBase Server { get; set; } - public SettingsBase? Settings { get; set; } + public SettingsBase Settings { get; set; } } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Server/Locations.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Server/Locations.cs index 9b050af8..f09d2dba 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Server/Locations.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Server/Locations.cs @@ -61,46 +61,46 @@ public record Locations private Dictionary? _locationDictionaryCache; [JsonPropertyName("bigmap")] - public Eft.Common.Location? Bigmap { get; set; } + public Eft.Common.Location Bigmap { get; set; } [JsonPropertyName("develop")] public Eft.Common.Location? Develop { get; set; } [JsonPropertyName("factory4_day")] - public Eft.Common.Location? Factory4Day { get; set; } + public Eft.Common.Location Factory4Day { get; set; } [JsonPropertyName("factory4_night")] - public Eft.Common.Location? Factory4Night { get; set; } + public Eft.Common.Location Factory4Night { get; set; } [JsonPropertyName("hideout")] public Eft.Common.Location? Hideout { get; set; } [JsonPropertyName("interchange")] - public Eft.Common.Location? Interchange { get; set; } + public Eft.Common.Location Interchange { get; set; } [JsonPropertyName("laboratory")] - public Eft.Common.Location? Laboratory { get; set; } + public Eft.Common.Location Laboratory { get; set; } [JsonPropertyName("lighthouse")] - public Eft.Common.Location? Lighthouse { get; set; } + public Eft.Common.Location Lighthouse { get; set; } [JsonPropertyName("privatearea")] public Eft.Common.Location? PrivateArea { get; set; } [JsonPropertyName("rezervbase")] - public Eft.Common.Location? RezervBase { get; set; } + public Eft.Common.Location RezervBase { get; set; } [JsonPropertyName("shoreline")] - public Eft.Common.Location? Shoreline { get; set; } + public Eft.Common.Location Shoreline { get; set; } [JsonPropertyName("suburbs")] public Eft.Common.Location? Suburbs { get; set; } [JsonPropertyName("tarkovstreets")] - public Eft.Common.Location? TarkovStreets { get; set; } + public Eft.Common.Location TarkovStreets { get; set; } [JsonPropertyName("labyrinth")] - public Eft.Common.Location? Labyrinth { get; set; } + public Eft.Common.Location Labyrinth { get; set; } [JsonPropertyName("terminal")] public Eft.Common.Location? Terminal { get; set; } @@ -109,13 +109,13 @@ public record Locations public Eft.Common.Location? Town { get; set; } [JsonPropertyName("woods")] - public Eft.Common.Location? Woods { get; set; } + public Eft.Common.Location Woods { get; set; } [JsonPropertyName("sandbox")] - public Eft.Common.Location? Sandbox { get; set; } + public Eft.Common.Location Sandbox { get; set; } [JsonPropertyName("sandbox_high")] - public Eft.Common.Location? SandboxHigh { get; set; } + public Eft.Common.Location SandboxHigh { get; set; } /// /// Holds a mapping of the linkages between locations on the UI diff --git a/Libraries/SPTarkov.Server.Core/Servers/Http/SptHttpListener.cs b/Libraries/SPTarkov.Server.Core/Servers/Http/SptHttpListener.cs index 8127204d..90b17544 100644 --- a/Libraries/SPTarkov.Server.Core/Servers/Http/SptHttpListener.cs +++ b/Libraries/SPTarkov.Server.Core/Servers/Http/SptHttpListener.cs @@ -59,7 +59,7 @@ public class SptHttpListener( || compressHeader != "0"; var requestCompressed = req.Method == "PUT" || requestIsCompressed; - var body = string.Empty; + string body; using MemoryStream bufferStream = new(); var buffer = new byte[BodyReadBufferSize];