added some debug commands

This commit is contained in:
ZioPao
2023-11-12 22:45:35 +01:00
parent d1aef1f67d
commit 30f343a7de
4 changed files with 53 additions and 3 deletions

View File

@@ -6,10 +6,32 @@ function TOC_DEBUG.togglePaneMod()
TOC_DEBUG.disablePaneMod = not TOC_DEBUG.disablePaneMod
end
---comment
---Print debug
---@param string string
function TOC_DEBUG.print(string)
if isDebugEnabled() then
print("TOC: " .. string)
end
end
function TOC_DEBUG.printTable(table, indent)
if not table then return end
indent = indent or ""
for key, value in pairs(table) do
if type(value) == "table" then
print(indent .. key .. " (table):")
TOC_DEBUG.printTable(value, indent .. " ")
else
print(indent .. key .. ":", value)
end
end
end
function TOC_DEBUG.printGlobalModDataServer(username)
local CommandsData = require("TOC/CommandsData")
---@type printTocDataParams
local params = {username = username}
sendClientCommand(CommandsData.modules.TOC_DEBUG, CommandsData.server.Debug.PrintTocData, params)
end