X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=ND%2FWeb%2FPages%2FRaids.pm;h=2c49a1a76cc5e4e766f1f91d28e0d43fc044f8f0;hb=37607373bbe268cc5dc741378dc51d878e8f8a9a;hp=15b8f68ec53afe5292c01e2cf510fb5efd43287a;hpb=30a9e2ee27cba724cc74ef77387a58b6c5fbdc1f;p=ndwebbie.git diff --git a/ND/Web/Pages/Raids.pm b/ND/Web/Pages/Raids.pm index 15b8f68..2c49a1a 100644 --- a/ND/Web/Pages/Raids.pm +++ b/ND/Web/Pages/Raids.pm @@ -25,7 +25,7 @@ use POSIX; use CGI qw/:standard/; use ND::Web::Include; -our @ISA = qw/ND::Web::XMLPage/; +use base qw/ND::Web::XMLPage/; $ND::Web::Page::PAGES{raids} = __PACKAGE__; @@ -195,8 +195,8 @@ 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})); - my $targetquery = $DBH->prepare(qq{SELECT r.id, r.planet, size, score, value, coords(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 + $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 LEFT OUTER JOIN covop_targets c ON p.id = c.planet @@ -247,6 +247,12 @@ sub render_body { } $target{Scans} = \@scans; + if ($planet){ + if ($planet->{x} == $target->{x}){ + $target{style} = 'incluster'; + } + } + my @roids; my @claims; my $size = $target{Size}; @@ -270,6 +276,8 @@ sub render_body { push @targets,\%target; } + @targets = sort {$b->{Roids}[0]{XP} <=> $a->{Roids}[0]{XP} or $b->{Size} <=> $a->{Size}} @targets; + $BODY->param(Targets => \@targets); }else{#list raids if we haven't chosen one yet my $query = $DBH->prepare(q{SELECT id,released_coords FROM raids WHERE open AND not removed AND