diff --git a/Libraries/Core/Controllers/CustomizationController.cs b/Libraries/Core/Controllers/CustomizationController.cs index 0843525d..7ee551cd 100644 --- a/Libraries/Core/Controllers/CustomizationController.cs +++ b/Libraries/Core/Controllers/CustomizationController.cs @@ -1,4 +1,3 @@ -using System.Text.Json; using Core.Helpers; using Core.Models.Common; using Core.Models.Eft.Common; @@ -14,8 +13,6 @@ using Core.Servers; using Core.Services; using Core.Utils.Cloners; using SptCommon.Annotations; -using SptCommon.Extensions; -using Location = Core.Models.Eft.Inventory.Location; namespace Core.Controllers; @@ -31,8 +28,8 @@ public class CustomizationController( PaymentService _paymentService ) { - protected string _lowerParentClothingId = "5cd944d01388ce000a659df9"; - protected string _upperParentClothingId = "5cd944ca1388ce03a44dc2a4"; + protected const string _lowerParentClothingId = "5cd944d01388ce000a659df9"; + protected const string _upperParentClothingId = "5cd944ca1388ce03a44dc2a4"; /// /// Get purchasable clothing items from trader that match players side (usec/bear) diff --git a/Libraries/Core/Servers/ConfigServer.cs b/Libraries/Core/Servers/ConfigServer.cs index a0010449..309e7f45 100644 --- a/Libraries/Core/Servers/ConfigServer.cs +++ b/Libraries/Core/Servers/ConfigServer.cs @@ -14,7 +14,7 @@ public class ConfigServer protected JsonUtil _jsonUtil; protected FileUtil _fileUtil; protected Dictionary configs = new(); - protected readonly string[] acceptableFileExtensions = ["json", "jsonc"]; + protected static readonly string[] acceptableFileExtensions = ["json", "jsonc"]; public ConfigServer( ISptLogger logger, diff --git a/Libraries/Core/Servers/SaveServer.cs b/Libraries/Core/Servers/SaveServer.cs index c860f5ea..ee0ae845 100644 --- a/Libraries/Core/Servers/SaveServer.cs +++ b/Libraries/Core/Servers/SaveServer.cs @@ -22,7 +22,7 @@ public class SaveServer( ConfigServer _configServer ) { - protected string profileFilepath = "user/profiles/"; + protected const string profileFilepath = "user/profiles/"; protected Dictionary profiles = new(); private Lock _lock = new(); diff --git a/Libraries/Core/Services/Cache/BundleHashCacheService.cs b/Libraries/Core/Services/Cache/BundleHashCacheService.cs index dafe2aed..28c4bced 100644 --- a/Libraries/Core/Services/Cache/BundleHashCacheService.cs +++ b/Libraries/Core/Services/Cache/BundleHashCacheService.cs @@ -14,7 +14,7 @@ public class BundleHashCacheService( ) { protected Dictionary _bundleHashes = new(); - protected readonly string _bundleHashCachePath = "./user/cache/bundleHashCache.json"; + protected static readonly string _bundleHashCachePath = "./user/cache/bundleHashCache.json"; public string GetStoredValue(string key) { diff --git a/Libraries/Core/Services/I18nService.cs b/Libraries/Core/Services/I18nService.cs index 9efd3158..8a4ad72f 100644 --- a/Libraries/Core/Services/I18nService.cs +++ b/Libraries/Core/Services/I18nService.cs @@ -8,8 +8,8 @@ public class I18nService { private List _locales; private Dictionary _fallbacks; - private string _defaultLocale; - private string _directory; + private readonly string _defaultLocale; + private readonly string _directory; private JsonUtil _jsonUtil; private FileUtil _fileUtil; private string _setLocale; diff --git a/Libraries/Core/Utils/DatabaseImporter.cs b/Libraries/Core/Utils/DatabaseImporter.cs index 4244079f..cc2df36f 100644 --- a/Libraries/Core/Utils/DatabaseImporter.cs +++ b/Libraries/Core/Utils/DatabaseImporter.cs @@ -18,6 +18,7 @@ public class DatabaseImporter : OnLoad private ValidationResult valid = ValidationResult.UNDEFINED; private string filepath; private HttpConfig httpConfig; + private const string _sptDataPath = "./Assets/"; protected ISptLogger _logger; protected LocalisationService _localisationService; @@ -62,7 +63,7 @@ public class DatabaseImporter : OnLoad */ public string GetSptDataPath() { - return "./Assets/"; + return _sptDataPath; } public async Task OnLoad()