jsonDecode
Definition
-- @/lua/common/utils.lua:422
function jsonDecode(content, context)
if not json then json = require("json") end
local state, data = xpcall(function() return json.decode(content) end, debug.traceback)
if state == false then
log('E', "jsonDecode", "unable to decode JSON: "..tostring(context))
log('E', "jsonDecode", "JSON decoding error: "..tostring(data))
return nil
end
return data
end
Callers
@/lua/ge/extensions/core/cameraModes/driver.lua
vehConfigs = vehConfigs:gsub("'",'"') -- fix INI values that passed through javascript (e.g. when opening Options menu)
vehConfigs = jsonDecode(vehConfigs) -- and then deserialize, so we can follow the user settings
local vehConfig = vehConfigs[vehicleName] or {0,0,0}
vehConfigs = vehConfigs:gsub("'",'"') -- fix INI values that passed through javascript (e.g. when opening Options menu)
vehConfigs = jsonDecode(vehConfigs) -- and then deserialize, so we can follow the user settings
vehConfigs[vehicleName] = vehConfig
@/lua/ge/extensions/editor/missionEditor/objectives.lua
local progressString = ffi.string(self._text[1])
local state, newSaveData = xpcall(function() return jsonDecode(progressString) end, debug.traceback)
if newSaveData == nil or state == false then
@/lua/ge/extensions/gameplay/rally/util/jsonlUtils.lua
if line ~= "" and not startsWithDoubleSlash(line) then
local obj = jsonDecode(line)
if processLine then
for line in io.lines(fname) do
local obj = jsonDecode(line)
if callback then
@/lua/ge/extensions/editor/gen/world.lua
local jbody = file:read('*all')
local jdesc = jsonDecode(jbody)
lo('?? desc_loaded:'..tostring(tableSize(jdesc['jdata'])))
local jbody = file:read('*all')
local jdesc = jsonDecode(jbody)
lo('?? desc_saved:'..tostring(tableSize(jdesc['jdata'])))
@/lua/common/tcpServer.lua
local data = jsonDecode(message, 'tcpConnection')
if not data then
@/lua/ge/extensions/editor/api/preferencesRegistry.lua
elseif item.type == "table" then
itemVal = jsonDecode(itemVal)
elseif item.type == "Point3F" or item.type == "vec3" then
@/lua/ge/extensions/editor/buildingEditor.lua
local function onDeserialize(data)
local jdesc = jsonDecode(data['jdata'])
-- local mode = data['mode']
@/lua/ge/extensions/core/audioRibbon.lua
local ribbon = {}
local ribbonData = jsonDecode(line)
if ribbonData then
@/lua/vehicle/extensions/vehicleStatsLogger.lua
local json = readFile(fpath)
local s = jsonDecode(json)
@/lua/ge/server/commands.lua
json = jsonDecode(json, nil)
if not json then return end
@/lua/ge/extensions/util/sortLines.lua
for line in content:gmatch('([^\n]*)\n?') do
local obj = jsonDecode(line)
local name = ''
@/lua/ge/extensions/editor/gen/terrain.lua
fl.close()
aregion = jsonDecode(str)
for i,d in pairs(aregion) do
fl.close()
local dw = jsonDecode(str)
ama = 0
]]
-- aregion = jsonDecode(str)
for i,d in pairs(aregion) do
@/lua/ge/extensions/core/highscores.lua
end
return jsonDecode(content, highscoreFile)
end
@/lua/vehicle/extensions/api.lua
--print('status:' .. tostring(status))
return jsonDecode(table.concat(respbody), 'json request response')
end
@/lua/vehicle/controller/drivingDynamics/CMU.lua
if receiver and receiver.setConfig and controllerConfig then
local configTable = jsonDecode(controllerConfig, "CMU SetConfig")
--dump(configTable)
local param = splits[3]
local paramTable = jsonDecode(param, "CMU SetProperty")
--dump(paramTable)
@/lua/ge/extensions/core/camera.lua
-- and then deserialize, so we can follow the user settings
savedConfiguration = jsonDecode(savedConfiguration)
-- if user settings version is good, go ahead and use it
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamBeautifier.lua
local function test(origJBeamStr, newJBeamStr)
local origData = jsonDecode(origJBeamStr)
local newData = jsonDecode(newJBeamStr)
local origData = jsonDecode(origJBeamStr)
local newData = jsonDecode(newJBeamStr)
@/lua/ge/extensions/editor/gen/exp_meshexplorer.lua
local cnt = fin:read('*all')
obj = jsonDecode(cnt)
afav = obj.list or {}
local cnt = fin:read('*all')
obj = jsonDecode(cnt)
afav = obj.list or {}
@/lua/ge/extensions/editor/shapeEditor.lua
end
meshConstructor = jsonDecode(data:match("^//JSON:([%w%g]+)"))
end
@/lua/ge/extensions/gameplay/rally/client.lua
--print('status:' .. tostring(status))
local rv = jsonDecode(table.concat(respbody), 'json request response')
return rv
else
local rv = jsonDecode(table.concat(respbody), 'json request response')
return rv
@/lua/ge/extensions/editor/levelValidator.lua
local data = object:serialize(true, -1)
data = jsonDecode(data)
data = prepareData(data)
@/lua/ge/extensions/util/wsTest.lua
else
local data = jsonDecode(evt.msg)
if data then
@/lua/common/utils.lua
end
return jsonDecode(content, filename)
end
@/lua/ge/extensions/ui/extApp.lua
if evt.type == 'D' and evt.msg ~= '' then
local data = jsonDecode(evt.msg)
if data then
@/lua/vehicle/extensions/debug/advancedExternalDebug.lua
if receiver and receiver.setConfig and controllerConfig then
local configTable = jsonDecode(controllerConfig, "CMU SetConfig")
--dump(configTable)
local param = splits[3]
local paramTable = jsonDecode(param, "CMU SetProperty")
--dump(paramTable)
@/lua/ge/extensions/editor/dynamicDecals/layerStack.lua
assert(payload.DataSize == ffi.sizeof(payloadSize))
local data = jsonDecode(ffi.string(payload.Data))
local from = data.from
assert(payload.DataSize == ffi.sizeof(payloadSize))
local data = jsonDecode(ffi.string(payload.Data))
local from = data.from
assert(payload.DataSize == ffi.sizeof(payloadSize))
local data = jsonDecode(ffi.string(payload.Data))
local from = data.from
assert(payload.DataSize == ffi.sizeof(payloadSize))
local data = jsonDecode(ffi.string(payload.Data))
local from = data.from
@/lua/ge/extensions/editor/api/object.lua
local function restoreSimObjectMemento(jsonString)
local jsonTable = jsonDecode(jsonString, "restoreSimObjectMemento function")
local name = jsonTable['name']
@/lua/ge/extensions/core/vehicles.lua
if data then
data = jsonDecode(data)
if p then p:add("json decode") end
if data then
data = jsonDecode(data)
if not data then
if data then
data = jsonDecode(data)
if p then p:add("pc decode") end
if data then
data = jsonDecode(data)
if p then p:add("json decode") end
if data then
data = jsonDecode(data)
if not data then
if data then
data = jsonDecode(data)
if p then p:add("pc decode") end
if formattxt and string.len(formattxt) >0 then
formats = jsonDecode(formattxt )
else
if formattxt and string.len(formattxt) >0 then
formats = jsonDecode(formattxt )
else
@/lua/vehicle/partCondition.lua
local function testLoad()
local data = jsonDecode(readFile("partConditionTest.json") or "{}")
hasSetPartCondition = {} --kill data from last init to avoid dual init warning
@/lua/ge/extensions/editor/missionEditor/progressSetup.lua
local progressString = ffi.string(self._text[1])
local state, newSaveData = xpcall(function() return jsonDecode(progressString) end, debug.traceback)
if newSaveData == nil or state == false then
@/lua/ge/extensions/editor/gen/utils.lua
return jsonDecode(cnt)
end
@/lua/ge/extensions/editor/missionEditor/progressSingle.lua
local progressString = ffi.string(self._text[1])
local state, newSaveData = xpcall(function() return jsonDecode(progressString) end, debug.traceback)
if newSaveData == nil or state == false then
@/lua/ge/extensions/editor/assetBrowser.lua
for line in io.lines(file.path) do
file.inspectorData.data[#file.inspectorData.data+1] = jsonDecode(line)
end
@/lua/ge/extensions/core/commandhandler.lua
-- args = { "v1", "openMap", "levels/gridmap/info.json" }
local jsondata = jsonDecode(data, nil)
-- if core_loadMapCmd then extensions.unload("core_loadMapCmd") end --if we are already going somewhere, remove previous 'queued' commands
@/lua/ge/extensions/editor/missionEditor/genericTypeData.lua
local progressString = ffi.string(self._text[1])
local state, newProgress = xpcall(function() return jsonDecode(progressString) end, debug.traceback)
if newProgress == nil or state == false then
@/lua/ge/extensions/core/modmanager.lua
if jsonContent then
mods[modname].modData = jsonDecode(jsonContent, tostring(filename) .. ' : ' .. tostring(v2))
-- fix the relative paths to be absolute paths for the UI
if jsonContent then
local modInfo = jsonDecode(jsonContent, tostring(filename) .. ' : ' .. tostring(v2))
if not modInfo then
@/lua/ge/extensions/util/inputSystemUtils.lua
end
local info = jsonDecode(content, filepath)
if not info then
@/lua/ge/extensions/tech/capturePlayer.lua
elseif state == PAYLOAD then
payload = jsonDecode(line)
end