From 2534fdf2a396e440f3cbf66bff4b1df04ccafc76 Mon Sep 17 00:00:00 2001 From: iopietro Date: Fri, 11 May 2018 01:46:17 +0200 Subject: [PATCH] General fixes -Removed the possibility to manual add Natars, WW Villages and WW building plans +The crop consumption in WW villages is now halved --- Admin/Templates/natarbuildingplan.tpl | 57 ------ Admin/Templates/natarend.tpl | 57 ------ Admin/admin.php | 4 - GameEngine/Admin/Mods/natarbuildingplan.php | 70 -------- GameEngine/Admin/Mods/natarend.php | 59 ------- GameEngine/Technology.php | 3 + Templates/menu.tpl | 1 - create_account.php | 183 -------------------- 8 files changed, 3 insertions(+), 431 deletions(-) delete mode 100644 Admin/Templates/natarbuildingplan.tpl delete mode 100644 Admin/Templates/natarend.tpl delete mode 100755 GameEngine/Admin/Mods/natarbuildingplan.php delete mode 100755 GameEngine/Admin/Mods/natarend.php delete mode 100644 create_account.php diff --git a/Admin/Templates/natarbuildingplan.tpl b/Admin/Templates/natarbuildingplan.tpl deleted file mode 100644 index bbf6c7a5..00000000 --- a/Admin/Templates/natarbuildingplan.tpl +++ /dev/null @@ -1,57 +0,0 @@ - - - - -
- - - -








- -
Create WW Buildingplan villages?
- -

 insert number of Villages and press 'enter'
- - - - - - - -
WW Buidingplan villages Added'; - - } - -?> \ No newline at end of file diff --git a/Admin/Templates/natarend.tpl b/Admin/Templates/natarend.tpl deleted file mode 100644 index 1ef1c7e6..00000000 --- a/Admin/Templates/natarend.tpl +++ /dev/null @@ -1,57 +0,0 @@ - - - - -
- - - -








- -
Create World Wonder villages?
- -

 insert number of Wonders and press 'enter'
