You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use binser to deserialize the raw Lua tables, but don't run any class deserializers.
Trigger an event that manipulates the raw data to convert it to the desired format.
Run the class deserializers on the raw data.
The raw data would be a set of Lua tables containing the version of the engine/mod that the data came from and the serial ID/require path of the class in its metatable or similar.
binser would be modified to no longer handle automatic class instance deserialization with this change. I think having our own Lua table to class instance deserializer would be best, given how robust the updating logic should be.
Also, this change would enable writing unit tests for save migrations, which is crucial for verifying correctness. The tests would supply the raw data that step 1 returns and verify that the final class instance returned by step 3 is properly converted.
The classes must be deserialized from the deepest nested property upwards, so that :deserialize() would be able to call class methods on child class instance properties.
The text was updated successfully, but these errors were encountered:
The basic idea would probably be:
The raw data would be a set of Lua tables containing the version of the engine/mod that the data came from and the serial ID/require path of the class in its metatable or similar.
binser
would be modified to no longer handle automatic class instance deserialization with this change. I think having our own Lua table to class instance deserializer would be best, given how robust the updating logic should be.Also, this change would enable writing unit tests for save migrations, which is crucial for verifying correctness. The tests would supply the raw data that step 1 returns and verify that the final class instance returned by step 3 is properly converted.
The classes must be deserialized from the deepest nested property upwards, so that
:deserialize()
would be able to call class methods on child class instance properties.The text was updated successfully, but these errors were encountered: