Jump to content
  • Advertisement
Sign in to follow this  
Wavesonics

Script Object Serialization

This topic is 3431 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!