ItsMods

Full Version: Easy way to call OnSay() method of all plugins loaded
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

is there any easy way to call the method OnSay() of every loaded plugin from a plugin?

Reason: I have plugins running on my server and I want to use the plugin commands like !votecancel , !warn, !nextmap, !yell, etc from another plugin. The other plugin listens on a network port/pipe and if I send a command to that port/pipe it calls all OnSay() methods of the other loaded plugins.

Is there any way to do it?

Thanks in advance
You can make one plugin which will load all references and get methods from it.
Search for "Assembly.LoadFile". It's a great thing which loads dynamic libraries and "invokes" necessary method.
(12-26-2013, 11:00)SailorMoon Wrote: [ -> ]You can make one plugin which will load all references and get methods from it.
Search for "Assembly.LoadFile". It's a great thing which loads dynamic libraries and "invokes" necessary method.

Thank you very much for your answer.

I know that Assembly.LoadFile loads dynamic libraries, but the plugins are already loaded by Nukem maddon, so they exists already in memory.
If I would use Assembly.LoadFile again it would make new instances of all plugins and would use double memory or am I wrong with that?
(12-26-2013, 11:44)tok Wrote: [ -> ]
(12-26-2013, 11:00)SailorMoon Wrote: [ -> ]You can make one plugin which will load all references and get methods from it.
Search for "Assembly.LoadFile". It's a great thing which loads dynamic libraries and "invokes" necessary method.

Thank you very much for your answer.

I know that Assembly.LoadFile loads dynamic libraries, but the plugins are already loaded by Nukem maddon, so they exists already in memory.
If I would use Assembly.LoadFile again it would make new instances of all plugins and would use double memory or am I wrong with that?

There is "unload" method.
You can try to load then unload it.
By the way, teknogod is not supported @this forum.

Edit: http://stackoverflow.com/questions/62581...y-loadfrom
(12-26-2013, 12:03)SailorMoon Wrote: [ -> ]
(12-26-2013, 11:44)tok Wrote: [ -> ]
(12-26-2013, 11:00)SailorMoon Wrote: [ -> ]You can make one plugin which will load all references and get methods from it.
Search for "Assembly.LoadFile". It's a great thing which loads dynamic libraries and "invokes" necessary method.

Thank you very much for your answer.

I know that Assembly.LoadFile loads dynamic libraries, but the plugins are already loaded by Nukem maddon, so they exists already in memory.
If I would use Assembly.LoadFile again it would make new instances of all plugins and would use double memory or am I wrong with that?

There is "unload" method.
You can try to load then unload it.
By the way, teknogod is not supported @this forum.

Edit: http://stackoverflow.com/questions/62581...y-loadfrom

Perhaps that is getting OT but what has this to do with TeknoGods?
(12-26-2013, 14:10)tok Wrote: [ -> ]
(12-26-2013, 12:03)SailorMoon Wrote: [ -> ]
(12-26-2013, 11:44)tok Wrote: [ -> ]
(12-26-2013, 11:00)SailorMoon Wrote: [ -> ]You can make one plugin which will load all references and get methods from it.
Search for "Assembly.LoadFile". It's a great thing which loads dynamic libraries and "invokes" necessary method.

Thank you very much for your answer.

I know that Assembly.LoadFile loads dynamic libraries, but the plugins are already loaded by Nukem maddon, so they exists already in memory.
If I would use Assembly.LoadFile again it would make new instances of all plugins and would use double memory or am I wrong with that?

There is "unload" method.
You can try to load then unload it.
By the way, teknogod is not supported @this forum.

Edit: http://stackoverflow.com/questions/62581...y-loadfrom

Perhaps that is getting OT but what has this to do with TeknoGods?

You said mAddon, no?
(12-26-2013, 14:20)SailorMoon Wrote: [ -> ]
(12-26-2013, 14:10)tok Wrote: [ -> ]
(12-26-2013, 12:03)SailorMoon Wrote: [ -> ]
(12-26-2013, 11:44)tok Wrote: [ -> ]
(12-26-2013, 11:00)SailorMoon Wrote: [ -> ]You can make one plugin which will load all references and get methods from it.
Search for "Assembly.LoadFile". It's a great thing which loads dynamic libraries and "invokes" necessary method.

Thank you very much for your answer.

I know that Assembly.LoadFile loads dynamic libraries, but the plugins are already loaded by Nukem maddon, so they exists already in memory.
If I would use Assembly.LoadFile again it would make new instances of all plugins and would use double memory or am I wrong with that?

There is "unload" method.
You can try to load then unload it.
By the way, teknogod is not supported @this forum.

Edit: http://stackoverflow.com/questions/62581...y-loadfrom

Perhaps that is getting OT but what has this to do with TeknoGods?

You said mAddon, no?

Sorry but I meant this MW3 Server Addon here.

BTW.What I want to do is, to control the server from command line and to reload some plugin config (most of my plugins have a "!reload" command) on the fly without starting the client and join the game.

If I would load and unload the plugins it would not change the configuration of the plugins which are already loaded. Sure I could use the commands of these plugins, but not change the variables, because they are new instances. So I search a way to do it with the already loaded plugins.

I tried also to use the console command "say !reload", but this is not passed to the OnSay() method of the plugins.