- - - - - - - -
World Wonders Added'; - - } - -?> \ No newline at end of file diff --git a/Admin/admin.php b/Admin/admin.php index e7aa1351..d5ec4be2 100644 --- a/Admin/admin.php +++ b/Admin/admin.php @@ -496,10 +496,6 @@ if (!empty($_GET['p'])) { Users Create Users
- Natars - Add WW Villages - Add WW Building Plan Villages -
Admin: Admin Log Server Settings diff --git a/GameEngine/Admin/Mods/natarbuildingplan.php b/GameEngine/Admin/Mods/natarbuildingplan.php deleted file mode 100755 index f37b0726..00000000 --- a/GameEngine/Admin/Mods/natarbuildingplan.php +++ /dev/null @@ -1,70 +0,0 @@ -generateBase($kid); - $database->setFieldTaken($wid); - $time = time(); - $q = "insert into ".TB_PREFIX."vdata (`wref`,`owner`,`name`,`capital`,`pop`,`cp`,`celebration`,`type`,`wood`,`clay`,`iron`,`maxstore`,`crop`,`maxcrop`,`lastupdate`,`loyalty`,`exp1`,`exp2`,`exp3`,`created`) values ('$wid','3','".PLANVILLAGE."',0,0,0,0,0,80000.00,80000.00,80000.00,80000,80000.00,80000,1314974534,100,0,0,0,1314968914)"; - mysqli_query($GLOBALS["link"], $q) or die(mysqli_error($database->dblink)); - $q = "insert into ".TB_PREFIX."fdata (`vref`,`f1`,`f1t`,`f2`,`f2t`,`f3`,`f3t`,`f4`,`f4t`,`f5`,`f5t`,`f6`,`f6t`,`f7`,`f7t`,`f8`,`f8t`,`f9`,`f9t`,`f10`,`f10t`,`f11`,`f11t`,`f12`,`f12t`,`f13`,`f13t`,`f14`,`f14t`,`f15`,`f15t`,`f16`,`f16t`,`f17`,`f17t`,`f18`,`f18t`,`f19`,`f19t`,`f20`,`f20t`,`f21`,`f21t`,`f22`,`f22t`,`f23`,`f23t`,`f24`,`f24t`,`f25`,`f25t`,`f26`,`f26t`,`f27`,`f27t`,`f28`,`f28t`,`f29`,`f29t`,`f30`,`f30t`,`f31`,`f31t`,`f32`,`f32t`,`f33`,`f33t`,`f34`,`f34t`,`f35`,`f35t`,`f36`,`f36t`,`f37`,`f37t`,`f38`,`f38t`,`f39`,`f39t`,`f40`,`f40t`,`f99`,`f99t`,`wwname`) values ($wid,0,1,0,4,0,1,0,3,0,2,0,2,0,3,0,4,0,4,0,3,0,3,0,4,0,4,0,1,0,4,0,2,0,1,0,2,20,17,20,11,10,27,20,10,10,22,10,25,0,0,20,15,10,19,0,0,0,0,0,0,10,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,16,0,0,0,0,'World Wonder')"; - mysqli_query($GLOBALS["link"], $q); - $pop = $automation->recountPop($wid); - $cp = $automation->recountPop($wid); - $database->addUnits($wid); - $database->addTech($wid); - $database->addABTech($wid); - $speed = NATARS_UNITS; - $q = "UPDATE ".TB_PREFIX."units SET u41 = u41 + " . (1500 * $speed) . ", u42 = u42 + " . (1500 * $speed) . ", u43 = u43 + " . (1500 * $speed) . ", u44 = u44 + " . (1500 * $speed) . ", u45 = u45 + " . (1500 * $speed) . ", u46 = u46 + " . (1500 * $speed) . ", u47 = u47 + " . (1500 * $speed) . ", u48 = u48 + " . (1500 * $speed) . " , u49 = u49 + " . (1500 * $speed) . ", u50 = u50 + " . (1500 * $speed) . " WHERE vref = '".$wid."'"; - mysqli_query($GLOBALS["link"], $q); - $desc = PLAN_DESC; - $database->addArtefact($wid, 3, 11, 1, PLAN, $desc, '', 'type1.gif'); - } - - $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"); - $text = preg_replace("'%TEKST%'",PLAN_INFO ,$text); - fwrite($fh, $text); - - $query="SELECT * FROM ".TB_PREFIX."users ORDER BY id DESC"; - $result=mysqli_query($GLOBALS["link"], $query) or die (mysqli_error($database->dblink)); - for ($i=0; $row=mysqli_fetch_row($result); $i++) { - $updateattquery = mysqli_query($GLOBALS["link"], "UPDATE ".TB_PREFIX."users SET ok = '1' WHERE id = '".$row[0]."'") - or die(mysqli_error($database->dblink)); - } - - mysqli_query($GLOBALS["link"], "Insert into ".TB_PREFIX."admin_log values (0,$id,'Added $amt WW Buildingplan Villages',".time().")"); - - -header("Location: ../../../Admin/admin.php?p=natarbuildingplan&g"); -?> diff --git a/GameEngine/Admin/Mods/natarend.php b/GameEngine/Admin/Mods/natarend.php deleted file mode 100755 index 86d0788c..00000000 --- a/GameEngine/Admin/Mods/natarend.php +++ /dev/null @@ -1,59 +0,0 @@ -generateBase($kid); - $database->setFieldTaken($wid); - $time = time(); - $q = "insert into ".TB_PREFIX."vdata (`wref`,`owner`,`name`,`capital`,`pop`,`cp`,`celebration`,`type`,`wood`,`clay`,`iron`,`maxstore`,`crop`,`maxcrop`,`lastupdate`,`loyalty`,`exp1`,`exp2`,`exp3`,`created`,`natar`) values ('$wid','3','".WWVILLAGE."',0,0,0,0,0,80000.00,80000.00,80000.00,80000,80000.00,80000,1314974534,100,0,0,0,$time,1)"; - mysqli_query($GLOBALS["link"], $q) or die(mysqli_error($database->dblink)); - $q = "insert into ".TB_PREFIX."fdata (`vref`,`f1`,`f1t`,`f2`,`f2t`,`f3`,`f3t`,`f4`,`f4t`,`f5`,`f5t`,`f6`,`f6t`,`f7`,`f7t`,`f8`,`f8t`,`f9`,`f9t`,`f10`,`f10t`,`f11`,`f11t`,`f12`,`f12t`,`f13`,`f13t`,`f14`,`f14t`,`f15`,`f15t`,`f16`,`f16t`,`f17`,`f17t`,`f18`,`f18t`,`f19`,`f19t`,`f20`,`f20t`,`f21`,`f21t`,`f22`,`f22t`,`f23`,`f23t`,`f24`,`f24t`,`f25`,`f25t`,`f26`,`f26t`,`f27`,`f27t`,`f28`,`f28t`,`f29`,`f29t`,`f30`,`f30t`,`f31`,`f31t`,`f32`,`f32t`,`f33`,`f33t`,`f34`,`f34t`,`f35`,`f35t`,`f36`,`f36t`,`f37`,`f37t`,`f38`,`f38t`,`f39`,`f39t`,`f40`,`f40t`,`f99`,`f99t`,`wwname`) values ($wid,0,1,0,4,0,1,0,3,0,2,0,2,0,3,0,4,0,4,0,3,0,3,0,4,0,4,0,1,0,4,0,2,0,1,0,2,20,17,20,11,20,15,20,10,10,22,10,25,0,0,0,0,10,19,0,0,0,0,0,0,10,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,16,0,0,0,40,'World Wonder')"; - mysqli_query($GLOBALS["link"], $q); - $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->addTech($addTechWrefs); -$database->addABTech($addABTechWrefs); - -mysqli_query($GLOBALS["link"], "Insert into ".TB_PREFIX."admin_log values (0,$id,'Added $amt WW Villages',".time().")"); - -header("Location: ../../../Admin/admin.php?p=natarend&g"); -?> diff --git a/GameEngine/Technology.php b/GameEngine/Technology.php index 3e8ece38..f84b2692 100755 --- a/GameEngine/Technology.php +++ b/GameEngine/Technology.php @@ -453,6 +453,9 @@ class Technology { $upkeep += $array[$index] * 6; $who = $database->getVillageField($vid, "owner"); + //If it's a WW village, halve the crop consumption + if($database->getVillageField($vid, "natar") == 1) $upkeep /= 2; + return ceil($database->getArtifactsValueInfluence($who, $vid, 4, $upkeep, false)); } diff --git a/Templates/menu.tpl b/Templates/menu.tpl index 5855f036..5ba5c62b 100644 --- a/Templates/menu.tpl +++ b/Templates/menu.tpl @@ -45,7 +45,6 @@ div.c1 {text-align: center} echo "".ADMIN_PANEL.""; echo "".MASS_MESSAGE.""; echo "".SYSTEM_MESSAGE.""; - echo "Create Natars"; } ?>

