Quantcast WoWInterface - View Single Post - SavedVariables forced write
View Single Post
04-01-20, 02:09 AM   #10
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,447
Originally Posted by doofus View Post
I got the idea from the well known TSM addon, where, I presume, an external application writes to the saved variables file, to be read later by the addon itself. So the communication can be two ways, albeit with the /reload in between.

I have also noticed many times that WoW loses character settings if you do not log out but crash out/lose connection, which also follows the same "save files on /reload" rule...

Yes, using reload in an addon ( via a button click ) or /reload command, will force an update of the saved variables. So that in the event of a crash out before the next reload you will have at least have up to the last save done. Unfortunately, any changes you make while you are still in the game will not be registered. You would have to log out ... update the file if needed ... log in. At that point it will load the updated file.

Hopefully these 3 scenarios will highlight why what you want will only work as an autosave type thing ( with a button press or slash command ) or as an external reader/writer of the file while the game is not running.

Log In > Saved Variables File Loaded into memory
Reload > Saved Variables File Updated from memory and loaded into memory
Crash .... > No change to Saved Variable File

Log In > Saved Variables File Loaded into memory
Reload > Saved Variables File Updated from memory and loaded into memory
External Program > Saved Variables File adjusted via program
Reload > Saved Variables File Updated from memory, replacing changes made by program, and then loaded into memory

Log In > Saved Variables File Loaded into memory
Log Out > Saved Variables File Updated from memory
External Program > Saved Variables File adjusted via program
Log In > Saved Variables File Loaded into memory including the changes mae by the program
__________________
  Reply With Quote