mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-29 00:54:31 +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{
|
||||
|
||||
@@ -21,8 +21,8 @@ if($session->tribe == 1) {
|
||||
$output.=" <tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u1\" src=\"img/x.gif\" alt=\"Legionnaire\" title=\"Legionnaire\" />
|
||||
Legionnaire
|
||||
<img class=\"unit u1\" src=\"img/x.gif\" alt=\"".U1."\" title=\"".U1."\" />
|
||||
".U1."
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u1['wood']."|
|
||||
@@ -54,8 +54,8 @@ if($session->tribe == 1) {
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u2\" src=\"img/x.gif\" alt=\"Praetorian\" title=\"Praetorian\" />
|
||||
Praetorian
|
||||
<img class=\"unit u2\" src=\"img/x.gif\" alt=\"".U2."\" title=\"".U2."\" />
|
||||
".U2."
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u2['wood']."|
|
||||
@@ -87,8 +87,8 @@ if($session->tribe == 1) {
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u3\" src=\"img/x.gif\" alt=\"Imperian\" title=\"Imperian\" />
|
||||
Imperian
|
||||
<img class=\"unit u3\" src=\"img/x.gif\" alt=\"".U3."\" title=\"".U3."\" />
|
||||
".U3."
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u3['wood']."|
|
||||
@@ -120,8 +120,8 @@ if($session->tribe == 1) {
|
||||
$output.= "<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u5\" src=\"img/x.gif\" alt=\"Equites Imperatoris\" title=\"Equites Imperatoris\" />
|
||||
Equites Imperatoris
|
||||
<img class=\"unit u5\" src=\"img/x.gif\" alt=\"".U5."\" title=\"".U5."\" />
|
||||
".U5."
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u5['wood']."|
|
||||
@@ -151,8 +151,8 @@ if($session->tribe == 1) {
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u6\" src=\"img/x.gif\" alt=\"Equites Caesaris\" title=\"Equites Caesaris\" />
|
||||
Equites Caesaris
|
||||
<img class=\"unit u6\" src=\"img/x.gif\" alt=\"".U6."\" title=\"".U6."\" />
|
||||
".U6."
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u6['wood']."|
|
||||
@@ -185,8 +185,8 @@ if($session->tribe == 2) {
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u11\" src=\"img/x.gif\" alt=\"Clubswinger\" title=\"Clubswinger\" />
|
||||
Clubswinger
|
||||
<img class=\"unit u11\" src=\"img/x.gif\" alt=\"".U11."\" title=\"".U11."\" />
|
||||
".U11."
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u11['wood']."|
|
||||
@@ -216,8 +216,8 @@ $output.="<tr>
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u12\" src=\"img/x.gif\" alt=\"Clubswinger\" title=\"Clubswinger\" />
|
||||
Clubswinger
|
||||
<img class=\"unit u12\" src=\"img/x.gif\" alt=\"".U12."\" title=\"".U12."\" />
|
||||
".U12."
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u12['wood']."|
|
||||
@@ -248,8 +248,8 @@ $output.="<tr>
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u13\" src=\"img/x.gif\" alt=\"Clubswinger\" title=\"Clubswinger\" />
|
||||
Clubswinger
|
||||
<img class=\"unit u13\" src=\"img/x.gif\" alt=\"".U13."\" title=\"".U13."\" />
|
||||
".U13."
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u13['wood']."|
|
||||
@@ -279,8 +279,8 @@ $output.="<tr>
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u15\" src=\"img/x.gif\" alt=\"Clubswinger\" title=\"Clubswinger\" />
|
||||
Clubswinger
|
||||
<img class=\"unit u15\" src=\"img/x.gif\" alt=\"".U15."\" title=\"".U15."\" />
|
||||
".U15."
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u15['wood']."|
|
||||
@@ -311,8 +311,8 @@ $output.="<tr>
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u16\" src=\"img/x.gif\" alt=\"Clubswinger\" title=\"Clubswinger\" />
|
||||
Clubswinger
|
||||
<img class=\"unit u16\" src=\"img/x.gif\" alt=\"".U16."\" title=\"".U16."\" />
|
||||
".U16."
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u16['wood']."|
|
||||
@@ -345,8 +345,8 @@ if($session->tribe == 3) {
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u21\" src=\"img/x.gif\" alt=\"Phalanx\" title=\"Phalanx\" />
|
||||
Phalanx
|
||||
<img class=\"unit u21\" src=\"img/x.gif\" alt=\"".U21."\" title=\"".U21."\" />
|
||||
".U21."
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u21['wood']."|
|
||||
@@ -376,8 +376,8 @@ $output.="<tr>
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u22\" src=\"img/x.gif\" alt=\"Clubswinger\" title=\"Clubswinger\" />
|
||||
Clubswinger
|
||||
<img class=\"unit u22\" src=\"img/x.gif\" alt=\"".U22."\" title=\"".U22."\" />
|
||||
".U22."
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u22['wood']."|
|
||||
@@ -408,8 +408,8 @@ $output.="<tr>
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u24\" src=\"img/x.gif\" alt=\"Clubswinger\" title=\"Clubswinger\" />
|
||||
Clubswinger
|
||||
<img class=\"unit u24\" src=\"img/x.gif\" alt=\"".U24."\" title=\"".U24."\" />
|
||||
".U24."
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u24['wood']."|
|
||||
@@ -439,8 +439,8 @@ $output.="<tr>
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u25\" src=\"img/x.gif\" alt=\"Clubswinger\" title=\"Clubswinger\" />
|
||||
Clubswinger
|
||||
<img class=\"unit u25\" src=\"img/x.gif\" alt=\"".U25."\" title=\"".U25."\" />
|
||||
".U25."
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u25['wood']."|
|
||||
@@ -471,8 +471,8 @@ $output.="<tr>
|
||||
$output.="<tr>
|
||||
<td class=\"desc\">
|
||||
<div class=\"tit\">
|
||||
<img class=\"unit u26\" src=\"img/x.gif\" alt=\"Clubswinger\" title=\"Clubswinger\" />
|
||||
Clubswinger
|
||||
<img class=\"unit u26\" src=\"img/x.gif\" alt=\"".U26."\" title=\"".U26."\" />
|
||||
".U26."
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".$u26['wood']."|
|
||||
|
||||
@@ -36,12 +36,12 @@ echo "<div class=\"headline\"><span class=\"f10 c5\">Error creating constant.php
|
||||
<td><span class="f9 c6">Beginners protection length:</span></td><td>
|
||||
<select name="beginner">
|
||||
<option value="0">None (0 hours)</option>
|
||||
<option value="3600*6">6 hours</option>
|
||||
<option value="3600*12" selected="selected">12 hours</option>
|
||||
<option value="3600*24">24 hours</option>
|
||||
<option value="3600*36">36 hours</option>
|
||||
<option value="3600*48">48 hours</option>
|
||||
<option value="3600*72">72 hours</option>
|
||||
<option value="21600">6 hours</option>
|
||||
<option value="43200" selected="selected">12 hours</option>
|
||||
<option value="86400">24 hours</option>
|
||||
<option value="129600">36 hours</option>
|
||||
<option value="172800">48 hours</option>
|
||||
<option value="259200">72 hours</option>
|
||||
</select>
|
||||
</td></tr><tr></tr>
|
||||
<td><span class="f9 c6">Plus account length:</span></td><td>
|
||||
|
||||
Reference in New Issue
Block a user