function OnFirstUpdate()
--do old function code
SendSimData()
end
-----------------------------------------------------------------------------------
in the usersync.lua
function OnSync()
--do old function code
if Sync.SimData then
UpdateSimData(Sync.SimData)
end
end
function UpdateSimData(data)
Prefs.SaveToCurrentProfile('SimData', data)
end
function SaveSimData(name, params)
local current = Prefs.GetFromCurrentProfile('SimData') or { }
current.name = params
Prefs.SaveToCurrentProfile('SimData', current)
end
function SendSimData()
local data = Prefs.GetFromCurrentProfile('SimData') or { }
local SD = { Func = 'UpdateSimData', Args = { params = data } }
SimCallback(SD, true)
end
function SetSimData(name, param)
if name and param then
SaveSimData(name, param)
SendSimData()
end
end
----------------------------------------------------------
in simsync.lua
local SimData = {}
function ResetSyncTable()
--do old ResetSyncTable code
Sync.SimData = false
end
function UpdateSimdata(data)
if data then
SimData = data
end
end
function GetSimData(name)
if SimData[name] then
return SimData[name]
else
return nil
end
end
function SendSimData()
SimSync.SimData = SimData
end
function SetSimData(name, param)
SimData[name] = param
SendSimData()
end
----------------------------------------------------------
in simcallbacks.lua
Callbacks.UpdateSimData(data)
UpdateSimData(data.params)
end
Statistics: Posted by Domino — 28 Aug 2013, 20:35
Statistics: Posted by Ze_PilOt — 19 Aug 2013, 22:30
Statistics: Posted by Ze_PilOt — 08 Aug 2013, 09:11
Statistics: Posted by Eukanuba — 01 Aug 2013, 15:53
Statistics: Posted by lextoc — 31 Jul 2013, 00:30
Statistics: Posted by Ze_PilOt — 31 Jul 2013, 00:17
Statistics: Posted by FireMessiah — 30 Jul 2013, 23:37