Mirror
Mirror copied to clipboard
incremental connection from client
- connection a client to a server | StartClient();
- stopping client connection | StopClient();
- reconnect again || StartClient();
now client will be register twice.
doing 2. & 3. again will try to connect +1 each time.
Reason: every time client gets started AddTransportHandlers() is call and callback are registered. RemoveTransportHandlers() won't be triggered when client stops. => Callback are registered multiple times, that's why client connection increases.
I have the same bug, in the last Mirror Update.
I found that the problem is from a missing call of "OnDisconnected?.Invoke();" in the the Disconnect() method in the class Client of Telepathy, when the client disconnect manually.
So I just added "OnDisconnected?.Invoke();" to the line 255 and it resolve the bug, at least for me.
@vis2k see also #3213
checking
let's close this in favor of https://github.com/vis2k/Mirror/issues/3213 , one open issue is enough