mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-05 12:24:20 +00:00
maked some update
This commit is contained in:
+14
-14
@@ -124,9 +124,6 @@ class Automation {
|
||||
if(!file_exists("GameEngine/Prevention/updatehero.txt") or time()-filemtime("GameEngine/Prevention/updatehero.txt")>50) {
|
||||
$this->updateHero();
|
||||
}
|
||||
if(!file_exists("GameEngine/Prevention/research.txt") or time()-filemtime("GameEngine/Prevention/research.txt")>10) {
|
||||
$this->researchComplete();
|
||||
}
|
||||
if(!file_exists("GameEngine/Prevention/cleardeleting.txt") or time()-filemtime("GameEngine/Prevention/cleardeleting.txt")>10) {
|
||||
$this->clearDeleting();
|
||||
}
|
||||
@@ -134,17 +131,28 @@ class Automation {
|
||||
{
|
||||
$this->buildComplete();
|
||||
}
|
||||
$this->MasterBuilder();
|
||||
if (! file_exists("GameEngine/Prevention/demolition.txt") or time() - filemtime("GameEngine/Prevention/demolition.txt") > 10)
|
||||
{
|
||||
$this->demolitionComplete();
|
||||
}
|
||||
$this->updateStore();
|
||||
if(!file_exists("GameEngine/Prevention/market.txt") or time()-filemtime("GameEngine/Prevention/market.txt")>10) {
|
||||
$this->marketComplete();
|
||||
}
|
||||
if(!file_exists("GameEngine/Prevention/research.txt") or time()-filemtime("GameEngine/Prevention/research.txt")>10) {
|
||||
$this->researchComplete();
|
||||
}
|
||||
if(!file_exists("GameEngine/Prevention/training.txt") or time()-filemtime("GameEngine/Prevention/training.txt")>10) {
|
||||
$this->trainingComplete();
|
||||
}
|
||||
if(!file_exists("GameEngine/Prevention/celebration.txt") or time()-filemtime("GameEngine/Prevention/celebration.txt")>10) {
|
||||
$this->celebrationComplete();
|
||||
}
|
||||
if(!file_exists("GameEngine/Prevention/sendunits.txt") or time()-filemtime("GameEngine/Prevention/sendunits.txt")>10) {
|
||||
$this->sendunitsComplete();
|
||||
}
|
||||
if(!file_exists("GameEngine/Prevention/loyalty.txt") or time()-filemtime("GameEngine/Prevention/loyalty.txt")>50) {
|
||||
if(!file_exists("GameEngine/Prevention/loyalty.txt") or time()-filemtime("GameEngine/Prevention/loyalty.txt")>50) {
|
||||
$this->loyaltyRegeneration();
|
||||
}
|
||||
if(!file_exists("GameEngine/Prevention/sendreinfunits.txt") or time()-filemtime("GameEngine/Prevention/sendreinfunits.txt")>10) {
|
||||
@@ -156,15 +164,7 @@ class Automation {
|
||||
if(!file_exists("GameEngine/Prevention/settlers.txt") or time()-filemtime("GameEngine/Prevention/settlers.txt")>10) {
|
||||
$this->sendSettlersComplete();
|
||||
}
|
||||
if(!file_exists("GameEngine/Prevention/celebration.txt") or time()-filemtime("GameEngine/Prevention/celebration.txt")>10) {
|
||||
$this->celebrationComplete();
|
||||
}
|
||||
if (! file_exists("GameEngine/Prevention/demolition.txt") or time() - filemtime("GameEngine/Prevention/demolition.txt") > 10)
|
||||
{
|
||||
$this->demolitionComplete();
|
||||
}
|
||||
$this->updateStore();
|
||||
$this->MasterBuilder();
|
||||
}
|
||||
|
||||
function activeCropDead(){
|
||||
@@ -278,7 +278,7 @@ if (array_sum($unitarr)>0){
|
||||
}
|
||||
|
||||
}
|
||||
private function loyaltyRegeneration() {
|
||||
private function loyaltyRegeneration() {
|
||||
global $database;
|
||||
$array = array();
|
||||
$q = "SELECT * FROM ".TB_PREFIX."vdata WHERE loyalty<>100";
|
||||
@@ -501,7 +501,7 @@ private function loyaltyRegeneration() {
|
||||
$array = $database->query_return($q);
|
||||
|
||||
foreach($array as $indi) {
|
||||
if($indi['lastupdate'] <= $time){
|
||||
if($indi['lastupdate'] <= $time && $indi['lastupdate'] > 0){
|
||||
$cp = $database->getVSumField($indi['id'], 'cp') * (time()-$indi['lastupdate'])/86400;
|
||||
|
||||
$newupdate = time();
|
||||
|
||||
@@ -630,6 +630,7 @@ class Building {
|
||||
global $database,$session,$logging,$village,$bid18,$bid10,$bid11,$technology,$_SESSION;
|
||||
if($session->access!=BANNED){
|
||||
if($session->gold >= 2){
|
||||
|
||||
foreach($this->buildArray as $jobs) {
|
||||
if($jobs['wid']==$village->wid){
|
||||
$wwvillage = $database->getResourceLevel($jobs['wid']);
|
||||
@@ -637,8 +638,7 @@ class Building {
|
||||
$level = $database->getFieldLevel($jobs['wid'],$jobs['field']);
|
||||
$level = ($level == -1) ? 0 : $level;
|
||||
if($jobs['type'] != 25 AND $jobs['type'] != 26 AND $jobs['type'] != 40) {
|
||||
$gold=$database->getUserField($_SESSION['username'],'gold','username');
|
||||
$gold-=2;
|
||||
$finish = 1;
|
||||
$database->updateUserField($_SESSION['username'],'gold',$gold,0);
|
||||
$resource = $this->resourceRequired($jobs['field'],$jobs['type']);
|
||||
$q = "UPDATE ".TB_PREFIX."fdata set f".$jobs['field']." = f".$jobs['field']." + 1, f".$jobs['field']."t = ".$jobs['type']." where vref = ".$jobs['wid'];
|
||||
@@ -685,6 +685,10 @@ class Building {
|
||||
}
|
||||
if(($jobs['field'] >= 19 && ($session->tribe == 1 || ALLOW_ALL_TRIBE)) || (!ALLOW_ALL_TRIBE && $session->tribe != 1)) { $innertimestamp = $jobs['timestamp']; }
|
||||
}
|
||||
if($finish == 1){
|
||||
$gold=$database->getUserField($_SESSION['username'],'gold','username');
|
||||
$gold-=2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
function register($username, $password, $email, $tribe, $locate, $act) {
|
||||
$time = time();
|
||||
$timep = (time() + PROTECTION);
|
||||
$q = "INSERT INTO " . TB_PREFIX . "users (username,password,access,email,timestamp,tribe,location,act,protect,regtime) VALUES ('$username', '$password', " . USER . ", '$email', $time, $tribe, $locate, '$act', $timep, $time)";
|
||||
$q = "INSERT INTO " . TB_PREFIX . "users (username,password,access,email,timestamp,tribe,location,act,protect,lastupdate,regtime) VALUES ('$username', '$password', " . USER . ", '$email', $time, $tribe, $locate, '$act', $timep, $time, $time)";
|
||||
if(mysql_query($q, $this->connection)) {
|
||||
return mysql_insert_id($this->connection);
|
||||
} else {
|
||||
|
||||
@@ -81,7 +81,7 @@ class Profile {
|
||||
$database->submitProfile($database->RemoveXSS($post['uid']),$database->RemoveXSS($post['mw']),$database->RemoveXSS($post['ort']),$database->RemoveXSS($birthday),$database->RemoveXSS($post['be2']),$database->RemoveXSS($post['be1']));
|
||||
$varray = $database->getProfileVillages($post['uid']);
|
||||
for($i=0;$i<=count($varray)-1;$i++) {
|
||||
$database->setVillageName($database->RemoveXSS($varray[$i]['wref']),$database->RemoveXSS($post['dname'.$i]));
|
||||
$database->setVillageName($database->RemoveXSS($varray[$i]['wref']),$post['dname'.$i]);
|
||||
}
|
||||
header("Location: ?uid=".$post['uid']);
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user