X-Git-Url: https://ruin.nu/git/?p=NDIRC.git;a=blobdiff_plain;f=Delling.pm;h=39c7cf9f65494371a17733531bbe950251fcd44b;hp=8008e810f2e9523d1bab6f91052817e56b1e9806;hb=1b3153d3a8a3c589c64af855627f996af4d4cb66;hpb=fbf88ef7c837a073498b1fc4902d7301c04ecc4e diff --git a/Delling.pm b/Delling.pm index 8008e81..39c7cf9 100644 --- a/Delling.pm +++ b/Delling.pm @@ -117,20 +117,23 @@ sub refresh { my $dbh = DB(); my $scans = $dbh->prepare(q{SELECT s.scan_id + ,coords(x,y,z),type ,array_agg(sr.nick) AS nick ,array_agg(sr.id) AS id FROM scan_requests sr JOIN scans s USING (pid,type) + JOIN current_planet_stats USING (pid) WHERE sr.time > NOW() - '30 min'::INTERVAL AND s.tick >= sr.tick AND NOT sr.sent - GROUP BY scan_id + GROUP BY scan_id,x,y,z,type }); my $sentscan = $dbh->prepare(q{UPDATE scan_requests SET sent = TRUE WHERE id = ANY($1) }); $scans->execute; while (my $scan = $scans->fetchrow_hashref){ - $heap->{irc}->yield(notice => $scan->{nick}, "http://game.planetarion.com/showscan.pl?scan_id=$scan->{scan_id}"); + $heap->{irc}->yield(notice => $scan->{nick}, "($scan->{coords} $scan->{type})" + ." http://game.planetarion.com/showscan.pl?scan_id=$scan->{scan_id}"); $sentscan->execute($scan->{id}); } return;