Revert "Updates Packets & Randomizer (#43)" (#61)

This reverts commit 179cb50557.
This commit is contained in:
Kamron Batman 2019-11-11 08:46:11 -08:00 • committed by GitHub
parent 179cb50557
commit c2ecc76457
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
588 changed files with 16260 additions and 10926 deletions

View file

@ -1,6 +1,6 @@
namespace Server.Misc
{
public static class NameVerification
public class NameVerification
{
public static readonly char[] SpaceDashPeriodQuote =
{
@ -148,9 +148,20 @@ namespace Server.Misc
exceptCount = 0;
}
else if (exceptCount++ == maxExceptions || exceptions.All(exception => exception != c) ||
i == 0 && noExceptionsAtStart)
return false;
else
{
bool except = false;
for (int j = 0; !except && j < exceptions.Length; ++j)
if (c == exceptions[j])
except = true;
if (!except || i == 0 && noExceptionsAtStart)
return false;
if (exceptCount++ == maxExceptions)
return false;
}
}
for (int i = 0; i < disallowed.Length; ++i)
@ -177,7 +188,11 @@ namespace Server.Misc
return false;
}
return startDisallowed.All(t => !name.StartsWith(t));
for (int i = 0; i < startDisallowed.Length; ++i)
if (name.StartsWith(startDisallowed[i]))
return false;
return true;
}
}
}
}