Adds style cop (#109)

This commit is contained in:
Kamron Batman 2020-04-26 00:16:02 -07:00 committed by GitHub
parent 3e715bcb60
commit 556a17aba8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1725 changed files with 33831 additions and 38046 deletions

View file

@ -12,20 +12,21 @@ namespace Server.Misc
public static class ProfanityProtection
{
private static bool Enabled = false;
// TODO: Move this to configuration
private static readonly bool Enabled = false;
private static ProfanityAction
private static readonly ProfanityAction
Action = ProfanityAction.Disallow; // change here what to do when profanity is detected
public static char[] Exceptions{ get; } =
public static char[] Exceptions { get; } =
{
' ', '-', '.', '\'', '"', ',', '_', '+', '=', '~', '`', '!', '^', '*', '\\', '/', ';', ':', '<', '>', '[', ']',
'{', '}', '?', '|', '(', ')', '%', '$', '&', '#', '@'
};
public static string[] StartDisallowed{ get; } = { };
public static string[] StartDisallowed { get; } = { };
public static string[] Disallowed{ get; } =
public static string[] Disallowed { get; } =
{
"jigaboo",
"chigaboo",
@ -93,16 +94,16 @@ namespace Server.Misc
from.CriminalAction(false);
return true;
case ProfanityAction.Disconnect:
{
from.NetState?.Dispose();
{
from.NetState?.Dispose();
return false;
}
return false;
}
default:
case ProfanityAction.Other: // TODO: Provide custom implementation if this is chosen
{
return true;
}
{
return true;
}
}
}