Flagged various strings as consts

This commit is contained in:
Chomp
2025-02-06 12:57:23 +00:00
parent 9b33dd2d35
commit 83f9c0c3eb
6 changed files with 9 additions and 11 deletions
@@ -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";
/// <summary>
/// Get purchasable clothing items from trader that match players side (usec/bear)
+1 -1
View File
@@ -14,7 +14,7 @@ public class ConfigServer
protected JsonUtil _jsonUtil;
protected FileUtil _fileUtil;
protected Dictionary<string, object> configs = new();
protected readonly string[] acceptableFileExtensions = ["json", "jsonc"];
protected static readonly string[] acceptableFileExtensions = ["json", "jsonc"];
public ConfigServer(
ISptLogger<ConfigServer> logger,
+1 -1
View File
@@ -22,7 +22,7 @@ public class SaveServer(
ConfigServer _configServer
)
{
protected string profileFilepath = "user/profiles/";
protected const string profileFilepath = "user/profiles/";
protected Dictionary<string, SptProfile> profiles = new();
private Lock _lock = new();
@@ -14,7 +14,7 @@ public class BundleHashCacheService(
)
{
protected Dictionary<string, string> _bundleHashes = new();
protected readonly string _bundleHashCachePath = "./user/cache/bundleHashCache.json";
protected static readonly string _bundleHashCachePath = "./user/cache/bundleHashCache.json";
public string GetStoredValue(string key)
{
+2 -2
View File
@@ -8,8 +8,8 @@ public class I18nService
{
private List<string> _locales;
private Dictionary<string, string> _fallbacks;
private string _defaultLocale;
private string _directory;
private readonly string _defaultLocale;
private readonly string _directory;
private JsonUtil _jsonUtil;
private FileUtil _fileUtil;
private string _setLocale;
+2 -1
View File
@@ -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<DatabaseImporter> _logger;
protected LocalisationService _localisationService;
@@ -62,7 +63,7 @@ public class DatabaseImporter : OnLoad
*/
public string GetSptDataPath()
{
return "./Assets/";
return _sptDataPath;
}
public async Task OnLoad()