From 845acd1b9805e5cb84ba03f6a493014a38b9e798 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 27 Oct 2021 14:26:17 +0200 Subject: [PATCH] =?utf8?q?=F0=9F=94=8A=20Add=20more=20debug=20logging?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Because I still can't see shit of what's happening! --- src/main/java/net/pterodactylus/xdcc/core/Core.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/net/pterodactylus/xdcc/core/Core.java b/src/main/java/net/pterodactylus/xdcc/core/Core.java index ea04286..db64416 100644 --- a/src/main/java/net/pterodactylus/xdcc/core/Core.java +++ b/src/main/java/net/pterodactylus/xdcc/core/Core.java @@ -892,28 +892,33 @@ public class Core extends AbstractExecutionThreadService { if (!network.isPresent()) { return; } + eventBus.post(new GenericMessage("a")); Set openDownloads = downloads.values().stream() .filter(download -> download.bot().name().equalsIgnoreCase(dccSendReceived.source().nick().orNull())) .filter(download -> download.dccReceiver() == null) .collect(toSet()); + eventBus.post(new GenericMessage("b")); if (openDownloads.isEmpty()) { /* I don't think we requested this. */ eventBus.post(new GenericMessage(format("Ignoring offer for %s, no open download from %s.", dccSendReceived.filename(), dccSendReceived.source()))); return; } + eventBus.post(new GenericMessage("c")); /* check if it’s already downloading. */ if (downloads.values().stream().anyMatch(download -> download.filename().equals(dccSendReceived.filename()) && download.dccReceiver() != null)) { eventBus.post(new GenericMessage(format("Ignoring offer for %s, it’s already being downloaded.", dccSendReceived.filename()))); return; } + eventBus.post(new GenericMessage("d")); Download download = openDownloads.stream() .filter(it -> it.filename().equals(dccSendReceived.filename())) .findFirst() .orElse(openDownloads.iterator().next()); + eventBus.post(new GenericMessage("e")); eventBus.post(new GenericMessage(format("Downloading %s from %s as %s.", dccSendReceived.filename(), dccSendReceived.source(), download.filename()))); /* check if the file already exists. */ -- 2.7.4