For$
<!-- begin site header -->
<div id=

Author Topic: Plugins need to check if they are loaded?  (Read 11699 times)

Ligustah

  • Newbie
  • *
  • Posts: 42
    • View Profile
Plugins need to check if they are loaded?
« 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?

xoft

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Plugins need to check if they are loaded?
« Reply #1 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, ...)

Fador

  • Administrator
  • Full Member
  • *****
  • Posts: 126
    • View Profile
Re: Plugins need to check if they are loaded?
« Reply #2 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

Ligustah

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Plugins need to check if they are loaded?
« Reply #3 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.