X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=scripts%2Fscans.pl;h=7f80125552b0c40481de3077b69f7044252cd937;hb=44fbe786d3049f2999a288e27bd26a13cfee86b2;hp=818be591e37d8937162fa6b98f2e3f59631d1d7a;hpb=a4b209407c81ec7b71c9c7f8c4d57bb2f77256f4;p=ndwebbie.git diff --git a/scripts/scans.pl b/scripts/scans.pl index 818be59..7f80125 100755 --- a/scripts/scans.pl +++ b/scripts/scans.pl @@ -91,6 +91,8 @@ $dbh->begin_work or die 'No transaction'; $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"; @@ -201,11 +203,13 @@ while (my $scan = $newscans->fetchrow_hashref){ 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 $@; @@ -220,6 +224,8 @@ while (my $scan = $newscans->fetchrow_hashref){ #$dbh->rollback; $dbh->commit; +system 'killall','-USR1', 'irssi' if $parsedscans; + sub addfleet { my ($name,$mission,$ships,$sender,$target,$tick,$eta,$back,$amount,$ingal) = @_;