try{
Iterator it = Plugin.clientBlock_set.getIterator();
//System.out.println(Plugin.clientBlock_set.getSize());
while(it.hasNext()){
ClientBlock cb = (ClientBlock)it.next();
//check if the clientName is RegEx or not
if(!cb.get_isRegEx()){
//is Regular String
if(stringContains(peerClient.toLowerCase(),cb.getClientName().toLowerCase())){
//match.. so block according to the rules
//check for superseeding block
if(cb.get_isSuperseeding()){
//positive for superseeding only.. now check if torrent is superseeding
if(isSuperSeeding){
Utils.changeHits(cb.getIndex(), 1);
return cb.getColor();
//makeIPFilterRule(peerIP,peerID,peerClient,downloadName,clientList[i][6]);
}
return "null";
}else{
//check for rule for download/upload
//first see if both are postive, and if so, block the peer out right
if(cb.get_isDownloading() && cb.get_isUploading()){
//both positive, so block away
//makeIPFilterRule(peerIP,peerID,peerClient,downloadName,clientList[i][6]);
Utils.changeHits(cb.getIndex(), 1);
return cb.getColor();
}else{
//both are not positve.. so need to step through and see which one is
try {
if(downloadState == Download.ST_DOWNLOADING){
//torrent of peer is downloading
//now see if the rule is there to block it
if(cb.get_isDownloading()){
//positive for the rule, so block
//makeIPFilterRule(peerIP,peerID,peerClient,downloadName,clientList[i][6]);
Utils.changeHits(cb.getIndex(), 1);
return cb.getColor();
}
return "null";
}else if(downloadState == Download.ST_SEEDING){
//torrent of peer is seeding
//now see if the rule is there to block it
if(cb.get_isUploading()){
//positve for the rule,so block
//makeIPFilterRule(peerIP,peerID,peerClient,downloadName,clientList[i][6]);
Utils.changeHits(cb.getIndex(), 1);
return cb.getColor();
}
return "null";
}else{
return "null";
}
} catch (Exception e) {
e.printStackTrace();
return "null";
}//end of single upload or download check
}//end of upload/download check
}//end of major superseed vs up/down check
}//end of regular string match
}else{
//isRegEx
Pattern p = Pattern.compile(cb.getClientName());
Matcher m = p.matcher(peerClient);
//System.out.println("INPUT: " + peer.getClient() + " : " + "Regex: " + p.pattern() + " : " + m.matches());
if(m.find()){
//check for superseeding block
if(cb.get_isSuperseeding()){
//positive for superseeding only.. now check if torrent is superseeding
if(isSuperSeeding){
//makeIPFilterRule(peerIP,peerID,peerClient,downloadName,clientList[i][6]);
Utils.changeHits(cb.getIndex(), 1);
return cb.getColor();
}
return "null";
}else{
//check for rule for download/upload
//first see if both are postive, and if so, block the peer out right
if(cb.get_isDownloading() && cb.get_isUploading()){
//both positive, so block away
//makeIPFilterRule(peerIP,peerID,peerClient,downloadName,clientList[i][6]);
Utils.changeHits(cb.getIndex(), 1);
return cb.getColor();
}else{
//both are not positve.. so need to step through and see which one is
try {
if(downloadState == Download.ST_DOWNLOADING){
//torrent of peer is downloading
//now see if the rule is there to block it
if(cb.get_isDownloading()){
//positive for the rule, so block
//makeIPFilterRule(peerIP,peerID,peerClient,downloadName,clientList[i][6]);
Utils.changeHits(cb.getIndex(), 1);
return cb.getColor();
}else{
return "null";
}
}else if(downloadState == Download.ST_SEEDING){
//torrent of peer is seeding
//now see if the rule is there to block it
if(cb.get_isUploading()){
//positve for the rule,so block
//makeIPFilterRule(peerIP,peerID,peerClient,downloadName,clientList[i][6]);
Utils.changeHits(cb.getIndex(), 1);
return cb.getColor();
}else{
return "null";
}
}else{