}
/**
- * Returns the currently active DCC receivers.
+ * Returns all currently running downloads.
*
- * @return The currently active DCC receivers
+ * @return All currently running downloads
*/
- public Collection<DccReceiver> dccReceivers() {
- return dccReceivers;
+ public Collection<Download> downloads() {
+ return downloads.values();
}
//
writeLine("End of Search.");
} else if (words[0].equalsIgnoreCase("dcc")) {
int counter = 0;
- for (DccReceiver dccReceiver : core.dccReceivers()) {
- writer.write(String.format("[%d] %s (%s, ", counter++, dccReceiver.filename(), f(dccReceiver.size())));
+ for (Download download : core.downloads()) {
+ DccReceiver dccReceiver = download.dccReceiver();
+ if (dccReceiver == null) {
+ /* download has not even started. */
+ writer.write(String.format("[%d] %s requested from %s (not started yet)\n", counter++, download.pack().name(), download.bot().name()));
+ continue;
+ }
+ writer.write(String.format("[%d] %s from %s (%s, ", counter++, dccReceiver.filename(), download.bot().name(), f(dccReceiver.size())));
if (dccReceiver.isRunning()) {
writer.write(String.format("%.1f%%, %s", dccReceiver.progress() * 100.0 / dccReceiver.size(), f(dccReceiver.currentRate())));
} else {