From d8c1f03f55384d08988ab9c2a72d1d68542a370b Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 4 Apr 2015 09:19:10 +0200 Subject: [PATCH] new module to enable jsreport for selected factions. --- scripts/eressea/e2/init.lua | 1 + scripts/eressea/jsreport.lua | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 scripts/eressea/jsreport.lua diff --git a/scripts/eressea/e2/init.lua b/scripts/eressea/e2/init.lua index a23aa3216..581836147 100644 --- a/scripts/eressea/e2/init.lua +++ b/scripts/eressea/e2/init.lua @@ -13,5 +13,6 @@ return { require('eressea.ponnuki'), require('eressea.astral'), require('eressea.locales'), + require('eressea.jsreport'), require('eressea.ents') } diff --git a/scripts/eressea/jsreport.lua b/scripts/eressea/jsreport.lua new file mode 100644 index 000000000..845c56504 --- /dev/null +++ b/scripts/eressea/jsreport.lua @@ -0,0 +1,18 @@ +local pkg = {} + +function pkg.update() + local factions = { '777', '1wpy', 'd08a', 'hani', 'scaL' } + 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 + eressea.log.debug("enable JSON report for " .. tostring(f)) + f.options = o + 8 + end + end + end +end + +return pkg