private void Disconnect(BattlEyeDisconnectionType? disconnectionType) { if (disconnectionType == BattlEyeDisconnectionType.ConnectionLost) this.disconnectionType = BattlEyeDisconnectionType.ConnectionLost; keepRunning = false; if (socket.Connected) { socket.Shutdown(SocketShutdown.Both); socket.Close(); } if (disconnectionType != null) OnDisconnect(loginCredentials, disconnectionType); }
private void OnDisconnect(BattlEyeLoginCredentials loginDetails, BattlEyeDisconnectionType? disconnectionType) { if (BattlEyeDisconnected != null) BattlEyeDisconnected(new BattlEyeDisconnectEventArgs(loginDetails, disconnectionType)); }
public BattlEyeDisconnectEventArgs(BattlEyeLoginCredentials loginDetails, BattlEyeDisconnectionType? disconnectionType) { LoginDetails = loginDetails; DisconnectionType = disconnectionType; Message = Helpers.StringValueOf(disconnectionType); }