diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index f1443145..5f148c8b 100755 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -689,6 +689,12 @@ class Automation { } } + // 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); + } + $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..03e1b7b8 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 vref = '$vref'"); + $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"; ?>"