From 0121660a54d34d0e14a4550fa88beef63705e69d Mon Sep 17 00:00:00 2001
From: Michael Andreen
Date: Mon, 26 Feb 2007 10:51:11 +0000
Subject: [PATCH] delay coords release
---
ND/Web/Pages/Raids.pm | 6 +-----
ND/Web/XMLPage.pm | 3 ++-
raid.js | 4 ++++
templates/raids.tmpl | 1 -
templates/raids.xml.tmpl | 1 -
5 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/ND/Web/Pages/Raids.pm b/ND/Web/Pages/Raids.pm
index cb2a7ed..7bcb1f4 100644
--- a/ND/Web/Pages/Raids.pm
+++ b/ND/Web/Pages/Raids.pm
@@ -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)));
}
diff --git a/ND/Web/XMLPage.pm b/ND/Web/XMLPage.pm
index d1804f1..9e5fce6 100644
--- a/ND/Web/XMLPage.pm
+++ b/ND/Web/XMLPage.pm
@@ -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 a4179ac..8bec240 100644
--- 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");
diff --git a/templates/raids.tmpl b/templates/raids.tmpl
index eaf6b19..4b3d109 100644
--- a/templates/raids.tmpl
+++ b/templates/raids.tmpl
@@ -84,7 +84,6 @@
- Target coords:
diff --git a/templates/raids.xml.tmpl b/templates/raids.xml.tmpl
index bf67668..804a379 100644
--- a/templates/raids.xml.tmpl
+++ b/templates/raids.xml.tmpl
@@ -12,7 +12,6 @@
-
--
2.39.2