for uid,tab in pairs(nncp_userdata) do
fh:write("nncp_userdata[" .. string.format("%q",uid) .. "] = {\n")
for k,v in pairs(tab) do
- fh:write(k .. ": " string.format(%q, v) .. ",\n")
+ fh:write("\t" .. k .. "=" .. string.format("%q", v) .. ",\n")
end
fh:write("}\n")
end
end
restore_nncp_userdata()
+ if not nncp_userdata[node_id] then
+ nncp_userdata[node_id] = {}
+ end
local input_string = io.stdin:read("*all")
local handle = string.match(input_string, "^%s*get%s+(%w+)%s*$")
if handle then
- nncp_userdata[node_id].handle = user_name
+ nncp_userdata[node_id].handle = handle
store_nncp_userdata()
else
- handle = nncp_userdata.handle[node_id]
+ handle = nncp_userdata[node_id].handle
end
if not handle then
qwk.build_qwk(handle, out_file_name)
+ print(qb.nncp_file .. " " .. out_file_name .. " " ..
+ node_id .. ":" .. qb.bbsid .. ".QWK")
os.execute(qb.nncp_file .. " " .. out_file_name .. " " ..
node_id .. ":" .. qb.bbsid .. ".QWK")
+ -- fs.copy(out_file_name, qb.path .. "/blah.qwk")
fs.rmfile(out_file_name)
local md5 = fs.getmd5(rep_file_name)
local stored_md5 = nncp_userdata[node_id].md5
- if stored_md5 and (md5 ~= stored_md5) then
+ if stored_md5 and md5 == stored_md5 then
print("Error: Duplicate REP submission detected. Skipping.")
return false
end