Hi, I'm simply wondering when the IsReading() function in ISerialize.h returns true? I've read the comment, that it returns true when it does a deserialization pass, but can't quite figure out how to trigger this pass.
Thanks!
Re: IsReading() in ISerialize
#2Hey there,
I am no networking expert in CE but from my understanding:
When you are syncing objects across the network, you are either sending or receiving data.
If you are sending data, then you are "writing", from the object to the serialization data.
When you receive data, you are "reading", from the serialized data back to the object.
The deserialization pass is automatic, and should happen when there is new data from the authority that needs to be synced with the entity in question.
Check out the Rollingball template for a basic example of syncing an object across the network.
I am no networking expert in CE but from my understanding:
When you are syncing objects across the network, you are either sending or receiving data.
If you are sending data, then you are "writing", from the object to the serialization data.
When you receive data, you are "reading", from the serialized data back to the object.
The deserialization pass is automatic, and should happen when there is new data from the authority that needs to be synced with the entity in question.
Check out the Rollingball template for a basic example of syncing an object across the network.
Uniflare
CRYENGINE Technical Community Manager
Here to help the community and social channels grow and thrive.
My personal belongings;
Beginner Guides | My GitHub | Splash Plugin
CRYENGINE Technical Community Manager
Here to help the community and social channels grow and thrive.
My personal belongings;
Beginner Guides | My GitHub | Splash Plugin
Re: IsReading() in ISerialize
#4Well, u use it for example in NetSerialize function. TSerialize ser is passed as a parameter there and if you send aspect from client to server, then you can do check on client like if (ser.IsWriting ())
And same with IsReading on server. And vice versa, when sending opposite.
And same with IsReading on server. And vice versa, when sending opposite.
Cryengine tutorial videos on my Youtube channel! Check it out !
https://www.youtube.com/user/MusicForLifePL20
https://www.youtube.com/user/MusicForLifePL20
Re: IsReading() in ISerialize
#5Each network-related TSerialize object abstracts either a Network-reading or Networking-writing class implementation.
IsReading() will return true if the class is a 'reader' => hence during net serialization if its reading....then it'll be true... XD
IsReading() will return true if the class is a 'reader' => hence during net serialization if its reading....then it'll be true... XD