Search in sources :

Example 6 with BuddyPluginBuddy

use of com.biglybt.plugin.net.buddy.BuddyPluginBuddy in project BiglyBT by BiglySoftware.

the class BuddyPluginTracker method checkTracking.

protected void checkTracking() {
    if (!(plugin_enabled && tracker_enabled)) {
        return;
    }
    List<BuddyPluginBuddy> online;
    synchronized (online_buddies) {
        online = new ArrayList<>(online_buddies);
    }
    Set<Download> downloads;
    int downloads_id;
    synchronized (tracked_downloads) {
        boolean downloads_changed = last_processed_download_set_id != download_set_id;
        if (downloads_changed) {
            last_processed_download_set = new HashSet<>(tracked_downloads);
            last_processed_download_set_id = download_set_id;
        }
        downloads = last_processed_download_set;
        downloads_id = last_processed_download_set_id;
    }
    Map diff_map = new HashMap();
    for (int i = 0; i < online.size(); i++) {
        BuddyPluginBuddy buddy = (BuddyPluginBuddy) online.get(i);
        BuddyTrackingData buddy_data = getBuddyData(buddy);
        buddy_data.updateLocal(downloads, downloads_id, diff_map);
    }
}
Also used : BuddyPluginBuddy(com.biglybt.plugin.net.buddy.BuddyPluginBuddy)

Aggregations

BuddyPluginBuddy (com.biglybt.plugin.net.buddy.BuddyPluginBuddy)6 PluginInterface (com.biglybt.pif.PluginInterface)2 UIInputReceiverListener (com.biglybt.pif.ui.UIInputReceiverListener)2 BuddyPlugin (com.biglybt.plugin.net.buddy.BuddyPlugin)2 PartialBuddy (com.biglybt.plugin.net.buddy.PartialBuddy)2 CoreRunningListener (com.biglybt.core.CoreRunningListener)1 DownloadManager (com.biglybt.core.download.DownloadManager)1 DownloadManagerState (com.biglybt.core.download.DownloadManagerState)1 GlobalManager (com.biglybt.core.global.GlobalManager)1 PEPeerManager (com.biglybt.core.peer.PEPeerManager)1 TagProperty (com.biglybt.core.tag.TagFeatureProperties.TagProperty)1 MenuItemListener (com.biglybt.pif.ui.menus.MenuItemListener)1 UIFunctions (com.biglybt.ui.UIFunctions)1 UserPrompterResultListener (com.biglybt.ui.UserPrompterResultListener)1 MultipleDocumentInterface (com.biglybt.ui.mdi.MultipleDocumentInterface)1 TrackerEditorListener (com.biglybt.ui.swt.maketorrent.TrackerEditorListener)1 SpeedAdapter (com.biglybt.ui.swt.views.ViewUtils.SpeedAdapter)1 InetAddress (java.net.InetAddress)1 List (java.util.List)1 DisposeEvent (org.eclipse.swt.events.DisposeEvent)1