diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index 31a31633..acb4685e 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -4341,11 +4341,12 @@ $crannyimg = " 3600"; + $time2 = NATURE_REGTIME; + $q = "SELECT * FROM " . TB_PREFIX . "odata where conqured = 0 and $time - lastupdated2 > $time2"; $array = $database->query_return($q); foreach($array as $oasis) { $database->populateOasisUnits($oasis['wref'],$oasis['high']); - $database->updateOasis($oasis['wref']); + $database->updateOasis2($oasis['wref']); } } diff --git a/GameEngine/Database/db_MYSQL.php b/GameEngine/Database/db_MYSQL.php index 19dd2c9c..6a99d0b5 100644 --- a/GameEngine/Database/db_MYSQL.php +++ b/GameEngine/Database/db_MYSQL.php @@ -1461,12 +1461,18 @@ class MYSQL_DB { $q = "UPDATE " . TB_PREFIX . "vdata set lastupdate = $time where wref = $vid"; return mysql_query($q, $this->connection); } + function updateOasis($vid) { $time = time(); $q = "UPDATE " . TB_PREFIX . "odata set lastupdated = $time where wref = $vid"; return mysql_query($q, $this->connection); } - + + function updateOasis2($vid) { + $time = time(); + $q = "UPDATE " . TB_PREFIX . "odata set lastupdated2 = $time where wref = $vid"; + return mysql_query($q, $this->connection); + } function setVillageName($vid, $name) { if(!empty($name)) @@ -2823,7 +2829,7 @@ class MYSQL_DB { $wid = $row['id']; $basearray = $this->getOMInfo($wid); //We switch type of oasis and instert record with apropriate infomation. - $q = "INSERT into " . TB_PREFIX . "odata VALUES ('" . $basearray['id'] . "'," . $basearray['oasistype'] . ",0,800,800,800,800,800,800," . time() . ",100,2,'Unoccupied Oasis',".rand(0,2).")"; + $q = "INSERT into " . TB_PREFIX . "odata VALUES ('" . $basearray['id'] . "'," . $basearray['oasistype'] . ",0,800,800,800,800,800,800," . time() . "," . time() . ",100,2,'Unoccupied Oasis',".rand(0,2).")"; $result = mysql_query($q, $this->connection); } } diff --git a/GameEngine/Database/db_MYSQLi.php b/GameEngine/Database/db_MYSQLi.php index 66ae45d7..29d69569 100644 --- a/GameEngine/Database/db_MYSQLi.php +++ b/GameEngine/Database/db_MYSQLi.php @@ -1464,12 +1464,18 @@ class MYSQLi_DB { $q = "UPDATE " . TB_PREFIX . "vdata set lastupdate = $time where wref = $vid"; return mysqli_query($this->connection, $q); } + function updateOasis($vid) { $time = time(); $q = "UPDATE " . TB_PREFIX . "odata set lastupdated = $time where wref = $vid"; return mysqli_query($this->connection, $q); } - + + function updateOasis2($vid) { + $time = time(); + $q = "UPDATE " . TB_PREFIX . "odata set lastupdated2 = $time where wref = $vid"; + return mysqli_query($this->connection, $q); + } function setVillageName($vid, $name) { if(!empty($name)) @@ -2826,7 +2832,7 @@ class MYSQLi_DB { $wid = $row['id']; $basearray = $this->getOMInfo($wid); //We switch type of oasis and instert record with apropriate infomation. - $q = "INSERT into " . TB_PREFIX . "odata VALUES ('" . $basearray['id'] . "'," . $basearray['oasistype'] . ",0,800,800,800,800,800,800," . time() . ",100,2,'Unoccupied Oasis',".rand(0,2).")"; + $q = "INSERT into " . TB_PREFIX . "odata VALUES ('" . $basearray['id'] . "'," . $basearray['oasistype'] . ",0,800,800,800,800,800,800," . time() . "," . time() . ",100,2,'Unoccupied Oasis',".rand(0,2).")"; $result = mysqli_query($this->connection, $q); } } diff --git a/install/data/sql.sql b/install/data/sql.sql index f1b79b8f..cc0375a1 100644 --- a/install/data/sql.sql +++ b/install/data/sql.sql @@ -1036,6 +1036,7 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%odata` ( `crop` int(11) unsigned NOT NULL, `maxcrop` int(11) unsigned NOT NULL, `lastupdated` int(11) unsigned NOT NULL, + `lastupdated2` int(11) unsigned NOT NULL, `loyalty` int(11) NOT NULL DEFAULT '100', `owner` int(11) unsigned NOT NULL DEFAULT '2', `name` varchar(32) NOT NULL DEFAULT 'Unoccupied Oasis',