/// <summary> /// Called when challenge socket is disconnected. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The e.</param> private void OnChallengeDisconnect(object sender, SocketDisconnectArgs e) { log.ConditionalDebug("Disconnected from challenge socket."); if (challengeCon != null && !_disposing && !e.Initiated && e.ReconnectionAttempts < Settings.ReconnectionAttemptLimit) { log.ConditionalDebug("Reconnecting challenge socket."); challengeCon.Reconnect(); } }
/// <summary> /// Called when the tournament socket disconnects. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The e.</param> private void OnDisconnect(object sender, SocketDisconnectArgs e) { log.ConditionalDebug("Disconnected from /tournament/{0}", tournamentData.Id); if (socket != null && !e.Initiated && e.ReconnectionAttempts < Client.Settings.ReconnectionAttemptLimit) { log.ConditionalDebug("Reconnecting /tournament/{0}", tournamentData.Id); socket.Reconnect(); } }
/// <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(); } } }