0
1
mirror of https://github.com/radio95-rnt/rds95.git synced 2026-02-26 12:32:05 +01:00

multiple arguments

This commit is contained in:
2025-12-29 11:10:16 +01:00
parent 36cdc5f91d
commit 246310779f

View File

@@ -2,11 +2,11 @@ function data_handle(data)
if string.sub(data, 1, 4):lower() == "lua=" then
local chunk, err = load("return " .. string.sub(data, 5), "udp_chunk") -- skip "lua="
if not chunk then return string.format("-\r\n%s\r\n", err) end
return tostring(chunk()) .. "\r\n"
return table.concat({ chunk() }, ", ") .. "\r\n"
elseif string.sub(data, 1, 5):lower() == "file=" then
local chunk, err = loadfile(data:sub(6)) -- skip "file="
if not chunk then return string.format("-\r\n%s\r\n", err) end
return tostring(chunk()) .. "\r\n"
return table.concat({ chunk() }, ", ") .. "\r\n"
end
local cmd, value = data:match("([^=]+)=([^=]+)")