/// <summary> /// Called when the client is disconncted from the lobby. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The e.</param> private void OnLobbyDisconnect(object sender, SocketDisconnectArgs e) { log.ConditionalDebug("Disconnected from lobby socket."); if (lobbyCon != null && !_disposing && !e.Initiated && Settings.AutoReconnect && e.ReconnectionAttempts < Settings.ReconnectionAttemptLimit) { Events.FireEventAsync(Events._onDisconnect, new Events.DisconnectEvent(this)); if (Settings.AutoReconnect) { log.ConditionalDebug("Reconnecting."); lobbyCon.Reset(); ConnectLobbyInternal(); } } }