[ADMIN] CmdBlocker - Kick player that are using certain commands. [740]

Discussion in 'Inactive/Unsupported Plugins' started by Hretsam, Apr 15, 2011.

  1. Offline

    Hretsam

    CmdBlocker - Kick player that are using certain commands.
    Version: v1.1

    This was the Antixraycmd plugin, but after a few changes i decided to change the name.

    This plugin kicks and/or bans players that use a command that are listed in the config file.
    The default is set up for a simple and light protection against the '/ixrai12345' command.
    (This is a command that is issued when a player joins a SMP server with the Xray mod installed.) But you can add other commands very simple. You can configure every command the way you like. More info in the config file itself.

    I added NewbyModder's own xray protection in it. But this can be turned off in the config file.

    Features:
    • Warns players that use a command
    • Kick/Ban user after a number of violations. (usages of a command)
    • Partial lightweight Xray solution
    • Permissions support (can be turned off)
    • Alternative of Permissions to allow players to use a command
    • McBans support (can be turned off)
    • NewbyModder's own xray protection. (can be turned off)
    • Runtime config reload with "/cbreloadconfig"
    Notice:
    This plugin does not provide a full protection against the Xray problem!

    To get full protection use the plugin of asdaarg, but this will use a lot of resources. This mod can be found here.

    Download file here. (version v1.1)
    Source (github)

    Default config.yml (open)
    Code:
    ## Checks the version of the config file, dont touch this.
    configversion: 2
    ## sends the message ingame. can be set to 'admin', 'global' or 'none'
    ingame message target: Global
    ingame message: Player %player% used the Xray command and got %result%!
    ## Username used on mcban, use a contact name
    mcban username: server
    use permissions: true
    ## The permission node of an admin
    admin node: cmbblocker.admin
    ## removes all records when the player gets banned.
    ## I suggest let this stay on true, as it reduces the database size over time.
    delete record on ban: true
    ## adds NewbyModder owns disable script;
    xray protection: true;
    ## Prints all the commands on startup
    debugmode: true
    
    commands:
        ixrai12345: ## xray mod command, is send when player enters server. Also used for the xray protection!
            ## how many violantions till getting kicked
            kick violations: 2
            ## how many violantions till getting banned
            ban violations: 2
            ## kick/ban after hit violation
            kick: true
            ban: true
            ## log usage
            log: true
            ## use mcbans
            mcbanlist: false
            ## node for permissions
            permission node: cmdblocker.command.ixrai12345
            ## Messages
            warning message: This command is blocked, to avoid getting kicked, stop using it!
            kick message: You are kicked from this server!
            ban message: You are banned from this server!
            ## Allowed users (use this when you dont got permis
            allowed users:
    
    changelog (open)

    Changelog:
    Version 1.1:
    • Updated to 733
    • Added warnings
    • Fixed null reference
    • Changed command to avoid collision with other plugins
    • Added creating of config file when none exists
    Version 1.0:
    • Changed name
    • Added Permissions and McBans support
    • Added SqlLite usage, instead of loading it into the memory
    • Added config file
    • Added logger
    Version 0.1:
    • Initial Release
     
    MaMaxGER likes this.
  2. Offline

    Hretsam

    Cant you just set that in the kick message?
    "Turn off xray, if you keep trying you will be banned?"?
     
  3. Offline

    Phaedrus

    yeah, like configurable amounts.

    Like
    Warn=true/false
    kick=true/false
    ban=true/false
    log=true/false
    warn times before kick=4
    kick times before ban=4

    sorry if some of that is in V1. i'm just getting it now.
     
  4. Offline

    Hretsam

    The kick times is, but the warning isn't.
    I will add that once the new recommended build comes out.
     
  5. Offline

    BioRage

    Any solution, since he removed the /command when they use the buttons? :x
     
  6. Offline

    Hretsam

    Well, this plugin also sends "Modes: -ax" to everyone that joins
    The pluginmaker said that would disable it.
    And no. dont got an other solution yet... maby something like a resource logger would help
     
  7. Offline

    tylerdn

    Im getting a error when anyone types in a blocked command, here is the error.
    Can you help?

    13:14:25 [SEVERE] Could not pass event PLAYER_COMMAND_PREPROCESS to CmdBlocker
    java.lang.NullPointerException
    at com.nijiko.permissions.Control.permission(Control.java:346)
    at com.bukkit.hretsam.CmdBlocker.PermissionsHandler.hasPermission(Permis
    sionsHandler.java:17)
    at com.bukkit.hretsam.CmdBlocker.CmdBlockerPlayerListener.onPlayerComman
    dPreprocess(CmdBlockerPlayerListener.java:69)
    at org.bukkit.plugin.java.JavaPluginLoader$5.execute(JavaPluginLoader.ja
    va:228)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:59)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:257)
    at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.
    java:642)
    at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:613)

    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:607)
    at net.minecraft.server.Packet3Chat.a(SourceFile:36)
    at net.minecraft.server.NetworkManager.a(NetworkManager.java:195)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:73)
    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)
    >
     
  8. Offline

    untergrundbiber

    I think same error here with CB720

    Code:
    22:46:20 [SEVERE] Could not pass event PLAYER_COMMAND_PREPROCESS to CmdBlocker
    java.lang.NoSuchFieldError: c
            at com.bukkit.hretsam.CmdBlocker.CmdBlockerPlayerListener.onPlayerCommandPreprocess(CmdBlockerPlayerListener.java:94)
            at org.bukkit.plugin.java.JavaPluginLoader$5.execute(JavaPluginLoader.java:228)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:257)
            at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:651)
            at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:622)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:616)
            at net.minecraft.server.Packet3Chat.a(SourceFile:36)
            at net.minecraft.server.NetworkManager.a(NetworkManager.java:195)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:73)
            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)
    
    And can you please create a extra subfolder for the logs? Its better to handle for web-access
     
  9. Offline

    Hretsam

    To the looks of it, if forgot to check for a null variable.
    Do you have the permissions plugin?

    This error is due to the renaming of bukkits variables. I solved it in the update.
    I will also place the logs in the subfolder
     
  10. Offline

    tylerdn

     
  11. Offline

    Hretsam

    If the YAML Parser didn't note anything it should be fine.. Can you post your config file here for me?


    Updated to V1.1!
     
  12. Offline

    tylerdn

    Sorry I'm no longer using this plugin :(
    But thanks for the help :)
     
  13. Offline

    Kalais

    Can you add area/region support? I need "/sethome" blocked (not necessarily kicked on use) from a certain area where I have a quest set up with a reward chest.
     
  14. Offline

    Hretsam

    hmm, should be doable.
    What plugin do you use for the regions, and how are they stored?
     
  15. Offline

    Kalais

    That would be great!
    I use WorldGuard. Regions are stored in a .yml.
     
  16. Offline

    BioRage

    Just out of curiosity, how would one make a new prevention for commands?

    I know there are fly and speed plugin's that use commands like "back" and such.

    Mind giving me a quick tutorial?
     
  17. Offline

    Hretsam

    Oh simple, just add second command to the file

    below is the config file where i added the back command
    the name before the ':' is the command that it listens to (and therefor blocked)

    Code:
    ## Checks the version of the config file, dont touch this.
    configversion: 2
    ## sends the message ingame. can be set to 'admin', 'global' or 'none'
    ingame message target: Global
    ingame message: Player %player% used the Xray command and got %result%!
    ## Username used on mcban, use a contact name
    mcban username: server
    use permissions: true
    ## The permission node of an admin
    admin node: cmbblocker.admin
    ## removes all records when the player gets banned.
    ## I suggest let this stay on true, as it reduces the database size over time.
    delete record on ban: true
    ## adds NewbyModder owns disable script;
    xray protection: true;
    ## Prints all the commands on startup
    debugmode: true
    
    commands:
        ixrai12345: ## xray mod command, is send when player enters server. Also used for the xray protection!
            ## how many violantions till getting kicked
            kick violations: 2
            ## how many violantions till getting banned
            ban violations: 2
            ## kick/ban after hit violation
            kick: true
            ban: true
            ## log usage
            log: true
            ## use mcbans
            mcbanlist: false
            ## node for permissions
            permission node: cmdblocker.command.ixrai12345
            ## Messages
            warning message: This command is blocked, to avoid getting kicked, stop using it!
            kick message: You are kicked from this server!
            ban message: You are banned from this server!
            ## Allowed users (use this when you dont got permis
            allowed users:
        back:  ## <--- this is the commands that is blocked
            kick violations: 2
            ban violations: 2
            kick: true
            ban: true
            log: true
            mcbanlist: false
            permission node: cmdblocker.command.back
            warning message: This command is blocked, to avoid getting kicked, stop using it!
            kick message: You are kicked from this server!
            ban message: You are banned from this server!
            allowed users:
     
  18. Offline

    Kalais

    Preventing /back to a certain area would be amazing as well.
     
  19. Offline

    SuicideHotline

    Is it possible to block commands based on a player. For instance, I have a few plugins like simplehome and magiccarpet and mcmmo and sometimes i want to block a player from using certain commands such as /home (which teleports them to their home location) or /mc (which allows them to go on a magic carpet and fly away) or /tp NAME (which allows them to teleport to another player)

    to sum it up, i want to be able to setup like a group of commands that will be blocked if i want to jail a player and then something like

    /restrict PLAYERNAME and it blocks all commands listed for that group
    /unrestrict PLAYERNAME would allow commands to be issued again

    would this be something possible?
     
  20. Offline

    Hretsam

    Its possible, when i got time i'll look into it.
     
  21. Offline

    Fireside

    Hi Hretsam, just a quick one to say thanks for the great plugin, and thanks for your hard work.
     
  22. Offline

    pjt0620

    is it possible to block commands with arguments like /Towny top money with this plugin?
     
  23. Offline

    Fob_Upset

    Code:
    04:19:51 [INFO] 3
    04:19:54 [SEVERE] [CmdBlocker] - Exception on fetching userdata database is locked
    04:19:54 [INFO] §9[PLAYER_COMMAND] dooble589: /give
    04:19:54 [WARNING] dooble589 was denied access to command.
    
    Im trying to make /give a instant kick but players just get warned

    Code:
        give:
            Kick violations: 1
            Ban violations: 3
            kick: true
            ban: true
            log: true
            mcbanlist: false
            permission node: cmdblocker.command.give
            warning message: This command is blocked, to avoid getting kicked, stop using it!
            kick message: You are kicked for using illegal commands on this server!
            ban message: You are banned for using illegal commands on this server!
            allowed users: 
     
  24. Offline

    fugue2005

    i'm confused

    ## node for permissions permission node: cmdblocker.command.ixrai12345

    do i add this to a group to allow the command or deny the command?

    can you add a way to make your own commands?
    i have been looking for a plugin that will set a persons permissions group based on a command like /rules 5
    i would love to be able to add my own commands to perform besides /ban or /kick

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

    Kene

    When players type /plugins

    they get a Warning, yet the plugins are still listed...
     
  26. Offline

    Hretsam

    Sorry for the late answer, been busy a lot with other stuff.

    Thank you, and no problem

    Yes,

    Hmm wierd, what craftbukkit build are you using?

    To deny

    Yes, this is a command of bukkit itself. It wont stop those.
     
  27. Offline

    Fob_Upset

    CB:640 and when i restarted my SSH server and tried again it says

    Player RubberDucky125 used a illegal command and got warned!
     
  28. Offline

    Hretsam

    oh wait, i think i see the problem.
    What is your OS, are you running it on an administrator user and what are the Read/write settings to the violators.db file
     
  29. Offline

    Fob_Upset

    Linux Opensuse (The server down because my host is having serve network problems :( )
    im on the Root Account and it works on every other command apart from /give.
     
  30. Offline

    40540057

    THANKS for this GREAT PLUGIN! though could you please update for 766 (or test and change title for 766), also please put your version number in the title ... makes it easier to find plugins that need updating ... with over 100 plugins on our server, it would take forever to check for updates if no one put their version in the title
     
  31. Offline

    Xpopox

    I can't seem to set any accepted users in the config file :/
    Is there a grammatical rule i'm supposed to follow?
     

Share This Page