Opened 7 years ago

Closed 3 years ago

Last modified 3 years ago

#4698 closed defect (fixed)

OOS on rejoin when using Vectors - Use prototype serialization code

Reported by: fatherbushido Owned by: wraitii
Priority: Must Have Milestone: Alpha 24
Component: Core engine Keywords:
Cc: leper, Krinkle Patch: Phab:D2746

Description (last modified by fatherbushido)

The commit in r19147 and r19154 shows issues with serialization of prototype (for js vector objects).

Here is a sum up of forum discussions (mainly a leper's investigation).

We have unused prototype serialization code (#407), that should most likely be used (see #1089 for an use for AI deserialization). Though it might be worth considering not making this opt-in (or at least failing loudly if we try to serialize something with an unknown prototype).

The attached diffs are wip, possibly broken and ugly (from leper). It shows the breakage though it seems that the test is incomplete.

Attachments (2)

serialization_vector_js_object.diff (6.9 KB ) - added by fatherbushido 7 years ago.
serialization_vector_js_object_fix.diff (22.9 KB ) - added by fatherbushido 7 years ago.

Download all attachments as: .zip

Change History (14)

by fatherbushido, 7 years ago

by fatherbushido, 7 years ago

comment:1 by fatherbushido, 7 years ago

Description: modified (diff)

comment:4 by elexis, 6 years ago

Milestone: BacklogAlpha 24
Priority: Should HaveMust Have
Summary: Use prototype serialization codeOOS on rejoin when using Vectors - Use prototype serialization code

This is a vietnam mantrap for OOS errors.

The first release of Alpha 23 stores a Vector2D in Danubius' riverDirection and thus triggers an OOS on rejoin, refs #5162.

Last edited 6 years ago by elexis (previous) (diff)

comment:5 by elexis, 6 years ago

In 21834:

Fix an OOS on rejoin on Danubius following rP20957, refs #4855, fixes #5198.

Vectors are still deserialized as objects without their prototype functions, so doing math on these obejcts fails upon rejoin, refs #4698.
This patch doesn't add any version incompatibilities and players with the patched version can successfully rejoin unpatched games.

Differential Revision: https://code.wildfiregames.com/D1548
Reviewed By: temple

comment:6 by Krinkle, 5 years ago

Cc: Krinkle added

comment:7 by Krinkle, 5 years ago

Owner: set to Krinkle

comment:8 by Krinkle, 5 years ago

Status: newassigned

comment:9 by wraitii, 4 years ago

Patch: https://code.wildfiregames.com/D1991

comment:10 by wraitii, 4 years ago

Owner: changed from Krinkle to wraitii
Patch: https://code.wildfiregames.com/D1991Phab:D2746
Status: assignednew

comment:11 by wraitii, 3 years ago

Resolution: fixed
Status: newclosed

In 24462:

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

comment:12 by wraitii, 3 years ago

In 24561:

Fix rP24462 - Set entity/template before deserializing.

Following rP24462, components Deserialize() was called before entity/template were set, which is incorrect.

Refs #4698.

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

Note: See TracTickets for help on using tickets.