aboutsummaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorBuckarooBanzay <BuckarooBanzay@users.noreply.github.com>2021-03-14 21:21:37 +0100
committerBuckarooBanzay <BuckarooBanzay@users.noreply.github.com>2021-03-14 21:21:37 +0100
commitfdb69489d823d3cb22f9757732245958f9734f3a (patch)
treefaede629dfe505d68fd8dafc532d47caa492b41c /init.lua
parent40ecd2db7223d178de6d21807499ff17ad3cf2ce (diff)
downloadmesecons_debug-fdb69489d823d3cb22f9757732245958f9734f3a.tar.gz
mesecons_debug-fdb69489d823d3cb22f9757732245958f9734f3a.zip
rework penalty stuff
addresses some issues in #6
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index a359583..64ce185 100644
--- a/init.lua
+++ b/init.lua
@@ -6,12 +6,22 @@ mesecons_debug = {
context_store = {},
context_store_size = 0,
+ -- max penalty in seconds
+ max_penalty = 300,
+
+ -- everything above this threshold will disable the mesecons in that mapblock
+ penalty_mapblock_disabled = 60,
+
+ -- time between /mesecons_clear_penalty commands, in seconds
+ penalty_clear_cooldown = 120,
+
-- mapblock-hash -> true
whitelist = {},
-- playername => true
hud = {},
+ -- cpu usage in microseconds that triggers the penalty mechanism
max_usage_micros = 15000
}
@@ -20,6 +30,8 @@ dofile(MP.."/whitelist.lua")
dofile(MP.."/privs.lua")
dofile(MP.."/flush.lua")
dofile(MP.."/context.lua")
+dofile(MP.."/penalty.lua")
+dofile(MP.."/clear_penalty.lua")
dofile(MP.."/overrides.lua")
dofile(MP.."/luacontroller.lua")
dofile(MP.."/chatcommands.lua")