mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Enhance live syncback process with improved reference handling and float precision
- Implemented ObjectValue carriers for service-level references, allowing for accurate serialization of non-direct child references during syncback. - Updated `encodeService` to include explicit handling of attributes and tags, ensuring they are properly encoded and preventing data loss. - Refactored `build_dom_from_chunks` to manage ObjectValue carriers and resolve references correctly, enhancing data integrity. - Truncated float values to f32 precision in `UnresolvedValue::from_variant`, aligning with rbxl storage requirements and improving consistency. These changes address critical issues in the live syncback process, enhancing reliability and data accuracy.
This commit is contained in:
parent
7dc4f52793
commit
39c8bd41f4
8 changed files with 342 additions and 121 deletions
|
|
@ -642,13 +642,18 @@ function App:performSyncback()
|
|||
|
||||
local services = {}
|
||||
local allChildren = {}
|
||||
local allCarriers = {}
|
||||
for _, className in SYNCBACK_SERVICES do
|
||||
local ok, service = pcall(game.FindService, game, className)
|
||||
if ok and service then
|
||||
local chunk = encodeService(service)
|
||||
local chunk, refTargets = encodeService(service)
|
||||
for _, child in service:GetChildren() do
|
||||
table.insert(allChildren, child)
|
||||
end
|
||||
for _, carrier in refTargets do
|
||||
table.insert(allChildren, carrier)
|
||||
table.insert(allCarriers, carrier)
|
||||
end
|
||||
table.insert(services, chunk)
|
||||
end
|
||||
end
|
||||
|
|
@ -658,6 +663,10 @@ function App:performSyncback()
|
|||
data = SerializationService:SerializeInstancesAsync(allChildren)
|
||||
end
|
||||
|
||||
for _, carrier in allCarriers do
|
||||
carrier:Destroy()
|
||||
end
|
||||
|
||||
local url = ("http://%s:%s/api/syncback"):format(host, port)
|
||||
local body = Http.msgpackEncode({
|
||||
protocolVersion = Config.protocolVersion,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue