use of com.biglybt.core.tracker.client.impl.dht.TRTrackerDHTAnnouncerImpl in project BiglyBT by BiglySoftware.
the class TRTrackerAnnouncerMuxer method create.
private TRTrackerAnnouncerHelper create(TOTorrent torrent, String[] networks, TOTorrentAnnounceURLSet[] sets) throws TRTrackerAnnouncerException {
TRTrackerAnnouncerHelper announcer;
boolean decentralised;
if (sets.length == 0) {
decentralised = TorrentUtils.isDecentralised(torrent.getAnnounceURL());
} else {
decentralised = TorrentUtils.isDecentralised(sets[0].getAnnounceURLs()[0]);
}
if (decentralised) {
announcer = new TRTrackerDHTAnnouncerImpl(torrent, networks, is_manual, getHelper());
} else {
announcer = new TRTrackerBTAnnouncerImpl(torrent, sets, networks, is_manual, getHelper());
}
for (TOTorrentAnnounceURLSet set : sets) {
URL[] urls = set.getAnnounceURLs();
for (URL u : urls) {
String key = u.toExternalForm();
StatusSummary summary = recent_responses.get(key);
if (summary == null) {
summary = new StatusSummary(announcer, u);
recent_responses.put(key, summary);
} else {
summary.setHelper(announcer);
}
}
}
if (provider != null) {
announcer.setAnnounceDataProvider(provider);
}
if (ip_override != null) {
announcer.setIPOverride(ip_override);
}
return (announcer);
}
Aggregations