Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
Ratio explication
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Support

2023-04-16 16:06:11
It's a bit of a basic question, but can someone explain to me exactly how to set the ratio?
In the config.php file we have several sections to configure the ratio...

$site_config['MEMBERSONLY_WAIT'] = true;					//ENABLE WAIT TIMES FOR BAD RATIO


//WAIT TIME VARS
$site_config['WAIT_CLASS'] = '1,2'; //Classes wait time applies to, comma seperated
$site_config['GIGSA'] = '1'; //Minimum gigs
$site_config['RATIOA'] = '0.50'; //Minimum ratio
$site_config['WAITA'] = '24'; //If neither are met, wait time in hours

$site_config['GIGSB'] = '3'; //Minimum gigs
$site_config['RATIOB'] = '0.65'; //Minimum ratio
$site_config['WAITB'] = '12'; //If neither are met, wait time in hours

$site_config['GIGSC'] = '5'; //Minimum gigs
$site_config['RATIOC'] = '0.80'; //Minimum ratio
$site_config['WAITC'] = '6'; //If neither are met, wait time in hours

$site_config['GIGSD'] = '7'; //Minimum gigs
$site_config['RATIOD'] = '0.95'; //Minimum ratio
$site_config['WAITD'] = '2'; //If neither are met, wait time in hours


and


//AUTO RATIO WARNING
$site_config["ratiowarn_enable"] = true; //Enable/Disable auto ratio warning
$site_config["ratiowarn_minratio"] = 0.5; //Min Ratio
$site_config["ratiowarn_mingigs"] = 2;  //Min GB Downloaded
$site_config["ratiowarn_daystowarn"] = 60; //Days to ban


But I don't understand exactly how time periods work. What does "classes wait time" mean, the minimum ratio and the minimum gigabytes.

For example, if I want a user to be able to download twice as many gigabytes as he has uploaded, I understand that the ratio is 0.5. But how exactly is this ratio configured in config.php and how do I interpret the time periods?
2023-04-16 16:15:41
Very old. A good design doesnt need any of those ratio fields in config.php at all. A good design automates and manages criteria and peer privileges'.

I think it hung around for V3 and I dont know what they do on MVC version. Never used those options myself as I never needed to. I wouldn't be too pressed on configuring them.
2023-04-16 16:27:46
But then, how can I make a user have download limits based on the number of bytes uploaded? I want to establish download limits depending on the ratio.
Last edited by dranivil on 2023-04-16 16:28:30
2023-04-16 21:36:02
@dranivil
I would like to ask you a counter question:
What is your knowledge of the script, honestly?


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
2023-04-16 21:52:17
@botanicar

What I deduce from the code that I observe.
2023-04-17 14:21:35
Thats good for learning the code, as how I have learned by just reviewing and following (it took years) but you must understand the principles in how peers behave and the rules they typically follow in most day to day trackers.
2023-04-18 17:41:02
I know a little bit about how p2p systems work, but really when I saw the "waiting times" functionality in the code, I thought that this tracker has some system to establish times based on the uploaded size. Really before I ask anything here I google quite a bit, but there isn't any documentation on this type of script anywhere.
2023-04-20 17:44:35
$site_config['WAIT_CLASS'] = '1,2'; //Classes wait time applies to, comma seperated
$site_config['GIGSA'] = '1'; //Minimum gigs
$site_config['RATIOA'] = '0.50'; //Minimum ratio
$site_config['WAITA'] = '24'; //If neither are met, wait time in hours


this for for forcing users to wait example
groups 1 & 2 with 1 gb (sum of uploaded) & ratio below 0.50 have to wait 24 hours
if you go to config and check ,wait is added it will show on index
$site_config["torrenttable_columns"] = "category,name,dl,uploader,comments,size,seeders,leechers,health,external";


the other section is for banning (although the script just sends a warning & message)

documentation is awful for torrenting, i keep meaning to start a wiki/guide here which will come & experience users can share they knowledge - github is the best place & the bittorrent specification site which explains the protocols and list the BEPS updates

the ratio itself is just a calculation of upload / download




2023-04-21 07:31:43
Thank you, I think I have understood.
2023-04-22 00:36:14
You can do different things in your script.

For example, grant a peer 2GB for every 2GB they downloaded.


if (($downloaded>= 1073741824)) {
 $bonus = $downloaded/ 2;
 $bytes = intval($bonus - 0.5 * 1073741824);
 $earned = max($bytes, 0) * 2;

if ($earned > 0) {
   $grant = SQL_Query_exec("UPDATE users SET uploaded = uploaded + $earned WHERE id = " . $userid);
   if ($grant) {
     // Send a message to shoutbox?
   }
}


Just mess around and confirm the calculations are correct. This math is fast.
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728