X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=Commands%2FDef.pm;h=2c8e7b1fb579f47b1163d895020db107a455cfa7;hb=84f84122d6e27123f026630ad1fa78e0f00520ac;hp=b115dd44be93aefc3cdcdc315e34fa02a88302fb;hpb=5f2c0808b406a1c97a4cf07d1c7c51d574b4a6f6;p=NDIRC.git diff --git a/Commands/Def.pm b/Commands/Def.pm index b115dd4..2c8e7b1 100644 --- a/Commands/Def.pm +++ b/Commands/Def.pm @@ -75,9 +75,9 @@ ORDER BY c.landing_tick; return; } } - $c->message(notice => $ND::memchan, "DEFENSE REQUIRED!! WAKE UP!!"); - $c->message(privmsg => $ND::memchan, "DEFENSE REQUIRED $mess $callinfo MSG " - .$c->nick." TO RESPOND"); + $c->message(notice => $c->disp->targets->{members}, "DEFENSE REQUIRED!! WAKE UP!!"); + $c->message(privmsg => $c->disp->targets->{members}, "DEFENSE REQUIRED " + ."$mess $callinfo MSG ".$c->nick." TO RESPOND"); } sub settype @@ -172,10 +172,10 @@ sub calltake $dbh->begin_work; my $rows = $dbh->do(q{ -UPDATE calls SET dc = (SELECT uid FROM users WHERE hostmask ILIKE $1) +UPDATE calls SET dc = $1 ,status = $3 WHERE call = $2 - },undef,$c->host,$id,$status); + },undef,$c->uid,$id,$status); if ($rows == 1){ $c->reply("Setting status on call $id to $status"); $c->def_log($id , "Changed status: [B]$status [/B]"); @@ -196,7 +196,7 @@ sub setcalc my $dbh = $c->model; $dbh->begin_work; - my $rows = $dbh->do(q{UPDATE calls SET calc = $2 WHERE id = $1} + my $rows = $dbh->do(q{UPDATE calls SET calc = $2 WHERE call = $1} ,undef,$id, $calc); if ($rows == 1){ $c->reply("Updated calc call $id"); @@ -219,7 +219,7 @@ sub getcalc my $dbh = $c->model; my $calc = $dbh->selectrow_array(q{ -SELECT calc FROM calls WHERE id = $1} +SELECT calc FROM calls WHERE call = $1} ,undef,$id); $calc //= "Bad call id, there is no such call."; $c->reply("Calc for call $id: $calc"); @@ -288,7 +288,7 @@ INSERT INTO calls (uid,landing_tick,info) VALUES(?,?,'') RETURNING call INSERT INTO incomings (call,pid,eta,amount,fleet) VALUES(?,?,?,?,?) RETURNING inc },undef,$call[0],$attacker[2],$9,$amount,$7); @attacker = map (valuecolor(0),@attacker); - if (! $threefleeter || $call[2]){ + if (! $threefleeter || $call[1] ne 'Ignored'){ $c->reply("New incoming: CallId: $call[0], IncId: $incid $1:$2:$3 ($user->{defprio}) is under Attack by $4:$5:$6, ($attacker[3]), $attacker[1]($attacker[4]) https://nd.ruin.nu/calls/edit/$call[0]"); }else{ $c->reply("Do not cover, NoDef member is under attack by $4:$5:$6, ($attacker[3]), $attacker[1]($attacker[4]) https://nd.ruin.nu/calls/edit/$call[0]"); @@ -296,11 +296,11 @@ INSERT INTO incomings (call,pid,eta,amount,fleet) VALUES(?,?,?,?,?) RETURNING in $dbh->do(q{UPDATE planets SET hit_us = hit_us + 1 WHERE pid = ?},undef,$attacker[2]); if ($call[1] eq 'Covered'){ $dbh->do(q{UPDATE calls SET status = 'Open' WHERE call = ?},undef,$call[0]); - $c->reply("Call is likely not covered anymore, please recalc! calc: $call[3]"); + $c->reply("Call is likely not covered anymore, please recalc! calc: $call[2]"); } }else{ @attacker = map (valuecolor(0),@attacker); - $c->reply("Duplicate call: Callid: $call[0], Covered: $call[1], Open: $call[2] $1:$2:$3 ($user->{defprio}) is under Attack by $4:$5:$6, ($attacker[3]), $attacker[1]($attacker[4]), landing tick: $landing_tick"); + $c->reply("Duplicate call: Callid: $call[0], Status: $call[1] $1:$2:$3 ($user->{defprio}) is under Attack by $4:$5:$6, ($attacker[3]), $attacker[1]($attacker[4]), landing tick: $landing_tick"); } my ($fleetcatch) = $dbh->selectrow_array(q{