Sign in to follow this  

Script Object Serialization

This topic is 3150 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm currently looking into ways to synchronize script objects over a network. My current method for application side object is to serialize them, send, then unpack on the client and using a UID, update the corresponding client side object from with the deserialized values. I overload the stream insertion and extraction operators to do the serializing at the moment. What I'm wondering is how I might go about a similar method for Script Objects. My first thought is for each Script class to have a serialize/deserialize method, register a custom stream class and have methods it can use like: stream.putInt() / stream.getInt() This is fine and all, but what sort of application side introspection can the script engine provide about Script side classes and objects? A more automatic serialization handled on the application side would be nicer.

Share this post


Link to post
Share on other sites
asIScriptObject has member functions that can be used to inspect the state of a script object. GetPropertyCount() will tell you how many members the object has, GetPropertyTypeId() and GetPropertyName() will tell you about the type and name of the properties and you can use GetPropertyPointer() to inspect the individual values.

Share this post


Link to post
Share on other sites

This topic is 3150 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this