summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/Debuggers/Debuggers.lua
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-01-26 04:44:09 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-01-26 04:44:09 +0100
commitab39853d9378e8dc43f7bc2c8f51b2a5092d2dbe (patch)
tree92800333f79dd6f98d3b3b3b6a1ce0ebf0b65a33 /MCServer/Plugins/Debuggers/Debuggers.lua
parentMerged the usable portion of the "gens" branch. (diff)
downloadcuberite-ab39853d9378e8dc43f7bc2c8f51b2a5092d2dbe.tar
cuberite-ab39853d9378e8dc43f7bc2c8f51b2a5092d2dbe.tar.gz
cuberite-ab39853d9378e8dc43f7bc2c8f51b2a5092d2dbe.tar.bz2
cuberite-ab39853d9378e8dc43f7bc2c8f51b2a5092d2dbe.tar.lz
cuberite-ab39853d9378e8dc43f7bc2c8f51b2a5092d2dbe.tar.xz
cuberite-ab39853d9378e8dc43f7bc2c8f51b2a5092d2dbe.tar.zst
cuberite-ab39853d9378e8dc43f7bc2c8f51b2a5092d2dbe.zip
Diffstat (limited to '')
-rw-r--r--MCServer/Plugins/Debuggers/Debuggers.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua
index f2f3f9570..a619e0b0a 100644
--- a/MCServer/Plugins/Debuggers/Debuggers.lua
+++ b/MCServer/Plugins/Debuggers/Debuggers.lua
@@ -1,6 +1,7 @@
-- Global variables
PLUGIN = {} -- Reference to own plugin object
+ShouldDumpFunctions = false -- If set to true, all available functions are logged upon plugin initialization
@@ -17,6 +18,28 @@ function Initialize(Plugin)
PluginManager:AddHook(Plugin, cPluginManager.HOOK_TAKE_DAMAGE)
LOG("Initialized " .. Plugin:GetName() .. " v." .. Plugin:GetVersion())
+
+ -- dump all available functions to console:
+ if (ShouldDumpFunctions) then
+ LOG("Dumping all available functions:");
+ function dump (prefix, a)
+ for i, v in pairs (a) do
+ if (type(v) == "table") then
+ if (v == _G) then
+ LOG(prefix .. i .. " == _G, CYCLE, ignoring");
+ elseif (v == _G.package) then
+ LOG(prefix .. i .. " == _G.package, ignoring");
+ else
+ dump(prefix .. i .. ".", v)
+ end
+ elseif (type(v) == "function") then
+ LOG(prefix .. i .. "()")
+ end
+ end
+ end
+ dump("", _G);
+ end
+
return true
end