1 #**************************************************************************
2 # Copyright (C) 2006 by Michael Andreen <harvATruinDOTnu> *
4 # This program is free software; you can redistribute it and/or modify *
5 # it under the terms of the GNU General Public License as published by *
6 # the Free Software Foundation; either version 2 of the License, or *
7 # (at your option) any later version. *
9 # This program is distributed in the hope that it will be useful, *
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 # GNU General Public License for more details. *
14 # You should have received a copy of the GNU General Public License *
15 # along with this program; if not, write to the *
16 # Free Software Foundation, Inc., *
17 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 #**************************************************************************/
26 use CGI qw/:standard/;
29 our @ISA = qw/Exporter/;
31 our @EXPORT = qw/showCall
35 my ($msg,$command) = @_;
37 if (defined $msg && $msg =~ /^(\d+)$/){
40 $ND::server->command("notice $ND::nick Usage: $command callid");
44 my $f = $ND::DBH->prepare(<<SQL
45 SELECT i.id,coords(p.x,p.y,p.z), p.planet_status,p.nick, p.alliance, p.race,i.eta,i.amount,i.fleet,i.shiptype,p.relationship,c.landing_tick - (SELECT value::integer FROM misc WHERE id = 'TICK')
47 JOIN calls c ON i.call = c.id
48 JOIN current_planet_stats p ON i.sender = p.id
54 while (my @row = $f->fetchrow()){
55 @row = map (valuecolor(0),@row);
56 $ND::server->command("notice $ND::nick (CALL $id) $row[0]: $row[1], $row[3] ($row[2]), $row[4] ($row[10]), $row[5], ETA: $row[11](/$row[6]), Amount: $row[7], $row[8], Type: $row[9]");
62 my ($msg,$command) = @_;
64 if (defined $msg && $msg =~ /^(\d+)\D(\d+)$/){
68 $ND::server->command("notice $ND::nick Usage: $command Min Max");
73 my $update = $ND::DBH->prepare('UPDATE misc SET value = ? :: int WHERE id = ?');
74 $update->execute($min,'DEFMIN');
75 $update->execute($max,'DEFMAX');
76 if ($ND::DBH->commit){
77 $ND::server->command("msg $ND::target min def prio set to $ND::B$min$ND::B and max set to $ND::B$max");
79 $ND::server->command("msg $ND::target something went wrong");