User Tools

Site Tools


Sidebar

B3 Homepage


Main Links


Support Subjects


Related Links


This wiki was updated recently and all user accounts were reset. If you want to contribute to this documentation wiki drop me an email at xlr8or[at]bigbrotherbot[dot]net.

usage:censor_plugin

Censor Plugin

The censor plugin monitors chat messages and player names for banned words. Whenever a player connects, renames himself or chats using a banned word he will receive a penalty.

A default penalty is set for bad words and another one is set for bad names. In the default config file that comes with this plugin they are a warning with keywordreason 'cuss' for bad words and a warning with keywordreason 'badname' for badnames. To alter how long these warnings remain active, refer to the 'cuss' and 'badname' settings in your admin plugin config file (look at section warn_reasons). In the default config file for the admin plugin, 'cuss' warnings remain active for 3 days and 'badname' warnings for 1 hour. Those default penalties can be customized for given bad words or bad names in the config.

Remember that B3 will tempban any player having an excessive number of active warnings. The maximum number of active warning allowed is defined in the admin plugin config file (see alert_kick_num). If you want to increase the duration of the tempban that will occur from an excessive number of warning, increase the duration for which a warning will remain active.

B3 has been pre-programmed with a list of profanities in many languages.

Configuration

Config location: b3/conf/plugin_censor.xml

settings section

<settings name="settings">
    <!-- max_level: Users with a greater level will not be checked for bad words/names. -->
    <set name="max_level">40</set>
    <!-- ignore_length: Only words having a length exceeding ignore_length will be checked -->
    <set name="ignore_length">3</set>
</settings>

max_level

The max_level option defines from which level players won't be checked by the censor plugin for bad words or bad names. It is the immunity level. Let's say you want your staff from group fulladmin to be immune, then you would set max_level to 60

See User Roles and Groups for the list of B3 groups and associated levels

ignore_length

In order to keep the censor plugin efficient small words are excluded from the search for bad words. The default value for ignore_length is 3. That means that only words of length 4 and above will be checked. Let's say you want to add the word 'fu' to the bad words list, then you would have to decrease ignore_length to 1 in order for words of 2 characters to be checked.

Badwords section

The badwords section defines first the default penalty to apply when someone uses a badword in chat. Then it defines a list of badword tags that describes the badwords.

<badwords>
    <!--
    type: The type of penalty to issue when a user uses a banned word. Can be warning, kick, ban, or tempban
    reasonkeyword: The reason keyword to use from plugin_admin.xml
    -->
    <penalty type="warning" reasonkeyword="cuss"/>
 
    <!--
    name: A descriptive name for the badword, usually the plaintext version of the word to ban
    lang: uses the iso639a standard abbreviations, http://www.oasis-open.org/cover/iso639a.html. In a couple places I used the full word cause I actually don't know what language it is. I'll get clarification later.
    -->    
 
    <badword name="cunt" lang="en">
        <regexp>\scunt\s</regexp>
    </badword>
 
    <badword name="dang" lang="en">
        <penalty type="warning" reason="^7Please don't use profanity" duration="1d"/>
        <regexp>d[a|@]ng\s</regexp>
    </badword>
 
</badwords>

Badnames section

The badnames section defines first the default penalty to apply when someone uses a bad word in his name. Then it defines a list of badname tags that describes the words forbidden in player names.

<badnames>
    <penalty type="warning" reasonkeyword="badname"/>
 
    <badname name="fuck">
        <regexp>f[u*.]ck</regexp>
    </badname>
 
    <badname name="cunt">
        <word>cunt</word>
    </badname>
 
    <badname name="nigger">
        <penalty type="ban" reasonkeyword="racism" />
        <regexp>n[1i!.]gger</regexp>
    </badname>
 
</badwords>

badword and badname tag

the <badword> and <badname> (singular) tags are exactly the same excepted that the first defines a word (or pattern) forbidden to use in chat while the latter defines a word (or pattern) forbidden in a player name.

All examples below will use the tag <badword> but the same examples for badname can be made by just naming the tag badname.

simple example with the word tag

Let say you want to penalize players saying 'fuck' in the chat with the default badnames penalty, you then add to the <badwords> section the <badword> tag as below :

    <badword name="fuck">
        <word>fuck</word>
    </badword>

If B3 finds a player using the word 'fuck', it will give him the default badwords penalty. That works perfectly but you soon enough find smart ass avoiding the plain word 'fuck' and say in chat 'f*ck'. You do not want to put a list of all variant of that word and that where you want to define patterns instead of words.

pattern example with the regexp tag

Let say you want to penalize players saying 'fuck' but also 'f*ck' or 'fuuuuuck' or 'fuu**uuck'. You can define a badword using a regular expression that will detect all those possible variant :

    <badword name="fuck">
        <regexp>f[u\*]+ck</regexp>
    </badword>

Learn more about Regular Expressions.

A convenient way for testing your regular expression is to use a tool such as Kodos.

badword example with a custom penalty

Not all badword usages deserve the same penalty. You might want to just give a short warning to someone calling people 'n00b' but also want to pemanently ban players saying 'nigger'. Here is how to specify a custom penalty for a given word :

    <badword name="nigger" lang="en">
        <penalty type="ban" reasonkeyword="racism" />
        <regexp>n[i!1]+gger</regexp>
    </badword>

With such a badword definition, anyone using 'nigger' or any variant will be penalized with a permanent ban and the reason text defined for the keyword 'racism' in the admin config file will be displayed.

penalty tag

The penalty tag defines a B3 penalty to apply. Let's see different penalties we can define :

simple warning

<penalty type="warning" duration="30m" />

the warning will remain active for 30 minute.

warning with a customized reason

<penalty type="warning" duration="2h" reason="use unacceptable language" />

the warning will remain active for 2 hours and the reason seen by all players in the warning announcement will be use unacceptable language.

warning refering to one of the warning reason keyword from the admin plugin config file

The admin config file has a section warn_reasons which defines shortcuts for current warning reasons. Each shortcut define a reason text and a duration for which the warning will remain active.

<penalty type="warning" reasonkeyword="lang" />

the warning will remain active for whatever duration is specified in the admin plugin config file for the 'lang' warn_reason and the matching reason text will be shown to all players.

kick

<penalty type="kick" reason="use unacceptable language" />

Defines a kick with reason “use unacceptable language

temporary ban

<penalty type="tempban" reason="use unacceptable language" duration="1d" />

Defines a temporary ban of 1 day with reason “use unacceptable language

permanent ban

<penalty type="ban" reason="use unacceptable language" />

Defines a permanent ban with reason “use unacceptable language

usage/censor_plugin.txt · Last modified: 2012/07/03 00:00 (external edit)

Page Tools