HomeWildfire Games

Correctly serialize/deserialize user-defined JS objects.
AuditedrP24462

Description

Correctly serialize/deserialize user-defined JS objects.

Generalize component/AI serialization system to any user-defined JS object. This includes Vector2D/3D, fixing an old issue.
As with components/AI, JS Objects may implement a Serialize/Deserialize function to store custom data instead of the default, which attemps to serialize all enumerable properties.

Fixes #4698

Differential Revision: https://code.wildfiregames.com/D2746

Event Timeline

Silier raised a concern with this commit.Dec 28 2020, 1:34 PM
Silier added a subscriber: Silier.

when hosting match

WARNING: Serialization symbol cannot be written on object ({r:21, g:55, b:149})

WARNING: Serialization symbol cannot be written on object ({r:150, g:20, b:20})

WARNING: Serialization symbol cannot be written on object ({r:21, g:55, b:149})

WARNING: Serialization symbol cannot be written on object ({r:150, g:20, b:20})

WARNING: Serialization symbol cannot be written on object ({r:21, g:55, b:149})

WARNING: Serialization symbol cannot be written on object ({r:150, g:20, b:20})

ERROR: JavaScript error: gui/gamesetup/Controls/GameSettingsControl.js line 230 can't define property Symbol(): Object is not extensible
This commit now has outstanding concerns.Dec 28 2020, 1:34 PM
Silier resigned from this commit.Dec 29 2020, 11:30 AM

works now

This commit no longer requires audit.Dec 29 2020, 11:30 AM
Silier raised a concern with this commit.Jan 11 2021, 9:57 PM
This commit now has outstanding concerns.Jan 11 2021, 9:57 PM
wraitii added inline comments.Jan 12 2021, 11:30 AM
/ps/trunk/source/simulation2/scripting/ScriptComponent.cpp
68

This is buggy, it should be above the assignation. I remember thinking I needed to fix it, and then forgetting about it...

wraitii requested verification of this commit.Jan 13 2021, 9:30 AM
This commit now requires verification by auditors.Jan 13 2021, 9:30 AM
Silier accepted this commit.Jan 18 2021, 8:10 PM

attack-move fixed

All concerns with this commit have now been addressed.Jan 18 2021, 8:10 PM