[INACTIVE][ADMN/CHAT] ChatCensor v0.23 - Chat censor system with auto-kick/fine/jail [860]

Discussion in 'Inactive/Unsupported Plugins' started by ddj, Mar 17, 2011.

  1. Offline

    ddj

    ChatCensor - Chat censor system with auto-kick/fine/jail

    Version: v0.23
    (USE SQLITE? Rename your database from csensor.db to ccensor.db manually before using v0.23!)

    Tested with craftbukkit builds: b860

    This plugin lets you control used languaged on your server, by censor words you want.

    You can also let users be kicked, fined and/or jailed, if you are running the appropiate plugins.

    Features:

    Filters words by pattern
    Auto-Kick on use of forbidden word(s)
    Let players pay a fine on use of forbidden word(s)
    Let players spend time in jail on use of forbidden word(s)
    Keeps track of players by storing stats in database
    Lets you also use the different actions manually.
    Toggle different actions on/off with commands
    Set jailtime/fine amount with commands
    Auto increase jailtime for recidivists
    import/export wordlists

    Prerequisites (open)


    A mysql*.jar or sqlite*.jar in your bukkit or bukkit/lib folder
    iConomy (tested with 5) - optionally
    Jail (tested with v0.6.1) - optionally
    Tested craftbukkit b860
    GroupManager v1.0(alpha-5) - should work on permission, but this is untested
    It checks on groupmanager first, then on permissions plugin. If not found, the plugin is disabled



    Installation (open)


    1) Drop the Jar in your plugin directory, and start your server.

    2) Stop your server and open the generated config.yml (in plugin/ChatCensor)

    3) Setup your defaults, save the config.yml and start your server

    4) Start adding forbidden words with /cc add word, this can be done on the server console, or in the mc client

    5) set the right toggles with /cc toggle pay|jail|kick|mute

    6) off you go!



    Config.yml (open)


    Code:
    
    # Configuration for ChatSensor
    #  - ddj 2011
    #
    # fine-amount: nr of iconomy units to pay as fine
    # jail-time: time in minutes player is sent to jail
    # auto-increase-jail-time: (jail-time + (auto-increase-jail-time*total times in jail) = variable jailtime
    #                          If you want to use the default fixed jailtime, set this number to 0.0
    # kick-when-broke: if a player is fined, but don't have enough coin, kick him/her instead.
    # use-regex: In development, doesnt do much atm
    settings:
        fine-amount: 50
        jail-time: 2
        auto-increase-jail-time: 0.0
        kick-when-broke: true
        use-regex: true
        jail-api-type: consolecommand
    
    ### Toggles (Values at startup) ###
    # use-autofine = let the player pay a fine
    # use-autokick = kick the player
    # use-autojail = automatically put the player in the nearest jail
    # use-automute = Mute player chat while in jail
    
    toggles:
        use-autofine: true
        use-autokick: false
        use-autojail: false
        use-jailmute: false
    
    ### database type sqlite or mysql
    database:
        type: sqlite
        mysql:
            name: minecraft
            username: root
            password: root
            hostname: localhost
            port: 3306
    
    ### Labels ###
    labelsandcolors:
        chat-prefix: '[CC]'
        chat-prefix-color: '&d'
        chat-message-color: '&f'
        chat-highlighted-color: '&a'
        replace-color: '&e'
        replace-word: bananas
        marked-words-color: '&c'
    
    ### Broadcast messages  ###
    broadcasttext:
        player-fined-message: '@playername@ received a fine of @fine-amount@ coin!'
        player-kicked-message: '@playername@ is kicked for not following our rules on cursing!'
        player-jailed-message: ' @playername@ is jailed @jailtime@ min for not following our rules on cursing!'
    
    ### Messages to player(s)
    messagetext:
        player-fined: 'You have been fined @fine-amount@ because you were not following our rules!'
        player-kicked: 'Kicked automatically because you were not following our rules!'
        player-kicked-fined: 'Kicked automatically and fined @fine-amount@ for not following our rules!'
        player-muted: 'You shout, but nobody is hearing you'
        internal-possible-toggles: 'Possible toggles: jail - pay - kick'
        internal-jail-status: 'Autojail status: @autojail-status@'
        internal-kick-status: 'Autokick status: @autokick-status@'
        internal-payfine-status: 'Autopay fine status: @autopayfine-status@'
        internal-jailmute-status: 'Prevent chatting in jail: @jailmute-status@'
    

    Permissions (open)

    Code:
    ChatCensor.reload      /cc reload|import|export
    ChatCensor.status      /cc - /cc check|top
    ChatCensor.list        /cc list|status
    ChatCensor.modify      /cc add|remove|setfine|setjailtime|toggle|reset|clearall
    ChatCensor.action.*    /cc jail|kick|fine
    ChatCensor.action.kick
    ChatCensor.action.jail
    ChatCensor.action.fine
    

    Commands (open)

    Code:
    /cc or /cc status -> shows status page (with all settings on fines/jail/time etc)
    /cc list <text> -> Lists all forbidden words, '/cc list abc' only show words with abc in it
    /cc import -> Imports words from censor.txt which you can place in the plugins/chatcensor folder
                  This should be a simple textfiles with one word per row.
    /cc export -> Exports all words to a censor.txt in the plugins/chatcensor folder
    /cc clearall -> Clears wordlist, use with care!
    /cc reload -> reloads configuration settings from config.yml
    /cc -> own stats
    /cc check <player>  -> show others stats
    /cc top -> top10 userlist
    /cc setfine <amount> (NOT stored, change in config.yml for persistence)
    /cc setjailtime <minutes> (NOT stored, change in config.yml for persistence)
    /cc add <word>
    /cc remove <word>
    /cc reset <player> -> Reset stats on player
    /cc toggle pay|jail|kick|mute -> toggles options on/off (NOT stored, change in config.yml for persistence)
    /cc kick player -> Let chatcensor kick this player manually
    /cc jail player -> Let chatcensor jail this player manually
    /cc fine player -> Let chatcensor fine this player manually
    


    Download latest version:
    http://www.crafters.nl/cc/ChatCensor_v0.23.zip (Jar only)

    Source Code is included in Jar and available through my github
    Changelog:
    Version 0.23
    Fixed bug (error messages) when chatcensor was used without jail plugin
    Version 0.22
    Fixed compatibility with jail plugin

    Version 0.21
    Fixed path bug for sqlite/linux systems
    Changed sqlite database name from csensor.db to ccensor.db
    (Use SQLITE? rename your db manually to ccensor.db before using v0.21!)

    Version 0.20
    Fixed autojail bug
    Fixed iConomy 5 support

    Version 0.19
    Made plugin compatible with jail 0.6.1

    Version 0.18
    Fixed bug with upper/lower case words not being replaced

    Version 0.17
    Fixed bug which caused whole sentence being replaced by 1 word
    All Versions (open)

    Version 0.16
    Fixed error after disabling plugin
    Added some code for full regex search (not functional yet)

    Version 0.15
    Little changes to iconomy setup (use subtract instead of setbalance)
    If player is fined, but don't have enough balance -> kick
    Forbidden words now have to be at least 3 chars long
    Fixed bug where it could happen that console was spammed with bananas;)
    This had to do with emtpy, or very small 'words' (spaces etc).
    Any 'word' shorter than 3 characters now will be ignored.
    Added one argument to /cc list -> /cc list abc now returns all words containing abc
    Added /cc clearall -> used for clear all words from databae; use with care!

    Version 0.14
    Added multiple replacement-words. Instead of only bananas, you can set your
    word-value to bananas,apples,peers It will then take one randomly each time a word is replaced.

    Version 0.13
    Added more flexible database libraries. Having a mysql*.jar or sqlite jar in
    your bukkit folder or lib, it will work in both cases, with most mysql versions.
    Fixed bug where newly (/cc add) added words would not be active right away.
    Added better error-handling while accessing iconomy/jail plugins.

    Version 0.12
    Broadcast messages also show on console now (player fined/jailed etc).
    Fixed bug in jail/iconomy check. If they were not used, this resulted in errors.
    This plugin now can be used without them without any problems.

    Version 0.11
    Fixed bug with jail toggle
    Ignore chat events if the are cancelled (by other plugins).
    Added option to let the jailtime auto-increase by a certain factor
    If the jail-time: 4, the auto-increase-jail-time: 0.5 and a player uses
    a forbidden word for the 10th time, his jailtime will be: (0.5*10) + 4 = 9 mins
    Added /cc reset command to reset playerstats

    Version 0.10
    Initial Release

     
    ItsQ, dark1256 and KillerBunnys122 like this.
  2. Offline

    ddj

    Thanks for mentioning, this bug is now fixed (in v0.17)
     
  3. Offline

    KillerBunnys122

    Thank you for updating so soon. :)
     
  4. Offline

    Phanku

    I am happy you use mysql for your plugin.

    MySQL (which btw is very easy to set up) is so nice because I have the same tables and logins on both my production and development server.

    This allows me to just drop my development code into my production server and BAM.. every thing is done.

    All troubles I have had with any data powered plugin is with trying to track the flat files while moving files around.

    Mysql is not hard to set up. It maintains data. You have no risk of losing data as its stored in the database. Record locking only happens if you use it. Mysql does not automatically lock records or tables. Mysql is more efficient than sqlite and way more efficient than straight file I/O.

    I for one applaud you for using mysql sir!
     
  5. Offline

    KillerBunnys122

    Found a problem with v0.17

    If you do Fuck or fUck it won't censor the word. Only if its all lowercase.
     
  6. Offline

    ddj

    upper/lowercase bug fixed in v0.18
     
  7. Offline

    KillerBunnys122

    Thank you very much. :)

    I forgot to thank you for the multiple replacement words for each swear. exactly what I wanted.
     
  8. Offline

    Arnold9995

    Hello,
    Can u tell me how to set a jail it self i cant f ind it :$
     
  9. Offline

    The PC Tech Guy

    @ddj You should look at the source of the simplecensor plugin, which kind of has its own system of recognizing attempts to get around a censor.
    See the jail plugin.
     
  10. Offline

    Arnold9995

    yeah i got the jail plugin but it doenst teleport me to it if i curse it only it says i get 50 coins fine
    and if i jail myself than it says im already jailt
     
  11. Offline

    Nytemare3701

    Request: Compatibility with the parties in McMMO. I'm using this to kick players who are obviously not using RP speech, and we have a OOC party for those who don't want to RP.
     
  12. Offline

    The PC Tech Guy

  13. Offline

    KillerBunnys122

    Could you please update this for CraftBukkit 740?
     
  14. Offline

    ddj

    Tested with 740, seems to work just fine
     
  15. Offline

    The PC Tech Guy

    Can you look at how SimpleCensor detects words? It seems to do the basic prevention of ways used to get around a censor. Then, you could have this as an option.
     
  16. Offline

    ddj

    I don't have time to change this setup at this moment.
    Also, I see that tee jay has not (yet) released his source code, if he did, I could probably add his way of censoring pretty quickly..
     
  17. Nice plugin!

    Testing with latest Jail version. That is in API mode, I suppose console mode works in any case.

    17:19:19 [SEVERE] Could not pass event PLAYER_CHAT to ChatCensor
    java.lang.NoSuchMethodError: com.matejdro.bukkit.jail.JailPrisoner.<init>(Ljava/lang/String;ILjava/lang/String;Ljava/lang/Boolean;Ljava/lang/String;)V
    at nl.crafters.chatcensor.ChatCensorPlayerListener.JailPlayer(ChatCensorPlayerListener.java:95)
    at nl.crafters.chatcensor.ChatCensorPlayerListener.TakeAction(ChatCensorPlayerListener.java:65)
    at nl.crafters.chatcensor.ChatCensorPlayerListener.onPlayerChat(ChatCensorPlayerListener.java:54)
    at org.bukkit.plugin.java.JavaPluginLoader$6.execute(JavaPluginLoader.java:236)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:257)
    at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:646)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:634)
    at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
    at net.minecraft.server.NetworkManager.a(NetworkManager.java:195)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:74)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:370)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:285)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)

    ===========

    Secondly, a request. We have many towns with their own HeroChat channels. Those are not global, and I would like to be able to exempt certain channels from the censor. Would be great to get that in!
     
  18. Offline

    The PC Tech Guy

    Just an option, because I'm using that right now. Too many people found a way around your censor way to quickly, and with so many variants to add to the word list was just a little too much.
     
  19. Offline

    bassbeast

    @ddj can you make it so after a set number of times they swear that they go to jail instead of being either jailed/getting fined or getting kicked?
     
  20. Offline

    Lite

    On linux servers, the sqllite db's name is "plugins\ChatCensor\csensor.db" and is located in the root folder. The plugin is working, but it would be nice if you could make it that the csensor.db is stored inside the plugin folder.
     
  21. Offline

    ddj

    Yup, api mode = broken for now, as long as console is working, I will not fix it.
    I don't have experience with HeroChat, so I have to do some research first.

    That's possible, but it will take some time, which I don't have right now..

    Should be fixed
     
  22. Offline

    EpicATrain

    You would be my best friend if you could find a way to ban on certain words and/or Mute players completely if certain words are used. I mean to prevent them from ever communicating with other players even if they disconnect and reconnect.
     
  23. Offline

    MG127

    would be cool to trigger a lightning on some words xD
    "fu**" --> ... got electicuted xD
     
  24. Offline

    Pythros

    Can I get an auto-ban option? we recently had been getting hit with advertiser for one particular server and want to ban them each time they say the name of it.

    Also, can there be some form of exemption permission node that won't run the "rules" on someone if they use a word?

    Thanks.
     
  25. Offline

    fysics

    could you make an option for the user to be hit with lightning when they swear?
     
  26. Offline

    wouter0100

    I get the following error :S:
    Could not pass event PLAYER_CHAT to Chat Censor..
    I use the build 818 and ChatCensor 0.21
     
  27. In the jail plugin you can put a sign by the jail cell so it states the players name, the time they are jailed for and the reason. Chat censor automatically puts in the name and time but dont put in a reason. can you make an option so that if a player swears it gives the reason "cursing" or "swearing" please
    Many thanks
    p.s. Great plugin!!!
     
  28. Offline

    tremor

    Just a couple quick questions.

    1. Should regex mode be true/false - the config.yml says: this doesn't do much yet.
    2. Do I have to set the permissions node: ChatCensor.action.kick - for the group that I want to 'have' kicked on a match? I have everything seemingly installed correctly yet, there are no kicks or word replacements occurring when someone swears.

    Code:
    20:51:19 [SEVERE] Could not pass event PLAYER_CHAT to ChatCensor java.lang.NoClassDefFoundError: com/matejdro/bukkit/jail/Jail
            at nl.crafters.chatcensor.ChatCensorPlayerListener.JailPlayer(ChatCensorPlayerListener.java:89)
            at nl.crafters.chatcensor.ChatCensorPlayerListener.TakeAction(ChatCensorPlayerListener.java:66)
            at nl.crafters.chatcensor.ChatCensorPlayerListener.onPlayerChat(ChatCensorPlayerListener.java:55)
            at org.bukkit.plugin.java.JavaPluginLoader$6.execute(JavaPluginLoader.java:278)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:310)
            at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:689)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:677)
            at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:217)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:401)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:311)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.ClassNotFoundException: com.matejdro.bukkit.jail.Jail
            at java.net.URLClassLoader$1.run(URLClassLoader.java:299)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:288)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:287)
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:36)
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:24)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
            ... 15 more
    Jail is set to false, no jail plugin loaded.. why am I getting this? I picks up 1 censor block the plugin stops working after than.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 12, 2016
  29. Offline

    Ghostetr

    is this plugin gonna get updated for 1.6.6 any time soon?
    //ghostetr
     
  30. Offline

    ddj

    Will try to update it within a week, but I cannot promise..
     
  31. Offline

    zigi00x

    Hi I have a question about your plugin if somehow he could not do that when one party
    kill him if it could automatically in jail.
    I want the server to do real life and this would make me pretty fit.
    Sorry for my English.

    Thank you for your answers.
     

Share This Page