原帖由 ljl_ch 于 2005-12-22 23:51 发表
BT的工作模式是,有一台服务器联系下载者与被下载者,只有那台服务器才有种子数和下载者数。
但如果服务器限制的话,就很难读出种子和下载数。
而文件信息是制作种子时存在种子文件里的,这个用PHP语言 ...
能不能把discuz论坛做为BT服务器
https://sourceforge.net/project/showfiles.php?group_id=153513
The tbsource code is used for the building and running of a PHP/mysql based Bittorrent tracker.
这个英文开放资源做 BT tracker的程序可以结合论坛。
--
-- Table structure for table `files`
--
CREATE TABLE files (
id int(10) unsigned NOT NULL auto_increment,
torrent int(10) unsigned NOT NULL default '0',
filename varchar(255) NOT NULL default '',
size bigint(20) unsigned NOT NULL default '0',
PRIMARY KEY (id),
KEY torrent (torrent)
) TYPE=MyISAM;
--
-- Table structure for table `peers`
--
CREATE TABLE peers (
id int(10) unsigned NOT NULL auto_increment,
torrent int(10) unsigned NOT NULL default '0',
peer_id varchar(20) binary NOT NULL default '',
ip varchar(64) NOT NULL default '',
port smallint(5) unsigned NOT NULL default '0',
uploaded bigint(20) unsigned NOT NULL default '0',
downloaded bigint(20) unsigned NOT NULL default '0',
to_go bigint(20) unsigned NOT NULL default '0',
seeder enum('yes','no') NOT NULL default 'no',
started datetime NOT NULL default '0000-00-00 00:00:00',
last_action datetime NOT NULL default '0000-00-00 00:00:00',
connectable enum('yes','no') NOT NULL default 'yes',
userid int(10) unsigned NOT NULL default '0',
agent varchar(60) NOT NULL default '',
finishedat int(10) unsigned NOT NULL default '0',
downloadoffset bigint(20) unsigned NOT NULL default '0',
uploadoffset bigint(20) unsigned NOT NULL default '0',
passkey varchar(32) NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY torrent_peer_id (torrent,peer_id),
KEY torrent (torrent),
KEY torrent_seeder (torrent,seeder),
KEY last_action (last_action),
KEY connectable (connectable),
KEY userid (userid)
) TYPE=MyISAM;
--
-- Table structure for table `torrents`
--
CREATE TABLE torrents (
id int(10) unsigned NOT NULL auto_increment,
info_hash varchar(20) binary NOT NULL default '',
name varchar(255) NOT NULL default '',
filename varchar(255) NOT NULL default '',
save_as varchar(255) NOT NULL default '',
search_text text NOT NULL,
descr text NOT NULL,
ori_descr text NOT NULL,
category int(10) unsigned NOT NULL default '0',
size bigint(20) unsigned NOT NULL default '0',
added datetime NOT NULL default '0000-00-00 00:00:00',
type enum('single','multi') NOT NULL default 'single',
numfiles int(10) unsigned NOT NULL default '0',
comments int(10) unsigned NOT NULL default '0',
views int(10) unsigned NOT NULL default '0',
hits int(10) unsigned NOT NULL default '0',
times_completed int(10) unsigned NOT NULL default '0',
leechers int(10) unsigned NOT NULL default '0',
seeders int(10) unsigned NOT NULL default '0',
last_action datetime NOT NULL default '0000-00-00 00:00:00',
visible enum('yes','no') NOT NULL default 'yes',
banned enum('yes','no') NOT NULL default 'no',
owner int(10) unsigned NOT NULL default '0',
numratings int(10) unsigned NOT NULL default '0',
ratingsum int(10) unsigned NOT NULL default '0',
nfo text NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY info_hash (info_hash),
KEY owner (owner),
KEY visible (visible),
KEY category_visible (category,visible),
FULLTEXT KEY ft_search (search_text,ori_descr)
) TYPE=MyISAM;
[ 本帖最后由 bonusboy29 于 2005-12-23 09:39 编辑 ] |