aboutsummaryrefslogtreecommitdiff
path: root/advtrains_luaautomation/init.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2019-12-05 10:14:07 +0100
committerorwell96 <orwell@bleipb.de>2019-12-05 10:15:36 +0100
commiteeef07d05a7e53de469f19a23fe1e69f569fc924 (patch)
tree6330ae717f337ec1a039004349d9c4c045ab632c /advtrains_luaautomation/init.lua
parent9c1d3565058799f21b6985c100ccf1abe045d3da (diff)
downloadadvtrains-eeef07d05a7e53de469f19a23fe1e69f569fc924.tar.gz
advtrains-eeef07d05a7e53de469f19a23fe1e69f569fc924.tar.bz2
advtrains-eeef07d05a7e53de469f19a23fe1e69f569fc924.zip
Add profiling instructions for advprofiler
Diffstat (limited to 'advtrains_luaautomation/init.lua')
-rw-r--r--advtrains_luaautomation/init.lua16
1 files changed, 14 insertions, 2 deletions
diff --git a/advtrains_luaautomation/init.lua b/advtrains_luaautomation/init.lua
index 75cf30a..643823b 100644
--- a/advtrains_luaautomation/init.lua
+++ b/advtrains_luaautomation/init.lua
@@ -9,11 +9,23 @@ else
atltrans = function(s,a,...)a={a,...}return s:gsub("@(%d+)",function(n)return a[tonumber(n)]end)end
end
+atlatc = { envs = {}}
+
+-- Profiler boilerplate
+if advprofiler then
+ atlatc.profiler = advprofiler.new_profiler("atlatc")
+else
+ atlatc.profiler = {
+ count=function() end,
+ enter=function() end,
+ leave=function() end,
+ }
+end
+
+
--Privilege
--Only trusted players should be enabled to build stuff which can break the server.
-atlatc = { envs = {}}
-
minetest.register_privilege("atlatc", { description = "Player can place and modify LUA ATC components. Grant with care! Allows to execute bad LUA code.", give_to_singleplayer = false, default= false })
--assertt helper. error if a variable is not of a type