[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

    contex

    That's a great idea, looking forward to see how it goes.
     
  3. Offline

    The PC Tech Guy

    Spelling note: Automatically, not "automaticly"

    Getting an error message, looks like the plugin is trying to find matejdro's jail plugin, which I don't use... getting a could not pass PLAYER_CHAT to ChatSensor
     
  4. Offline

    KillerBunnys122

    Ok. Can you make this plugin a little more simple please?

    Right now you HAVE TO have MySQL or SQLite.

    Can't you have it so people can use this as a simple plugin to swap a swear with the replacement words like 'banana' (Yeah thats already in the settings but it never replaces swears with itself)

    Oh and I have iChat. Don't tell me I'm going to have to remove iChat to make this work too?
     
  5. Offline

    The PC Tech Guy

    I disagree. You don't need to have MySQL or SQLite... I don't know why you need that for this plugin. Anyways, both of them can be a hassle, like database lockups and the such (at least for SQLite, and then MySQL I hear is hard to configure).
     
  6. Offline

    unusualbob

    How do I set the list of swears? There's no config at all for that.

    Edit: Just tested it too:

    Code:
    01:10:23 [INFO] [ChatCensor] Configuration reloaded
    01:11:46 [SEVERE] Could not pass event PLAYER_CHAT to ChatSensor
    java.lang.NoClassDefFoundError: com/matejdro/bukkit/jail/Jail
            at nl.crafters.chatcensor.ChatCensorPlayerListener.onPlayerChat(ChatCensorPlayerListener.java:29)
            at org.bukkit.plugin.java.JavaPluginLoader$6.execute(JavaPluginLoader.java:187)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:255)
            at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:614)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:602)
            at net.minecraft.server.Packet3Chat.a(SourceFile:24)
            at net.minecraft.server.NetworkManager.a(SourceFile:230)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:76)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.lang.ClassNotFoundException: com.matejdro.bukkit.jail.Jail
            at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:30)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
            ... 13 more
    01:11:46 [INFO] [HeroChat] [g] unusualbob: testing swear checker... shit
    01:11:51 [SEVERE] Could not pass event PLAYER_CHAT to ChatSensor
    java.lang.NoClassDefFoundError: com/matejdro/bukkit/jail/Jail
            at nl.crafters.chatcensor.ChatCensorPlayerListener.onPlayerChat(ChatCensorPlayerListener.java:29)
            at org.bukkit.plugin.java.JavaPluginLoader$6.execute(JavaPluginLoader.java:187)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:255)
            at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:614)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:602)
            at net.minecraft.server.Packet3Chat.a(SourceFile:24)
            at net.minecraft.server.NetworkManager.a(SourceFile:230)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:76)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    01:11:51 [INFO] [HeroChat] [g] unusualbob: lol didnt work
    
     
  7. Offline

    ddj

    Concerning the playerchat errors, they are fixed in 0.12, I actually never tested it without the iconomy/jail plugins:)
    It will work without them now.

    @KillerBunys122 /The PC Tech Guy
    I am following the database versus flatfile discussions on this forum for some time now, and I agree that a lot of plugins are using databases, where plain flatfiles would be as good or even better.

    One of the features of my plugin is that I keep track of player behaviour, so you can adjust the height of your fine/jailtime based on the players behaviour. For this, with every chat that takes place, the stats of this player needs to be looked up. With lots of players, I figured for this, an indexed table would justify the use of this database.

    Will see if I can strip some functions and make it more simple for basic use.

    Concerning iChat, it should work together with iChat/essentialsChat like plugins just fine.

    Adding/removing words can be done with the /cc add <word> and /cc remove <word> commands.
    To bulk-add words you can place a textfile with one word on each line in your plugin/chatcensor folder and name it censor.txt.
    After that, you type /cc import and the list will be imported into the database.
     
  8. Offline

    KillerBunnys122

    Well I have MySQL on my server. I tryed to use this plugin with nothing. It didn't work. I tried using it with MySQL (Must have stuffed up some details) That didn't work. So I just left the default settings with jail turned off, then it used SQLite on its own (I think?) and the plugin worked.

    BUT! When I got in my server to test /cc add 'word' it said word added but I said the 'word' and it didn't get censored. I just got the same error as unusualbob.
     
  9. Offline

    ddj

    Fixed all errors in 0.13
    I would like to get feedback on mysql errors. I have tested with sqlite and mysql, and no errors here.

    On any errors accessing the jail/iconomy plugin, details will be displayed in the server console. Please provide me with this info if iConomy/Jail is not working for you.

    Besides the fact that this bug should be fixed now, if you restarted your server, it should have worked from that point on.
    Concerning the error, are you sure you used version 0.12?
     
  10. Offline

    The PC Tech Guy

    I'm sorry, I thought you were suggesting that it should use MySQL or SQlite. I did not check to see if that was the case upon instalation.
     
  11. Offline

    s0nge

    Hi. Great plugin, working like a charm. But i was wondering if it is possible to add more replace words then just bananas?

    I tried to add more after bananas but then they all showed up in 1 line when someone used
    a cencored word
     
  12. Offline

    KillerBunnys122

    I added a word and it worked! yay BUT! When I restarted my server it would not work (No error) and when I attempted to re add the word it says I can't.

    I agree with sOnge we need more replacement words other than just the 1 word.

    EDIT: I guess this is where /cc export comes in handy
     
  13. Offline

    ddj

    Just added multiple replacement words (version 0.14). Change bananas into bananas,apples,pears and you're done!

    If you do /cc list, do the right words show up then?
     
  14. Offline

    The PC Tech Guy

    Hi, in 0.13, I got a problem when I attempted to import words.txt (I got a text file of the Internet) which contained around 358 words. Eventually, nobody was able to talk, and it said "bananas" constantly to the point we were end of streamed. Only until I have to delete the database does it start working again.

    I won't be importing until this is fixed... ;) Seeing "bananas" spamming my console and chat is pretty frightening...
     
  15. Offline

    ddj

    This sounds like there is a empty line or something like a space in your textfile.
    Could you check this? If this isnt the case, could you provide me with the file so I can test it myself?
     
  16. Offline

    The PC Tech Guy

  17. Offline

    ddj

    Found the little bugger, expect an fix within an hour

    v0.15 prevents any form of banana spamming:)
    Turned out that in some cases, an empty string would act like some kind of forbidden word.

    Concerning this file, note that my plugin does not support words with a * at the beginning and/or end of the word.
    At least not at his moment...

    Another thing, realize that if you use 400+ words , everytime a player chats, the text he or she types, is checked against this 400-long list of words. I am not sure this actually will cause any lagg, but be warned with these kind of list-sizes.

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

    KillerBunnys122

    It works like a charm now! :D

    BUT! Could you make it so it pick one of the random words for each swear in the one sentance?

    Eg: "Fuck you bitch." Will turn out to be "silly you silly."

    I would prefer it to pick a random replacement word every time a swear appers.

    Eg: "Fuck you bitch." Will turn out to be "silly you pants" If you know what I mean.

    If you can that would be great! :)

    EDIT: Not asking for a 'This word is replaced with this word' But if you can make an optin for that. That would be good for those that want it.
     
  19. Offline

    Penorzilla

    Could you add a whitelist meaning.. Assassin isn't a bad word... Grass isn't a bad word... but I still get kicked if ass is in the naughty world list.
     
  20. Offline

    DThielke

    Since I see that is uses regex now, you can use \bass\b rather than just ass to only filter out ass and not words containing ass.
     
  21. Offline

    ddj

    I am actually busy with that right now. Since regex is very hard for most people, I am trying to incorporate functionality that looks at * and ? chars for matching strings. Not nearly as powerfull as regex, but much more understandable then those damn regex strings:)
     
  22. Offline

    DThielke

    Ah, I misinterpreted your feature list then - apologies.
     
  23. Offline

    ddj

    You didnt misinterpreted, I stated regex support where I dont have it the way you should expect it.
    So.. I am the one who should apologize:)
     
  24. Offline

    Nathan C

    Oh god, this plugin is the best!

    Working great with the latest ichat too and iconomy!
     
  25. Offline

    The PC Tech Guy

    Would love it if you could have those wildcards. However, what if we want those who, for instance, use only one asterisk in blocking their word? Doesn't hide much, I'd like these censored without many variants of the same word (such as using the ? wildcard in place of one letter for four times, for a four-letter word).
     
  26. Offline

    Fireside

    Hi there, this plugin looks awesome! I'm curious to know if it would be possible to have more than one word list with a view to having players fined on the use of mildly bad language and kicked upon use of truly foul language?
     
  27. Offline

    goldseed

    Fantastic!!

    works with cb617!
     
  28. Offline

    KillerBunnys122

    Please update for Build 670 :)
     
  29. Offline

    ddj

    As far as I can see, my plugin.yml already complies.

    Compiled a new version with some small changes anyway.
    If it doesnt work, please post the exact error.

    Version 0.16

    • Fixed error after disabling plugin
    • Added some code for full regex search (not functional yet)
     
    KillerBunnys122 likes this.
  30. Offline

    KillerBunnys122

    No more errors with 1.6 but if I swear in a sentence it replaces the whole sentence with 1 replacement word.

    I'm re-using the old config.yml and stuff from v0.15
     

Share This Page