Aliases - They should keep evaluating through all plugins.

Posted by Magnum on Tue 14 Jan 2003 01:38 PM — 6 posts, 28,014 views.

Canada #0
Ok, I did some testing this morning and found, to my dismay, that aliases do not keep evaluating through each plugin. Here's what I was trying to do:

All plugins written by me display a header when they are installed/connected. I decided that I wanted to make a single alias "Plugins", which would be processed by each plugin, which would then act by displaying it's header.

Surprisingly, only one plugin would process the alias.

I feel this is contrary to what a plugin should do. It seemed as though the mandate of a plugin (when we were all discussing it) would be that it is independant (in most respects) to the main world, and other plugins. Alias collision is contrary to that mandate.

In my opinion, each plugin, as well as the main world, should have a go at the inputted text, running it through their respective alias-processing routines. In my case, ALL of my plugins would match the string as an alias, and they would ALL, in turn, run their respective actions.

(I confirmed my assessment by removing and reinstalling plugins).

I know there is probably a work around for this, by doing that pre-processing thingy, whatever it is. I forget, and I don't remember what to search for.
Portugal #1
I have duplicated triggers in 3 plugins and all fire with the same output line... I agree it should be possible to happen with aliases too..
Australia Forum Administrator #2
You want OnPluginCommand - see Plugin callbacks.

I suppose it is not consistent with triggers, but I thought you would only want one action to a typed command not dozens. Using OnPluginCommand you can simulate that. OnPluginCommand is executed in each plugin, so you should be able to use that to achieve the affect you are after.

Canada #3
Well, I'll try that workaround for the short term, but as I allude to in my original post, I don't think the current methodology is favourable.

The reason behind that statement is that alias collision causes one or more plugins to malfunction. Multiple processing by each plugin and the main world is preferable.

The only exception should be, that if any plugin matched the input as an alias, then it should not be sent as regular text to the mud. IE: If I type "help" and three plugins match the text for aliases, the main world file would not send "help" to the mud.

Should you refuse to make this change, and should I want to ensure that my plugins always work, I would have to use OnPluginCommand in every Plugin, then process every single line through my own alias matching routine. What a nightmare.

(Oh so dramatic!) - LOL.
Australia Forum Administrator #4
I'm not refusing anything right now. I'm on holiday and don't have my Windows compiler with me. :) So it is "can't", not "won't".
Australia Forum Administrator #5
This problem is fixed in version 3.35 - command and alias evaluation has been rewritten, and now each plugin can take a shot at evaluating what you type, including if another plugin has matched.