View Issue Details

IDProjectCategoryView StatusLast Update
0008706Multi Theft Auto : San AndreasScriptingpublic2015-01-16 14:42
ReporterBpb_XommkoAssigned Toccw 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version 
Target Version1.4.1Fixed in Version1.4.1 
Summary0008706: Element data desync
Description

When element data is set in onElementDataChange, it wil desync on clients.

Steps To Reproduce

run addEventHandler("onElementDataChange", root, function() setElementData(source,"ng:status", "loaded2test") end)
run setElementData(getPlayerFromName("your_name"), "ng:status", "123")

Now, get this element data on server:
run getElementData(getPlayerFromName("your_name"), "ng:status")
--> Command results: loaded2test [string]

And on clients:
crun getElementData(localPlayer, "ng:status")
--> Command results: 123 [string]

TagsNo tags attached.

Activities

Bpb_Xommko

2015-01-09 20:43

viewer   ~~0022814

Last edited: 2015-01-09 20:43

View 2 revisions

It seems that clients receive new data in wrong order. I did some more testing, and noticed that client receives changed data first, then it receives original value.

addEventHandler("onElementDataChange", root,
function (dataName)
outputChatBox("onElementDataChange|server " .. dataName .. ": " .. tostring(getElementData(source, dataName)))

    if dataName == "status" then
        if getElementData(source, dataName) == 1 then
            setElementData(source, "status", 3)
        end
    end
end

)
setElementData(player, "status", 1)

onElementDataChange|server status: 1
onElementDataChange|server status: 3
onClientElementDataChange|client status: 3
onClientElementDataChange|client status: 1

ccw

2015-01-12 01:22

administrator   ~~0022853

Fixed in https://code.google.com/p/mtasa-blue/source/detail?r=7009

Seems like a simple fix, therefore expect end of world.

Bpb_Xommko

2015-01-16 14:42

viewer   ~~0022867

Thanks. It's been for years (first noticed in 1.0.4), and now it has been fixed.

Issue History

Date Modified Username Field Change