From 646d1dedda61d1b464c916ec4cb3743e624c77ac Mon Sep 17 00:00:00 2001
From: Martin Ambrus
Date: Mon, 27 Nov 2017 11:31:26 +0100
Subject: [PATCH 3/9] feat: ads on side changed for text and graphics
---
Templates/News/newsbox2.tpl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Templates/News/newsbox2.tpl b/Templates/News/newsbox2.tpl
index 8b9f3419..52dfc9ed 100644
--- a/Templates/News/newsbox2.tpl
+++ b/Templates/News/newsbox2.tpl
@@ -1,10 +1,10 @@
-
+
Date: Thu, 30 Nov 2017 20:12:59 +0100
Subject: [PATCH 7/9] catching up (#2)
* fix: all languages added to installer
* fix: all languages added to installer and Admin
* fix: max crop/resources reset to level 1 value temporarily
This happened when level 1 granary / warehouse was built because of
a missing + sign in a formula.
#374
* chore: some more badges and thanks to JetBrains :)
* chore: one more badge :P
* chore: cleanup
* fix: Multihunter should have access to villages info
* fix: troops duplicate for certain tribes via raid lists
---
Admin/Templates/troopUpgrades.tpl | 2 +-
Admin/Templates/troops.tpl | 2 +-
Admin/Templates/village.tpl | 2 +-
README.md | 16 +++-
Templates/a2b/startRaid.tpl | 10 ++-
cache/.htaccess | 4 -
payment/.htaccess | 11 ---
payment/c2p.php | 117 ------------------------------
8 files changed, 24 insertions(+), 140 deletions(-)
delete mode 100644 cache/.htaccess
delete mode 100644 payment/.htaccess
delete mode 100644 payment/c2p.php
diff --git a/Admin/Templates/troopUpgrades.tpl b/Admin/Templates/troopUpgrades.tpl
index c6b61c99..41152c70 100644
--- a/Admin/Templates/troopUpgrades.tpl
+++ b/Admin/Templates/troopUpgrades.tpl
@@ -1,5 +1,5 @@
diff --git a/Admin/Templates/troops.tpl b/Admin/Templates/troops.tpl
index 8533977d..2836de67 100644
--- a/Admin/Templates/troops.tpl
+++ b/Admin/Templates/troops.tpl
@@ -108,7 +108,7 @@
else if($units['u49'] > 0){$u49 = ''.$units['u49'].'';}
if($units['u50'] == 0){$u50 = ''.$units['u50'].'';}
else if($units['u50'] > 0){$u50 = ''.$units['u50'].'';}
- if($_SESSION['access'] == ADMIN)
+ if($_SESSION['access'] >= MULTIHUNTER)
{
if($user['tribe'] == 1)
{
diff --git a/Admin/Templates/village.tpl b/Admin/Templates/village.tpl
index b3946cc3..f2f19e8b 100644
--- a/Admin/Templates/village.tpl
+++ b/Admin/Templates/village.tpl
@@ -10,7 +10,7 @@
## Copyright: TravianZ (c) 2010-2014. All rights reserved. ##
## Improved: aggenkeech ##
#################################################################################
-if($_SESSION['access'] < 9) die("Access Denied: You are not Admin!");
+if($_SESSION['access'] < 8) die("Access Denied: You are not Admin!");
error_reporting(0);
$id = $_GET['did'];
if(isset($id))
diff --git a/README.md b/README.md
index 0c06b5a5..a08d9043 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,13 @@
[](https://www.codetriage.com/shadowss/travianz)
-[](https://gitter.im/TravianZ-V8/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
-[](https://gratipay.com/~martinambrus/)
[]()
+[]()
+[]()
+[]()
+[]()
+[]()
+[](https://www.jetbrains.com/buy/opensource/?product=phpstorm)
+[](https://gitter.im/TravianZ-V8/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+[](https://liberapay.com/martinambrus/donate)
TravianZ Version **v.8.3.3 BETA b3**
======
@@ -48,4 +54,8 @@ runnign this game :)
Also, our thanks go to all both, the original and occasional developers, especially [yi12345](https://github.com/yi12345/),
[advocaite](https://github.com/advocaite/), [brainiacX](https://github.com/brainiacX/), [ronix](https://github.com/ronix/),
[MisterX](https://github.com/MisterX/), [Elio](https://github.com/Elio/) and many others who were part of this
-project's history.
\ No newline at end of file
+project's history.
+
+Last but not least, our thanks go to [JetBrains](https://www.jetbrains.com/) for lending us a one-year full-featured
+[open-source PHPStorm](https://www.jetbrains.com/buy/opensource/?product=phpstorm) (and other products) license!
+Thanks guys, you're awesome :)
\ No newline at end of file
diff --git a/Templates/a2b/startRaid.tpl b/Templates/a2b/startRaid.tpl
index 982f29bb..c274fbe6 100644
--- a/Templates/a2b/startRaid.tpl
+++ b/Templates/a2b/startRaid.tpl
@@ -128,8 +128,14 @@
$modes = [];
for ( $u = 1; $u <= 10; $u ++ ) {
- $units[] = $uname2 . ($u < 10 ? $u : 0);
- $amounts[] = $data[ 'u' . ($u < 10 ? $u : 0) ];
+ if ($tribe == 1) {
+ $unitKey = $uname2 . $u;
+ } else {
+ $unitKey = $uname2 . ($u < 10 ? $u : 0);
+ }
+
+ $units[] = $uname2 . $unitKey;
+ $amounts[] = $data[ 'u' . $unitKey ];
$modes[] = 0;
}
diff --git a/cache/.htaccess b/cache/.htaccess
deleted file mode 100644
index d87fe95b..00000000
--- a/cache/.htaccess
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Order allow,deny
-Deny from all
-
\ No newline at end of file
diff --git a/payment/.htaccess b/payment/.htaccess
deleted file mode 100644
index 5a2d943e..00000000
--- a/payment/.htaccess
+++ /dev/null
@@ -1,11 +0,0 @@
-
-Order deny,allow
-Deny from all
-Allow from service.micropayment.de
-Allow from proxy.micropayment.de
-Allow from access.micropayment.de
-ErrorDocument 403 http://travian.shadowss.ro/403.php
-ErrorDocument 404 http://travian.shadowss.ro/404.php
-ErrorDocument 500 http://travian.shadowss.ro/500.php
-Options -Indexes
-
\ No newline at end of file
diff --git a/payment/c2p.php b/payment/c2p.php
deleted file mode 100644
index 94221ff1..00000000
--- a/payment/c2p.php
+++ /dev/null
@@ -1,117 +0,0 @@
-Somethings wrong";
-}
-if ($id1 == 199) {
-$_SESSION['amount'] = $amount;
-$trenner = "\n";
-$status = 'ok';
-$url = "http://" . $_SERVER['HOMEPAGE'] . "/a2b2.php"; // change to your own
-$target = '_blank';
-$forward = 0;
-
-$response = 'status=' . $status;
-$response.= $trenner;
-$response.= 'url=' . $url;
-$response.= $trenner;
-$response.= 'target=' . $target;
-$response.= $trenner;
-$response.= 'forward=' . $forward;
-
-
-echo $response;
-}
-
-if ($id1 == 499) {
-$_SESSION['amount'] = $amount;
-$trenner = "\n";
-$status = 'ok';
-$url = "http://" . $_SERVER['HOMEPAGE'] . "/a2b2.php"; // change to your own
-$target = '_blank';
-$forward = 1;
-
-$response = 'status=' . $status;
-$response.= $trenner;
-$response.= 'url=' . $url;
-$response.= $trenner;
-$response.= 'target=' . $target;
-$response.= $trenner;
-$response.= 'forward=' . $forward;
-
-
-echo $response;
-}
-if ($id1 == 999) {
-$_SESSION['amount'] = $amount;
-$trenner = "\n";
-$status = 'ok';
-$url = "http://" . $_SERVER['HOMEPAGE'] . "/a2b2.php"; // change to your own
-$target = '_blank';
-$forward = 1;
-
-$response = 'status=' . $status;
-$response.= $trenner;
-$response.= 'url=' . $url;
-$response.= $trenner;
-$response.= 'target=' . $target;
-$response.= $trenner;
-$response.= 'forward=' . $forward;
-
-
-echo $response;
-}
-if ($id1 == 1999) {
-$_SESSION['amount'] = $amount;
-$trenner = "\n";
-$status = 'ok';
-$url = "http://" . $_SERVER['HOMEPAGE'] . "/a2b2.php"; // change to your own
-$target = '_blank';
-$forward = 1;
-
-$response = 'status=' . $status;
-$response.= $trenner;
-$response.= 'url=' . $url;
-$response.= $trenner;
-$response.= 'target=' . $target;
-$response.= $trenner;
-$response.= 'forward=' . $forward;
-
-
-echo $response;
-}
-if ($id1 == 4999) {
-$_SESSION['amount'] = $amount;
-$trenner = "\n";
-$status = 'ok';
-$url = "http://" . $_SERVER['HOMEPAGE'] . "/a2b2.php"; // change to your own
-$target = '_blank';
-$forward = 1;
-
-$response = 'status=' . $status;
-$response.= $trenner;
-$response.= 'url=' . $url;
-$response.= $trenner;
-$response.= 'target=' . $target;
-$response.= $trenner;
-$response.= 'forward=' . $forward;
-
-
-echo $response;
-}
-?>
-
From 23c0f4f8f758d77583508fbb97038b4836e5ed91 Mon Sep 17 00:00:00 2001
From: Martin Ambrus
Date: Fri, 1 Dec 2017 11:10:00 +0100
Subject: [PATCH 8/9] catching up (#3)
* fix: all languages added to installer
* fix: all languages added to installer and Admin
* fix: max crop/resources reset to level 1 value temporarily
This happened when level 1 granary / warehouse was built because of
a missing + sign in a formula.
#374
* chore: some more badges and thanks to JetBrains :)
* chore: one more badge :P
* chore: cleanup
* fix: Multihunter should have access to villages info
* fix: troops duplicate for certain tribes via raid lists
* fix: no need for WW Building Plan to start building a WW
#337
* fix: natar WW villages created without units
#392
* fix: sendunits.txt file could not be opened from Admin
* fix: WW villages created via Admin do not have any units
#392
* fix: WW building plans must be in player's village to start building WW
#337
---
GameEngine/Admin/Mods/natarbuildingplan.php | 5 +----
GameEngine/Admin/Mods/natarend.php | 4 +---
GameEngine/Automation.php | 6 +++---
GameEngine/Building.php | 13 ++++++++++---
4 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/GameEngine/Admin/Mods/natarbuildingplan.php b/GameEngine/Admin/Mods/natarbuildingplan.php
index 1928f904..f37b0726 100755
--- a/GameEngine/Admin/Mods/natarbuildingplan.php
+++ b/GameEngine/Admin/Mods/natarbuildingplan.php
@@ -27,7 +27,6 @@ include_once($autoprefix."GameEngine/Database.php");
$id = (int) $_POST['id'];
$amt = (int) $_POST['vill_amount'];
-$addUnitsWrefs = [];
for($i=1;$i<=$amt;$i++) {
@@ -41,7 +40,7 @@ $addUnitsWrefs = [];
mysqli_query($GLOBALS["link"], $q);
$pop = $automation->recountPop($wid);
$cp = $automation->recountPop($wid);
- $addUnitsWrefs[] = $wid;
+ $database->addUnits($wid);
$database->addTech($wid);
$database->addABTech($wid);
$speed = NATARS_UNITS;
@@ -51,8 +50,6 @@ $addUnitsWrefs = [];
$database->addArtefact($wid, 3, 11, 1, PLAN, $desc, '', 'type1.gif');
}
- $database->addUnits($addUnitsWrefs);
-
$myFile = "../../../Templates/text.tpl";
$fh = fopen($myFile, 'w') or die("
Can't open file: templates/text.tpl");
$text = file_get_contents("../../../Templates/text_format.tpl");
diff --git a/GameEngine/Admin/Mods/natarend.php b/GameEngine/Admin/Mods/natarend.php
index 68497aa4..a3fd058f 100755
--- a/GameEngine/Admin/Mods/natarend.php
+++ b/GameEngine/Admin/Mods/natarend.php
@@ -27,7 +27,6 @@ include_once($autoprefix."GameEngine/Database.php");
$id = (int) $_POST['id'];
$amt = (int) $_POST['vill_amount'];
-$addUnitsWrefs = [];
$addTechWrefs = [];
$addABTechWrefs = [];
@@ -44,17 +43,16 @@ for($i=1;$i<=$amt;$i++) {
mysqli_query($GLOBALS["link"], $q);
$pop = $automation->recountPop($wid);
$cp = $automation->recountPop($wid);
- $addUnitsWrefs[] = $wid;
$addTechWrefs[] = $wid;
$addABTechWrefs[] = $wid;
$speed = NATARS_UNITS;
//new with random amount of troops
+ $database->addUnits($wid);
$q = "UPDATE " . TB_PREFIX . "units SET u41 = " . (rand(50, 1200) * $speed) . ", u42 = " . (rand(100, 1400) * $speed) . ", u43 = " . (rand(200, 1600) * $speed) . ", u44 = " . (rand(10, 50) * $speed) . ", u45 = " . (rand(48, 1700) * $speed) . ", u46 = " . (rand(60, 1800) * $speed) . ", u47 = " . (rand(200, 1600) * $speed) . ", u48 = " . (rand(40, 200) * $speed) . " , u49 = " . (rand(4, 20) * $speed) . ", u50 = " . (rand(5, 25) * $speed) . " WHERE vref = '".$wid."'";
mysqli_query($GLOBALS["link"], $q);
}
-$database->addUnits($addUnitsWrefs);
$database->addTech($addTechWrefs);
$database->addABTech($addABTechWrefs);
diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php
index 97f9086a..fcc2878e 100755
--- a/GameEngine/Automation.php
+++ b/GameEngine/Automation.php
@@ -1206,7 +1206,7 @@ class Automation {
}
$reload=false;
- $ourFileHandle = fopen("GameEngine/Prevention/sendunits.txt", 'w');
+ $ourFileHandle = fopen($autoprefix."GameEngine/Prevention/sendunits.txt", 'w');
fclose($ourFileHandle);
$time = time();
$q = "
@@ -3138,8 +3138,8 @@ class Automation {
}
}
- if(file_exists("GameEngine/Prevention/sendunits.txt")) {
- unlink("GameEngine/Prevention/sendunits.txt");
+ if(file_exists($autoprefix."GameEngine/Prevention/sendunits.txt")) {
+ unlink($autoprefix."GameEngine/Prevention/sendunits.txt");
}
if ($reload) header("Location: ".$_SERVER['PHP_SELF']);
}
diff --git a/GameEngine/Building.php b/GameEngine/Building.php
index da5ac596..17e81ff6 100755
--- a/GameEngine/Building.php
+++ b/GameEngine/Building.php
@@ -87,19 +87,22 @@ class Building {
// check if we should allow building the WW this high
if ( $wwHighestLevelFound >= 50 ) {
- $needed_plan = 1;
+ $needed_plan = 2;
} else {
- $needed_plan = 0;
+ $needed_plan = 1;
}
// count building plans
if ( $needed_plan ) {
$wwbuildingplan = 0;
+ $planFoundInOwnersVillage = false;
$villages = $database->getVillagesID( $session->uid );
+
foreach ( $villages as $village1 ) {
$plan = count( $database->getOwnArtefactInfoByType2( $village1, 11 ) );
if ( $plan > 0 ) {
$wwbuildingplan = 1;
+ $planFoundInOwnersVillage = true;
}
}
@@ -118,7 +121,11 @@ class Building {
}
}
- $cached = $wwbuildingplan > $needed_plan;
+ if ($needed_plan == 1) {
+ $cached = ($wwbuildingplan >= $needed_plan && $planFoundInOwnersVillage);
+ } else {
+ $cached = $wwbuildingplan >= $needed_plan;
+ }
} else {
// no need for building plans, we can still upgrade WW
$cached = true;
From a321906d41e07028a5e50e53d9f3378e971e6ad5 Mon Sep 17 00:00:00 2001
From: Martin Ambrus
Date: Fri, 1 Dec 2017 19:57:57 +0100
Subject: [PATCH 9/9] catching up (#4)
* fix: all languages added to installer
* fix: all languages added to installer and Admin
* fix: max crop/resources reset to level 1 value temporarily
This happened when level 1 granary / warehouse was built because of
a missing + sign in a formula.
#374
* chore: some more badges and thanks to JetBrains :)
* chore: one more badge :P
* chore: cleanup
* fix: Multihunter should have access to villages info
* fix: troops duplicate for certain tribes via raid lists
* fix: no need for WW Building Plan to start building a WW
#337
* fix: natar WW villages created without units
#392
* fix: sendunits.txt file could not be opened from Admin
* fix: WW villages created via Admin do not have any units
#392
* fix: WW building plans must be in player's village to start building WW
#337
* fix: hero training and revival misbehaving
* fix: spending hero points subtracts these from all player's heroes
#341
* fix: 2nd row of catapults firing when not allowed
#393
* fix: 2nd wave of catapults destroys targets and villages incorrectly
#393
* fix: adding new village via Admin generates incorrect fields
* chore: create default users with bcrypt enabled by default
* fix: in-game Support login fails
* fix: wrong password verify check allows for any login
---
GameEngine/Account.php | 2 +
GameEngine/Admin/database.php | 2 +-
GameEngine/Automation.php | 96 ++++++++++++++++++-------------
GameEngine/Database.php | 2 +-
GameEngine/Session.php | 6 +-
Templates/Build/37.tpl | 104 ++++++++++++++++++++--------------
Templates/Build/37_hero.tpl | 35 ++++++------
Templates/Build/37_revive.tpl | 1 -
Templates/Build/37_train.tpl | 34 +++++------
var/db/struct.sql | 10 ++--
10 files changed, 166 insertions(+), 126 deletions(-)
diff --git a/GameEngine/Account.php b/GameEngine/Account.php
index e498ee17..b730be41 100755
--- a/GameEngine/Account.php
+++ b/GameEngine/Account.php
@@ -218,6 +218,8 @@ class Account {
if ( $activateData != "" ) {
$form->addError( "activate", $_POST['user'] );
+ } else {
+ $form->addError("pw",LOGIN_PW_ERROR);
}
} else {
$form->addError("pw",LOGIN_PW_ERROR);
diff --git a/GameEngine/Admin/database.php b/GameEngine/Admin/database.php
index c3a08562..f47c4bdc 100755
--- a/GameEngine/Admin/database.php
+++ b/GameEngine/Admin/database.php
@@ -181,7 +181,7 @@ class adm_DB {
$username = $database->getUserArray($uid,1);
$username = $username['username'];
$database->addVillage($wid,$uid,$username,'0');
- $database->addResourceFields($wid,$database->getVillageType($wid));
+ $database->addResourceFields($wid,$database->getVillageType($wid, false));
$database->addUnits($wid);
$database->addTech($wid);
$database->addABTech($wid);
diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php
index fcc2878e..95b437f9 100755
--- a/GameEngine/Automation.php
+++ b/GameEngine/Automation.php
@@ -1090,8 +1090,8 @@ class Automation {
}
// oasis cannot be destroyed
+ $pop=$this->recountPop($data['to'], false);
if ($isoasis == 0) {
- $pop=$this->recountPop($data['to'], false);
if($pop==0 && $can_destroy==1){
$village_destroyed = 1;
// this will ensure the right $info_cat text
@@ -2267,6 +2267,9 @@ class Automation {
else
{
// village stands, let's do the damage
+ /**
+ * FIRST CATAPULTS ROW
+ */
$basearray = $data['to'];
$bdo = $database->getResourceLevel($basearray, false);
$catapultTarget = $data['ctar1'];
@@ -2277,15 +2280,12 @@ class Automation {
$catapults2TargetRandom = ($catapults2WillNotShoot || $catapultTarget2 == 99);
// we're manually targetting 1st and/or 2nd row of catapults
- if (!$catapults1TargetRandom || !$catapults2TargetRandom)
+ if (!$catapults1TargetRandom)
{
$_catapultsTarget1Levels=array();
$__catapultsTarget1AltTargets=array();
- $_catapultsTarget2Levels=array();
- $__catapultsTarget2AltTargets=array();
-
- // calculate targets for 1st and 2nd rows of catapults
+ // calculate targets for 1st rows of catapults
$j=0;
for ($i=1;$i<=41;$i++)
{
@@ -2298,13 +2298,6 @@ class Automation {
$_catapultsTarget1Levels[$j]=$bdo['f'.$i];
$__catapultsTarget1AltTargets[$j]=$i;
}
-
- // 2nd row of catapults pre-selected target calculations, if needed
- if (!$catapults2TargetRandom && !$catapults2WillNotShoot && $bdo['f'.$i.'t'] == $catapultTarget2 && $bdo['f'.$i] > 0 && $catapultTarget2 != 31 && $catapultTarget2 != 32 && $catapultTarget2 != 33)
- {
- $_catapultsTarget2Levels[$j]=$bdo['f'.$i];
- $__catapultsTarget2AltTargets[$j]=$i;
- }
}
// if we couldn't find a suitable target for 1st row of catapults,
@@ -2321,6 +2314,54 @@ class Automation {
$catapults1TargetRandom = true;
}
}
+ }
+
+ // 1st row of catapults set to target randomly
+ if ($catapults1TargetRandom)
+ {
+ $list=array();
+ for ($i=1;$i<=41;$i++)
+ {
+ if ($i==41) $i=99;
+ if ($bdo['f'.$i] > 0 && $catapultTarget != 31 && $catapultTarget != 32 && $catapultTarget != 33)
+ {
+ $list[]=$i;
+ }
+ }
+ $catapultTarget = $list[ rand(0, count($list) - 1) ];
+ }
+
+ /**
+ * resolve 1st row of catapults
+ */
+ $village_destroyed = 0;
+ $this->resolveCatapultsDestruction($bdo, $battlepart, $info_cat, $data, $catapultTarget, !$catapults2WillNotShoot, false, $catp_pic, $can_destroy, $isoasis, $village_destroyed);
+
+ /**
+ * SECOND CATAPULTS ROW
+ */
+ // reload resource levels, since they've changed now
+ $bdo = $database->getResourceLevel($basearray, false);
+
+ // we're manually targetting 2nd row of catapults
+ if (!$catapults2TargetRandom)
+ {
+ $_catapultsTarget2Levels=array();
+ $__catapultsTarget2AltTargets=array();
+
+ // calculate targets for 2nd rows of catapults
+ $j=0;
+ for ($i=1;$i<=41;$i++)
+ {
+ if ($i==41) $i=99;
+
+ // 2nd row of catapults pre-selected target calculations, if needed
+ if (!$catapults2TargetRandom && !$catapults2WillNotShoot && $bdo['f'.$i.'t'] == $catapultTarget2 && $bdo['f'.$i] > 0 && $catapultTarget2 != 31 && $catapultTarget2 != 32 && $catapultTarget2 != 33)
+ {
+ $_catapultsTarget2Levels[$j]=$bdo['f'.$i];
+ $__catapultsTarget2AltTargets[$j]=$i;
+ }
+ }
// if we couldn't find a suitable target for 2nd row of catapults,
// select a random target instead
@@ -2338,46 +2379,21 @@ class Automation {
}
}
- // 1st row of catapults set to target randomly
- if ($catapults1TargetRandom)
- {
- $list=array();
- $j = 1;
- for ($i=1;$i<=41;$i++)
- {
- if ($i==41) $i=99;
- if ($bdo['f'.$i] > 0 && $catapultTarget != 31 && $catapultTarget != 32 && $catapultTarget != 33)
- {
- $list[$j]=$i;
- $j++;
- }
- }
- $catapultTarget = $list[ rand(1, $j - 1) ];
- }
-
// 2nd row of catapults set to target randomly
if ($catapults2TargetRandom && !$catapults2WillNotShoot)
{
$list=array();
- $j=1;
for ($i=1;$i<=41;$i++)
{
if ($i==41) $i=99;
if ($bdo['f'.$i] > 0)
{
- $j++;
- $list[$j]=$i;
+ $list[]=$i;
}
}
- $catapultTarget2 = $list[ rand(1, $j - 1) ];
+ $catapultTarget2 = $list[ rand(0, count($list) - 1) ];
}
- /**
- * resolve 1st row of catapults
- */
- $village_destroyed = 0;
- $this->resolveCatapultsDestruction($bdo, $battlepart, $info_cat, $data, $catapultTarget, !$catapults2WillNotShoot, false, $catp_pic, $can_destroy, $isoasis, $village_destroyed);
-
/**
* resolve 2nd row of catapults
*/
diff --git a/GameEngine/Database.php b/GameEngine/Database.php
index eb46c265..f6ced345 100755
--- a/GameEngine/Database.php
+++ b/GameEngine/Database.php
@@ -5535,7 +5535,7 @@ References: User ID/Message ID, Mode
$t11 = [$t11];
$type = [$type];
$ctar1 = [$ctar1];
- $ctar2 = [$ctar1];
+ $ctar2 = [$ctar2];
$spy = [$spy];
$b1 = [$b1];
$b2 = [$b2];
diff --git a/GameEngine/Session.php b/GameEngine/Session.php
index e66ed563..abff455c 100755
--- a/GameEngine/Session.php
+++ b/GameEngine/Session.php
@@ -180,7 +180,7 @@ class Session {
if($user && ($admin || isset($_SESSION['sessid']))) {
// check if this is not a support user, for who only messages and statistics are available
- if ($user == 1) {
+ if ($user == 'Support') {
$req_file = basename($_SERVER['PHP_SELF']);
if (!in_array($req_file, ['nachrichten.php', 'logout.php', 'statistiken.php', 'rules.php', 'karte.php', 'karte2.php', 'spieler.php'])) {
header('Location:nachrichten.php');
@@ -269,7 +269,9 @@ class Session {
if($this->userarray['b4'] > $this->time) {
$this->bonus4 = 1;
}
- $this->CheckHeroReal();
+ if (!in_array($this->username, ['Support', 'Multihunter'])) {
+ $this->CheckHeroReal();
+ }
}
private function SurfControl(){
diff --git a/Templates/Build/37.tpl b/Templates/Build/37.tpl
index c9ac1231..c7abd466 100644
--- a/Templates/Build/37.tpl
+++ b/Templates/Build/37.tpl
@@ -8,7 +8,8 @@
| Copyright: TravianX Project All rights reserved |
\*-------------------------------------------------------*/
- $hero_info = $units->Hero($session->uid, 0, true);
+ $hero_info = $units->Hero($session->uid);
+ $heroes = $units->Hero($session->uid, 1);
$define['reset_level'] = 3; // Until which level you are able to reset your points
?>
@@ -22,47 +23,70 @@
- getTimeFormat($hero_info['trainingtime'] - time());
+ $include_training = true;
+ $include_revive = false;
+ foreach ($heroes as $hdata) {
+ if ($hdata['dead'] == 1) {
+ $include_revive = true;
+ }
+
+ if ($hdata['inrevive'] == 1) {
+ $name1 = $hdata['name'];
+ $include_training = false;
+ }
+ }
+
+ if($hero_info === false && $include_revive){
+ include_once("37_revive.tpl");
+ }
+
+ if ($hero_info === false && $include_training) {
+ include_once("37_train.tpl");
+ } else if($hero_info['intraining'] == 1) {
+
+ $timeleft = $generator->getTimeFormat($hero_info['trainingtime'] - time());
?>
@@ -85,9 +109,7 @@
escape($_POST['name']))."' where `uid`='".$database->escape($session->uid)."' AND dead = 0") or die("ERROR:".mysqli_error($database->dblink));
echo "".NAME_CHANGED."";
-}
- $hero_info = $units->Hero($session->uid);
+}
?>