X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=ND%2FWeb%2FXMLPage.pm;h=9e5fce64f846f32f6e11e25a370ca3509bf31d84;hb=4aa8043871fac60e6a5038489f6bc05ab2f3bd78;hp=b7e70151488fe02f7d40c349e13aa8fe0c0e0fb5;hpb=c5cc1151b5a4f1e52eb577a78df1f79dfdc193db;p=ndwebbie.git diff --git a/ND/Web/XMLPage.pm b/ND/Web/XMLPage.pm index b7e7015..9e5fce6 100644 --- a/ND/Web/XMLPage.pm +++ b/ND/Web/XMLPage.pm @@ -39,7 +39,8 @@ sub process : method { sub listTargets () : method { my $self = shift; my $DBH = $self->{DBH}; - 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,c.wave,c.joinable + my $query = $DBH->prepare(qq{SELECT t.id, r.id AS raid, r.tick+c.wave-1 AS landingtick, + (released_coords AND old_claim(timestamp)) AS released_coords, coords(x,y,z),c.launched,c.wave,c.joinable FROM raid_claims c JOIN raid_targets t ON c.target = t.id JOIN raids r ON t.raid = r.id @@ -54,7 +55,7 @@ ORDER BY r.tick+c.wave,x,y,z}); push @targets,{Coords => $coords, Launched => $target->{launched}, Raid => $target->{raid} , Target => $target->{id}, Tick => $target->{landingtick}, Wave => $target->{wave} , AJAX => $self->{AJAX}, JoinName => $target->{joinable} ? 'N' : 'J' - , Joinable => $target->{joinable} ? 'FALSE' : 'TRUE'}; + , Joinable => $target->{joinable} ? 'FALSE' : 'TRUE', JoinableTitle => $target->{joinable} ? 'Disable join' : 'Make target joinable'}; } my $template = HTML::Template->new(filename => "templates/targetlist.tmpl", cache => 1); $template->param(Targets => \@targets); @@ -116,7 +117,7 @@ sub render : method { $template->param(isHC => $self->isHC); $template->param(isDC => $self->isDC()); $template->param(isBC => $self->isBC()); - $template->param(isIntel => $self->isBC()); + $template->param(isIntel => $self->isIntel()); $template->param(isAttacker => $ATTACKER && (!$self->isMember() || ((($TICK - $fleetupdate < 24) || $self->isScanner()) && $self->{PLANET}))); if ($ATTACKER && (!$self->isMember() || ((($TICK - $fleetupdate < 24) || $self->isScanner()) && $self->{PLANET}))){ $template->param(Targets => $self->listTargets); @@ -129,6 +130,7 @@ sub render : method { $template->param(Error => $ND::ERROR); $template->param(BODY => $body->output); my $output = $template->output; + $output =~ s/[^\x{9}\x{A}\x{D}\x{20}-\x{D7FF}\x{E000}-\x{FFFD}\x{10000}-\x{10FFFF}]//g; print header(-type=> $type, -charset => 'utf-8', -Content_Length => length $output); print $output; };