$newscans->execute or die $dbh->errstr;
$dbh->pg_savepoint('scans') or die "No savepoint";
+my $parsedscans = 0;
+
while (my $scan = $newscans->fetchrow_hashref){
$dbh->pg_release('scans') or die "Couldn't save";
$dbh->pg_savepoint('scans') or die "Couldn't save";
my $id = addfleet($1,$2,$3,$planet,undef,$tick,undef,undef,$4);
$fleetscan->execute($id,$scan->{id}) or die $dbh->errstr;
}
+ } elsif($type eq 'Landing'){
} else {
- print "Something wrong with scan $scan->{id} type $type at tick $tick http://game.planetarion.com/showscan.pl?scan_id=$scan->{scan_id}";
+ print "Something wrong with scan $scan->{id} type $type at tick $tick http://game.planetarion.com/showscan.pl?scan_id=$scan->{scan_id}\n";
}
$parsedscan->execute($tick,$type,$planet,$scan->{id}) or die $dbh->errstr;
#$dbh->rollback;
+ ++$parsedscans;
};
if ($@) {
warn $@;
#$dbh->rollback;
$dbh->commit;
+system 'killall','-USR1', 'irssi' if $parsedscans;
+
sub addfleet {
my ($name,$mission,$ships,$sender,$target,$tick,$eta,$back,$amount,$ingal) = @_;