View Single Post
05-28-11, 02:59 PM   #19
lilsparky
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 117
as a generic system, i think a guild-wide information sharing system would be pretty useful. i've done a bit of dabbling for a specific addon of mine, but debugging code that requires multiple accounts is difficult if you don't actually have multiple accounts.

my approach was to employ a master/client kind of model -- kind of what you are describing... tho i don't understand your use of the word "queue" in this regard.

the easy part is writing the client code and the master code. the clients all just listen for messages and react to them. occasionally, they would report new information to the master. the master would listen for information from the clients and then distribute that information as needed -- either as a broadcast or as individual messages depending on what makes the most sense.

the hard part is electing the master and changing states between master and client....

guess i don't have much to add beyond the interest in seeing a generic guild-wide data sharing system implemented somewhere...

edit: in terms of implementing a queue in lua, i think you're overcomplicating things. use a table.

to add to the end:
myQueue[#myQueue+1] = newEntry

to pull from the head:
firstEntry = table.remove(myQueue,1)

that's really all you need to do.

if you want to check the next entry:
nextEntry = myQueue[1]

Last edited by lilsparky : 05-28-11 at 03:04 PM.
  Reply With Quote