]> ruin.nu Git - NDIRC.git/blobdiff - Members.pm
use float to not get integer overflow
[NDIRC.git] / Members.pm
index e60ecde6820886bfa35f0dc04f8d98ad75dd42c2..05b7ac701103fd593abf74a19869faee5f54ce29 100644 (file)
@@ -28,18 +28,16 @@ our @ISA = qw/Exporter/;
 our @EXPORT = qw/currentCalls showraids checkPoints findSMS/;
 
 sub currentCalls {
-       my ($verbose) = @_;
-       DB();
+       my ($msg, $command) = @_;
        if (1){ #TODO: add check for member
                my $f = $ND::DBH->prepare(<<SQL
-       SELECT (c.landing_tick - tick()) AS eta, concat(i.shiptype||'/') AS shiptype, dc.username,p.x
+       SELECT (c.landing_tick - tick()) AS eta, concat(i.shiptype||'/') AS shiptype, dc.username
        FROM calls c 
                JOIN incomings i ON i.call = c.id
                LEFT OUTER JOIN users dc ON dc.uid = c.dc
                JOIN users u ON u.uid = c.member
-               JOIN current_planet_stats p ON u.planet = p.id
        WHERE open AND (c.landing_tick - tick()) >= 7
-       GROUP BY c.id,c.landing_tick,dc.username,p.x
+       GROUP BY c.id,c.landing_tick,dc.username
        ORDER BY c.landing_tick;
 SQL
 );
@@ -48,17 +46,16 @@ SQL
                while (my @row = $f->fetchrow()){
                        chop($row[1]);
                        my $dc = defined $row[2] ? $row[2] : '';
-                       $calls .= " (Anti $row[1] ETA: $row[0] Cluster: $row[3] DC: $dc) |"
+                       $calls .= " (Anti $row[1] ETA: $row[0] DC: $dc) |"
                }
                chop($calls);
-               if (defined $verbose || length $calls > 0){
+               if (defined $command || length $calls > 0){
                        $ND::server->command("msg $ND::target Current calls: $calls");
                }
        }
 }
 
 sub showraids {
-       DB();
        if (1){ #TODO: add check for member
                my $f = $ND::DBH->prepare(<<SQL
        SELECT id FROM raids 
@@ -78,8 +75,7 @@ SQL
 }
 
 sub checkPoints {
-       my ($nick) = @_;
-       DB();
+       my ($nick,$command) = @_;
        my $f;
        if ($nick){
                if (officer() || dc() || bc()){