From b34d60e2292fd751d6baa3bf26f561687dbcb5f6 Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Thu, 12 Mar 2009 20:58:59 +0100 Subject: [PATCH] Tweaked covop sorting and output --- lib/NDWeb/Controller/CovOp.pm | 17 +++++++++-------- root/src/covop/index.tt2 | 4 ++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/NDWeb/Controller/CovOp.pm b/lib/NDWeb/Controller/CovOp.pm index 1c2a3a4..b4e71fe 100644 --- a/lib/NDWeb/Controller/CovOp.pm +++ b/lib/NDWeb/Controller/CovOp.pm @@ -23,18 +23,19 @@ Catalyst Controller. sub index :Path :Args(0) { my ( $self, $c ) = @_; - $c->stash( where => q{hack5 > 60000 - ORDER BY hack5 DESC, hack15 DESC, minalert - ,lastcovop NULLS FIRST,pstick DESC, dstick DESC,x,y,z + $c->stash( where => q{hack5 > 60000 AND minalert < 60 + ORDER BY hack5 DESC, hack13 DESC + ,(CASE WHEN tick() - lastcovop < 6 THEN lastcovop ELSE NULL END) NULLS FIRST + ,minalert, pstick DESC, dstick DESC,x,y,z }); $c->forward('list'); } sub easy : Local { my ( $self, $c ) = @_; - $c->stash( where => q{minalert < 70 - ORDER BY minalert, max_bank_hack DESC, hack5 DESC, hack15 DESC - ,lastcovop NULLS FIRST,pstick DESC, dstick DESC,x,y,z + $c->stash( where => q{minalert < 60 + ORDER BY minalert, hack5 DESC,lastcovop NULLS FIRST + ,hack13 DESC,pstick DESC, dstick DESC,x,y,z }); $c->forward('list'); } @@ -65,9 +66,9 @@ sub list : Private { my $query = $dbh->prepare(q{ SELECT * FROM ( SELECT * - ,max_bank_hack(500000,500000,500000,pvalue,cvalue,5) + ,(2*pvalue::float/cvalue) :: Numeric(3,1) AS max_bank_hack ,max_bank_hack(metal,crystal,eonium,pvalue,cvalue,5) AS hack5 - ,max_bank_hack(metal,crystal,eonium,pvalue,cvalue,13) AS hack15 + ,max_bank_hack(metal,crystal,eonium,pvalue,cvalue,13) AS hack13 FROM (SELECT p.id,coords(x,y,z),x,y,z,size ,metal + metal_roids * (tick()-ps.tick) * 125 AS metal ,crystal + crystal_roids * (tick()-ps.tick) * 125 AS crystal diff --git a/root/src/covop/index.tt2 b/root/src/covop/index.tt2 index d0fd401..d6ded60 100644 --- a/root/src/covop/index.tt2 +++ b/root/src/covop/index.tt2 @@ -15,7 +15,7 @@ CoordsTickMetalCrystalEonium GovAlertTickDists - Max (5 agents)(15 agents)MaxLast covop (tick) + Max (5 agents)(13 agents)MaxLast covop (tick) [% debug(targets.size) %] @@ -31,7 +31,7 @@ [% t.dstick %] [% t.distorters %] [% t.hack5 %] - [% t.hack15 %] + [% t.hack13 %] [% t.max_bank_hack %] [% t.lastcovop %] Did CovOp this tick -- 2.39.2