pageLoadTimeStart(); - -################################################################################# -## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ## -## --------------------------------------------------------------------------- ## -## Project: TravianZ ## -## Version: 22.06.2015 ## -## Filename create_account.php ## -## Developed by: Dzoki , Advocaite , Donnchadh , yi12345 , Shadow , MisterX ## -## Fixed by: Shadow & MisterX - Scouting all players , artefact names. ## -## Fixed by: InCube - double troops ## -## Fixed by: ronix ## -## License: TravianZ Project ## -## Copyright: TravianZ (c) 2010-2015. All rights reserved. ## -## URLs: http://travian.shadowss.ro ## -## Source code: https://github.com/Shadowss/TravianZ ## -## ## -################################################################################# - - -use App\Entity\User; -use App\Utils\AccessLogger; - -global $autoprefix; - -// go max 5 levels up - we don't have folders that go deeper than that -$autoprefix = ''; -for ($i = 0; $i < 5; $i++) { - $autoprefix = str_repeat('../', $i); - if (file_exists($autoprefix.'autoloader.php')) { - // we have our path, let's leave - break; - } -} - -include_once ($autoprefix."GameEngine/Session.php"); -include_once ($autoprefix."GameEngine/config.php"); -AccessLogger::logRequest(); - - -/** - * If user is not administrator, access is denied! - */ - if($session->access < ADMIN){ - die("Access Denied: You are not Admin!"); - }else{ - -?> - - - - <?php echo SERVER_NAME ?> - Account Creation - - - - - - - - - - - - gpack == null || GP_ENABLE == false) { - echo " - - "; - } else { - echo " - - "; - } - ?> - - - - - -
- -
-
- -
- -
-createNatars(); - - $artifactArrays = [ARCHITECTS_DESC => [["type" => 1, "size" => 1, "name" => ARCHITECTS_SMALL, "vname" => ARCHITECTS_SMALLVILLAGE, "effect" => "(4x)", "quantity" => 6, "img" => 2], - ["type" => 1, "size" => 2, "name" => ARCHITECTS_LARGE, "vname" => ARCHITECTS_LARGEVILLAGE, "effect" => "(3x)", "quantity" => 4, "img" => 2], - ["type" => 1, "size" => 3, "name" => ARCHITECTS_UNIQUE,"vname" => ARCHITECTS_UNIQUEVILLAGE, "effect" => "(5x)", "quantity" => 1, "img" => 2]], - - HASTE_DESC => [["type" => 2, "size" => 1, "name" => HASTE_SMALL, "vname" => HASTE_SMALLVILLAGE, "effect" => "(2x)", "quantity" => 6, "img" => 4], - ["type" => 2, "size" => 2, "name" => HASTE_LARGE, "vname" => HASTE_LARGEVILLAGE, "effect" => "(1.5x)", "quantity" => 4, "img" => 4], - ["type" => 2, "size" => 3, "name" => HASTE_UNIQUE, "vname" => HASTE_UNIQUEVILLAGE, "effect" => "(3x)", "quantity" => 1, "img" => 4]], - - EYESIGHT_DESC => [["type" => 3, "size" => 1, "name" => EYESIGHT_SMALL, "vname" => EYESIGHT_SMALLVILLAGE, "effect" => "(5x)", "quantity" => 6, "img" => 5], - ["type" => 3, "size" => 2, "name" => EYESIGHT_LARGE, "vname" => EYESIGHT_LARGEVILLAGE, "effect" => "(3x)", "quantity" => 4, "img" => 5], - ["type" => 3, "size" => 3, "name" => EYESIGHT_UNIQUE, "vname" => EYESIGHT_UNIQUEVILLAGE, "effect" => "(10x)", "quantity" => 1, "img" => 5]], - - DIET_DESC => [["type" => 4, "size" => 1, "name" => DIET_SMALL, "vname" => DIET_SMALLVILLAGE, "effect" => "(50%)", "quantity" => 6, "img" => 6], - ["type" => 4, "size" => 2, "name" => DIET_LARGE, "vname" => DIET_LARGEVILLAGE, "effect" => "(25%)", "quantity" => 4, "img" => 6], - ["type" => 4, "size" => 3, "name" => DIET_UNIQUE, "vname" => DIET_UNIQUEVILLAGE, "effect" => "(50%)", "quantity" => 1, "img" => 6]], - - ACADEMIC_DESC => [["type" => 5, "size" => 1, "name" => ACADEMIC_SMALL, "vname" => ACADEMIC_SMALLVILLAGE, "effect" => "(50%)", "quantity" => 6, "img" => 8], - ["type" => 5, "size" => 2, "name" => ACADEMIC_LARGE, "vname" => ACADEMIC_LARGEVILLAGE, "effect" => "(25%)", "quantity" => 4, "img" => 8], - ["type" => 5, "size" => 3, "name" => ACADEMIC_UNIQUE, "vname" => ACADEMIC_UNIQUEVILLAGE, "effect" => "(50%)", "quantity" => 1, "img" => 8]], - - STORAGE_DESC => [["type" => 6, "size" => 1, "name" => STORAGE_SMALL, "vname" => STORAGE_SMALLVILLAGE, "effect" => "(50%)", "quantity" => 6, "img" => 9], - ["type" => 6, "size" => 2, "name" => STORAGE_LARGE, "vname" => STORAGE_LARGEVILLAGE, "effect" => "(25%)", "quantity" => 4, "img" => 9]], - - CONFUSION_DESC => [["type" => 7, "size" => 1, "name" => CONFUSION_SMALL, "vname" => CONFUSION_SMALLVILLAGE, "effect" => "(200)", "quantity" => 6, "img" => 10], - ["type" => 7, "size" => 2, "name" => CONFUSION_LARGE, "vname" => CONFUSION_LARGEVILLAGE, "effect" => "(100)", "quantity" => 4, "img" => 10], - ["type" => 7, "size" => 3, "name" => CONFUSION_UNIQUE, "vname" => CONFUSION_UNIQUEVILLAGE, "effect" => "(500)", "quantity" => 1, "img" => 10]], - - FOOL_DESC => [["type" => 8, "size" => 1, "name" => FOOL_SMALL, "vname" => FOOL_SMALLVILLAGE, "effect" => "", "quantity" => 5, "img" => "fool"], - ["type" => 8, "size" => 3, "name" => FOOL_UNIQUE, "vname" => FOOL_UNIQUEVILLAGE, "effect" => "", "quantity" => 1, "img" => "fool"]]]; - - //Add artefacts and their villages - $database->addArtifactVillages($artifactArrays); - - //Write the system message - $database->displaySystemMessage(ARTEFACT); - - echo '

Done: Natars created and artifacts spawned!

'; -}else{ -?> -

-Error: Natar account already exists -

- -
-



- -
-
-
- -
- - -
-
-
- pageLoadTimeEnd()-$start_timer)*1000); -?> ms - -
-
-
-
- -
- - -