From: Michael Andreen Date: Tue, 22 Jan 2008 08:14:30 +0000 (+0100) Subject: Use def_log for defcall loggin X-Git-Url: https://ruin.nu/git/?a=commitdiff_plain;h=094c16b1d21e4b336d9e791d52ad91493078cd9f;p=NDIRC.git Use def_log for defcall loggin --- diff --git a/Def.pm b/Def.pm index a21a17d..e9647d6 100644 --- a/Def.pm +++ b/Def.pm @@ -98,7 +98,7 @@ sub setType { }elsif (defined $x){ $fleet = $ND::DBH->prepare(qq{ $query - WHERE i.call = ? AND p.id = planetid(?,?,?,0) + WHERE i.call = ? AND p.id = planetid(?,?,?,tick()) }); $fleet->execute($id,$x,$y,$z); }else{ @@ -110,7 +110,7 @@ sub setType { } while (my ($id,$call,$oldtype,$coords,$tick) = $fleet->fetchrow()){ if($ND::DBH->do(q{UPDATE incomings SET shiptype = ? WHERE id = ?},undef,$type,$id) == 1){ - log_message $user->{uid}, "DC set fleet: $id to: $type"; + def_log $user->{uid}, $call , "Set fleet: [B] $id [/B] to: [B] $type [/B]"; $ND::server->command("msg $ND::target Set fleet from $coords on call $call to $type (previously $oldtype)"); if ($tick < 0 && not (defined $x && $x eq 'call')){ $ND::server->command("msg $ND::target This call is old, did you use the call id, instead of inc id by accident? You can use .settypeall callid to set the type on all incs in a call."); @@ -128,10 +128,11 @@ sub takeCall { $ND::server->command("notice $ND::nick Usage: $command callid"); return; } - if (dc()){ + if (my $user = dc()){ if ($ND::DBH->do(q{UPDATE calls SET dc = (SELECT uid FROM users WHERE hostmask ILIKE ?) WHERE id = ?} ,undef,$ND::address,$id) == 1){ $ND::server->command("msg $ND::target Updated the DC for call $id"); + def_log $user->{uid}, $id , "Used: [B] $command [/B]"; } } } @@ -145,10 +146,11 @@ sub covCall { $ND::server->command("notice $ND::nick Usage: $command callid"); return; } - if (dc()){ + if (my $user = dc()){ if($ND::DBH->do(q{UPDATE calls SET dc = (SELECT uid FROM users WHERE hostmask ILIKE ?), covered = TRUE, open = FALSE WHERE id = ?} ,undef,$ND::address,$id) == 1){ $ND::server->command("msg $ND::target Marked call $id as covered"); + def_log $user->{uid}, $id , "Used: [B] $command [/B]"; } } } @@ -162,10 +164,11 @@ sub ignoreCall { $ND::server->command("notice $ND::nick Usage: $command callid"); return; } - if (dc()){ + if (my $user = dc()){ if($ND::DBH->do(q{UPDATE calls SET dc = (SELECT uid FROM users WHERE hostmask ILIKE ?), covered = FALSE, open = FALSE WHERE id = ?} ,undef,$ND::address,$id) == 1){ $ND::server->command("msg $ND::target Marked call $id as ignored"); + def_log $user->{uid}, $id , "Used: [B] $command [/B]"; } } }