-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/thomasrudin-mt/mesecons_d…
- Loading branch information
Showing
13 changed files
with
308 additions
and
437 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.