Multiple Send plugin not working (3.38)

Posted by Norry on Sun 20 Apr 2003 08:25 AM — 6 posts, 23,345 views.

#0
I upgraded to 3.38 and while playing around with triggers and stuff, I found that the multiple send plugin doesn't seem to work. I had to change the alias a bit (since I have a similar "repeat" alias) and when I tested it out, it only performs the action in one world.

With two worlds open:

World 1 sends: ##1 bounce (works)
World 1 sends: ##2 bounce (world 1 does the action, not 2)
World 1 sends: ##all hop (world 1 does the action twice, world 2 does nothing)
World 2 sends: ##1 laugh (works)
World 2 sends: ##2 laugh (world 1 does the action, not 2)
World 2 sends: ##all smirk (world 1 does the action twice, world 2 does nothing)

The "all" depends on how many worlds are open; it does the action that many times. I tested it with more worlds open, and the action always seems to go to the first world that was opened.

I've tried to reinstall it, remove/add, and it doesn't seem to help. I don't think I broke it... (I haven't touched the code at all, just the alias part).

For reference, my repeat alias:

<aliases>
  <alias
   name="repeat"
   script="OnRepeat"
   match="^#([0-9]+) (.+)$"
   enabled="y"
   regexp="y"
  >
  </alias>
</aliases>


The multiple_send alias:

<aliases>
  <alias
   script="SendToWlds"
   match="##* *"
   enabled="y"
  >
  </alias>
</aliases>

Amended on Sun 20 Apr 2003 08:26 AM by Norry
Australia Forum Administrator #1
I can't reproduce that, even with your changed aliases. I would have to guess that something else is interfering with it, eg. your scripting prefix, your speedwalk prefix.

If you email me your world file (remove the character name and password), I'll try to reproduce it and see what is happening.
#2
I almost started to bang my head against the wall, since I logged on to my usual MUD and couldn't reproduce the problem. I had been testing it on my copy of SMAUG, so I thought maybe that was the problem. What I did was open a world then open a second world, pre-loading the defaults from the first world. That seems to be the problem. I know it's not my scripting prefix (// because the / precedes note commands in SMAUG) or the speedwalking prefix (/w) which isn't even enabled.

Steps to reproduce:
1. Open a world
2. Click "New world", say yes to preload defaults from an existing world, and choose the first world

Now the multiple send plugin doesn't work right. And I tested with a couple of worlds both in the mud and off and I got the same result, so I don't think it's a world problem.

I can still email you the world, but I don't know how you feel about attachments. ;)
Australia Forum Administrator #3
If you look at the write-up for GetWorldList which the multiple-send plugin uses:

http://www.gammon.com.au/scripts/function.php?name=GetWorldList

You will see it returns an array of the names of the open worlds - that is used to send to each world. My guess is that by getting defaults from a previous world that they both have the same *name* - that is your problem.

Try changing the name of the second world to something different and see what happens.

Meanwhile, I think I'll make a different function that returns world IDs (which didn't exist at the time I did the earlier one) which will always be unique - that will be more reliable.
Amended on Sun 20 Apr 2003 10:14 PM by Nick Gammon
Australia Forum Administrator #4
I have added two new routines to scripting to get world unique IDs rather than world names, and will updated the plugin accordingly. This should be more reliable in cases like this. This will be in version 3.39.

The problem you describe would have been in earlier versions, perhaps you didn't do this sequence of events earlier.
#5
Wow, you're fast. And thanks, that's exactly what the problem was. I guess I just got lazy and didn't bother renaming my "testing" worlds, since I never saved them. I just had one then any other characters I was playing with got the defaults from the first world. My real mud chars all have a separate world of their own, so I didn't have a problem there. I tried changing the names and it worked as expected. Guess that's what I get for testing stuff in the middle of the night. :P