Quick fixes (awesome name)

This commit is contained in:
FeTetra 2025-05-25 22:10:31 -04:00
commit 0c8ff50176
5 changed files with 15 additions and 13 deletions

View file

@ -6,9 +6,15 @@ public static class PatchworkHelper
{
static int patchworkMajorVer = ServerConfiguration.Instance.PatchworkMajorVersionMinimum;
static int patchworkMinorVer = ServerConfiguration.Instance.PatchworkMinorVersionMinimum;
public static bool userHasValidPatchworkUserAgent(string userAgent)
public static bool UserHasValidPatchworkUserAgent(string userAgent)
{
if (userAgent.StartsWith("PatchworkLBP"))
string userAgentPrefix = "PatchworkLBP";
char gameVersion = userAgent[userAgentPrefix.Length];
if (userAgent.StartsWith(userAgentPrefix))
return false;
if (gameVersion is not '1' or '2' or '3' or 'V')
return false;
string[] patchworkVer = userAgent.Split(' ')[1].Split('.');