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 <b>$id</b>");
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 <b>$id</b>: $calc");
},undef,$user->{uid});
unless (@call){ #call doesn't exists, create a new one
@call = $dbh->selectrow_array(q{
-INSERT INTO calls (uid,landing_tick,info) VALUES(?,?,'') RETURNING call
+INSERT INTO calls (uid,landing_tick,info) VALUES(?,?,'') RETURNING call,status,calc
},undef,$user->{uid},$landing_tick);
if ($threefleeter){
$dbh->do(q{UPDATE calls SET status = 'Ignored' WHERE call = $1},undef,$call[0]);
$c->def_log($call[0], 'This member has been marked as [B]NoDef[/B], do [B]not cover[/B] unless you have a good reaon.');
+ $call[1] = 'Ignored';
}
}
if (@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("<b>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]</b>");
}else{
$c->reply("<b>Do not cover</b>, NoDef member is under attack by $4:$5:$6, ($attacker[3]), $attacker[1]($attacker[4]) https://nd.ruin.nu/calls/edit/$call[0]");
$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("<b>Call is likely not covered anymore, please recalc! calc: $call[3]</b>");
+ $c->reply("<b>Call is likely not covered anymore, please recalc! calc: $call[2]</b>");
}
}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{