use ND::Include;
use NDIRC::Access;
use NDIRC::Misc;
+use CGI qw/:standard/;
require Exporter;
our @ISA = qw/Exporter/;
-our @EXPORT = qw/showCall setType takeCall covCall ignoreCall defcall anon setDefPrio/;
+our @EXPORT = qw/showCall setType takeCall covCall ignoreCall
+ defcall anon setDefPrio setCalc getCalc/;
sub showCall {
my ($msg,$command) = @_;
});
$fleet->execute($id);
}
+ $type = escapeHTML($type);
while (my ($id,$call,$oldtype,$coords,$tick) = $fleet->fetchrow()){
if($ND::DBH->do(q{UPDATE incomings SET shiptype = ? WHERE id = ?},undef,$type,$id) == 1){
def_log $user->{uid}, $call , "Set fleet: [B] $id [/B] to: [B] $type [/B]";
}
}
+sub setCalc {
+ my ($msg,$command) = @_;
+ my ($id, $calc);
+ if (defined $msg && $msg =~ /^(\d+) (.+)$/){
+ $id = $1;
+ $calc = escapeHTML($2);
+ }else{
+ $ND::server->command("notice $ND::nick Usage: $command callid calc");
+ return;
+ }
+ if (my $user = dc()){
+ if ($ND::DBH->do(q{UPDATE calls SET calc = $2 WHERE id = $1}
+ ,undef,$id, $calc) == 1){
+ $ND::server->command("notice $ND::nick Updated calc call $ND::B$id$ND::O");
+ def_log $user->{uid}, $id , 'Updated calc to: [URL]'
+ .$calc.'[/URL]';
+ }
+ }
+}
+
+sub getCalc {
+ my ($msg,$command) = @_;
+ my ($id);
+ if (defined $msg && $msg =~ /^(\d+)$/){
+ $id = $1;
+ }else{
+ $ND::server->command("notice $ND::nick Usage: $command callid");
+ return;
+ }
+ if (my $user = dc()){
+ my $calc = $ND::DBH->selectrow_array(q{SELECT calc
+ FROM calls WHERE id = $1}
+ ,undef,$id);
+ $ND::server->command("notice $ND::nick calc for call $ND::B$id$ND::O: $calc");
+ }
+}
sub setDefPrio {
my ($msg,$command) = @_;