From c574a71b3af2ca6553b1d1c2224ff30f63289bd5 Mon Sep 17 00:00:00 2001 From: iopietro Date: Thu, 21 Jun 2018 14:43:47 +0200 Subject: [PATCH] General fixes +Fixed a bug that didn't delete artifacts when a player deleted his account +Added "(artifact)" if a village has an artifact in the village overview +Added the artifact section in the multihunter panel (return to natars doesn't work yet) NOTE: To play this version of the game, you have to run this query first (where "s1_" is the prefix of your server): ALTER TABLE `s1_artefacts` ADD `del` TINYINT(1) NULL DEFAULT '0' AFTER `lastupdate`; ALTER TABLE `testtravian`.`s1_artefacts` ADD INDEX `active-owner-conquered-del` (`active`, `owner`, `conquered`, `del`); --- Admin/Templates/artifact.tpl | 53 +++ Admin/Templates/troopUpgrades.tpl | 45 +- Admin/Templates/village.tpl | 49 +- GameEngine/Admin/function.php | 550 +++++++++++++--------- GameEngine/Artifacts.php | 79 ++++ GameEngine/Automation.php | 4 +- GameEngine/Database.php | 17 +- Templates/Build/27_1.tpl | 81 ++-- Templates/Build/27_show.tpl | 95 +--- Templates/Profile/overview.tpl | 6 +- gpack/travian_default/lang/en/compact.css | 20 +- sql_updates.txt | 4 + var/db/struct.sql | 4 +- 13 files changed, 587 insertions(+), 420 deletions(-) create mode 100644 Admin/Templates/artifact.tpl create mode 100644 GameEngine/Artifacts.php diff --git a/Admin/Templates/artifact.tpl b/Admin/Templates/artifact.tpl new file mode 100644 index 00000000..6973638d --- /dev/null +++ b/Admin/Templates/artifact.tpl @@ -0,0 +1,53 @@ +getOwnArtefactInfo($_GET['did'])); +$artifactOfTheFool = !empty($artifact) && $artifact['type'] == 8; +$artifactInfo = Artifacts::getArtifactInfo($artifact); +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Artifact
NameBonusArea of effectTime of conquerTime of activationNext activation
+ Return to Natars'; + ?> + \ No newline at end of file diff --git a/Admin/Templates/troopUpgrades.tpl b/Admin/Templates/troopUpgrades.tpl index 41152c70..2e9cf0cb 100644 --- a/Admin/Templates/troopUpgrades.tpl +++ b/Admin/Templates/troopUpgrades.tpl @@ -1,6 +1,3 @@ - @@ -15,50 +12,34 @@ if($_SESSION['access'] < MULTIHUNTER) die("Access Denied: You are not Admin!");
'; - } - for($i=1; $i<9; $i++) - { - echo ''; - } + for($i = 1; $i < 9; $i++) echo ''; + for($i = 1; $i < 9; $i++) echo ''; ?> ?"; $abtech['b'.$i]="?";} echo ''; - } ##B - for($i=1; $i<9; $i++) - { - echo ''; } + + //Blacksmith + for($i = 1; $i < 9; $i++) echo ''; ?>
'.$abtech['a'.$i].'
'.$abtech['b'.$i].'
'.$abtech['b'.$i].'
Upgrades Troops';} - else { echo 'Upgrades TroopsResearch Log';} - } - if(isset($_GET['ab'])){ - echo '
AB Tech Troops upgrades
'; - } + + if($tribe == 5) echo 'Upgrades Troops'; + else echo 'Upgrades TroopsResearch Log'; + + if(isset($_GET['ab'])) echo '
AB Tech Troops upgrades
'; ?> \ No newline at end of file diff --git a/Admin/Templates/village.tpl b/Admin/Templates/village.tpl index 6439b281..d5cb33ae 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'] < 8) die("Access Denied: You are not Admin!"); +include_once("../GameEngine/Generator.php"); $id = $_GET['did']; if(isset($id)){ @@ -21,26 +21,29 @@ if(isset($id)){ $fdata = $database->getResourceLevel($village['wref']); $units = $database->getUnit($village['wref']); $abtech = $database->getABTech($id); // Armory/blacksmith level - if($type == 1){ $typ = array(3,3,3,9); } - elseif($type == 2){ $typ = array(3,4,5,6); } - elseif($type == 3){ $typ = array(4,4,4,6); } - elseif($type == 4){ $typ = array(4,5,3,6); } - elseif($type == 5){ $typ = array(5,3,4,6); } - elseif($type == 6){ $typ = array(1,1,1,15); } - elseif($type == 7){ $typ = array(4,4,3,7); } - elseif($type == 8){ $typ = array(3,4,4,7); } - elseif($type == 9){ $typ = array(4,3,4,7); } - elseif($type == 10){ $typ = array(3,5,4,6); } - elseif($type == 11){ $typ = array(4,5,3,6); } - elseif($type == 12){ $typ = array(5,4,3,6); } + + switch($type){ + case 1: $typ = [3, 3, 3, 9]; break; + case 2: $typ = [3, 4, 5, 6]; break; + case 3: $typ = [4, 4, 4, 6]; break; + case 4: $typ = [4, 5, 3, 6]; break; + case 5: $typ = [5, 3, 4, 6]; break; + case 6: $typ = [1, 1, 1, 15]; break; + case 7: $typ = [4, 4, 3, 7]; break; + case 8: $typ = [3, 4, 4, 7]; break; + case 9: $typ = [4, 3, 4, 7]; break; + case 10: $typ = [3, 5, 4, 6]; break; + case 11: $typ = [4, 5, 3, 6]; break; + case 12: $typ = [5, 4, 3, 6]; break; + } + $ocounter = []; $wood = $clay = $iron =$crop = 0; $q = "SELECT o.*, w.x, w.y FROM ".TB_PREFIX."odata AS o LEFT JOIN ".TB_PREFIX."wdata AS w ON o.wref=w.id WHERE conqured = ".(int) $village['wref']; $result = $database->query_return($q); - if(!empty($result) > 0){ + if(!empty($result)){ $newResult = []; - foreach($result as $row) - { + foreach($result as $row){ $type = $row['type']; if ( $type == 1 ) { $row['type'] = ' + 25%'; @@ -91,15 +94,6 @@ if(isset($id)){ $refreshiconfrm = "../img/admin/refresh.png"; $refreshicon = ""; - class MyGenerator - { - public function getMapCheck($wref) - { - return substr(md5($wref), 5, 2); - } - }; - $generator = new MyGenerator; - if($village && $user){ include("search2.tpl"); ?>