Search in sources :

Example 1 with PEPeerTransportProtocol

use of com.biglybt.core.peer.impl.transport.PEPeerTransportProtocol in project BiglyBT by BiglySoftware.

the class RemotePieceDistributionView method refresh.

@Override
public void refresh() {
    if (pem == null)
        return;
    if (peer instanceof PEPeerTransportProtocol) {
        PEPeerTransportProtocol pet = (PEPeerTransportProtocol) peer;
        BitFlags avl = pet.getAvailable();
        if (avl == null)
            hasPieces = null;
        else
            hasPieces = avl.flags;
    } else {
        if (peer.isSeed()) {
            hasPieces = new boolean[pem.getPieces().length];
            Arrays.fill(hasPieces, true);
        } else
            hasPieces = null;
    }
    super.refresh();
}
Also used : PEPeerTransportProtocol(com.biglybt.core.peer.impl.transport.PEPeerTransportProtocol) BitFlags(com.biglybt.core.peermanager.piecepicker.util.BitFlags)

Aggregations

PEPeerTransportProtocol (com.biglybt.core.peer.impl.transport.PEPeerTransportProtocol)1 BitFlags (com.biglybt.core.peermanager.piecepicker.util.BitFlags)1