- Home /
Supress initial OnSerializeNetworkView state update
Authorative Server Architecture here.
I instantiate a object on each client (including the server) by calling an RPC that contains the NetworkViewID. So far so good, now I use the OnSerializeNetworkView to keep the status of the object in sync with the server, however I do this selectively every second by changing the observed target in the NetworkView on the server, while the client always listens.
Here a short snippet for understanding:
// called on the server when he should send a status update
void DoSync()
{
this.networkView.observed = this;
}
void OnSerializeNetworkView(BitStream stream, NetworkMessageInfo info)
{
if (stream.isWriting)
{
// sending data here
...
// we only ride once
this.networkView.observed = null;
}
else if(stream.isReading)
{
// read data here
...
}
}
So far so good, however in the RPC the object is already instantiated correctly on the client side, but the server always sends an generic initial state update after instantiation that screws up the clients setup because it's empty.
How do I prevent this generic initial state update, or how do I identify it and ignore it on the Client? I assume the reason for the initial state update is because I'm using Delta Compressed Synchronization. It doesn't happen with Unreliable State Synchronization.
Your answer
Follow this Question
Related Questions
State synchronization non-functional after mode change? 0 Answers
Does the position change need state synchronization? 2 Answers
NetworkView Control 2 Answers