private void OnClientDisconnectInternal(RawClient client, DisconnectEventArgs args) { bool ok = false; lock ( m_Clients ) { if (m_Clients.Contains(client)) { client.DisconnectEvent -= OnClientDisconnectInternal; client.ConnectEvent -= OnClientConnectInternal; m_Clients.Remove(client); ok = true; } } if (ok) { OnClientDisconnect(client, args); if (ClientDisconnectEvent != null) { ClientDisconnectEvent.Invoke(client, args); } } }
protected virtual void OnClientDisconnect(RawClient client, DisconnectEventArgs args) { }