Quantcast
WoWInterface - View Single Post - Send addon message based on GUID?
View Single Post
01-10-22, 04:56 PM   #3
Chr0nicxHack3r
A Deviate Faerie Dragon
 
Chr0nicxHack3r's Avatar
Join Date: Jan 2021
Posts: 11
Originally Posted by Dridzt View Post
Assuming addon should respect individual player options, ie if the player has disabled announces or has them routed to their local chatframe as an example they shouldn't announce.

What I'd do is.
1. Monitor GROUP_JOINED GROUP_FORMED and GROUP_LEFT events.
2. When your addon detects that you joined a group (check with IsInGroup) it sends a single SendAddonMessage with distribution RAID (this will automatically go to PARTY if you are in a 5man) that essentially says "hey I have calloutAddon with announces on" C_ChatInfo.SendAddonMessage("calloutPrefix", "yourversion;announcestatus", "RAID")
3. You also send this message if you are in a group and you changed your announce option from ON to OFF or vice versa)
4. You also register your prefix to receive messages from other instances of your addon. Any time you receive a message from another player in your group, you update a table with players having your addon with announce "on".
5. You sort that table alphabetically. Any instance of the addon does a simple check "am I the player that's first on the list?" If yes > call out. If not > mute.
6. Each instance of the addon also monitors for players leaving the group. If it was one of those in the group announce list, they get removed.

That would limit addon messages significantly, while still letting each instance of the addon decide on its own if it should call out or not, without constant traffic.

Thank you so much for the quick response. I will do some digging and play around more with this info!!!

Last edited by Chr0nicxHack3r : 01-10-22 at 11:42 PM.
  Reply With Quote