deserialize
Definition
-- @/lua/common/utils.lua:1277
function deserialize(s)
-- if you crash here with "attempt to call a nil value" check if your serialize function emits invalid lua: ["windowViewport"]=cdata: 0x0257e75a5580
if s == nil then return nil end
return loadstring("return " .. s)()
end
Callers
@/lua/vehicle/controller.lua
if name and loadedControllers[name] and loadedControllers[name].deserialize then
loadedControllers[name].deserialize(controllerData)
end
@/lua/ge/extensions/core/vehicleBridge.lua
local function callbackFromVlua(vehId, callbackId, ...)
local deserializedData = deserialize(...)
if deserializedData.failReason then
@/lua/ge/extensions/editor/main.lua
--TODO: objects need serializable formats not C++ object refs
--editor.history:deserialize(editorHistoryData)
end
@/lua/ge/extensions/tech/techCore.lua
-- Serialize & deserialize to get rid of data MessagePack can't serialize
local cameraData = deserialize(serialize(core_camera.getCameraDataById(veh:getID())))
cameraData['unicycle'] = nil
@/lua/vehicle/controller/driveModes.lua
local function deserialize(data)
if data then
@/lua/ge/extensions/core/vehicle/partmgmt.lua
elseif dataType == 'string' and configData:sub(1, 1) == '{' then
local res, newConfigData = preprocessPartConfig(deserialize(configData))
if res then
@/lua/ge/extensions/editor/inspector.lua
local function onEditorLoadGuiInstancerState(state)
guiInstancer:deserialize("inspectorInstances", state)
for key, val in pairs(guiInstancer.instances) do
@/inspector/Views/HeapAllocationsTimelineView.js
workerProxy.createImportedSnapshot(snapshotStringData, result.filename, ({objectId, snapshot: serializedSnapshot}) => {
let snapshot = WI.HeapSnapshotProxy.deserialize(objectId, serializedSnapshot);
snapshot.snapshotStringData = snapshotStringData;
workerProxy.createSnapshot(snapshotStringData, ({objectId, snapshot: serializedSnapshot}) => {
let snapshot = WI.HeapSnapshotProxy.deserialize(objectId, serializedSnapshot);
snapshot.snapshotStringData = snapshotStringData;
workerProxy.createSnapshotDiff(snapshot1.proxyObjectId, snapshot2.proxyObjectId, ({objectId, snapshotDiff: serializedSnapshotDiff}) => {
let diff = WI.HeapSnapshotDiffProxy.deserialize(objectId, serializedSnapshotDiff);
this.showHeapSnapshotDiff(diff);
@/lua/vehicle/controller/esc.lua
local function deserialize(data)
if data and data.escConfigKey then
@/lua/vehicle/controller/4wd.lua
local function deserialize(data)
if data then
@/lua/ge/extensions/gameplay/drag/general.lua
local status, ret = xpcall(function() return type(deserialize(vehicle.partConfig)) end, nop)
racer.stock = not ret
@/lua/vehicle/controller/twoStepLaunch.lua
local function deserialize(data)
if data and data.state and data.rpm then
@/inspector/Protocol/ConsoleObserver.js
workerProxy.createSnapshot(snapshotStringData, title || null, ({objectId, snapshot: serializedSnapshot}) => {
let snapshot = WI.HeapSnapshotProxy.deserialize(objectId, serializedSnapshot);
snapshot.snapshotStringData = snapshotStringData;
@/lua/common/jbeam/loader.lua
if not vehicleBundle.config.paints then
vehicleBundle.config.paints = deserialize(vehicleObj.paints or '{}')
end
@/inspector/Proxies/HeapSnapshotNodeProxy.js
static deserialize(objectId, serializedNode)
{
if (isNode)
return WI.HeapSnapshotNodeProxy.deserialize(this._proxyObjectId, component);
return WI.HeapSnapshotEdgeProxy.deserialize(this._proxyObjectId, component);
return WI.HeapSnapshotNodeProxy.deserialize(this._proxyObjectId, component);
return WI.HeapSnapshotEdgeProxy.deserialize(this._proxyObjectId, component);
});
@/lua/ge/extensions/flowgraph/nodes/vehicle/customPartsConfigProvider.lua
if im.Button("Copy from Vehicle") then
self.partConfig = deserialize(veh.partConfig) or {parts = {},vars = {}}
self.model = veh.JBeam
if im.Button("Copy only Parts") then
self.partConfig.parts = deserialize(veh.partConfig).parts or {}
self.model = veh.JBeam
if im.Button("Copy only Vars") then
self.partConfig.vars = deserialize(veh.partConfig).vars or {}
self.model = veh.JBeam
self._opened = true
im.Text(dumps(deserialize(veh.partConfig)))
im.TreePop()
@/lua/ge/extensions/editor/sceneTree.lua
local function onEditorLoadGuiInstancerState(state)
guiInstancer:deserialize("scenetreeInstances", state)
recacheAllNodes()
@/lua/ge/extensions/flowgraph/nodes/vehicle/special/customVehicleGetter.lua
function C:returnValue(value)
self.returnedValue = deserialize(value)
end
@/lua/vehicle/controller/controllerTemplate.lua
-- local function deserialize(data)
-- if data then
@/lua/vehicle/energyStorage/fuelTank.lua
local function deserialize(storage, data)
if data.remainingVolume then
@/inspector/Models/URLBreakpoint.js
static deserialize(serializedInfo)
{
@/lua/common/utils.lua
if data == nil then return end
extensions.deserialize(data)
-- print("serialized data: " .. tostring(s))
-- da = deserialize(s)
-- print("restored data: " .. tostring(da))
-- end
-- if deserialize(serialize(nil)) ~= nil then print "serialize with nil fails to work corectly" end
-- end
@/inspector/Proxies/HeapSnapshotDiffProxy.js
static deserialize(objectId, serializedSnapshotDiff)
{
// should we serialize the objectId with the snapshot so we have the right objectId?
let snapshot1 = WI.HeapSnapshotProxy.deserialize(objectId, serializedSnapshot1);
let snapshot2 = WI.HeapSnapshotProxy.deserialize(objectId, serializedSnapshot2);
let snapshot1 = WI.HeapSnapshotProxy.deserialize(objectId, serializedSnapshot1);
let snapshot2 = WI.HeapSnapshotProxy.deserialize(objectId, serializedSnapshot2);
return new WI.HeapSnapshotDiffProxy(objectId, snapshot1, snapshot2, totalSize, totalObjectCount, categories);
WI.HeapSnapshotWorkerProxy.singleton().callMethod(this._proxyObjectId, "nodeWithIdentifier", nodeIdentifier, (serializedNode) => {
callback(WI.HeapSnapshotNodeProxy.deserialize(this._proxyObjectId, serializedNode));
});
@/lua/ge/ge_utils.lua
local geluaCommand = string.format('local args = %s; %s(unpack(args, 1, table.maxn(args)))', 'deserialize(%q)', geluaFunctionName)
local cmd = string.format('obj:queueGameEngineLua(string.format(%q, serialize({%s, unpack(%s)})))', geluaCommand, vluaCommand, serialize({...}))
@/inspector/Models/DOMBreakpoint.js
static deserialize(serializedInfo)
{
@/inspector/Models/EventBreakpoint.js
static deserialize(serializedInfo)
{
@/inspector/Proxies/HeapSnapshotProxy.js
static deserialize(objectId, serializedSnapshot)
{
WI.HeapSnapshotWorkerProxy.singleton().callMethod(this._proxyObjectId, "nodeWithIdentifier", nodeIdentifier, (serializedNode) => {
callback(WI.HeapSnapshotNodeProxy.deserialize(this._proxyObjectId, serializedNode));
});
@/lua/ge/extensions/career/modules/inventory.lua
local vehicleData = jsonReadFile(files[i])
vehicleData.partConditions = deserialize(vehicleData.partConditions)
if vehicleData.timeToAccess then
@/lua/vehicle/controller/nitrousOxideInjection.lua
local function deserialize(data)
if data and data.isArmed then
@/lua/common/extensions.lua
local function deserialize(data, filter)
if data == nil then return end
@/lua/ge/extensions/career/modules/partInventory.lua
if jsonData and not outdated then
partInventory = deserialize(jsonData[1])
@/lua/vehicle/energyStorage/n2oTank.lua
local function deserialize(storage, data)
if data.remainingMass then
@/lua/ge/extensions/editor/api/guiInstancer.lua
function C:deserialize(name, state)
if state[name] then
@/inspector/Protocol/HeapObserver.js
workerProxy.createSnapshot(snapshotStringData, ({objectId, snapshot: serializedSnapshot}) => {
let snapshot = WI.HeapSnapshotProxy.deserialize(objectId, serializedSnapshot);
snapshot.snapshotStringData = snapshotStringData;
workerProxy.createSnapshot(snapshotStringData, ({objectId, snapshot: serializedSnapshot}) => {
let snapshot = WI.HeapSnapshotProxy.deserialize(objectId, serializedSnapshot);
snapshot.snapshotStringData = snapshotStringData;
@/inspector/Controllers/DOMDebuggerManager.js
for (let existingSerializedBreakpoint of existingSerializedBreakpoints)
await objectStore.putObject(constructor.deserialize(existingSerializedBreakpoint));
}
for (let serializedBreakpoint of serializedBreakpoints) {
let breakpoint = constructor.deserialize(serializedBreakpoint);
@/inspector/Models/HeapAllocationsTimelineRecord.js
workerProxy.createImportedSnapshot(snapshotStringData, title, ({objectId, snapshot: serializedSnapshot}) => {
let snapshot = WI.HeapSnapshotProxy.deserialize(objectId, serializedSnapshot);
snapshot.snapshotStringData = snapshotStringData;
@/lua/ge/extensions/editor/api/history.lua
--- Deserialize the history stacks
function C:deserialize(data)
if data.history then
@/lua/vehicle/main.lua
-- deserialize extensions first, so the extensions are loaded before they are trying to get deserialized
deserializePackages(deserialize(s))
end
@/lua/ge/extensions/core/camera.lua
if data.globalCameras[camName] then
tableMergeRecursive(cam, deserialize(data.globalCameras[camName]))
if cam.onDeserialized then cam:onDeserialized() end
if svdata.cameras[camName] then
tableMergeRecursive(cam, deserialize(svdata.cameras[camName]))
end
@/lua/vehicle/energyStorage.lua
-- if name and energyStorages[name] then
-- energyStorages[name]:deserialize(storageData)
-- end
@/lua/vehicle/extensions/tech/trailSim.lua
local function trailerData(dataString, id)
local trailerData = deserialize(dataString)
for i, d in ipairs(trailerData) do
@/inspector/Models/HeapAllocationsInstrument.js
workerProxy.createSnapshot(snapshotStringData, ({objectId, snapshot: serializedSnapshot}) => {
let snapshot = WI.HeapSnapshotProxy.deserialize(objectId, serializedSnapshot);
snapshot.snapshotStringData = snapshotStringData;
@/lua/vehicle/energyStorage/pressureTank.lua
local function deserialize(storage, data)
if data.remainingMass then
@/lua/ge/extensions/editor/rallyEditor/measurementsTab.lua
-- Deserialize measurements from JSON data
function C:deserialize(data)
if not data then return end
self:deserialize(data)
@/inspector/Proxies/HeapSnapshotEdgeProxy.js
static deserialize(objectId, serializedEdge)
{