mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-31 04:51:40 +09:00
-_-
This commit is contained in:
@@ -72,18 +72,18 @@ function json_log(lua_table,no_log)
|
|||||||
local result, done, only_indexs = {}, {}, true
|
local result, done, only_indexs = {}, {}, true
|
||||||
for key,value in ipairs(lua_table) do
|
for key,value in ipairs(lua_table) do
|
||||||
done[key] = true
|
done[key] = true
|
||||||
if type(value) == 'table' then value = table.insert(result,json_log(value,true)) end
|
if type(value) == 'table' then value = table.insert(result,json_log(value,true))
|
||||||
if type(value) == 'string' then json = table.insert(result,'"'..value..'"')
|
else if type(value) == 'string' then json = table.insert(result,'"'..value..'"')
|
||||||
elseif type(value) == 'number' then table.insert(result,value)
|
elseif type(value) == 'number' then table.insert(result,value)
|
||||||
else table.insert(result,key..':null') end
|
else table.insert(result,key..':null') end
|
||||||
end
|
end
|
||||||
for key,value in pairs(lua_table) do
|
for key,value in pairs(lua_table) do
|
||||||
if not done[key] then
|
if not done[key] then
|
||||||
only_indexs = false
|
only_indexs = false
|
||||||
if type(value) == 'table' then table.insert(result,'"'..key..'":'..json_log(value,true)) end
|
if type(value) == 'table' then table.insert(result,'"'..key..'":'..json_log(value,true))
|
||||||
if type(value) == 'string' then table.insert(result,'"'..key..'":"'..value..'"')
|
elseif type(value) == 'string' then table.insert(result,'"'..key..'":"'..value..'"')
|
||||||
elseif type(value) == 'number' then table.insert(result,'"'..key..'":'..value)
|
elseif type(value) == 'number' then table.insert(result,'"'..key..'":'..value)
|
||||||
else table.insert(result,key..':null') end
|
else table.insert(result,'"'..key..'":null') end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if only_indexs then
|
if only_indexs then
|
||||||
|
|||||||
Reference in New Issue
Block a user