]> ruin.nu Git - NDIRC.git/commitdiff
Support listing of just some types of scan requests
authorMichael Andreen <harv@ruin.nu>
Fri, 20 Feb 2009 20:11:42 +0000 (21:11 +0100)
committerMichael Andreen <harv@ruin.nu>
Fri, 20 Feb 2009 20:11:42 +0000 (21:11 +0100)
Scans.pm

index 146efeaf5ae25c0bc0a01824c921ea28fa90dc7c..038286ba43f7be62179c80728c693eeeb401e810 100644 (file)
--- 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} "