[UNSUPPORTED][ADMN] HotSwap: Enable, Disable, Reload, and Load Plugins On-the-Fly

Discussion in 'Inactive/Unsupported Plugins' started by Zenexer, Jan 18, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Zenexer

    You'll want to use GroupUsers with this one.

    Commands
    • /plugin load PLUGIN: loads the Java archive for PLUGIN from the plugins directory and enables it. Relative paths are accepted.
    • /plugin list: lists all loaded plugins, both enabled and disabled.
    • /plugin enable PLUGIN: enables already-loaded PLUGIN. Does nothing if PLUGIN is already enabled.
    • /plugin disable PLUGIN: disables already-loaded PLUGIN. Does nothing if PLUGIN is already disabled.
    • /plugin reload PLUGIN: disables, loads, and enables PLUGIN, though not necessarily in that order. Theoretically, disable could run after enable, but that would be unlikely/impossible in most/all JVMs.

    Download from Earth2Me or get the source code.
     
  2. Offline

    GDorn

    Does this work in the console, or only from inside the game?
     
  3. Offline

    Zenexer

    Console commands do not work yet--at least, that is my understanding. This plugin does implement the console command class, so it will work with only a slight edit once console commands are supported. (I originally made this as a console command, only to find that there was no way to intercept the actual command!)
     
  4. Offline

    Exo

    Very nice. Thanks alot for this :)
     
  5. Offline

    fuzzyhunter0608

    Thanks for the plugin, it works great. I have a couple of ideas to improve it, if you are willing to consider them...
    • Color coding for plugins in /plugin list that are enabled/disabled (red/green maybe?)
    • Config file for default setting for each plugin, so you can have plugins installed but not enabled (not sure if this is possible or how it would work...)
     
  6. Offline

    Zenexer

    Updated with color-coded list. Thanks for the idea, fuzzyhunger0608!
     
  7. Offline

    EggRoll

    Didn't work on 79. Which build do I need?
     
  8. Offline

    Zenexer

    The latest build, I believe.
     
  9. Offline

    fuzzyhunter0608

    Thanks for the update, I think this makes it a bit easier to use.
    I thought of one more thing as well that should be fairly easy to implement:
    Can you make it so that the plugins and commands are not case-sensitive?
     
  10. Offline

    pagangeek

    just ran /plugin reload General (after making config changes)
    It booted me off the server with a non-specific error message.
    Latest Snapshot build.
     
  11. Offline

    Zenexer

    Surprisingly, this is not so easy to implement! POSIX servers, such as those running on Linux, have case-sensitive filesystems. Thus, two plugins could have the same case-insensitive signature, but be two different files. Unfortunately, this means case-sensitivity is a must.
     
  12. Offline

    fuzzyhunter0608

    That's fine then, no big deal
     
  13. Offline

    highwisdom

    CraftBukkit build 85:
    no errors on load
    list works fine
    load appears to work (plugin appears red in list)
    enable, disable, and reload appear to do nothing (plugin always stays red)

    Edit: I fail at forums. Respecting case sensitivity makes it work.
     
  14. Offline

    rushone2009

    implement a listener class the reads input from the console, than parce those commands, no?
     
  15. Offline

    Zenexer

    That'd work great if I could actually attach a listener to the console, which seems impossible at present.
     
  16. Offline

    feverdream

    I love the sound of this.. your provideing source right?

    Seems you should submit a patch set to ScrapBukkit.
     
  17. Offline

    Zenexer

    Open source? Why would I do a crazy thing like that? ;) (The link to the source will be in the original post in a few moments.)
     
  18. Offline

    feverdream

    Something like this is needed for scrap bukkit last I checked anyway, you may want to submit a patch that add it. Really.
     
  19. Offline

    seriosbrad

    On build 86 after using /plugin reload PLUGIN it would essentially run duplicates of that plugin. Running a command from that plugin would result in the command running multiple times :p
     
  20. Offline

    Zenexer

    Updated to fix the bug pointed out by seriosbrad.

    I know exactly why that was happening, and it is entirely due to a lack of testing on my part. Oops :3

    Perhaps we should add something to Bukkit to prevent idiots like me from loading the same plugin twice, lol.
     
  21. Offline

    feverdream

    Code like yours is really utility code; it should be written only once. Please, please, please, submit a patch of this to ScrapBukkit.
     
    clash likes this.
  22. Offline

    Zenexer

    I figured I wouldn't complicate matters while they're trying to get it released. Once console commands work and Bukkit is stable, I'll submit a feature patch.
     
  23. Offline

    Nijikokun

    Yeah, this is how it needs to be coded for it to try and run correctly bukkit doesn't load them right.
     
  24. Offline

    Zenexer

    Sorry, but I didn't quite comprehend that >_>
     
  25. Offline

    rushone2009

    what are you writing it in? Is Bukkit all Java atm?
     
  26. Offline

    Zenexer

    Yes, I am writing this in Java. Bukkit is in Java and YAML (though the latter is more of a means for serialization). I think the key to commands might be in the YAML plugin description, though.
     
  27. Offline

    GEN3RIC

    Hey Zenexer. Why doesn't this plugin report itself in the server log when running? Also, may I suggest that typing /plugin would send help feedback for syntax?
     
  28. Offline

    Zenexer

    Some plugins manually display a report in the server log, but I generally don't bother because Bukkit will soon be doing that automatically, and, I'll admit it, I'm lazy sometimes. I'd like the transition to the new command system to be as easy as possible, so I try to avoid adding workarounds that will need to be removed later for redundancy.

    Updated to support multi-word plugins.

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

    ToitagL

    First, thanks for your time and your work. We really appreciate this.

    Enable/Disable/Reload seems to work perfectly well, but if I want to update "on the fly", even a disabled plugin can't be replaced / deleted. Is this a bukkit-limitation of some kind ?
     
  30. Offline

    GEN3RIC

    Thanks for clarifying.
     
Thread Status:
Not open for further replies.

Share This Page