[SEC/ADMN] McDefcon v4.0 - Server Lock Down [1240]

Discussion in 'Inactive/Unsupported Plugins' started by SystexPro, Jul 25, 2011.

?

Does this help your server?

Poll closed Sep 13, 2011.
  1. Yes

    70.2%
  2. No

    29.8%
  1. Offline

    SystexPro

    [​IMG]
    Download [.jar Only] | API<Wiki> [Coming Soon] | Wiki[Coming Soon] | Report Bugs
    !PLEASE READ!
    I will soon be moving this Plugin to BukkitDev as since it has the new Issue Tracker.




    McDefcon v4.0 - Lockdown your server!​
    Version: 4.0


    Development Channel:
    Server: irc.geekshed.net​
    Channel: #mcdefcon​
    If you want to see other updates on this or my other Plugins, or just want to stalk me :p Follow me on Twitter @SystexPro
    Description -
    McDefcon is a plugin that allows you to set certain Levels on your Server to keep Griefers out. It works on Offline/Online Modes Servers and it also works with McBans and it is set up with OP, Bukkit Permissions, and PermissionsEx(NEW)!​
    Defcon Levels -
    There are 6 Defcon Levels.​
    0 - Normal (The server allows incoming Players)​
    1 - KickMode (Kicks any player trying to join. McBans will kick the player aswell)​
    2 - Temp Ban(Temporary Bans Player from your Server. McBan Defcon Level only)​
    3 - BanMode (Kick Bans any player trying to join the server. For McBans purposes, it will be a LocalBan.)​
    4 - Mutes all Players(Does not kick Players with this Level).​
    5 - Turns off Building.​
    6 - Freezes all Players.​
    Defcon Commands -
    Command Trigger - /dc and /defcon​
    /dc ? - Shows Help Menu.​
    /dc lvl/level <level> - Sets the Defcon Level.​
    /dc level view - Shows the current Defcon Levels.​
    /dc check - Returns the current Defcon Level.​
    /dc reload - Reloads the Configuration File.​
    /dc cs - Clear Serve(Kick all Players)​
    Defcon Permission Nodes (Works with Bukkit Permissions as well) -
    mcdefcon.admin - Allows the Player to change Defcon Levels​
    mcdefcon.accept - Allows the Player to bypass any Defcon Level, OP's will also be allowed to bypass.​
    Defcon Configuration File -
    Code:
    #====================================
    #McBans by SystexPro
    #Build: #1240
    #Version: 4.0
    #====================================
    
    messages:
        Level 1 Message: Kicked. Defcon level 3.
        Level 2 Message: Banned. Defcon Level 2.
        Level 4 Message: Defcon Level 4. All Players Muted.
        Level 5 Message: Defcon Level 5. Building is off.
        Level 6 Message: Defcon Level 6. All players are frozen.
    options:
        Broadcast Level Change: true
        McBans Temporary Ban Time: 5m
        Kick All Players on Defcon Level Change: false
        Use McBans: false
        Use Bukkit Permissions: false
        Show Defcon Level On Join: true
    main:
        Defcon Level: 0
    
    [​IMG](McDefcon is know Open Source) Please do not abuse.
    How-To Video -
    Bugs -
    Commands don't work in the Server Console.(DOS)​
    On Server Close, Defcon Level doesn't save to Config. <-- Being worked on for 4.5​
    TODO -
    Add Console Commands.​
    Allow Multiple Defcon Levels.​
    Fix Defcon Level 5.
    Changelog:
    Version 4.0 - October 7
    • Know uses PermissionsEx(same nodes)
    • Started on Custom Defcon Level 7.
    • Continued working on Auto-Updater.
    • Changed API to use PermissionsEx.
    Version 3.5 - October 4

    • Updated to #1240
    • No Major Updates, staying at 3.5
    • Changed up the API a bit.
    • Started looking into Plugin Conflicts with McDefcon<Thanks Zombiemold!>
    Version 3.5 - September 21
    • Updated to #1185
    • Added Defcon Level 6
    • Fixed some bugs with Level 4.
    • Added Command: /dc cs
    • Fixed some colors in the Messages.
    • Fixed a Version Error in the help menu.
    • Added a option to show the current level on join.
    • Started on McDefconAPI - 65% Done(More Here) <-- Link coming soon :)
    Version 3.0 - September 19
    • Fixed Defcon Level 5 not working.
    • Updated to Build #1060
    Version 2.5 - July 29
    • Changed Configuration Layout
    • Started to work on Auto-Updater
    • Added Defcon Level 5.
    • Fixed some Permission Bugs.
    Version 2.0 - July 28
    • Added Defcon Level 4.
    • Added Command /dc level view and /dc ?
    • New Bug: On Server Close, Defcon Level doesn't save to Config.
    • Changed order of Defcon Levels. (Thanks Joy!)
    Version 1.5 - July 27
    • Fixed McDefcon Folder not being created.
    • Removed McBan Type, Default Bans are Local.
    • Added Defcon Level 3
    • Added to kick all Players on Defcon Level Change
    Version 1.0 - July 25
    • Added Plugin
     
  2. Offline

    noahwhygodwhy

    hmm, this is kinda nice, maybe a way with defcon 1 it kicks them a configurable amount of times, then bans them? just an idea
     
  3. Offline

    Plague

    title is missing version
     
  4. Offline

    SystexPro

    Done.
     
  5. Offline

    Haekon

    Interesting, but MCBans just for trying to join? This is why I refuse to use MCBans...
     
  6. Offline

    SystexPro

    You can Configure to use McBans. In the Configuration, McBans is set to false.
     
  7. Interesting idea!

    Can you add to defcon level 2 to make them temporary mcbans? That makes more sense to me, and perhaps configurable time.

    Then the kick message could say like "Temporarily banned for 5 minutes, server is in Defcon 2" or so.

    ===

    Also, perhaps DC 1 and/or 2 could be configured to disable building/breaking in all worlds?

    And what about an option to kick all players when moving to DefCon 2? Or possibly make that DefCon 3

    Ok some issues:

    Loaded plugin for the first time, no MCDefcon folder is created, so I have no idea where or what the config file is.

    Also, writing "dc" or "defcon" on console errors:

    Code:
    >dc
    09:36:57 [WARNING] Unexpected exception while parsing console command
    org.bukkit.command.CommandException: Unhandled exception executing command 'dc' in plugin MCDefcon v1.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 com.systexpro.defcon.MCDefcon.onCommand(MCDefcon.java:92)
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
            ... 6 more
    
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
  8. Offline

    SystexPro

    Alright i'll check that out. Also i'll change Defcon 2 to Temp Bans and add Defcon 3 for Regular Bans with the McBans Type. And for know, /dc and /defcon won't work in console, i'll add that.

    Cheers.

    I didn't fix the Command Console Errors yet, but i did fix the Plugin Folder and added some of your ideas.
    I'll start to work on the other Bugs.

    Cheers and thanks for the ideas :D

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

    undeadmach1ne

    is it possible to return the message they would get if the server was down instead of telling them they are kicked? like a stealth/invisible mode?

    i have a small server on my lan and i am in the process of setting it up/configuring things and testing plugins. my buddies seem to have a knack for randomly trying to log in at the worst times and catch me testing plugins or setting things up i dont want them to know about. it would be awesome to be able to make it appear to them that its just not running at all when i dont want anyone popping up, and open it back up to the 'public' when its time to play.
     
  10. Offline

    SystexPro

    Sure, i just got home. I'll add that soon.

    Cheers :D
     
  11. Offline

    jamietech

    Could someone explain to me the concept of this plugin?
    I don't see why it would be used.
     
  12. Offline

    SystexPro

    It's to be able to lockdown your server to keep people out. And there's certain Levels to do that.

    Actully to do this, change the Kick Message in the config.yml to something like "No Connection to Host" and then set the server to Defcon 1 to kick any Players trying to join.

    Cheers

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

    jamietech

    I got that but I don't see when you would use it.
     
  14. Offline

    undeadmach1ne

    wonderful! thank you [cake]
     
  15. Offline

    SystexPro

    No Problem! :D
     
  16. Offline

    lolzrofl

    What is the point of banning any players that join?
     
  17. Offline

    SystexPro

    It's not really ban, but keeping people out of your server. Everything is configurable.
     
  18. Offline

    undeadmach1ne

    the config file/folder were not created on start so i made \plugins\MCDefcon with config.yml in it and copied your example from the first post. i tried to connect when the server was not running to see what it says (which is 'Connection refused: connect'). turns out the : causes the plugin to fail to load. i guess there is nothing which can be done about that though as the : throws everything off. as a test i just removed the : and it loads fine, but i still get the default 'kicked defcon level 1' msg when i try to log in with a second client. for me, i dont think this will work the way i wanted anyway, because when the server is down the top line (which you cant change) of the error says 'failed to connect' and even if defcon was using my custom msg, that top line says 'server refused' or similar...an observant player would know something was up =)

    so thanks anyway. consider this post a quick error report i guess. here is the cfg, error (caused by having a : in my msg) and other relevant info. let me know if you would like to see anything else or have me test something.

    im on bukkit 1031 and my config/yml is:

    Code:
    Defcon Level: 0
    Use Bukkit Permissions: false
    Broadcast Level Change: true
    Level 1 Message: Connection refused  connect
    Level 2 Message: Banned. Defcon Level 2.
    Kick All Players on Defcon Level Change: false
    Use McBans: false
    McBans Temporary Ban Time: 5m
    error msg:

    Code:
    23:35:42 [SEVERE] Could not load 'plugins\MCDefcon.jar' in folder 'plugins':
    mapping values are not allowed here
     in "<reader>", line 4, column 36:
        Level 1 Message: Connection refused: connect
                                           ^
    
            at org.yaml.snakeyaml.scanner.ScannerImpl.fetchValue(ScannerImpl.java:74
    5)
            at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.ja
    va:307)
            at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:18
    3)
            at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(Par
    serImpl.java:564)
            at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:163)
            at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:148)
            at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java
    :228)
            at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
            at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:12
    2)
            at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:105)
    
            at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseCons
    tructor.java:124)
            at org.yaml.snakeyaml.Yaml.load(Yaml.java:264)
            at org.bukkit.util.config.Configuration.load(Configuration.java:82)
            at org.bukkit.plugin.java.JavaPlugin.initialize(JavaPlugin.java:157)
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:175)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:213)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:136)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:128)
            at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:97)
            at net.minecraft.server.ServerConfigurationManager.<init>(ServerConfigur
    ationManager.java:51)
            at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:132)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:335)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
     
  19. 2011-07-28 08:20:35 [INFO] [MCDefcon] Loading MCDefcon Version 1.0
    2011-07-28 08:20:35 [INFO] [MCDefcon] Loading Configuration File.

    Yet the folder MCDefcon does not exist, no config...
     
  20. Offline

    Cody Pawlowski

    Um.. the download link leads to Defcon 1.0, not 1.5. That might be why theres no config or level 3 ;)
     
  21. Offline

    SystexPro

    ... Sorry, i changed the name of it, It know Works with 1.5

    ===UPGRADE TO 1.5===

    • Creates folder
    • Added Defcon 3
    • Fixed more Bugs

    Linkes Fixed to 1.5. Sorry :/

    Cheers.

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

    undeadmach1ne

    awesome thanks =) ill check that out in the morning [cake]
     
    SystexPro likes this.
  23. Shouldn't DC 3 be local bans, DC2 be temp bans? Temporary bans are less "heavy" than local bans I'd say :p

    Config works now :)
     
  24. Offline

    SystexPro

    Haha i might switch it, Though i will add defcon 4 for mutes and defcon 5 for no building. xD.

    Thanks for using the Plugin. Enjoy!

    Cheers!
     
  25. Offline

    undeadmach1ne

    works perfect now =) custom msg is delivered, folder and config generated with no errors. thanks for the quick fix [cake]
     
    SystexPro likes this.
  26. Offline

    jamietech

    I still don't get what this is useful for.
     
  27. Offline

    SystexPro

    Then don't worry about.
     
  28. Offline

    lolzrofl

    MCBans seems really like a ban to me.
     
  29. Offline

    EmanuxJade

    hello, awesome plugin, is possible in the next release implement commands by console?

    i tryed to use in console and i got this error:

    Code:
    2011-07-29 10:27:33 [WARNING] Unexpected exception while parsing console command
    org.bukkit.command.CommandException: Unhandled exception executing command 'dc' in plugin McDefcon v2.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 com.systexpro.defcon.MCDefcon.onCommand(MCDefcon.java:92)
            at org.bukkit.comma
    
     
  30. Offline

    SystexPro

    Yep, thats on my TODO list. Going to work on that today.
     

Share This Page