New plugin: NameFilter

Remove un-typable characters from players names.
This commit is contained in:
BotoX
2016-12-05 18:57:05 +01:00
parent 8598179f26
commit 4c6a9e7f57
2 changed files with 352 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
"filters"
{
// this is what the filtered characters are replaced by, do "" to just remove them
"censor" ""
// regex expression for filtering, matches are replaced by the censor, here we are using a whitelist - this would strip unicode characters
"filter" "[^A-Za-z0-9\s!@#$%^&*()-_+=-`~\\\]\[{}|';:/.,?><]"
// series of regex expressions for names POST FILTER, matches will get replacement names
"banned"
{
"1" "[Aa4]+[Dd]+[Mm]+[IiL1]+[nN]+"
"2" "@((!?)me|(c?)t(s?)|(!?)admins|(!?)friends|random((c?)t?)|humans|spec|alive|dead|aim|bots)"
}
// replacement names, granted by banned filter, or if the name is too short (<2)
"names"
{
"1" "BAD_NAME"
}
}