]> ruin.nu Git - ndwebbie.git/commitdiff
Better sorting of covop targets
authorMichael Andreen <harv@ruin.nu>
Mon, 16 Feb 2009 09:15:19 +0000 (10:15 +0100)
committerMichael Andreen <harv@ruin.nu>
Mon, 16 Feb 2009 09:15:19 +0000 (10:15 +0100)
lib/NDWeb/Controller/CovOp.pm
root/src/covop/index.tt2

index 1eaca566feeba7f5627eb32e30ce4433abca4e3b..7b020b045d81a9379204206623331194a38a03fc 100644 (file)
@@ -24,21 +24,21 @@ Catalyst Controller.
 sub index :Path :Args(0) {
        my ( $self, $c ) = @_;
        $c->stash( where => q{AND max_bank_hack > 60000
-               ORDER BY max_bank_hack DESC, minalert ASC});
+               ORDER BY max_bank_hack DESC, hack5 DESC, hack15 DESC, minalert,x,y,z});
        $c->forward('list');
 }
 
 sub easy : Local {
        my ( $self, $c ) = @_;
        $c->stash( where =>  qq{AND minalert < 70
-               ORDER BY minalert ASC,max_bank_hack DESC});
+               ORDER BY minalert, max_bank_hack DESC, hack5 DESC, hack15 DESC,x,y,z});
        $c->forward('list');
 }
 
 sub distwhores : Local {
        my ( $self, $c ) = @_;
        $c->stash( where =>  qq{AND distorters > 0
-               ORDER BY distorters DESC, minalert ASC});
+               ORDER BY distorters DESC, minalert, x,y,z});
        $c->forward('list');
 }
 
@@ -57,11 +57,12 @@ sub list : Private {
        my $dbh = $c->model;
 
        my $query = $dbh->prepare(q{SELECT *
-               FROM (SELECT p.id,coords(x,y,z),size, metal,crystal,eonium
+               FROM (SELECT p.id,coords(x,y,z),x,y,z,size, metal,crystal,eonium
                        ,distorters,guards
                        ,covop_alert(seccents,ds.total,size,guards,gov,0) AS minalert
                        ,covop_alert(seccents,ds.total,size,guards,gov,50) AS maxalert
-                       ,max_bank_hack(metal,crystal,eonium,p.value,c.value,5)
+                       ,max_bank_hack(500000,500000,500000,p.value,c.value,5)
+                       ,max_bank_hack(metal,crystal,eonium,p.value,c.value,5) AS hack5
                        ,max_bank_hack(metal,crystal,eonium,p.value,c.value,15) AS hack15
                        , planet_status, relationship,gov,ps.tick AS pstick, ds.tick AS dstick
                        FROM current_planet_stats p
index 89f2871472f81d80ca35e842eca19b6d1540a792..d0fd401d3d280d73825f67e4cbc3870aab3e750b 100644 (file)
@@ -15,7 +15,7 @@
        <tr>
                <th>Coords</th><th>Tick</th><th>Metal</th><th>Crystal</th><th>Eonium</th>
                <th>Gov</th><th>Alert</th><th>Tick</th><th>Dists</th>
-               <th>Max (5 agents)</th><th>(15 agents)</th><th>Last covop (tick)</th>
+               <th>Max (5 agents)</th><th>(15 agents)</th><th>Max</th><th>Last covop (tick)</th>
        </tr>
 
 [% debug(targets.size) %]
@@ -30,8 +30,9 @@
        <td>[% t.minalert %] - [% t.maxalert %]</td>
        <td[% PROCESS style tick=t.dstick%]>[% t.dstick %]</td>
        <td>[% t.distorters %]</td>
-       <td>[% t.max_bank_hack %]</td>
+       <td>[% t.hack5 %]</td>
        <td>[% t.hack15 %]</td>
+       <td>[% t.max_bank_hack %]</td>
        <td>[% t.lastcovop %]</td>
        <td><a href="[% c.uri_for('marktarget', t.id) %]">Did CovOp this tick</a></td>
        </tr>