fixed a missing parenthesis, added baseline non encrypted tables from tadb, added function for loading tables from file without kv or encryption

This commit is contained in:
2021-10-24 16:34:42 -04:00
parent b9a5a8fe23
commit 616fb96310
8 changed files with 1950 additions and 310 deletions

View File

@@ -422,6 +422,12 @@ end
return table.fromstring(string.decode(string.loadkvfile(path), SERVER_KEY))
end
-- Should read a lua table string from a file and return the table again, we'll see when it's tested
function table.fromfile(path)
local file = io.open(path, "r")
return table.fromstring(file:read("a"))
end
-- 获取表中值元素的长度不计nil
function table.count(t)
if type(t) ~= "table" then