Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
NatureFreshMilk committed Oct 21, 2019
2 parents 12fe683 + 4f8eb60 commit 60aa79c
Show file tree
Hide file tree
Showing 13 changed files with 308 additions and 437 deletions.
6 changes: 4 additions & 2 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
allow_defined_top = true

globals = {
"mesecons_debug",
"mesecon",
"minetest"
}
Expand All @@ -12,5 +12,7 @@ read_globals = {

-- Minetest
"vector", "ItemStack",
"dump"
"dump",

"monitoring"
}
49 changes: 0 additions & 49 deletions api_action_on.lua

This file was deleted.

49 changes: 0 additions & 49 deletions api_nodetimer.lua

This file was deleted.

48 changes: 48 additions & 0 deletions chatcommands.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@


minetest.register_chatcommand("mesecons_hud", {
description = "mesecons_hud on/off",
func = function(name, params)
local enable = params == "on"
mesecons_debug.hud[name] = enable
if enable then
return true, "mesecons hud enabled"
else
return true, "mesecons hud disabled"
end
end
})

minetest.register_chatcommand("mesecons_stats", {
description = "shows some mesecons stats for the current position",
func = function(name)
local player = minetest.get_player_by_name(name)
if not player then
return
end

local ctx = mesecons_debug.get_context(player:get_pos())
return true, "Mapblock usage: " .. ctx.avg_micros .. " us/s " ..
"(across " .. mesecons_debug.context_store_size .." mapblocks)"
end
})

minetest.register_chatcommand("mesecons_enable", {
description = "enables the mesecons globlastep",
privs = {mesecons_debug=true},
func = function()
-- flush actions, while we are on it
mesecon.queue.actions = {}
mesecons_debug.enabled = true
return true, "mesecons enabled"
end
})

minetest.register_chatcommand("mesecons_disable", {
description = "disables the mesecons globlastep",
privs = {mesecons_debug=true},
func = function()
mesecons_debug.enabled = false
return true, "mesecons disabled"
end
})
138 changes: 0 additions & 138 deletions circuit_breaker.lua

This file was deleted.

20 changes: 0 additions & 20 deletions dump_queue.lua

This file was deleted.

Loading

0 comments on commit 60aa79c

Please sign in to comment.