]> ruin.nu Git - ndwebbie.git/blobdiff - ND/Web/Pages/Raids.pm
better parsing
[ndwebbie.git] / ND / Web / Pages / Raids.pm
index 4af8631b612fb28fcb8facf49536baab39671a31..c46571288cd3c836d8135ebdcb9e7506fe91b5dd 100644 (file)
@@ -19,7 +19,7 @@
 
 package ND::Web::Pages::Raids;
 use strict;
-use warnings FATAL => 'all';
+use warnings;
 use ND::Include;
 use POSIX;
 use CGI qw/:standard/;
@@ -178,7 +178,7 @@ sub render_body {
                return $self->generateClaimXml($BODY,$raid,$from);
        }
        if ($self->{XML} && param('cmd') eq 'gettargets' ){
-               $_ = listTargets();
+               $_ = $self->listTargets();
                $BODY->param(TargetList => $_);
        }
 
@@ -195,7 +195,7 @@ sub render_body {
                        $noingal = "AND NOT (x = $planet->{x} AND y = $planet->{y})";
                }
                $BODY->param(Message => parseMarkup($raid->{message}));
-               $BODY->param(LandingTick => parseMarkup($raid->{tick}));
+               $BODY->param(LandingTick => $raid->{tick});
                my $targetquery = $DBH->prepare(qq{SELECT r.id, r.planet, size, score, value, p.x,p.y,p.z, race, p.value - p.size*200 -coalesce(c.metal+c.crystal+c.eonium,0)/150 - coalesce(c.structures,(SELECT avg(structures) FROM covop_targets)::int)*1500 AS fleetvalue,(c.metal+c.crystal+c.eonium)/100 AS resvalue, comment
                        FROM current_planet_stats p 
                        JOIN raid_targets r ON p.id = r.planet 
@@ -224,7 +224,7 @@ sub render_body {
                        $target{comment} = parseMarkup($target->{comment}) if ($target->{comment});
 
                        my $scans = $DBH->prepare(q{SELECT DISTINCT ON (type) type, tick, scan FROM scans 
-                               WHERE planet = ? AND type ~ 'Unit|Planet|Military|.* Analysis' AND tick + 24 > tick()
+                               WHERE planet = ? AND type ~ 'Unit|Planet|Military|.* Analysis' AND tick + 24 > tick() AND scan is not null
                                GROUP BY type, tick, scan ORDER BY type ,tick DESC});
                        $scans->execute($target->{planet});
                        my %scans;
@@ -237,7 +237,7 @@ sub render_body {
                                next unless exists $scans{$type};
                                my $scan = $scans{$type};
                                if ($self->{TICK} - $scan->{tick} > 5){
-                                       $scan->{scan} =~ s{<table( cellpadding="\d+")?>}{<table$1 class="old">};
+                                       $scan->{scan} =~ s{<table( cellpadding="\d+")?>}{<table class="old">};
                                }
                                if ($type eq 'Planet'){
                                        $target{PlanetScan} = $scan->{scan};