Myriana, do you often get the insta disconnect when logging in ?
If you do that could explain why changes you make may be getting reset. I noticed this recently myself with more obvious results.
Recently I have seen this log in process based on the reset of wtf file variables:
Code:
1. Log In Screen - Enter Account/Password
2. Character Selection Screen - Choose Server/Character
3. Enter Game
4. Load Addon - Addon is started with addon code outside of event driven functionality being executed. This can and usually includes default settings for wtf data.
5. ADDON_LOADED event triggered which loads the wtf file associated with the addon allowing use of saved variables.
6. Other events triggered as they happen
7. PLAYER_LOGOUT event triggered - Sent when the player logs out or the UI is reloaded, just before SavedVariables are saved. The event fires after PLAYER_LEAVING_WORLD. ( As from wowwiki )
8. Saved Variable data saved to wtf file.
Now the insta disconnect seems to occur between stages 4 and 5 meaning that the saved variable data is initialised but not restored but it then triggers stage 7 which then stores whatever data is in your currently generated saved variable data. Possible solution is to not initialise the saved variable array outside of ADDON_LOADED code thus no wtf file changes in theory but then again it could also mean that the full wtf file for the addon will be wiped. An even worse scenario. So, still not a solution it seems.
Quote from Wowiki regarding loading process follows:
Code:
Saved variables loading After the addon code has been loaded, the loading process can be followed by registering for various events, listed here in order of firing.
1.ADDON_LOADED
■This event fires whenever an AddOn has finished loading and the SavedVariables for that AddOn have been loaded from their file.
2.SPELLS_CHANGED
■This event fires shortly before the PLAYER_LOGIN event and signals that information on the user's spells has been loaded and is available to the UI.
3.PLAYER_LOGIN
■This event fires immediately before PLAYER_ENTERING_WORLD.
■Most information about the game world should now be available to the UI.
■All Sizing and Positioning of frames is supposed to be completed before this event fires.
■AddOns that want to do one-time initialization procedures once the player has "entered the world" should use this event instead of PLAYER_ENTERING_WORLD.
4.PLAYER_ENTERING_WORLD
■This event fires immediately after PLAYER_LOGIN
■Most information about the game world should now be available to the UI. If this is an interface reload rather than a fresh log in, talent information should also be available.
■All Sizing and Positioning of frames is supposed to be completed before this event fires.
■This event also fires whenever the player enters/leaves an instance and generally whenever the player sees a loading screen
5.PLAYER_ALIVE
■This event fires after PLAYER_ENTERING_WORLD
■Quest and Talent information should now be available to the UI
Until 3.0, VARIABLES_LOADED used to fire upon completion of the addon loading process; since 3.0, it is fired in response to CVars, Keybindings and other associated "Blizzard" variables being loaded, and may therefore be delayed until after PLAYER_ENTERING_WORLD. The event may still be useful to override positioning data stored in layout-cache.txt
Load On Demand behavior Load on Demand addons cannot rely on most of the event sequence being fired for them; only ADDON_LOADED is a reliable indication that the saved variables for your LoD addon have been loaded.