I’ve downloaded the official Networking example.
Both non-auth server and auth server example use state synchronization to update position. And both example use this code:
void OnSerializeNetworkView(BitStream stream, NetworkMessageInfo info)
{
// Always send transform (depending on reliability of the network view)
if (stream.isWriting)
{
Vector3 pos = transform.position;
Quaternion rot = transform.rotation;
stream.Serialize(ref pos);
stream.Serialize(ref rot);
}
//................
}
It work properly but I got confused. In the case of non-auth server, the program keep sending transform to server when the object is own by local client. On the other hand, auth server use the same code but it seems only when it runs as a server does the transform send.
So my question is: how does BitStream determine whether it should send information or not?