Thread: Logout-Events
View Single Post
04/26/15, 11:33 AM   #3
Bl4ck M4ch!n3
 
Bl4ck M4ch!n3's Avatar
Join Date: Apr 2015
Posts: 4
That looks promising, thanks!

Why i think it happens to often? I hope i got that whole "SavedVariables"-stuff right.

For example :
AddOnExampleName.savedValues = ZO_SavedVars:New(........)

So, everytime i write something to AddOnExampleName.savedValues the SavedVariables-file is updated, right?
If it's just like this, then its happening too often. Because i call a method which is saving a couple of things at the following events:

EVENT_MONEY_UPDATE
EVENT_LOOT_RECEIVED
EVENT_INVENTORY_ITEM_USED
EVENT_INVENTORY_ITEM_DESTROYED
EVENT_INVENTORY_FULL_UPDATE
EVENT_INVENTORY_SINGLE_SLOT_UPDATE
EVENT_PLAYER_DEAD
EVENT_PLAYER_ALIVE
EVENT_EXPERIENCE_GAIN
EVENT_EXPERIENCE_GAIN_DISCOVERY
EVENT_EXPERIENCE_UPDATE

Maybe there is a event which is unnecessary? I assume its too often, but maybe i'm just a bit sensitive?
I just want to reduce the amount of calls. So i thought about saving those things if the user logs out of the game.

If i preHook the "Logout" will it work like this?
ZO_PreHook("Logout", AddOnExample.SaveThings())

Thanks in advance and sorry for my bad english!

Greetings
  Reply With Quote