Server sends multicast twice error

This forum deleted my original question due to timeout or something… so, i´m tired to write all again…

Issue: Multicast event is received twice on CLIENTS only.

Evidence:

  1. I see this image which shows instances, it is repeated sometimes with same name, should it be like this?

272324-multipleinstances.png

  1. On multicast event, I added a “IsLocallyControlled”, still executes twice, so i´m sure it is same instance.

  2. On multicast event, I added “runOnce”, and it runs just once, so i´m sure IS the same instance receiving twice.

  3. Server method calling this multicast, it is happening just once, based on logs I can see is not executed multiple times.

  4. If I click on “PlayerFreeFor3” (the second repeated instance) it selects the first one, it´s like it knows is the same instance, is not a different one, but in the map, If I run “get actors of class”, I don´t see repeated instances.

**Any ideas why may I be seeing this duplication on unreal? **
it´s driving me mad…

2 Likes

Update over here… I did a quick/clean POC, and I confirmed some stuff…

With this empty project I see this looks expected, perhaps the reason is that even if the instance is one in the server, and other in the client, a multicast might need to be triggered even in the server side, you just need to check if it is locally controlled to decide… for example, to show a widget (doesnt have sense to show a widget in the server copy, right?)

This is the pattern used on this POC, it is the same as I´m using on my code, but here works fine… SO I think I need to check further on my code what could be wrong…

Only thing I can think of, instead of allowing game mode to create pawn by default, i´m creating this pawn in server side by myself… could this be a problem???

HOOOOOOOOOOLY SH111111111111111T, after 3 days checking this issue, I finally cracked it… it´s an error in unreal editor!!!

I thought for a moment… When you have an event, you also have a method tied to it, aka Delegate, and you can have more than one delegate for the same method, if it´s registered twice, it will happen/execute twice.

I don`t know HOW! but somehow something crashed on my blueprint, that caused a confusion inside blueprint, and this particular event was “listened” twice… perhaps a binary problem inside blueprint, merge error, dkw…

I solved it by deleting this Multicast method, and created a new one with same parameters, and I made a call replacing one for the other… Is the same friking method, but I created it just now, fresh…

and What it executes, I unpinned old code and pinned new / fresh method…
MAGIC:

IT WORKS… NOW IT´S CALLED JUST ONCE!
:@

I can rest in peace…
Probably in C++ I would be able to see this, but here behind the blueprint,… it was PURE LUCK.,

3 Likes

After solving my problem with this, closing and reopening unreal, application crashes really bad… so I´m worst than square 1…

I just thought I’d reply to this from the future… in case anyone else ends up here from google.
I had a similar issue (5.1), however with my multicast event I also implemented it in a child class and I called the parent function… big dumb dumb… as the parent call also multicasts the event to the local client so may run it twice in parallel, I assume in the same way that the above was happening with a dual delegate.