[INACTIVE][DEV] PluginDisabler v0.0.2 Easy Plugin Disabling [733]

Discussion in 'Inactive/Unsupported Plugins' started by madcap, Mar 26, 2011.

  1. Offline

    madcap

    Plugin Disabler

    Download
    Source

    While attempting to integrate Permissions into another plugin I was working on I found myself wishing there was a way to selectively enable and disable plugins at will so I could make sure I was hooking into it correctly. From that need this plugin was born.

    You can use this plugin to disable and enable selected plugins quickly and easily.

    Commands:
    penable ARGUMENTS - Enables all plugins specified. (alias: pon)
    pdisable ARGUMENTS - Disables all plugins specified. (alias: poff)
    ptoggle ARGUMENTS - Toggles the status of the plugins specified (alias: p)
    pstatus ARGUMENTS - Lists the enabled/disabled status of each specified plugin (alias: pstat)

    ARGUMENTS can be the following:
    * - all plugins
    (no argument) - whatever argument you used last
    pluginname1 pluginname2 ... - This plugin will attempt to match the plugin names you typed. All plugins that match will be used. This is not case sensitive.

    Examples:

    Show the status of all plugins:
    Code:
    pstat *
    or:
    Code:
    pstatus *
    Disable the Permissions plugin and the iConomy plugin (and any other plugins that start with 'perm' or 'icon'):
    Code:
    poff perm icon
    or:
    Code:
    pdisable perm icon
    Enable the plugins you disabled last time:
    Code:
    pon
    or:
    Code:
    penable
    Toggle the status of the Essentials plugins (enable them if they are currently disabled or vice versa):
    Code:
    p essen
    or:
    Code:
    ptoggle essen

    This plugin will never disable itself. Players must be ops to use these commands.

    Changelog

    0.0.2
    * Updated for RB CB733
    0.0.1
    * Release
     
  2. Offline

    tha d0ctor

    are disabled plugins fully disabled to the point where you can delete the .jar or paste over if necessary?
     
  3. Offline

    madcap

    When the server is running all plugins are held in memory. You could replace/delete the jar files and it would have no affect on your running server. Once you issue the /reload command (from CraftBukkit) or restart the server then the new jar file (if any) would be used instead.

    So if you're making updates to the jar file you'll want to /reload (which reloads all plugins). For my next update I'll add /pload and /punload that will allow loading of a particular plugin.

    Setting a plugin to disabled means it's still present but no longer running*. It's onDisable method get's called meaning any code you have there would be executed and any plugins listening for OnPluginDisable events would see your plugin get disabled and run their code.

    *Using this plugin to enable/disable plugins I've found some bugs in CB with regard to the handling of disabled plugins. But in general you can assume it's not running.
     
  4. Offline

    Fireside

    Hi madcap. I'm encountering some issues with the order in which plugins load. For example shop plugins loading before iConomy comes up or iChat coming up before MV and stopping the world prefix from working in chat. While I have had some success with renaming plugins, its all a bit messy and I know one day I will add something that messes it all up again.

    So I wonder if something like your plugin could be used to load plugins in a certain order, and even possibly with some delay to allow things to complete their initialization before the next loads in.

    It would be awesome to run one command that executes a previously configured load order. Would appreciate your thoughts.

    Fireside.
     
  5. Offline

    madcap

    Interesting idea. If people would write their plugins correctly it wouldn't be a problem. And I'm almost tempted to say that we shouldn't do this just so that bad programming doesn't get covered up with bandaid solutions. But that isn't very helpful.

    Something like you suggest would certainly be possible but I'm not sure it would have the intended affect. As I found when I started playing around with disabling plugins, a lot of plugins don't behave correctly when they are disabled and then re-enabled (agian, bad programming, and even Craftbukkit bugs). Hopefully people will use tools like this to experiment with turning their plugins on and off and making sure they actually behave right.

    All that said, this plugin should do exactly what you want.

    Say you want to run them in order plugin1, plugin2, then plugin3 (p1, p2 and p3).

    Do:
    poff p1 p2 p3

    Then:
    pon (no argument needed here, it uses the same ones as last time).

    The command will actually execute in order and all 3 of the plugins will be running in the order you want. There shouldn't be any need for a delay, they are activated in order as far as I know.

    So I guess it's really just a matter of automating it.
     
  6. Offline

    Fireside

    Thanks for your reply. I appreciate what your saying about the writing plugins correctly and will put in a polite request with a few developers here and there.
    But for now, what you have given us seems quite workable and I will get in and have a play with that.
    Cheers,
    Fireside.
     
  7. Offline

    Plague

    considered inactive
     
  8. Offline

    madcap

    Updated for latest RB.
     
  9. Offline

    SuicideHotline

    I would like to use this once it supports unload and reloading plugins.
     
    untergrundbiber likes this.
  10. I think the plugin would be alot more usefull if it would support unload+reload
     
  11. Offline

    untergrundbiber

    +1
     
  12. Offline

    Shooty

    Cool but for next version i would like /pll (for load plugins) and /plu for unload plugins it's possible :D ?
     
  13. Offline

    MiHo

    Code:
    // check that sender has access, must either be console or op
    		boolean perm = false;
    		String name = "";
    		if(sender instanceof Player){
    			name = ((Player)sender).getName();
    			if(((Player) sender).isOp())
    				perm = true;
    		}
    		else{
    			// what else could this be besides console?
    			perm = true;
    			name = "Console";
    		}
    Could be IRC for example. ;)
     
  14. Offline

    MonsieurApple

    Considered inactive.
     

Share This Page