View Single Post
03/24/22, 09:28 PM   #1
buldezir
AddOn Author - Click to view addons
Join Date: Oct 2018
Posts: 4
[open] message bus for addons

Right now its implemented in ridiculous way with map-ping.
A lot of addons may use this functions, if there will be "right" and less restricted way to do it.

so, without introducing very special functionality for this, what we need is:

- "hidden" group channel, which addons can write to. ref: CHAT_ROUTER:AddSystemMessage(message)
- event to subscribe (already existing EVENT_CHAT_MESSAGE_CHANNEL, or smth special with autodeserialize)
- maybe some included funcs for (de)serialize (json_encode, json_decode ?)

example:
Code:
 
 CHAT_ROUTER:AddDataMessage(tableData)
 EVENT_MANAGER:RegisterForEvent("...", EVENT_CHAT_DATA_MESSAGE, fn(_, unitTag, displayName, tableData))
  Reply With Quote