Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev
Reply
  #1  
Old 1st May 2019, 07:15
Tedmorris Tedmorris is offline
Senior Member
 
Join Date: Sep 2017
Posts: 62
Default 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']); 
Reply With Quote
  #2  
Old 1st May 2019, 08:32
Napon Napon is offline
Banned
 
Join Date: Feb 2016
P2P
Posts: 522
Default
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
Reply With Quote
  #3  
Old 1st May 2019, 08:43
Tedmorris Tedmorris is offline
Senior Member
 
Join Date: Sep 2017
Posts: 62
Default
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.
Reply With Quote
  #4  
Old 1st May 2019, 10:10
Napon Napon is offline
Banned
 
Join Date: Feb 2016
P2P
Posts: 522
Default
ok post files up ill look
Reply With Quote
  #5  
Old 1st May 2019, 11:18
Tedmorris Tedmorris is offline
Senior Member
 
Join Date: Sep 2017
Posts: 62
Default
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");
 } 
Reply With Quote
  #6  
Old 1st May 2019, 23:25
Napon Napon is offline
Banned
 
Join Date: Feb 2016
P2P
Posts: 522
Default
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
Reply With Quote
  #7  
Old 2nd May 2019, 05:27
Tedmorris Tedmorris is offline
Senior Member
 
Join Date: Sep 2017
Posts: 62
Default
Cheers..ive got it in php 7 mysqli also
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 11:53. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.