This commit is contained in:
kepler155c
2017-09-18 14:46:21 -04:00
parent b4d3160cd8
commit 4116e046d1
14 changed files with 2491 additions and 2211 deletions

View File

@@ -7,17 +7,15 @@ function TableDB:init(args)
fileName = '',
dirty = false,
data = { },
tabledef = { },
}
Util.merge(defaults, args)
Util.merge(self, defaults)
end
function TableDB:load()
local table = Util.readTable(self.fileName)
if table then
self.data = table.data
self.tabledef = table.tabledef
local t = Util.readTable(self.fileName)
if t then
self.data = t.data or t
end
end
@@ -43,10 +41,7 @@ end
function TableDB:flush()
if self.dirty then
Util.writeTable(self.fileName, {
-- tabledef = self.tabledef,
data = self.data,
})
Util.writeTable(self.fileName, self.data)
self.dirty = false
end
end