mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 20:17:24 +08:00
improve announce log
This commit is contained in:
@@ -52,8 +52,8 @@ class Test extends Command
|
|||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
// $r = \Illuminate\Support\Facades\Schema::getColumnListing('torrents');
|
// $r = \Illuminate\Support\Facades\Schema::getColumnListing('torrents');
|
||||||
$r = urldecode('bm9wZQ%3D%3D');
|
$r = urldecode('%b5%8f%7c%a9%85%ed%e2%bb%09%fd1%ab%8d%11%e5%11%bb%18%deD');
|
||||||
$r = base64_decode($r);
|
$r = bin2hex($r);
|
||||||
dd($r);
|
dd($r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+9
-4
@@ -79,12 +79,13 @@ $seeder = ($left == 0) ? "yes" : "no";
|
|||||||
|
|
||||||
// check passkey
|
// check passkey
|
||||||
if (!$az = $Cache->get_value('user_passkey_'.$passkey.'_content')){
|
if (!$az = $Cache->get_value('user_passkey_'.$passkey.'_content')){
|
||||||
$res = sql_query("SELECT id, downloadpos, enabled, uploaded, downloaded, class, parked, clientselect, showclienterror FROM users WHERE passkey=". sqlesc($passkey)." LIMIT 1");
|
$res = sql_query("SELECT id, downloadpos, enabled, uploaded, downloaded, class, parked, clientselect, showclienterror,passkey FROM users WHERE passkey=". sqlesc($passkey)." LIMIT 1");
|
||||||
$az = mysql_fetch_array($res);
|
$az = $currentUser = mysql_fetch_array($res);
|
||||||
$Cache->cache_value('user_passkey_'.$passkey.'_content', $az, 950);
|
$Cache->cache_value('user_passkey_'.$passkey.'_content', $az, 950);
|
||||||
}
|
}
|
||||||
if (!$az) err("Invalid passkey! Re-download the .torrent from $BASEURL");
|
if (!$az) err("Invalid passkey! Re-download the .torrent from $BASEURL");
|
||||||
$userid = intval($az['id'] ?? 0);
|
$userid = intval($az['id'] ?? 0);
|
||||||
|
$GLOBALS["CURUSER"] = $currentUser;
|
||||||
|
|
||||||
//3. CHECK IF CLIENT IS ALLOWED
|
//3. CHECK IF CLIENT IS ALLOWED
|
||||||
$clicheck_res = check_client($peer_id,$agent,$client_familyid);
|
$clicheck_res = check_client($peer_id,$agent,$client_familyid);
|
||||||
@@ -102,12 +103,16 @@ elseif ($az['showclienterror'] == 'yes'){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check torrent based on info_hash
|
// check torrent based on info_hash
|
||||||
|
$checkTorrentSql = "SELECT id, owner, sp_state, seeders, leechers, UNIX_TIMESTAMP(added) AS ts, banned FROM torrents WHERE " . hash_where("info_hash", $info_hash);
|
||||||
if (!$torrent = $Cache->get_value('torrent_hash_'.$info_hash.'_content')){
|
if (!$torrent = $Cache->get_value('torrent_hash_'.$info_hash.'_content')){
|
||||||
$res = sql_query("SELECT id, owner, sp_state, seeders, leechers, UNIX_TIMESTAMP(added) AS ts, banned FROM torrents WHERE " . hash_where("info_hash", $info_hash));
|
$res = sql_query($checkTorrentSql);
|
||||||
$torrent = mysql_fetch_array($res);
|
$torrent = mysql_fetch_array($res);
|
||||||
$Cache->cache_value('torrent_hash_'.$info_hash.'_content', $torrent, 350);
|
$Cache->cache_value('torrent_hash_'.$info_hash.'_content', $torrent, 350);
|
||||||
}
|
}
|
||||||
if (!$torrent) err("torrent not registered with this tracker");
|
if (!$torrent) {
|
||||||
|
do_log("[TORRENT NOT EXISTS] $checkTorrentSql");
|
||||||
|
err("torrent not registered with this tracker");
|
||||||
|
}
|
||||||
elseif ($torrent['banned'] == 'yes' && $az['class'] < $seebanned_class) err("torrent banned");
|
elseif ($torrent['banned'] == 'yes' && $az['class'] < $seebanned_class) err("torrent banned");
|
||||||
// select peers info from peers table for this torrent
|
// select peers info from peers table for this torrent
|
||||||
$torrentid = $torrent["id"];
|
$torrentid = $torrent["id"];
|
||||||
|
|||||||
Reference in New Issue
Block a user