From 1a71fdbc60401a6bf757e032dcd3ce98d9c0f443 Mon Sep 17 00:00:00 2001
From: Alex Stoica <0x01.alex@gmail.com>
Date: Sun, 7 Jan 2018 16:48:22 +0000
Subject: [PATCH 1/3] Add WW win correct date
---
GameEngine/Automation.php | 6 ++++++
sql_updates.txt | 3 +++
var/db/struct.sql | 1 +
winner.php | 5 ++++-
4 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php
index f1443145..1b854f53 100755
--- a/GameEngine/Automation.php
+++ b/GameEngine/Automation.php
@@ -689,6 +689,12 @@ class Automation {
}
}
+ // Update ww last finish upgrate
+ if ($indi['type'] == 40) {
+ $qW = "UPDATE ".TB_PREFIX."fdata set ww_lastupdate = ".time()." where vref = ".(int) $indi['wid'];
+ $database->query($qW);
+ }
+
$dbIdsToDelete[] = (int) $indi['id'];
}
diff --git a/sql_updates.txt b/sql_updates.txt
index f8a2611d..2653f925 100644
--- a/sql_updates.txt
+++ b/sql_updates.txt
@@ -1,3 +1,6 @@
+-- 7.01.2018 -> new column
+ALTER TABLE s1_fdata ADD `ww_lastupdate` int(11) NULL DEFAULT NULL AFTER `wwname`;
+
-- 2.12.2017 -> new indexes
ALTER TABLE `s1_vdata` ADD INDEX(`exp1`);
ALTER TABLE `s1_vdata` ADD INDEX(`exp2`);
diff --git a/var/db/struct.sql b/var/db/struct.sql
index bbea2d0e..bec6ed7a 100644
--- a/var/db/struct.sql
+++ b/var/db/struct.sql
@@ -707,6 +707,7 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%fdata` (
`f99` tinyint(2) NULL DEFAULT '0',
`f99t` tinyint(2) NULL DEFAULT '0',
`wwname` varchar(100) NULL DEFAULT 'World Wonder',
+ `ww_lastupdate` int(11) DEFAULT NULL,
PRIMARY KEY (`vref`),
KEY `f99` (`f99`),
KEY `f99t` (`f99t`)
diff --git a/winner.php b/winner.php
index 7f99de1f..7d66fec5 100644
--- a/winner.php
+++ b/winner.php
@@ -155,6 +155,9 @@ else {
$sql = mysqli_query($GLOBALS['link'],"SELECT tag FROM ".TB_PREFIX."alidata WHERE id = '$allianceid'")or die(mysqli_error($database->dblink));
$winningalliancetag = mysqli_result($sql, 0);
+
+ $sql = mysqli_query($GLOBALS['link'],"SELECT ww_lastupdate FROM ".TB_PREFIX."fdata WHERE f99 = '100' and f99t = '40'");
+ $finishconstruction = mysqli_result($sql, 0);
?>
@@ -213,7 +216,7 @@ else {
The results: Day had long since passed into night, yet the workers in getMapCheck($vref)."\">$winningvillagename"; ?>,
laboured on throught the wintery eve, every wary of the countless armies marching to destroy their work, knowing that they raced against time and the greatest
- threat that had ever faced the free people. Their tireless struggles were rewarded at on after a
+ threat that had ever faced the free people. Their tireless struggles were rewarded at on after a
nameless worker laid the dinal stone in what will forever known as the greatest and most magnificent creation in all of history since the fall of the Natars
Together with the alliance "$winningalliancetag"; ?>", "$username"; ?>"
From 83d22f16e7428c6c25d9eaa4185b70887ca3441c Mon Sep 17 00:00:00 2001
From: Alex Stoica <0x01.alex@gmail.com>
Date: Sun, 7 Jan 2018 16:49:55 +0000
Subject: [PATCH 2/3] Fix typo
---
GameEngine/Automation.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php
index 1b854f53..5f148c8b 100755
--- a/GameEngine/Automation.php
+++ b/GameEngine/Automation.php
@@ -689,7 +689,7 @@ class Automation {
}
}
- // Update ww last finish upgrate
+ // Update ww last finish upgrade
if ($indi['type'] == 40) {
$qW = "UPDATE ".TB_PREFIX."fdata set ww_lastupdate = ".time()." where vref = ".(int) $indi['wid'];
$database->query($qW);
From 757445b1b4e967a47577021ba1e3d0d19895de77 Mon Sep 17 00:00:00 2001
From: Alex Stoica <0x01.alex@gmail.com>
Date: Sun, 7 Jan 2018 16:52:03 +0000
Subject: [PATCH 3/3] Much more logical
---
winner.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/winner.php b/winner.php
index 7d66fec5..03e1b7b8 100644
--- a/winner.php
+++ b/winner.php
@@ -156,7 +156,7 @@ else {
$sql = mysqli_query($GLOBALS['link'],"SELECT tag FROM ".TB_PREFIX."alidata WHERE id = '$allianceid'")or die(mysqli_error($database->dblink));
$winningalliancetag = mysqli_result($sql, 0);
- $sql = mysqli_query($GLOBALS['link'],"SELECT ww_lastupdate FROM ".TB_PREFIX."fdata WHERE f99 = '100' and f99t = '40'");
+ $sql = mysqli_query($GLOBALS['link'],"SELECT ww_lastupdate FROM ".TB_PREFIX."fdata WHERE vref = '$vref'");
$finishconstruction = mysqli_result($sql, 0);
?>