#**************************************************************************/
use strict;
+use warnings FATAL => 'all';
+no warnings qw(uninitialized);
use POSIX;
our $BODY;
our $DBH;
my $query = $DBH->prepare(intelquery('o.alliance AS oalliance,coords(o.x,o.y,o.z) AS origin',"t.id = ? $showticks"));
$query->execute($planet->{id}) or $error .= $DBH->errstr;
my @intellists;
- my @intel;
+ my @incomings;
my $i = 0;
while (my $intel = $query->fetchrow_hashref){
if ($intel->{ingal}){
}else{
$intel->{missionclass} = $intel->{mission};
}
- $intel->{ODD} = $i % 2;
- push @intel,$intel;
$i++;
+ $intel->{ODD} = $i % 2;
+ push @incomings,$intel;
}
- push @intellists,{Message => 'Incoming fleets', Intel => \@intel, Origin => 1};
+ push @intellists,{Message => 'Incoming fleets', Intel => \@incomings, Origin => 1};
- my $query = $DBH->prepare(intelquery('t.alliance AS talliance,coords(t.x,t.y,t.z) AS target',"o.id = ? $showticks"));
+ $query = $DBH->prepare(intelquery('t.alliance AS talliance,coords(t.x,t.y,t.z) AS target',"o.id = ? $showticks"));
$query->execute($planet->{id}) or $error .= $DBH->errstr;
- my @intel;
- my $i = 0;
+ my @outgoings;
+ $i = 0;
while (my $intel = $query->fetchrow_hashref){
if ($intel->{ingal}){
$intel->{missionclass} = 'ingal';
}else{
$intel->{missionclass} = $intel->{mission};
}
- $intel->{ODD} = $i % 2;
- push @intel,$intel;
$i++;
+ $intel->{ODD} = $i % 2;
+ push @outgoings,$intel;
}
- push @intellists,{Message => 'Outgoing Fleets', Intel => \@intel, Target => 1};
+ push @intellists,{Message => 'Outgoing Fleets', Intel => \@outgoings, Target => 1};
$BODY->param(IntelLIsts => \@intellists);
}else{
$intel->{missionclass} = $intel->{mission};
}
+ $i++;
$intel->{ODD} = $i % 2;
push @intel,$intel;
- $i++;
}
push @intellists,{Message => q{Intel where alliances doesn't match}, Intel => \@intel, Origin => 1, Target => 1};
$BODY->param(IntelLIsts => \@intellists);