UFilter automatically blocks or censors advertising of IP addresses, domain names, and profanity in names and messages. The plugin also features ban, kick, kill, and slap punishment options if simply blocking or censoring isn't enough. IP addresses, domain names, and words can be whitelisted in the configuration file if needed.
Permissions
ufilter.admin
-- Allows player to add/remove words from the profanity listufilter.bypass
-- Allows player to bypass advertisement and profanity checks
Commands
This plugin offers both chat and console commands. When using a command chat, prefix with a forward slash: /
.
ufilter add <word or string>
-- Add the specified word or string to the profanity listufilter remove <word or string>
-- Remove the specified word or string from the profanity listufilter list
-- Show all words in the profanity list
Configuration
{
"Check for advertising (true/false)": true,
"Check for profanity (true/false)": true,
"Check player chat (true/false)": true,
"Check player names (true/false)": true,
"Log advertising (true/false)": false,
"Log profanity (true/false)": false,
"Log to console (true/false)": false,
"Log to file (true/false)": false,
"Warn player in chat (true/false)": true,
"Action for advertising": "block",
"Action for profanity": "censor",
"Word or symbol to use for censoring": "*",
"Allowed advertisements": [
"1.1.1.1",
"umod.org"
],
"Allowed profanity": [
"butt",
"fluffer",
"monkey"
]
}
Localization
{
"CommandUsage": "Usage:\n{0} <add/remove> <word or phrase>\n{0} <list> shows profanity list",
"NoAdvertising": "Advertising is not allowed on this server",
"NoData": "The profanity list is empty",
"NoProfanity": "Profanity is not allowed on this server",
"NotAllowed": "You are not allowed to use the '{0}' command",
"WordAdded": "Word '{0}' was added to the profanity list",
"WordListed": "Word '{0}' is already in the profanity list",
"WordNotListed": "Word '{0}' is not in the profanity list",
"WordRemoved": "Word '{0}' was removed from the profanity list"
}
Developer API
API Methods
GetProfanities
Used to get the current profanity list.
string[] GetProfanities()
- Example:
if (UFilter != null && UFilter.IsLoaded)
{
string[] profanities = UFilter.Call("GetProfanities") as string[];
if (profanities != null)
{
Puts($"{profanities.Length} profanities loaded");
}
}
GetAllowedProfanity
Used to get the current allowed profanity list.
string[] GetAllowedProfanity()
- Example:
if (UFilter != null && UFilter.IsLoaded)
{
string[] allowedProfanity = UFilter.Call("GetAllowedProfanity") as string[];
if (allowedProfanity != null)
{
Puts($"{allowedProfanity.Length} allowed profanities loaded");
}
}
AddProfanity
Used to add word or phrase to the profanity list.
bool AddProfanity(string profanity)
- Example:
string profanity = "word or phrase";
if (UFilter != null && UFilter.IsLoaded)
{
object resultCall = UFilter.Call("AddProfanity", profanity);
if (resultCall is bool && (bool)resultCall)
{
Puts($"'{profanity}' was added to the profanity list");
}
}
RemoveProfanity
Used to remove word or phrase to the profanity list.
bool RemoveProfanity(string profanity)
- Example:
string profanity = "word or phrase";
if (UFilter != null && UFilter.IsLoaded)
{
object resultCall = UFilter.Call("RemoveProfanity", profanity);
if (resultCall is bool && (bool)resultCall)
{
Puts($"'{profanity}' was removed frome the profanity list");
}
}
Hooks
OnProfanityAdded
OnProfanityAdded
is called when word or phrase was added to the profanity list.
private void OnProfanityAdded(string profanity)
{
Puts($"'{profanity}' was added to the profanity list");
}
OnProfanityRemoved
OnProfanityRemoved
is called when word or phrase was removed from the profanity list.
private void OnProfanityRemoved(string profanity)
{
Puts($"'{profanity}' was removed from the profanity list");
}
MIT License, with distribution exclusivity for uMod.org
Copyright (c) 2020 Wulf
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.