Comparison

util/datamanager.lua @ 177:606c433955e7

Bug fixes and checks for presence subscriptions, etc
author Waqas Hussain <waqas20@gmail.com>
date Sun, 26 Oct 2008 00:22:18 +0500
parent 129:0f119bece309
child 182:f5cb6b5a6eb7
comparison
equal deleted inserted replaced
176:e5cd2a03891d 177:606c433955e7
4 local char = string.char; 4 local char = string.char;
5 local loadfile, setfenv, pcall = loadfile, setfenv, pcall; 5 local loadfile, setfenv, pcall = loadfile, setfenv, pcall;
6 local log = log; 6 local log = log;
7 local io_open = io.open; 7 local io_open = io.open;
8 local tostring = tostring; 8 local tostring = tostring;
9 local error = error;
9 10
10 module "datamanager" 11 module "datamanager"
11 12
12 13
13 ---- utils ----- 14 ---- utils -----
47 f:write(" [", basicSerialize(k), "] = ") 48 f:write(" [", basicSerialize(k), "] = ")
48 simplesave(f, v) 49 simplesave(f, v)
49 f:write(",\n") 50 f:write(",\n")
50 end 51 end
51 f:write("}\n") 52 f:write("}\n")
53 elseif type(o) == "boolean" then
54 f:write(o and "true" or "false");
52 else 55 else
53 error("cannot serialize a " .. type(o)) 56 error("cannot serialize a " .. type(o))
54 end 57 end
55 end 58 end
56 59