server/scripts/eressea/jsreport.lua

25 lines
577 B
Lua
Raw Normal View History

local pkg = {}
2015-04-05 12:50:10 +02:00
print("loading jsreport module")
function pkg.init()
eressea.settings.set("feature.jsreport.enable", "1")
end
function pkg.update()
local factions = { '777', '1wpy', 'd08a', 'hani', 'scaL' }
2015-04-05 12:50:10 +02:00
for _, id in ipairs(factions) do
local f = faction.get(id)
if f then
local o = f.options
local bit = (math.floor(o / 8) % 2)
if bit==0 then
2015-04-05 12:50:10 +02:00
eressea.log.warning("enable JSON report for " .. tostring(f))
f.options = o + 8
end
end
end
end
return pkg