]> ruin.nu Git - ndwebbie.git/commitdiff
delay coords release
authorMichael Andreen <harv@ruin.nu>
Mon, 26 Feb 2007 10:51:11 +0000 (10:51 +0000)
committerMichael Andreen <harv@ruin.nu>
Mon, 26 Feb 2007 10:51:11 +0000 (10:51 +0000)
ND/Web/Pages/Raids.pm
ND/Web/XMLPage.pm
raid.js
templates/raids.tmpl
templates/raids.xml.tmpl

index cb2a7ed0d06639215b6ea0d24f046e8ebbbbc3ef..7bcb1f4e633d0ce13a4498c056cdbb10f4c6508c 100644 (file)
@@ -63,7 +63,6 @@ sub generateClaimXml : method {
        while (my $target = $targets->fetchrow_hashref){
                my %target;
                $target{Id} = $target->{id};
-               $target{Coords} = $target->{id};
                my @waves;
                for (my $i = 1; $i <= $raid->{waves}; $i++){
                        my %wave;
@@ -83,9 +82,6 @@ sub generateClaimXml : method {
                                $claimers = join '/', @claimers;
                                if ($owner){
                                        $wave{Command} = 'Unclaim';
-                                       if ($raid->{released_coords}){
-                                               $target{Coords} = $DBH->selectrow_array('SELECT coords(x,y,z) FROM current_planet_stats WHERE id = ?',undef,$target->{planet});
-                                       }
                                }elsif ($joinable){
                                        $wave{Command} = 'Join';
                                }else{
@@ -261,7 +257,7 @@ sub render_body {
                        for (my $i = 1; $i <= $raid->{waves}; $i++){
                                my $roids = floor(0.25*$size);
                                $size -= $roids;
-                               my $xp;
+                               my $xp = 0;
                                if ($planet){
                                        $xp = max(0,floor($roids * 10 * (min(2,$target{Score}/$planet->{score}) + min(2,$target{Value}/$planet->{value})-1)));
                                }
index d1804f1a02ea2c40d8a7d417209868f460258b81..9e5fce64f846f32f6e11e25a370ca3509bf31d84 100644 (file)
@@ -39,7 +39,8 @@ sub process : method {
 sub listTargets () : method {
        my $self = shift;
        my $DBH = $self->{DBH};
-       my $query = $DBH->prepare(qq{SELECT t.id, r.id AS raid, r.tick+c.wave-1 AS landingtick, released_coords, coords(x,y,z),c.launched,c.wave,c.joinable
+       my $query = $DBH->prepare(qq{SELECT t.id, r.id AS raid, r.tick+c.wave-1 AS landingtick, 
+               (released_coords AND old_claim(timestamp)) AS released_coords, coords(x,y,z),c.launched,c.wave,c.joinable
 FROM raid_claims c
        JOIN raid_targets t ON c.target = t.id
        JOIN raids r ON t.raid = r.id
diff --git a/raid.js b/raid.js
index a4179ac46ea1a492cb21dd08a91895e3dd3216ec..8bec240b57e1689932cfe721bf490b2618e3b091 100644 (file)
--- a/raid.js
+++ b/raid.js
@@ -139,12 +139,16 @@ function updateClaims(dataSource,xmlthingy,timestamp){
                                b.setAttribute("onclick", "claim('"+dataSource+"',"+target+","+wave+",'"+command+"');");
                                obj.appendChild(b);
                        }
+                       /*@cc_on
                        obj.innerHTML = obj.innerHTML; // IE doesn't understand unless you tell it twice
+                       @*/
                }
+               /*
                obj = document.getElementById("coords"+target);
                var coords = targets[i].getElementsByTagName("coords");;
                if (obj)
                        obj.innerHTML = coords[0].firstChild.nodeValue;
+               */
        }
        if (timestamp){
                timestamp = xmlthingy.getElementsByTagName("timestamp");
index eaf6b19a45b4426c573c6727d11b467084f91d11..4b3d109cc6b55d3224ed159d9a9af6d18d9df224 100644 (file)
@@ -84,7 +84,6 @@
        </span>
        </p>
        </form>
-       <p>Target coords: <span id="coords<TMPL_VAR NAME=Id>"><TMPL_VAR NAME=Coords></span></p>
 </fieldset>
 </TMPL_LOOP>
 <TMPL_IF Ajax>
index bf67668d3029f9be4a5193b3c8d74b32ee3fdb82..804a379f448e017b7580a9589bf113ea4b9ce531 100644 (file)
@@ -12,7 +12,6 @@
                        <joinable><TMPL_VAR NAME=Joinable></joinable>
                </wave>
        </TMPL_LOOP>
-       <coords><TMPL_VAR NAME=Coords></coords>
        </target>
 </TMPL_LOOP>
 </targets>