savedvariables refactoring

This commit is contained in:
Manuel Simon Hirsig
2017-03-18 12:24:20 +01:00
parent 57543230f3
commit 1829ce6374
10 changed files with 89 additions and 86 deletions
+16
View File
@@ -39,6 +39,22 @@ function LOAD()
end)
end
do
local characters = empty
function M.is_player(name)
return characters[name] and true or false
end
function LOAD2()
characters = persistence.realm'characters'
for k, v in characters do
if GetTime() > v + 60 * 60 * 24 * 30 then
characters[k] = nil
end
end
characters[UnitName'player'] = GetTime()
end
end
do
local sell_scan_queued, incomplete_buy_data
function on_merchant_show()
+2 -10
View File
@@ -9,16 +9,8 @@ local history_schema = {'tuple', '#', {next_push='number'}, {daily_min_buyout='n
local value_cache = {}
do
local cache
function get_data()
if not cache then
local dataset = persistence.dataset
cache = dataset.history or T
dataset.history = cache
end
return cache
end
function LOAD2()
data = persistence.faction'history'
end
do