You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both the client and the server can subscribe to the `NetworkManager.OnClientDisconnectCallback` event to be notified when a client is disconnected.
158
+
Subscribe to the `NetworkManager.OnClientDisconnectCallback` event to receive notifications when a client is disconnected.
159
159
160
160
**When disconnect notifications are triggered:**
161
-
- Clients are notified when they're disconnected by the server.
161
+
162
+
- Clients are notified when they're disconnected by the server or from the distributed authority session.
162
163
- The server is notified when any client disconnects from the server, whether the server disconnects the client or the client disconnects itself.
163
164
- Both the server and clients are notified when their network connection is unexpectedly disconnected (network interruption).
164
165
165
166
**Client notification identifiers**
167
+
166
168
- On the server-side, the client identifier parameter is the identifier of the client that disconnects.
167
169
- On the client-side, the client identifier parameter is the identifier assigned to the client.
168
170
-_The exception to this is when a client is disconnected before its connection is approved._
169
171
170
172
You can also use the `NetworkManager.OnServerStopped` and `NetworkManager.OnClientStopped` callbacks to get local notifications when the server or client stops respectively.
171
173
172
174
### Connection notification manager example
175
+
173
176
Below is one example of how you can provide client connect and disconnect notifications to any type of NetworkBehaviour or MonoBehaviour derived component.
0 commit comments