X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=ND%2FWeb%2FPages%2FCalls.pm;h=6cb626a13c2e5e70d459159538f90e7ca42a7454;hb=f6cfe40e6a8da61229131a2d38a2535ae66da359;hp=c9a51f7acf00479ac2ac0ba3a876ca56c0186584;hpb=29770a0a20d4343051560f7d4f2ddca6ceadc0e1;p=ndwebbie.git diff --git a/ND/Web/Pages/Calls.pm b/ND/Web/Pages/Calls.pm index c9a51f7..6cb626a 100644 --- a/ND/Web/Pages/Calls.pm +++ b/ND/Web/Pages/Calls.pm @@ -144,13 +144,13 @@ sub render_body { my $ships = $DBH->prepare('SELECT ship,amount FROM fleet_ships WHERE fleet = ?'); $fleets->execute($call->{member},$call->{landing_tick},$call->{landing_tick}); my @fleets; - my $i = 0; while (my $fleet = $fleets->fetchrow_hashref){ if ($fleet->{back} == $call->{landing_tick}){ $fleet->{Fleetcatch} = 1; } $ships->execute($fleet->{id}); my @ships; + my $i = 0; while (my $ship = $ships->fetchrow_hashref){ $i++; $ship->{ODD} = $i % 2; @@ -163,15 +163,14 @@ sub render_body { $fleets = $DBH->prepare(q{ - SELECT username, id FROM fleets f JOIN users u USING (uid) WHERE target = $1 and landing_tick = $2 - AND back = landing_tick + eta - 1 + SELECT username, id,back - (landing_tick + eta - 1) AS recalled FROM fleets f JOIN users u USING (uid) WHERE target = $1 and landing_tick = $2 }); $fleets->execute($call->{planet},$call->{landing_tick}) or $ND::ERROR .= p $DBH->errstr; my @defenders; - $i = 0; while (my $fleet = $fleets->fetchrow_hashref){ $ships->execute($fleet->{id}); my @ships; + my $i = 0; while (my $ship = $ships->fetchrow_hashref){ $i++; $ship->{ODD} = $i % 2; @@ -191,7 +190,7 @@ sub render_body { ORDER BY p.x,p.y,p.z}); $attackers->execute($call->{id}); my @attackers; - $i = 0; + my $i = 0; while(my $attacker = $attackers->fetchrow_hashref){ $i++; $attacker->{ODD} = $i % 2; @@ -246,6 +245,7 @@ sub render_body { push @calls,{}; $i = 0; } + $call->{attackers} =~ s{(\d+:\d+:\d+)}{$1}g; $call->{dc} = 'Hostile' unless defined $call->{dc}; $i++; $call->{ODD} = $i % 2;