[CHAT] WordFilter v1.0 - Lightweight chat filter plugin [1337]

Discussion in 'Inactive/Unsupported Plugins' started by Everdras, Jul 1, 2011.

  1. Offline

    Everdras

    WordFilter is now on BukkitDev.
    This page will no longer be updated.

    WordFilter- Filters Words.

    Version: v1.0

    Features:
    • Add/remove words to be filtered
    • List/clear words to be filtered
    • Default Bukkit Permission system
    • Toggle filtering on/off
    • Phrases can be filtered, use _'s wherever a space would be
    • Can choose between the three best filtering algorithms I came up with.
    Download: JAR
    Source Code: http://code.google.com/p/bukkit-word-filter/

    Changelog:
    Show Spoiler

    Version 0.2.0
    • can filter phrases
    • can choose between three options
    Version 0.1.2
    • Fixed a lot of stuff and did a lot of bug testing. Version 0.1.2 is confirmed to work.
    • Added so much logging your logs will be logging while they log, dawg.
    Version 0.1.1
    • Added clearing, listing
    • Allowed op's to bypass permissions
    • Changed save location
    Version 0.1.0
    • Initial release


    Permission Nodes:
    • WordFilter.add - allows player to add words
    • WordFilter.remove - allows player to remove words
    • Wordfilter.list - allows player to list words
    • WordFilter.toggle - allows player to toggle words on/off
    Usage:
    • /wf add originalword replacementword - sets originalword to be filtered to replacementword
    • /wf remove originalword replacementword - remove the filter on the originalword/replacementword combo
    • /wf list - lists all filtered words and their replacements
    • /wf clear - clears all listed words
    • /wf on - turns filtering on
    • /wf off - turns filtering off
    • /wf option X - replace X with REPLACE_ALL, REPLACE_PART, or REPLACE_WORD to set the filtering mechanism to that. See below for more info.
    About /wf option
    Show Spoiler

    • REPLACE_ALL - replaces the entire word if any part of the word matches a filtered String regardless of case
    • REPLACE_PART - replaces the part of the word that matches the filtered string, case sensitive
    • REPLACE_WORD - replaces the word with the filtered word if the whole word matches a filtered word, regardless of case


    Post any bug reports in this thread please.

    Do you enjoy what I do? Then click the spoiler below!
    Show Spoiler
    Show Spoiler
    Show Spoiler
    Show Spoiler

    I'm the Server Manager for ChiRho Entertainment. Stop on by, and stay and play if you like it!
    [​IMG]

    Also, I'm a college student! So, any small gifts you could part with to support my plugin development (and my habit of eating food) is enormously appreciated! Click here to donate via PayPal!

    (If you donate $5 or more, I'll personally write you a haiku. And if you mention it to me, I'll push updating the plugin of your choice (that I develop) to the top of my to-do list.)


    TODO:
    -Let wildcarding replace all this nonsense with using three different filtering algorithms. Hooray for elegance.

    KNOWN ISSUES:
    -filtering phrases doesn't work for REPLACE_ALL or REPLACE_WORD. Confirmed to work for REPLACE_PART, and filtering words into phrases always works.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
    Deathfromace likes this.
  2. Offline

    68x

    Code:
    15:46:56 [WARNING] Unexpected exception while parsing console command
    org.bukkit.command.CommandException: Unhandled exception executing command 'wf' in plugin WordFilter v0.2.0
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:129)
            at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:312)
            at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:480)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:465)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.ClassCastException: org.bukkit.craftbukkit.command.ColouredConsoleSender cannot be cast to org.bukkit.entity.Player
            at me.everdras.WordFilter.WordFilter.onCommand(WordFilter.java:170)
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
            ... 6 more
    
    This happens when I try to enable WF through the console.
     
  3. Offline

    Everdras

    Ah yeah. I forgot about that. This was my first plugin, and I was a wee bit less savvy to how minecraft servers were run back then, to the point that I never even realized I either needed to support console use or say that the console isn't supported.

    I'll add in support. Until then, only use it from in-game characters.

    (FYI, the bug is from when the sender isn't an instance of a Player object, so the cast fails early on in the command call process.)
     
  4. Offline

    a_dizzle

    Maybe add theme filters?, Such as the medievil word filter in tf2.
     
  5. Offline

    Everdras

    Beyond the scope of this plugin. Plus, it'd drive me nuts that I'd never manage to preserve grammatical accuracy after the filtration.

    hotfixed: commands now work from the console

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

    Tux_Peng

  7. Offline

    Everdras

    Hm. I can certainly make a .txt config file that you could just paste that list into, as well as what you want it to filter to. However, with a list that long, efficiency WOULD become a small concern. I'd have to update my data structure to something that favors CPU-efficiency rather than RAM efficiency as it does now. I would also need to make the /wf list command printout a bit less of a mess, though that's on my todo list already.

    There are probably more concerns that I would have, but right now I'm watching Family Guy and can't think of them.

    In short, I'll strongly consider it! =)
     
  8. Offline

    Mike Geitz

    I'm having a tough time keeping the '/wf option replace_word' stick. It seems to revert to the default algorithm after i log out and there's not apparent way to change the config (unless I'm supposed to edit that .ser).
     
  9. Offline

    Everdras

    Yeah, I still need to make that one variable persist. Will be in next patch.

    patched.

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

    Mike Geitz

    Tried the patch, got this:

    10:17:39 [SEVERE] Error occurred while enabling WordFilter v0.2.0 (Is it up to date?): me.everdras.WordFilter.FilterOption cannot be cast to java.util.LinkedList
    java.lang.ClassCastException: me.everdras.WordFilter.FilterOption cannot be cast to java.util.LinkedList
    at me.everdras.WordFilter.WordFilter.loadWords(WordFilter.java:165)
    at me.everdras.WordFilter.WordFilter.onEnable(WordFilter.java:42)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:126)
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:878)
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:272)
    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:162)
    at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:146)
    at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:284)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:271)
    at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:148)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:335)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)

    EDIT: Just plain not working with 1060 since the hotfix
     
  11. Offline

    t0phux

    Is this plugin incompatible with other chat plugins? I have iChat and craftIRC and the text is still showing normally in the server, but the text in coming craft craftIRC (in our IRC channel) has the filter applied to it.
     
  12. Offline

    Pythros

    Bump... updates???? ;)
     
  13. Offline

    Mike Geitz

    Very happy to see an update!! :D

    However, I'm getting 'insufficient permissions' returned whenever I try anything (using permissions 3.1.6, have full '*' permission for everything, so not sure what to do).

    Is there a fix?
     
  14. Offline

    JRiSETH

    Doesn't work with PermissionsEX. Says Insuffcient permissions all the time.
     
  15. Offline

    Kalkarzin

    Could you make it that OP's can't swear in the config and make a config.yml file instead of a config.SER file?
     
  16. Offline

    gameswereus

    I shall try this plugin out, I really hope it works, as there are not any other plugins that seem to filter the chat.
     
  17. Offline

    Nolig

    Can you please make it so that the plugin can also filter messages that comes from plugins ?
     
  18. Offline

    biblelucas

    guys i think you guys are asking too much things. As you read it, it says a LIGHT weight pluging. I like it. Its just that instead of fu** people can find look holes such as f0Uck like this.
     

Share This Page