From 1b3153d3a8a3c589c64af855627f996af4d4cb66 Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Tue, 10 Nov 2009 16:42:40 +0100 Subject: [PATCH] Add coords and type to the scan response --- Delling.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; -- 2.39.2