Luna
Short Description
Luna is a developers tool for handling addon commutation between players. It allows any addon to register with it and send messages that go out over a single private chat channel and then returns any messages it sees for that addon. Messages will be added to a queue and be sent out one at a time in 2 second intervals to avoid the spam filter. This means that Luna is not for time sensitive messages or for rapid sending, but for syncing of data like resource node locations or quest data. It is inspired by the old Sky addon from WoW and as such has been named Luna to be a companion for Sol.
Features
1) Automatically connects to the Luna private channel to allow for the communication of your addon with other users of the addon
2) Register your addon's name and a function that the messages will be returned to
3) Queues messages to be sent at a first come first serve basis in 2 second intervals, to avoid the spam filter
4) Automatically breaks up long messages into multiple packets and recombines them on the other end
5) Adds messages into the body of a link so that the only text that appears in the ingame chat is <addonname>, though the channel is hidden by default
6) If a received message is for an addon you have registered, then it will send the sender's name and message to the function you registered
7) You can register and unregister addons at any time after "VARIABLES_LOADED"(any sooner could be to soon), to allow for optional configuration of your addons
8) Luna will tell you when a newer version is out
9) Luna currently works for English and German clients. Anyone that is interested in doing the French or Spanish translations should check out the Localization page on curseforge
Ideas for Addons that would use Luna
1) add to Advanced Quest Book the ability to seen and receive quest dumps for users with quest dumper enabled
2) a fully realized and useful LFG/LFM window complete with selectable quests,zones, instances along with player's/party's class, level and health
3) mob or boss drop loot table with the ability to send blue+ drop info to all users to allow large and accurate loot tables with percentages without having to manually create a database.
4) added to ygather to send resource node locations out to everyone
5) any addon could use it as an optional dependancy to tell there users when a newer version is available
Credits
Much of this code was inspired or rewritten from Alleris2_0's AddonManager and Vlocka's ModTrader. A big thanks goes to you two for your coding genesis.
Instructions for Addon Developers
(replace anything inside <> with your info)
DO NOT add this addon's files into your addon, add it as a dependency in curseforge and label it as a dependency on your addons description
register the event "VARIABLES_LOADED"
add this into your onevent function
if event == "VARIABLES_LOADED" then
if Luna then
Luna.RegisterAddon(<addonname>, <function_that_messages_are_returned_to>)
else
<do whatever you need to if Luna is not found, to prevent errors>
DEFAULT_CHAT_FRAME:AddMessage("Luna not found, failed to register <addonname>")
end
end
use this command to send a message out
Luna.QueueMessage(<addonname>, <your_message>)
add this to handle receiving messages from others
function <function_that_messages_are_returned_to>(sendername, message)
<do whatever with your message>
end
note: messages and addonnames are strings, " and | characters will break the message, do not use them.
if you would like to unregister your addon then use this command
Luna.UnregisterAddon(<addonname>)
------------------------------------------------------------------------
r26 | mavoc | 2009-09-10 15:31:58 +0000 (Thu, 10 Sep 2009) | 6 lines
Changed paths:
A /tags/v1.0.1 (from /trunk:25)
[ADDED]: Debug messages for alpha versions
[FIXED]: All strings use locales now
[ADDED]: AddonManager support
[ADDED]: Luna version checker with notifation of new versions
[FIXED]: Quirk of joining the channel to soon, should always work now despite RoM's private channel coding
------------------------------------------------------------------------
r25 | mavoc | 2009-09-10 15:11:13 +0000 (Thu, 10 Sep 2009) | 5 lines
Changed paths:
M /trunk/Luna.lua
[FIXED]: debug messages working correctly now
[FIXED]: AddonManager displays correct info
[FIXED]: all strings use locale now
[CHANGED]: Luna version checker - better message
------------------------------------------------------------------------
r24 | mavoc | 2009-09-10 13:51:14 +0000 (Thu, 10 Sep 2009) | 1 line
Changed paths:
M /trunk/Luna.lua
[FIXED]: svn error maybe this time
------------------------------------------------------------------------
r23 | mavoc | 2009-09-10 13:35:32 +0000 (Thu, 10 Sep 2009) | 1 line
Changed paths:
M /trunk/Luna.lua
[FIXED]: svn error
------------------------------------------------------------------------
r22 | mavoc | 2009-09-10 13:24:20 +0000 (Thu, 10 Sep 2009) | 1 line
Changed paths:
M /trunk/Luna.lua
[ADDED: more locale entries
------------------------------------------------------------------------
r21 | mavoc | 2009-09-10 11:55:30 +0000 (Thu, 10 Sep 2009) | 1 line
Changed paths:
M /trunk/Luna.lua
[ADDED: more locale entries
------------------------------------------------------------------------
r20 | mavoc | 2009-09-10 10:13:31 +0000 (Thu, 10 Sep 2009) | 1 line
Changed paths:
M /trunk/Luna.lua
[ADDED]: AddonManager support
------------------------------------------------------------------------
r12 | mavoc | 2009-09-09 13:32:39 +0000 (Wed, 09 Sep 2009) | 1 line
Changed paths:
M /trunk/Luna.lua
[FIXED]: @non-alpha@ quirk
------------------------------------------------------------------------
r11 | mavoc | 2009-09-09 13:21:17 +0000 (Wed, 09 Sep 2009) | 3 lines
Changed paths:
M /trunk/Luna.lua
[ADDED]: Luna version checker
[ADDED]: Some Alpha Level Debug Code
[FIXED]: Quirk of joining the channel to soon
------------------------------------------------------------------------
r10 | mavoc | 2009-09-09 12:23:31 +0000 (Wed, 09 Sep 2009) | 1 line
Changed paths:
M /trunk/Luna.lua
Locale alpha test
------------------------------------------------------------------------
r9 | mavoc | 2009-09-09 12:07:11 +0000 (Wed, 09 Sep 2009) | 1 line
Changed paths:
M /trunk/Luna.lua
Locale alpha test
------------------------------------------------------------------------
r8 | mavoc | 2009-09-09 10:31:13 +0000 (Wed, 09 Sep 2009) | 1 line
Changed paths:
M /trunk/Locales/de.lua
M /trunk/Locales/en.lua
A /trunk/Locales/es.lua
A /trunk/Locales/fr.lua
M /trunk/Luna.lua
Locale alpha test
------------------------------------------------------------------------
r7 | mavoc | 2009-09-09 10:22:55 +0000 (Wed, 09 Sep 2009) | 1 line
Changed paths:
A /trunk/Locales
A /trunk/Locales/de.lua
A /trunk/Locales/en.lua
M /trunk/Luna.lua
Locale alpha test
------------------------------------------------------------------------
r5 | mavoc | 2009-09-09 08:43:09 +0000 (Wed, 09 Sep 2009) | 1 line
Changed paths:
M /trunk/Luna.lua
test update
------------------------------------------------------------------------
r4 | mavoc | 2009-09-09 08:31:12 +0000 (Wed, 09 Sep 2009) | 1 line
Changed paths:
M /trunk/Luna.lua
Test Update
------------------------------------------------------------------------
r2 | mavoc | 2009-09-09 07:51:05 +0000 (Wed, 09 Sep 2009) | 1 line
Changed paths:
A /trunk/Luna.lua
A /trunk/Luna.toc
A /trunk/Luna.xml
Init Version
------------------------------------------------------------------------
r1 | root | 2009-09-09 06:19:47 +0000 (Wed, 09 Sep 2009) | 1 line
Changed paths:
A /branches
A /tags
A /trunk
"luna/mainline: Initial Import"
------------------------------------------------------------------------