X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=Def.pm;fp=Def.pm;h=0000000000000000000000000000000000000000;hb=5f3e2c69d303e9196a76dd10607b595cac6658a8;hp=b8dc386ba21f8d09fa48cd3c9e742a7f74026c30;hpb=4a4767265bc5003e9442d52c904869a21a42983e;p=NDIRC.git diff --git a/Def.pm b/Def.pm deleted file mode 100644 index b8dc386..0000000 --- a/Def.pm +++ /dev/null @@ -1,84 +0,0 @@ -#************************************************************************** -# Copyright (C) 2006 by Michael Andreen * -# * -# This program is free software; you can redistribute it and/or modify * -# it under the terms of the GNU General Public License as published by * -# the Free Software Foundation; either version 2 of the License, or * -# (at your option) any later version. * -# * -# This program is distributed in the hope that it will be useful, * -# but WITHOUT ANY WARRANTY; without even the implied warranty of * -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -# GNU General Public License for more details. * -# * -# You should have received a copy of the GNU General Public License * -# along with this program; if not, write to the * -# Free Software Foundation, Inc., * -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * -#**************************************************************************/ -package NDIRC::Def; -use strict; -use warnings; -use ND::DB; -use ND::Include; -use NDIRC::Access; -use NDIRC::Misc; -use CGI qw/:standard/; -require Exporter; - -our @ISA = qw/Exporter/; - -our @EXPORT = qw/showCall - setDefPrio/; - -sub showCall { - my ($msg,$command) = @_; - my ($id); - if (defined $msg && $msg =~ /^(\d+)$/){ - $id = $1; - }else{ - $ND::server->command("notice $ND::nick Usage: $command callid"); - return; - } - if (dc()){ - my $f = $ND::DBH->prepare(<execute($id); - while (my @row = $f->fetchrow()){ - @row = map (valuecolor(0),@row); - $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]"); - } - } -} - -sub setDefPrio { - my ($msg,$command) = @_; - my ($min,$max); - if (defined $msg && $msg =~ /^(\d+)\D(\d+)$/){ - $min = $1; - $max = $2; - }else{ - $ND::server->command("notice $ND::nick Usage: $command Min Max"); - return; - } - if (hc()){ - $ND::DBH->begin_work; - my $update = $ND::DBH->prepare('UPDATE misc SET value = ? :: int WHERE id = ?'); - $update->execute($min,'DEFMIN'); - $update->execute($max,'DEFMAX'); - if ($ND::DBH->commit){ - $ND::server->command("msg $ND::target min def prio set to $ND::B$min$ND::B and max set to $ND::B$max"); - }else{ - $ND::server->command("msg $ND::target something went wrong"); - } - } -} - -1;