Master Relay

Silent addon bus and Forever settings backup. Used by the Master suite, and available to any addon that opts in.

Master Relay

Hidden comms and Forever settings backup for the Master suite — and for any other addon that opts in.

Author: Sarcazmo
Clients: Retail (Midnight) and World of Warcraft: Forever
Version: 1.1.15

Master Relay has no window and no minimap button. It does not print to chat unless debug is on.

What it does

  • Learns other players who run Master addons from target, mouseover, nameplates, and group
  • Talks to them with silent addon whispers (no custom chat channel)
  • Only remembers players who actually answer
  • Lets addons send and receive data through one bus
  • Captures Lua errors from Master addons locally (error text is never broadcast)
  • Can notify once per login if a peer is on a newer Master addon version
  • On Forever only, backs up registered addon settings in account macros (Mz*) because SavedVariables can fail
  • On Retail, settings stay in SavedVariables. Relay does not create macros there

Requirements

Any addon that uses Relay should list:

## RequiredDeps: MasterRelay

Slash commands

Command Action
/mrelay Status
/mrelay debug Toggle debug prints
/mrelay test Send a test ping

For other addon authors (Forever restore)

Forever can drop SavedVariables. Relay can keep a copy of your settings in account macros and push them back on login. You do not need a Relay patch. Call the persist API from your addon.

1. Depend on Relay

In your .toc:

## RequiredDeps: MasterRelay

2. Pick a short key

The key is letters and numbers only. Relay uses the first 6 characters for macro names (Prices → MzPrices1). Use a unique 6-character key so you do not collide with another addon.

Good: "MyMod", "AHBuy", "HealUI"
Bad: two addons both using "Config"

3. Register a snapshot

Call this once after your SavedVariables exist (ADDON_LOADED for your addon):

MasterRelay:Persist("MyMod", function()
  return {
    enabled = MyModDB.enabled,
    scale = MyModDB.scale,
  }
end, function(data)
  if type(data) ~= "table" then
    return
  end
  MyModDB.enabled = data.enabled
  MyModDB.scale = data.scale
end)

getter must return a table. Keep it small (options, lists). Do not dump the whole auction house.

4. Load and save

-- after Persist(), when the player is in the world
MasterRelay:PersistLoad("MyMod")

-- whenever your settings change
MasterRelay:PersistNow("MyMod")

PersistLoad prefers the Forever macro copy if it is newer/heavier than the in-memory copy. PersistNow writes the getter snapshot. Writes are skipped in combat and run later.

5. Optional

MasterRelay:PersistWipe("MyMod")   -- delete this key's backup macros
MasterRelay:IsForeverClient()      -- true on Forever, false on Retail

On Retail, persist still runs but does not write macros. Your own SavedVariables remain the source of truth.

Limits

  • Account macro slots are shared. A huge table can fill them; Relay prints one warning and stops that write.
  • Nested tables, strings, numbers, and booleans pack. Functions and frames do not.
  • Players must have Master Relay installed and enabled.

Comms API

MasterRelay:Register("YourAddon", "MSGTYPE", handler)
MasterRelay:Unregister("YourAddon", "MSGTYPE", handler)
MasterRelay:Broadcast("YourAddon", "MSGTYPE", data)
MasterRelay:Whisper("YourAddon", "MSGTYPE", data, "Name-Realm")
MasterRelay:Announce("YourAddon", "version")
MasterRelay:IsReady()
MasterRelay:InLockdown()
MasterRelay:GetRoster()
MasterRelay:Persist("Key", getter, setter)
MasterRelay:PersistNow("Key")
MasterRelay:PersistLoad("Key")
MasterRelay:PersistWipe("Key")
MasterRelay:IsForeverClient()

handler is called as handler(sender, data, msgType, addonName).

Install

Copy the MasterRelay folder into:

  • Retail: World of Warcraft/_retail_/Interface/AddOns/
  • Forever: World of Warcraft/_classic_era_/Interface/AddOns/ (or your Forever AddOns folder)

Enable it in the addon list.

Master Relay Team

profile avatar
  • 14
    Projects
  • 2.4K
    Downloads

More from SarcazmoView all