feat: Improve command processing output; list command names instead of serializing the commands table
This commit is contained in:
@@ -913,7 +913,13 @@ local function processMessage(message)
|
|||||||
|
|
||||||
if message.command then
|
if message.command then
|
||||||
print(" Command: " .. message.command)
|
print(" Command: " .. message.command)
|
||||||
print(" Available handlers: " .. textutils.serialize(table.keys or function(t) local k={} for n in pairs(t) do table.insert(k,n) end return k end)(commands))
|
-- Don't try to serialize the commands table - it contains functions!
|
||||||
|
-- Just list the command names
|
||||||
|
local availableCommands = {}
|
||||||
|
for cmdName, _ in pairs(commands) do
|
||||||
|
table.insert(availableCommands, cmdName)
|
||||||
|
end
|
||||||
|
print(" Available handlers: " .. table.concat(availableCommands, ", "))
|
||||||
|
|
||||||
local handler = commands[message.command]
|
local handler = commands[message.command]
|
||||||
if handler then
|
if handler then
|
||||||
|
|||||||
Reference in New Issue
Block a user