View Single Post
08/21/15, 01:21 PM   #17
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
Originally Posted by haggen View Post
I mean technically how would you sync this information ? Or are you saying that the player would have to download the file and place it in the correct folder manually ?

About that, I wonder if we could hack our way to sync data between players in-game... What if we send the data serialized via mail/chat/private message, and then the add-on would detect such message and deserialize it. That'll definitely be ugly, but it could work. Is it possible to automate messages between players in the game ? It could work like a peer-to-peer or decentralized data transmission system
Emails sometimes will not show until you logout and in again. And the email texts are only accessible as you open the email inbox "manually". Answer: No

Chat messages can be sent by the help of addons as far as I know. But sometimes you are only able to put the text into the chat edit box, and you'll manually have to press the RETURN key to send the message.
Answer: Maybe (but still ugly!!!! )

Instand messages are the same like chat messages.


About the synch:
An external tool needs to read the data from a website/database and must update the information to the SavedVariables file of your addon (which is displaying the messages ingame).

Problems:
If the ueser is currently doing a reloadui ingame as the external tool is trying to update the SavedVariables file there are 2 sources trying to access the SavedVariables file at the same time -> How do you detect this? (Maybe preHook the /reloadui function and set a variable to TRUE inside the SavedVariables of your addon, read this variable by help of the external tool and only if it is FALSE update the SavedVariables file from external sources. To reet the variable to FALSE just do it at the EVENT_PLAYER_ACTIVATED).
But the other way around it is not possible to detect from the addon ingame if the external tool is currently accessing the SavedVariables file

All updates from external will be overwritten again if you do a reloadui! The game will always take the internally used variables and data and store it into the SavedVariables. So basically there is no way to update it from external as long as the user is logged in :-(
Maybe if you work with 2 different SavedVariables files somehow.
  Reply With Quote