From d2f154dff1ee55b23fab7576a9c50063065d40d4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 10 Apr 2013 06:48:14 +0200 Subject: [PATCH] Add command to show active DCC receivers. --- src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java b/src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java index 17d2389..059d63d 100644 --- a/src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java +++ b/src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java @@ -23,6 +23,7 @@ import java.io.Writer; import java.util.Collections; import java.util.List; +import net.pterodactylus.irc.DccReceiver; import net.pterodactylus.xdcc.core.Core; import net.pterodactylus.xdcc.data.Bot; import net.pterodactylus.xdcc.data.Pack; @@ -102,6 +103,12 @@ public class CommandReader extends AbstractExecutionThreadService { writer.write(String.format("[%d] %s (%s) from %s (#%s) on %s\n", counter++, result.pack().name(), result.pack().size(), result.bot().name(), result.pack().id(), result.bot().network().name())); } writer.write("End of Search.\n"); + } else if (words[0].equalsIgnoreCase("dcc")) { + int counter = 0; + for (DccReceiver dccReceiver : core.dccReceivers()) { + writer.write(String.format("[%d] %s (%s, %d%%%s)\n", counter++, dccReceiver.filename(), dccReceiver.size(), dccReceiver.progress() * 100 / dccReceiver.size(), dccReceiver.isRunning() ? "" : ", finished")); + } + writer.write("End of DCCs.\n"); } lastLine = line; -- 2.7.4