Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Easy way to call OnSay() method of all plugins loaded
#1
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
Reply

#2
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.
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#3
(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?
Reply

#4
(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
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#5
(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?
Reply

#6
(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?
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#7
(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.
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tutorial] How to install plugins to your MW3 Server JariZ 24 36,316 07-17-2017, 07:54
Last Post: syrvvp
Video How to compile MW3 server plugins for supernoobs JariZ 57 46,943 07-24-2015, 14:06
Last Post: graphix2004

Forum Jump:


Users browsing this thread:
3 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.