- Home /
UNET Client Ready Flag Inconsistancy
I am currently setting up the UNET pipeline and I noticed that there was a flag called: ClientReady. This flag seems to prevent all networking coming to an individual client as long is a client is marked as not-ready. As far as I can see from the documentation, there is nowhere that this flag should be set to true on its own and yet my client is made ready after connecting to the server and loading the scene automatically through the NetworkManager.ServerChangeScene function. Within the documentation(listed below) it says that clients will be set to "not-ready" and that client must set their ready flag on their own. I am wondering if somehow this is not happening or if even the inverse of this is happening and the server is setting the clients to ready. If there is somewhere else that the clients are being set to ready that I am unaware of I would love to know. Thank you in advance.
http://docs.unity3d.com/ScriptReference/Networking.NetworkManager.ServerChangeScene.html
Answer by CommandoJones · Jun 27, 2015 at 12:12 AM
Discovered that the NetworkManager.OnClientConnect function be default will add the player object which will set the ClientReady flag to true. The ServerChangeScene function probably only sets the clients' ClientReady flag to unready once it is initially called which, in my case, was before the client ever connected.
This is something I'm also looking at. So, when calling ServerChangeScene manually, you've found that the client's ready flag does not get set to false but remains true?
I have not tried calling this function once the client has already connected. However, calling it before the client connected did not seem to have any effect.
so, how can i make a client always in a ready state?? please help
Answer by SCLaunder · Jul 01, 2016 at 01:56 PM
For anyone still having a problem with this issue we've found that if you don't override NetworkManager.OnClientSceneChanged(NetworkConnection conn) then the default implementation of this function sets the client connection to ready. However if you override this function you will need to set your client connections to ready manually using ClientScene.Ready(NetworkConnection connection).
I hope this helps.