- Home /
Why can't my client attempt to reconnect after being disconnected?
I have setup a server to disconnect clients when the max number of players has been exceeded. It works, however afterwards the client can't even reconnect to the server. StartClient() doesn't seem to be doing anything. I know for a fact it happens the other way around too. I can't even start a server. Seems like the network manager just hangs as soon as it disconnects.
public void SetupClient()
{
StartClient();
print("Client Started...");
}
public override void OnServerConnect(NetworkConnection conn)
{
if (sessionStarted || sessionPlayers.Count >= maxPlayers) conn.Disconnect();
}
Here's a snippet of my extended network manager. The behaviour is the same if any network error occurs so I am pretty sure it isn't the way I have overrided OnServerConnect.
Your answer
Follow this Question
Related Questions
Unity networking tutorial? 6 Answers
Can i make multiplayer game without unity multiplayer service ? 1 Answer
NetworkServer.dontListen not working - How do I stop clients connecting? 2 Answers
How to make a LAN game in Unity 2019.1.0f2 1 Answer
Multiplayer| Attaching camera to player (if i am the owner 1 Answer