OnClientConnectDisconnect returning wrong ID

I need these to get the client ID of the client that disconnects so I can detect if it was the host or not to take action, but whenever the host is the one that disconnects it returns the local ID of the client so there’s no way of knowing if the host was the one that disconnected, this also happens the OnConnectionEvent :hushed:. Any workarounds, or solutions is much appreciated!

Yes there is.

The client didn’t initiate the disconnect on purpose so when OnDisconnected returns that client’s ID, you can assume that the session was ended by the server (host). I believe if the client merely loses Internet connection you get a transport error (additionally) so you can also handle that case.

In all other cases where there is, say, a “Disconnect” button you remember that intent and when OnDisconnected runs you can be like “oh right, I intentionally disconnected”. :wink:

That makes sense, thanks for the help and quick response!:smile: