X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=index.pl;h=ad5ccfb52ce27851a4279f9688c891fc6776bafc;hb=c09ad789e3b01520e8eb41cc19631099879787d2;hp=118d0332e80db9d62f3079ac00c3dca939db1c38;hpb=6fec5ae1e0a9f7c4bb1964563392f06c8f2a7bb4;p=ndwebbie.git diff --git a/index.pl b/index.pl index 118d033..ad5ccfb 100755 --- a/index.pl +++ b/index.pl @@ -66,7 +66,7 @@ while (my ($name,$attack,$gid) = $query->fetchrow()){ our $LOG = $DBH->prepare('INSERT INTO log (uid,text) VALUES(?,?)'); my $page = 'main'; -if (param('page') =~ /^(main|check|motd)$/){ +if (param('page') =~ /^(main|check|motd|points|covop|top100|launchConfirmation|addintel)$/){ $page = $1; } @@ -87,6 +87,24 @@ $TEMPLATE->param(isHC => isHC()); $TEMPLATE->param(isDC => isDC()); $TEMPLATE->param(isBC => isBC()); $TEMPLATE->param(isAttacker => $ATTACKER && (!isMember() || ((($TICK - $fleetupdate < 24) || isScanner()) && $PLANET))); +if ($ATTACKER && (!isMember() || ((($TICK - $fleetupdate < 24) || isScanner()) && $PLANET))){ + my $query = $DBH->prepare(qq{SELECT t.id, r.id AS raid, r.tick+c.wave-1 AS landingtick, released_coords, coords(x,y,z),c.launched +FROM raid_claims c + JOIN raid_targets t ON c.target = t.id + JOIN raids r ON t.raid = r.id + JOIN current_planet_stats p ON t.planet = p.id +WHERE c.uid = ? AND r.tick+c.wave > ? AND r.open AND not r.removed +ORDER BY r.tick+c.wave,x,y,z}); + $query->execute($UID,$TICK); + my @targets; + while (my $target = $query->fetchrow_hashref){ + my $coords = "Target $target->{id}"; + $coords = $target->{coords} if $target->{released_coords}; + push @targets,{Coords => $coords, Launched => $target->{launched}, Raid => $target->{raid} + , Target => $target->{id}, Tick => $target->{landingtick}}; + } + $ND::TEMPLATE->param(Targets => \@targets); +} $ND::TEMPLATE->param(BODY => $ND::BODY->output); print $TEMPLATE->output;