Page 1 of 1

[Dev] - Plugin dependencies

Posted: 16 Aug 2014, 06:15
by marlburrow
Hi,

first of all, very good job, this server controller is amazing :), keep it up.

I've two question about plugin developpement.

First, i would like to check an other plugin dependency when my plugin is loaded.

I actually use this way but it doesn't works when ManiaControl is starting :

Code: Select all

public function load(ManiaControl $maniaControl) {

if(!$maniaControl->pluginManager->getPlugin('steeffeen\ObstaclePlugin')) {

$errormsg = 'This plugin requires "ObstaclePlugin" by Steeffeen.';
throw new \Exception($errormsg);

}

/* Blablabla */
}
This exception is always thrown even when the Obstacle Plugin is enabled.

I think it doesn't works because my plugin is loaded before the Obstacle Plugin, if I enable my plugin manually after ManiaControl runtime, it's works well.

So, i there a better way to check others plugins dependencies ?

An other question now : i've registered an admin command in my plugin using this way :

Code: Select all

$maniaControl->getCommandManager()->registerCommandListener(array('cmd', 'alias'), $this, 'commandMethod',true, 'Amaze command');
But when i test this command, nothing happens and it doesn't appear in the command list (/helpall).

yet, my player login is registered as a SuperAdmin in the server.xml config. I missed something ?

the notice message shown below is displayed when ManiaControl start, maybe it can help you answer.

Code: Select all

Notice: Field 'nickname' doesn't have a default value in /home/action/workspace/obsmania/maniacontrol/core/Admin/AuthenticationManager.php on line 199


Thank you very much for your reply.

...and very sorry for the Dev mode env, I didn't know. Maybe you should describe that on this page http://www.maniacontrol.com/docs

Re: [Dev] - Plugin dependencies

Posted: 16 Aug 2014, 10:33
by steeffeen
hey!
thanks for the kind words :)

yeah the docs page is absolutely outdated, we know that but we didn't find the time to fix it because there have been other priorities so far
i also forget the dev mode sometimes but developing without it the whole time creates maaaany error reports on the website ^^

there is no support for plugin loading order but imo you shouldn't need that
i was always annoyed how like 90% of all plugins of the other controllers have had some kind of dependencies to other plugins, which is why we don't support that natively
if you need another plugin for doing stuff, just don't do it as long it's unavailable and print an error message
i can't think of something that would require to stop your plugin

Re: [Dev] - Plugin dependencies

Posted: 18 Aug 2014, 22:57
by marlburrow
Thank you for the answer Steeffeen,

Last question, how can i submit my plugin when it's done ?

Thank you

Re: [Dev] - Plugin dependencies

Posted: 18 Aug 2014, 22:58
by steeffeen
check out http://maniacontrol.com -> User Area -> My Plugins