This is the method from Unity’s networking source (NetworkManager.cs for 5.4 branch) that you’ll want to override in your network manager:
public virtual void OnServerDisconnect(NetworkConnection conn)
{
NetworkServer.DestroyPlayersForConnection(conn);
if (conn.lastError != NetworkError.Ok)
{
if (LogFilter.logError)
{
Debug.LogError("ServerDisconnected due to error: " + conn.lastError);
}
}
}
Then you can handle the errors however you want to
Same issue here with unity 5.4.2. With Unity 5.4.3 I get this error:
I don’t have any of this issues with Unity 5.4.1, but in that version the editor is unstable, crashes and bugs that later versions don’t have. It’s a bit uncomfortable working with 5.4.1.
We have been witnessing major issues with basic apps running on UNET with Unity 5.5.
Using Hololens, any device may disconnect quite regularly.
Also, having 3 clients (one server) and one common object only (NetworkTransform), the system will quickly throw an error claiming to many data are being sent (Can’t remember the message wording).
Also, I see often tutorials testing with a build running aside the editor on the same computer. Works fine but the same code on different devices and you get some authority errors. Actually, my code was faulty but it would not tell me.
I would think that since messages were all coming with same ip address, the program is not able to make the difference between the server and the client.
Finally, as we are using Hololens, it is often not anchoring properly or only after 2 to 5min. That time is long enough to actually lose the connection so basically it is not really happening.
@Paradoks , check please with 5.4 which we published here (see newtransport release) 5.6.0 will contain all of these changes. Beside this, it is difficult to say without reproducing this bug, is it timeout caused by internal bug, caused by wrong configuration (Confid,NetDropThreshold should be set to 80, and probably OverflowThreshold should be increased) or real timeout when server or client doesn’t receive any packet for DisconnectTimeout period.