diff --git a/ProjectLighthouse.Servers.GameServer/Helpers/PatchworkHelper.cs b/ProjectLighthouse.Servers.GameServer/Helpers/PatchworkHelper.cs index 2723573c..3a7f604f 100644 --- a/ProjectLighthouse.Servers.GameServer/Helpers/PatchworkHelper.cs +++ b/ProjectLighthouse.Servers.GameServer/Helpers/PatchworkHelper.cs @@ -5,8 +5,8 @@ namespace LBPUnion.ProjectLighthouse.Servers.GameServer.Helpers; public static partial class PatchworkHelper { - static readonly int requiredMajor = ServerConfiguration.Instance.Authentication.PatchworkMajorVersionMinimum; - static readonly int requiredMinor = ServerConfiguration.Instance.Authentication.PatchworkMinorVersionMinimum; + private static readonly int requiredMajor = ServerConfiguration.Instance.Authentication.PatchworkMajorVersionMinimum; + private static readonly int requiredMinor = ServerConfiguration.Instance.Authentication.PatchworkMinorVersionMinimum; [GeneratedRegex(@"^PatchworkLBP[123V] (\d{1,5})\.(\d{1,5})$")] private static partial Regex PatchworkUserAgentRegex(); diff --git a/ProjectLighthouse.Tests.GameApiTests/Unit/PatchworkUserAgentTests.cs b/ProjectLighthouse.Tests.GameApiTests/Unit/PatchworkUserAgentTests.cs index b5658f73..5567fc91 100644 --- a/ProjectLighthouse.Tests.GameApiTests/Unit/PatchworkUserAgentTests.cs +++ b/ProjectLighthouse.Tests.GameApiTests/Unit/PatchworkUserAgentTests.cs @@ -30,15 +30,15 @@ public class PatchworkUserAgentTests }; bool result; - for (int i = 0; i < validUserAgents.Length; i++) + foreach (string userAgent in validUserAgents) { - result = PatchworkHelper.IsValidPatchworkUserAgent(validUserAgents[i]); - Assert.True(result, $"Valid user agent: \"{validUserAgents[i]}\" was evaluated as {result}."); + result = PatchworkHelper.IsValidPatchworkUserAgent(userAgent); + Assert.True(result, $"Valid user agent: \"{userAgent}\" was evaluated as {result}."); } - for (int i = 0; i < invalidUserAgents.Length; i++) + foreach (string userAgent in invalidUserAgents) { - result = PatchworkHelper.IsValidPatchworkUserAgent(invalidUserAgents[i]); - Assert.False(result, $"Invalid user agent: \"{invalidUserAgents[i]}\" was evaluated as {result}."); + result = PatchworkHelper.IsValidPatchworkUserAgent(userAgent); + Assert.False(result, $"Invalid user agent: \"{userAgent}\" was evaluated as {result}."); } } } \ No newline at end of file