-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix AceComm for communicating cross realm #21
base: master
Are you sure you want to change the base?
Conversation
When senind mulitpart messsages across realms, the messages can be received out of order. Fix this by introducing a new header that contains the message number and message total.
There's a bit of debugging code left in there, because I assume that this isn't the final version. The context of this change is WeakAuras/WeakAuras2#5342 That could obviously also be solved by the game not reordering messages. |
I'd rather you get this fixed in the game than patching in a bandaid only to remove it later. If it's about "we can do this until it's patched" well we've lived with cross realm comms being unusable previously, so we can live with it being out of order a little longer. |
I have zero ability to get this fixed in WoW. |
I'll poke around |
As-is I believe this would still spuriously fail when dealing with out-of-order receipt of streams of multipart chunks where the size is consistent. Consider a sender that sends a multipart message chunked into two pieces ("1" and "2"), and they're sending them constantly to a receiver such that their message output on the stream looks like "121212". Now imagine a receiver observes a stream and sees "121212". This might look correct, however there's no metadata in your chunking to prove that the "2"'s have been received in the same order that they were sent - it's entirely possible that the second received "2" is part of any of the three chunk pairs. This invalid ordering would pass through your message count/total checks on receipt and end up stitching together two unrelated messages for addon code to then explode on. Another bug you'll have is that the receipt code unilaterally trusts that the incoming chunk is actually correctly ordered. Assume a sender transmits a chunk stream like "12312", and a receiver reads "12231". The receipt code as-is will fall over on this badly; you'll effectively double-count the "2" chunk and increment the received counter causing things to get out-of-sync. Further, as before it's possible the second "2" chunk is from an unrelated message and so the assignment of the Chomp mitigates this issue by including a wrapping "session" ID (0-4095) in the chunk metadata, with the initial value chosen randomly on startup and incremented once when a multipart message is enqueued for transmission. Incoming messages are bucketed into separate spools keyed upon As for getting Blizzard to fix it - I'd like SendAddonMessage to not suffer from this to begin with but I'd also note that Battle.net comms have been unordered forever. |
One other concern I had is the forced use of headered messages on transmission. There'll be a time between which a sender with a new AceComm version and a receiver on an old version will result in all traffic between the two players being dropped, as the old version won't know what to do with the incoming unrecognized message type. AceComm has wide enough usage across big addons that people are likely to eventually get the update to support the new message type, but I do remain concerned about the risk of it taking longer than is desirable and causing a lot of "broken comms" bug reports in addons using AceComm because the receiving half insists on running their updater clients once every half a year. Is there any mangling of the API that we could use to perhaps limit the use of the new headered messages only if the transmission actually requires them? Comms between players on the same realm could use the old transmission for example, and hopefully between players of the same connected realm set (see: GetAutoCompleteRealms). |
Yes, that's surely a problem. One solution for that is to add the receiving support first, and add the sending change at a later date. I haven't tested, but assume that PARTY/RAID/GUILD are also affected by out of order messaging for the cross-realm receipcients. For these channels checking what method to use is possible but somewhat annoying. |
So any decison on how to proceed? |
So if you aren't interested in AceComm working cross-realm, you should say so. |
Waiting to hear back from the server team. |
Has there been an update on this @funkydude ? |
Nope, issue is still open and awaiting investigation from the server team |
When sending mulitpart messsages across realms, the messages can be received out of order. Fix this by introducing a new header that contains the message number and message total.