Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   TBDev (http://www.bvlist.com/forumdisplay.php?f=20)
-   -   H&R on incompleted set (http://www.bvlist.com/showthread.php?t=11982)

Tedmorris 1st May 2019 07:15

H&R on incompleted set
 
Does anyone have their H&R modded to include incomplete torrent package sets? For example a user downloads only half a 50gb torrent set but isnt flagged as H&R due to the torrent not being finished. So $a['finished'] == 'yes' is removed from the below line of code.

PHP Code:

 //=== only run the function if the ratio is below 1
 
if( ($a['uploaded'] + $upthis) < ($a['downloaded'] + $downthis) && $a['finished'] == 'yes'

However now the user cant meet the seed time due to no seed time being recorded in the snatched table as only leech time will be recorded until the torrent is finished.

PHP Code:

 $HnR_time_seeded = ($a['seedtime'] + $self['announcetime']); 


Napon 1st May 2019 08:32

lol install the mod proper then it will work your taking code out so how do you think its going work no lol TBDev 09 crap

Tedmorris 1st May 2019 08:43

Its installed properly m8. H&R doesnt time stamp the entry unless the torrents finished which in this case its not going to work on incompleted torrent package sets.

Napon 1st May 2019 10:10

ok post files up ill look

Tedmorris 1st May 2019 11:18

The orignal mod as im sure you know uses snatched mod which works great however the H&R mod was never designed to time stamp seedtime for incompleted torrent sets as the user will always be listed as a leecher due to the torrent not being completed.

PHP Code:

$announcetime = ($self["seeder"] == "yes" "seedtime = seedtime + $self[announcetime]"leechtime = leechtime + $self[announcetime]"); 

I think $announcetime would need to be modified otherwise its just going to add leechtime.

PHP Code:

 if (isset($self) && $event == "stopped") {
$seeded 'no';
mysql_query("DELETE FROM peers WHERE $selfwhere") or err("D Err");

 
//===09 sir_snuggles hit and run
 
$res_snatch mysql_query("SELECT seedtime, uploaded, downloaded, finished, start_date AS start_snatch FROM snatched WHERE torrentid = $torrentid AND userid = {$user['id']}") or err('Snatch Error 1');
 
$a mysql_fetch_array($res_snatch);
 
//=== only run the function if the ratio is below 1
 
if( ($a['uploaded'] + $upthis) < ($a['downloaded'] + $downthis) && $a['finished'] == 'yes')
 {
 
$HnR_time_seeded = ($a['seedtime'] + $self['announcetime']);
 
//=== get times per class
 
switch (true)
 { 
 
//=== user
 
case ($user['class'] < UC_POWER_USER):
 
$days_3 2*86400//== 2 days
 
$days_14 2*86400//== 2 days
 
$days_over_14 86400//== 1 day
 
break;
 
//=== poweruser
 
case ($user['class'] == UC_POWER_USER):
 
$days_3 129600//== 36 hours
 
$days_14 129600//== 36 hours
 
$days_over_14 64800//== 18 hours
 
break;
 
//=== vip / donor?
 
case ($user['class'] == UC_VIP):
 
$days_3 129600//== 36 hours
 
$days_14 86400//== 24 hours
 
$days_over_14 43200//== 12 hours
 
break;
 
//=== uploader / staff and above (we don't need this for uploaders now do we?
 
case ($user['class'] >= UC_UPLOADER):
 
$days_3 43200//== 12 hours
 
$days_14 43200//== 12 hours
 
$days_over_14 43200//== 12 hours
 
break;
 }

 switch(
true
 {
 case ((
$a['start_snatch'] - $torrent['ts']) < 7*86400):
 
$minus_ratio = ($days_3 $HnR_time_seeded);
 break;
 case ((
$a['start_snatch'] - $torrent['ts']) < 21*86400):
 
$minus_ratio = ($days_14 $HnR_time_seeded);
 break;
 case ((
$a['start_snatch'] - $torrent['ts']) >= 21*86400):
 
$minus_ratio = ($days_over_14 $HnR_time_seeded);
 break;
 }
 
$hit_and_run = (($minus_ratio && ($a['uploaded'] + $upthis) < ($a['downloaded'] + $downthis)) ? ", seeder='no', hit_and_run= '".TIME_NOW."'" ", hit_and_run = '0'");
 } 
//=== end if not 1:1 ratio
 
else
 
$hit_and_run ", hit_and_run = '0'";
 
//=== end hit and run
 
if (mysql_affected_rows()) {
 
$updateset[] = ($self["seeder"] == "yes" "seeders = seeders - 1" "leechers = leechers - 1");
 
mysql_query("UPDATE snatched SET ip = ".sqlesc($ip).", port = $port, connectable = '$connectable', uploaded = uploaded + $upthis, downloaded = downloaded + $downthis, to_go = $left, upspeed = $upspeed, downspeed = $downspeed$announcetime, last_action = ".TIME_NOW.", seeder = '$seeder', agent = ".sqlesc($agent).$hit_and_run WHERE torrentid = $torrentid AND userid = {$user['id']}") or err("SL Err 1");
 } 


Napon 1st May 2019 23:25

yes mate ive got this in mysqli PHP7 so ill do some test on it add some code or remove some see what i can do

Tedmorris 2nd May 2019 05:27

Cheers..ive got it in php 7 mysqli also


All times are GMT +2. The time now is 17:55.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.