Mineserver Community

Mineserver => Development => Topic started by: Ligustah on February 27, 2011, 02:42:06 pm



Title: Plugins need to check if they are loaded?
Post by: Ligustah on February 27, 2011, 02:42:06 pm
Why do plugins need to check if they are loaded already?
Isn't that a thing general enough for the plugin loader to take care of?
If i am not mistaken all plugins use the very same code to do that check,
so why not put it to a place where it is done for all the plugins automatically?


Title: Re: Plugins need to check if they are loaded?
Post by: xoft on March 06, 2011, 01:20:36 pm
I'm just trying to make up some reasons that could be behind this, don't take me too seriously ;)

There might be a scenario when actually loading a plugin twice would affect the way the plugin acts. For example a plugin that adds a bot that it controls may add another bot when loaded for the second time. Or a logging plugin might get loaded several times, each time with a different configuration (output file, verbosity, ...)


Title: Re: Plugins need to check if they are loaded?
Post by: Fador on March 06, 2011, 01:23:28 pm
..you don't really need to check if the plugin is already loaded inside the plugin if you don't want to ;D


Title: Re: Plugins need to check if they are loaded?
Post by: Ligustah on March 09, 2011, 07:09:38 pm
I was just wondering about that, because it seemed akward to me that all the plugins
i looked at checked for that in their code.
And it looked all the same.