Author Topic: Command hook for plugins  (Read 3028 times)

alterNERDtive

  • Jr. Member
  • **
  • Posts: 52
Command hook for plugins
« on: August 17, 2020, 09:58:04 AM »
Hey, it’s me again! Fiddling with plugins I realized that it would be great to be able to do _more_ things with them.

The biggest thing I have in mind right now is being able to hook into command invocations. So basically either just have a method that’s called when any command is invoked, or be able to register certain (partial) commands that you want to be “notified” about.

Basically like having a plugin invocation added to all the commands, without having to actually, you know, do that.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2831
Re: Command hook for plugins
« Reply #1 on: August 27, 2020, 08:57:02 PM »
I have added two very basic events to the proxy:  CommandExecuting(Guid? InternalID) and CommandExecuted(Guid? InternalID).  The former is raised before the command executes and the latter is raised after the command executes.  To eliminate unnecessary overhead, there will be a setting in the Advanced/Experimental command options to allow a command to raise these events to the proxy.

This will be in the next beta.