From: Michael Andreen Date: Fri, 20 Feb 2009 20:11:42 +0000 (+0100) Subject: Support listing of just some types of scan requests X-Git-Url: https://ruin.nu/git/?a=commitdiff_plain;h=d3b8ab262dabafff6f4b26862196040721333ecd;p=NDIRC.git Support listing of just some types of scan requests --- diff --git a/Scans.pm b/Scans.pm index 146efea..038286b 100644 --- a/Scans.pm +++ b/Scans.pm @@ -164,6 +164,13 @@ sub scanReqs { if (scanner()){ + my @notype; + if ($msg && $msg =~ /-([pdunja]+)/){ + for (split //, $1){ + push @notype, $scantypes[$scanid{$_}-1]; + } + } + my $reqs = $ND::DBH->prepare(q{SELECT min(sr.id) AS id, x,y,z,type FROM scan_requests sr JOIN current_planet_stats p ON p.id = sr.planet @@ -173,10 +180,11 @@ sub scanReqs { AND type = sr.type AND tick >= sr.tick ) + AND type <> ALL($1) GROUP BY x,y,z,type ORDER BY id }); - $reqs->execute; + $reqs->execute(\@notype); my $text = ''; while (my $req = $reqs->fetchrow_hashref){ $text .= "$ND::B$req->{id}$ND::O http://game.planetarion.com/waves.pl?id=$scantypes{$req->{type}}&x=$req->{x}&y=$req->{y}&z=$req->{z} "