Store all downloads.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 11 Apr 2013 05:32:54 +0000 (07:32 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 11 Apr 2013 05:32:54 +0000 (07:32 +0200)
src/main/java/net/pterodactylus/xdcc/core/Core.java

index 4596f0d..8aa31e2 100644 (file)
@@ -43,6 +43,7 @@ import net.pterodactylus.xdcc.core.event.BotAdded;
 import net.pterodactylus.xdcc.core.event.CoreStarted;
 import net.pterodactylus.xdcc.data.Bot;
 import net.pterodactylus.xdcc.data.Channel;
+import net.pterodactylus.xdcc.data.Download;
 import net.pterodactylus.xdcc.data.Network;
 import net.pterodactylus.xdcc.data.Pack;
 import net.pterodactylus.xdcc.data.Server;
@@ -93,6 +94,9 @@ public class Core extends AbstractIdleService {
        /** The currently known bots. */
        private final Table<Network, String, Bot> networkBots = HashBasedTable.create();
 
+       /** The current downloads. */
+       private final Map<String, Download> downloads = Maps.newHashMap();
+
        /** The current DCC receivers. */
        private final Collection<DccReceiver> dccReceivers = Sets.newHashSet();
 
@@ -191,6 +195,9 @@ public class Core extends AbstractIdleService {
                        return;
                }
 
+               Download download = new Download(bot, pack);
+               downloads.put(pack.name(), download);
+
                try {
                        connection.sendMessage(bot.name(), "XDCC SEND " + pack.id());
                } catch (IOException ioe1) {