diff --git a/Admin/Templates/config.tpl b/Admin/Templates/config.tpl index 255b0826..eb56cd0d 100644 --- a/Admin/Templates/config.tpl +++ b/Admin/Templates/config.tpl @@ -42,11 +42,11 @@ if($_SESSION['access'] < 9) die(ACCESS_DENIED_ADMIN); ? - - - - - + ? @@ -80,33 +80,45 @@ if($_SESSION['access'] < 9) die(ACCESS_DENIED_ADMIN); ? + + ? + + + + ? + + + + ? + + ? x ? - + ? - hour/s + hour/s ? - True"; } else { echo "False"; } ?> + True" : "False"; ?> ? - Enabled"; } else { echo "Disabled"; } ?> + Enabled" : "Disabled"; ?> ? - Enabled"; } else { echo "Disabled"; } ?> + Enabled" : "Disabled"; ?> ? - Travian Official"; } else { echo "TravianZ Extended"; } ?> + Travian Official" : "TravianZ Extended"; ?> ? @@ -114,12 +126,28 @@ if($_SESSION['access'] < 9) die(ACCESS_DENIED_ADMIN); ? - Enabled"; } else if(WW == false) { echo "Disabled"; } ?> + Enabled"; } else if(WW == false) { echo "Disabled"; } ?> ? = 86400){ echo ''.(NATURE_REGTIME/86400).' Days'; } else if(NATURE_REGTIME < 86400){ echo ''.(NATURE_REGTIME/3600).' Hours'; } ?> + + ? + + + + ? + + + + ? + + + + ? + + ? = 86400){ echo ''.(MEDALINTERVAL/86400).' Days'; } else if(MEDALINTERVAL < 86400){ echo ''.(MEDALINTERVAL/3600).' Hours'; } ?> @@ -130,23 +158,20 @@ if($_SESSION['access'] < 9) die(ACCESS_DENIED_ADMIN); ? - Enabled"; } else { echo "Disabled"; } ?> + Enabled"; } else { echo "Disabled"; } ?> ? - True"; } else { echo "False"; } ?> + True"; } else { echo "False"; } ?> ? - + ? - Enabled"; } else { echo "Disabled"; } ?> + Enabled"; } else { echo "Disabled"; } ?> @@ -214,7 +239,7 @@ if($_SESSION['access'] < 9) die(ACCESS_DENIED_ADMIN); ? - = 86400){ echo ''.(PLUS_TIME/86400).' Days'; } else if(PLUS_TIME < 86400){ echo ''.(PLUS_TIME/3600).' Hours'; } ?> + = 86400){ echo ''.(PLUS_TIME/86400).' Days'; } else if(PLUS_TIME < 86400){ echo ''.(PLUS_TIME / 3600).' Hours'; } ?> ? @@ -237,35 +262,35 @@ if($_SESSION['access'] < 9) die(ACCESS_DENIED_ADMIN); ? - Enabled"; } else if(LOG_BUILD == false){ echo "Disabled"; } ?> + Enabled"; } elseif(!LOG_BUILD){ echo "Disabled"; } ?> ? - Enabled"; } else if(LOG_TECH == false){ echo "Disabled"; } ?> + Enabled"; } elseif(!LOG_TECH){ echo "Disabled"; } ?> ? - Enabled"; } else if(LOG_LOGIN == false){ echo "Disabled"; } ?> + Enabled"; } elseif(!LOG_LOGIN){ echo "Disabled"; } ?> ? - Enabled"; } else if(LOG_GOLD_FIN == false){ echo "Disabled"; } ?> + Enabled"; } elseif(!LOG_GOLD_FIN){ echo "Disabled"; } ?> ? - Enabled"; } else if(LOG_ADMIN == false){ echo "Disabled"; } ?> + Enabled"; } elseif(!LOG_ADMIN){ echo "Disabled"; } ?> ? - Enabled"; } else if(LOG_WAR == false){ echo "Disabled"; } ?> + Enabled"; } elseif(!LOG_WAR){ echo "Disabled"; } ?> ? - Enabled"; } else if(LOG_MARKET == false){ echo "Disabled"; } ?> + Enabled"; } elseif(!LOG_MARKET){ echo "Disabled"; } ?> ? - Enabled"; } else if(LOG_ILLEGAL == false){ echo "Disabled"; } ?> + Enabled"; } elseif(!LOG_ILLEGAL){ echo "Disabled"; } ?> @@ -284,27 +309,27 @@ if($_SESSION['access'] < 9) die(ACCESS_DENIED_ADMIN); ? - Enabled"; } else if(NEWSBOX1 == false){ echo "Disabled"; } ?> + Enabled"; } elseif(!NEWSBOX1){ echo "Disabled"; } ?> ? - Enabled"; } else if(NEWSBOX2 == false){ echo "Disabled"; } ?> + Enabled"; } elseif(!NEWSBOX2){ echo "Disabled"; } ?> ? - Enabled"; } else if(NEWSBOX3 == false){ echo "Disabled"; } ?> + Enabled"; } elseif(!NEWSBOX3){ echo "Disabled"; } ?> @@ -366,11 +391,11 @@ if($_SESSION['access'] < 9) die(ACCESS_DENIED_ADMIN); ? - Enabled"; } else if(LIMIT_MAILBOX == false){ echo "Disabled"; } ?> + Enabled"; } else if(LIMIT_MAILBOX == false){ echo "Disabled"; } ?> ? - Limit mailbox disabled"; } ?> + Limit mailbox disabled"; } ?> @@ -388,36 +413,32 @@ if($_SESSION['access'] < 9) die(ACCESS_DENIED_ADMIN); ? - No admin name defined!"; } else if(ADMIN_NAME != ''){ echo ADMIN_NAME; } ?> + No admin name defined!"; } else if(ADMIN_NAME != ''){ echo ADMIN_NAME; } ?> ? - No admin email defined!"; } else if(ADMIN_EMAIL != ''){ echo ADMIN_EMAIL; } ?> + No admin email defined!"; } else if(ADMIN_EMAIL != ''){ echo ADMIN_EMAIL; } ?> ? - Enabled"; } else if(INCLUDE_ADMIN == false){ echo "Disabled"; } ?> + Enabled"; } else if(INCLUDE_ADMIN == false){ echo "Disabled"; } ?> ? - Enabled"; } else if(ADMIN_RECEIVE_SUPPORT_MESSAGES == false){ echo "Disabled"; } ?> + Enabled"; } else if(ADMIN_RECEIVE_SUPPORT_MESSAGES == false){ echo "Disabled"; } ?> ? - Yes"; } else if(ADMIN_ALLOW_INCOMING_RAIDS == false){ echo "No"; } ?> + Yes"; } else if(ADMIN_ALLOW_INCOMING_RAIDS == false){ echo "No"; } ?> $value ) - { - $keyname = ($keys ? $keys . "_" : "") . $key; - if( is_array( $array[$key] ) ) - define_array( $array[$key], $keyname ); - else - define( $keyname, $value ); +function define_array($array, $keys = null){ + foreach($array as $key => $value){ + $keyname = ($keys ? $keys."_" : "").$key; + if(is_array($array[$key])) define_array($array[$key], $keyname); + else define($keyname, $value); } } //define_array($array); diff --git a/Admin/Templates/editServerSet.tpl b/Admin/Templates/editServerSet.tpl index d7f500a9..464ae92e 100644 --- a/Admin/Templates/editServerSet.tpl +++ b/Admin/Templates/editServerSet.tpl @@ -100,6 +100,18 @@ function refresh(tz) { ? + + ? + + + + ? + + + + ? + + ? x @@ -189,18 +201,34 @@ function refresh(tz) { ? + + ? + + + + ? + + + + ? + + + + ? + + ? diff --git a/GameEngine/Admin/Mods/editServerSet.php b/GameEngine/Admin/Mods/editServerSet.php index dc883216..5554c2c0 100755 --- a/GameEngine/Admin/Mods/editServerSet.php +++ b/GameEngine/Admin/Mods/editServerSet.php @@ -70,7 +70,14 @@ $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\con $text = preg_replace("'%WW%'", $_POST['ww'], $text); $text = preg_replace("'%SHOW_NATARS%'", $_POST['show_natars'], $text); $text = preg_replace("'%NATARS_UNITS%'", $_POST['natars_units'], $text); + $text = preg_replace("'%NATARS_SPAWN_TIME%'", $_POST['natars_spawn_time'], $text); + $text = preg_replace("'%NATARS_WW_SPAWN_TIME%'", $_POST['natars_ww_spawn_time'], $text); + $text = preg_replace("'%NATARS_WW_BUILDING_PLAN_SPAWN_TIME%'", $_POST['natars_ww_building_plan_spawn_time'], $text); $text = preg_replace("'%NATURE_REGTIME%'", $_POST['nature_regtime'], $text); + $text = preg_replace("'%OASIS_WOOD_MULTIPLIER%'", $_POST['oasis_wood_multiplier'], $text); + $text = preg_replace("'%OASIS_CLAY_MULTIPLIER%'", $_POST['oasis_clay_multiplier'], $text); + $text = preg_replace("'%OASIS_IRON_MULTIPLIER%'", $_POST['oasis_iron_multiplier'], $text); + $text = preg_replace("'%OASIS_CROP_MULTIPLIER%'", $_POST['oasis_crop_multiplier'], $text); $text = preg_replace("'%T4_COMING%'", $T4, $text); $text = preg_replace("'%ACTIVATE%'", $_POST['activate'], $text); $text = preg_replace("'%MEDALINTERVAL%'", $_POST['medalinterval'], $text); diff --git a/GameEngine/Database.php b/GameEngine/Database.php index 1cbd5c58..bfcb09d7 100755 --- a/GameEngine/Database.php +++ b/GameEngine/Database.php @@ -4386,118 +4386,55 @@ References: User ID/Message ID, Mode function removeBuilding($d) { list($d) = $this->escape_input((int) $d); - global $building, $village; + global $building, $village, $session; + + //Variables initialization + $jobToDelete = []; + $canBeRemoved = true; + $time = time(); + $newTime = $loopTime = 0; - $jobLoopconID = -1; - $SameBuildCount = 0; + //Search the job which needs to be deleted $jobs = $building->buildArray; - for($i = 0; $i < sizeof($jobs); $i++) { - if($jobs[$i]['id'] == $d) { - $jobDeleted = $i; + foreach($jobs as $job){ + //We need to modify waiting loop orders + if(!empty($jobToDelete) && $job['loopcon'] == 1 && ($session->tribe != 1 || $session->tribe == 1 && (($jobToDelete['field'] <= 18 && $job['field'] <= 18) || ($jobToDelete['field'] >= 19 && $job['field'] >= 19)))){ + + //Does this job have the same field of the deleted one? + $sameBuilding = $jobToDelete['field'] == $job['field'] ? 1 : 0; + + //Can the building be completely removed from the village? + if($sameBuilding && $canBeRemoved) $canBeRemoved = !$sameBuilding; + + //Get the time required to upgrade the building at the given level + $newTime = $building->resourceRequired($job['field'], + $job['type'], + $job['level'] - $village->resarray['f'.$job['field']] - $sameBuilding)['time']; + + //Increase the looptime + $loopTime += $newTime; + + //Update the values + $q = "UPDATE + " .TB_PREFIX. "bdata + SET + ".($job['master'] ? "" : "loopcon = 0,")." + timestamp = ".($job['master'] ? $newTime : $loopTime + $time)." + ".($sameBuilding ? ", level = level - 1" : "")." + WHERE + id = ".$job['id']; + mysqli_query($this->dblink, $q); + } - if($jobs[$i]['loopcon'] == 1 && $jobs[$i]['master'] == 0) { - $jobLoopconID = $i; - } - if($jobs[$i]['master'] == 1) { - $jobMaster = $i; - $level = $jobs[$i]['level']; - } - } - if(count($jobs) > 1 && ($jobs[0]['field'] == $jobs[1]['field'])) { - $SameBuildCount = 1; - } - if(count($jobs) > 2 && ($jobs[0]['field'] == $jobs[2]['field'])) { - $SameBuildCount = 2; - } - if(count($jobs) > 2 && ($jobs[1]['field'] == $jobs[2]['field'])) { - $SameBuildCount = 3; - } - if(count($jobs) > 3 && ($jobs[0]['field'] == $jobs[3]['field'])) { - $SameBuildCount = 8; - } - if(count($jobs) > 3 && ($jobs[1]['field'] == $jobs[3]['field'])) { - $SameBuildCount = 9; - } - if(count($jobs) > 3 && ($jobs[2]['field'] == $jobs[3]['field'])) { - $SameBuildCount = 10; - } - if(count($jobs) > 2 && ($jobs[0]['field'] == $jobs[1]['field'] && $jobs[1]['field'] == $jobs[2]['field'])) { - $SameBuildCount = 4; - } - if(count($jobs) > 3 && ($jobs[0]['field'] == $jobs[1]['field'] && $jobs[1]['field'] == $jobs[3]['field'])) { - $SameBuildCount = 5; - } - if(count($jobs) > 3 && ($jobs[0]['field'] == $jobs[2]['field'] && $jobs[2]['field'] == $jobs[3]['field'])) { - $SameBuildCount = 6; - } - if(count($jobs) > 3 && ($jobs[1]['field'] == $jobs[2]['field'] && $jobs[2]['field'] == $jobs[3]['field'])) { - $SameBuildCount = 7; - } - if(isset($jobMaster) && isset($level) && $level - 1 <= 0){ - $SameBuildCount = 0; + + //We found the job that needs to be deleted + if($job['id'] == $d) $jobToDelete = $job; + } + + if($canBeRemoved && $jobToDelete['field'] > 18 && $jobToDelete['type'] != 99 && $jobToDelete['level'] - 1 == 0){ + $this->setVillageLevel($village->wid, ["f".$jobToDelete['field']."t"], [0]); } - if ($SameBuildCount > 0) { - if ($SameBuildCount > 3) { - if ($SameBuildCount == 4 || $SameBuildCount == 5) { - if ($jobDeleted == 0) { - $uprequire = $building->resourceRequired($jobs[1]['field'], $jobs[1]['type'], 1); - $time = $uprequire['time']; - $timestamp = $time + time(); - $q = "UPDATE " . TB_PREFIX . "bdata SET loopcon=0,level=level-1,timestamp=" . $timestamp . " WHERE id=" . (int) $jobs[1]['id']; - mysqli_query($this->dblink, $q); - } - } else if ($SameBuildCount == 6) { - if ($jobDeleted == 0) { - $uprequire = $building->resourceRequired($jobs[2]['field'], $jobs[2]['type'], 1); - $time = $uprequire['time']; - $timestamp = $time + time(); - $q = "UPDATE " . TB_PREFIX . "bdata SET loopcon=0,level=level-1,timestamp=" . $timestamp . " WHERE id=" . (int) $jobs[2]['id']; - mysqli_query($this->dblink, $q); - } - } else if ($SameBuildCount == 7) { - if ($jobDeleted == 1) { - $uprequire = $building->resourceRequired($jobs[2]['field'], $jobs[2]['type'], 1); - $time = $uprequire['time']; - $timestamp = $time + time(); - $q = "UPDATE " . TB_PREFIX . "bdata SET loopcon=0,level=level-1,timestamp=" . $timestamp . " WHERE id=" . (int) $jobs[2]['id']; - mysqli_query($this->dblink, $q); - } - } - if ($SameBuildCount < 8) { - $uprequire = $building->resourceRequired($jobs[$jobMaster]['field'], $jobs[$jobMaster]['type'], 2); - $q1 = "UPDATE " . TB_PREFIX . "bdata SET level=level-1,timestamp=" . $uprequire['time'] . " WHERE id=" . (int) $jobs[$jobMaster]['id']; - mysqli_query($this->dblink, $q1); - } else { - $uprequire = $building->resourceRequired($jobs[$jobMaster]['field'], $jobs[$jobMaster]['type'], 1); - $q1 = "UPDATE " . TB_PREFIX . "bdata SET level=level-1,timestamp=" . $uprequire['time'] . " WHERE id=" . (int) $jobs[$jobMaster]['id']; - mysqli_query($this->dblink, $q1); - } - } else if ($d == $jobs[floor($SameBuildCount / 3)]['id'] || $d == $jobs[floor($SameBuildCount / 2) + 1]['id']) { - $q = "UPDATE " . TB_PREFIX . "bdata SET loopcon=0,level=level-1,timestamp=" . (int) $jobs[floor($SameBuildCount / 3)]['timestamp'] . " WHERE master = 0 AND id > " . $d . " and (ID=" . (int) $jobs[floor($SameBuildCount / 3)]['id'] . " OR ID=" . (int) $jobs[floor($SameBuildCount / 2) + 1]['id'] . ")"; - mysqli_query($this->dblink, $q); - } - } else { - if ($jobs[$jobDeleted]['field'] >= 19) { - $x = "SELECT f" . $jobs[$jobDeleted]['field'] . " FROM " . TB_PREFIX . "fdata WHERE vref=" . (int) $jobs[$jobDeleted]['wid']; - $result = mysqli_query($this->dblink, $x); - $fieldlevel = mysqli_fetch_row($result); - if ($fieldlevel[0] == 0) { - if ($village->natar == 1 && $jobs[$jobDeleted]['field'] == 99) { // fix by ronix - } else { - $x = "UPDATE " . TB_PREFIX . "fdata SET f" . $jobs[$jobDeleted]['field'] . "t=0 WHERE vref=" . (int) $jobs[$jobDeleted]['wid']; - mysqli_query($this->dblink, $x); - } - } - } - if (($jobLoopconID >= 0) && ($jobs[$jobDeleted]['loopcon'] != 1)) { - if (($jobs[$jobLoopconID]['field'] <= 18 && $jobs[$jobDeleted]['field'] <= 18) || ($jobs[$jobLoopconID]['field'] >= 19 && $jobs[$jobDeleted]['field'] >= 19) || sizeof($jobs) < 4) { - $uprequire = $building->resourceRequired($jobs[$jobLoopconID]['field'], $jobs[$jobLoopconID]['type']); - $x = "UPDATE " . TB_PREFIX . "bdata SET loopcon = 0,timestamp=" . (time() + (int) $uprequire['time']) . " WHERE wid=" . (int) $jobs[$jobDeleted]['wid'] . " AND loopcon = 1 AND master = 0"; - mysqli_query($this->dblink, $x); - } - } - } $q = "DELETE FROM " . TB_PREFIX . "bdata where id = $d"; return mysqli_query($this->dblink, $q); } diff --git a/GameEngine/Lang/en.php b/GameEngine/Lang/en.php index ab3c6f42..5c3a05ba 100755 --- a/GameEngine/Lang/en.php +++ b/GameEngine/Lang/en.php @@ -1302,7 +1302,13 @@ define("CONF_SERV_CRANCAPACITY_TOOLTIP","A multiplier for the capacity of resour define("CONF_SERV_TRAPCAPACITY","Trapper Capacity"); define("CONF_SERV_TRAPCAPACITY_TOOLTIP","A multiplier for the capacity of the trap of the Gauls, which can capture enemy soldiers even before attacking the village. The value of 1 is equal to the capacity of 400 at the 20 level of construction. If you set the value to 2, then the capacity will be 800."); define("CONF_SERV_NATUNITSMULTIPLIER","Natars Units Multiplier"); -define("CONF_SERV_NATUNITSMULTIPLIER_TOOLTIP","At the moment, this parameter is responsible for the number of scouts of Natars, who will come to the scouting of the capital of each player, after the creation of the account of Natars. The multiplier of the created troops in the village is taken from the speed of the server and can not exceed 5."); +define("CONF_SERV_NATUNITSMULTIPLIER_TOOLTIP","This parameter is responsible for the number of troops of Natars, on artifacts and WW villages."); +define("CONF_SERV_NATARS_SPAWN_TIME","Natars Spawn (Days)"); +define("CONF_SERV_NATARS_SPAWN_TIME_TOOLTIP",""); +define("CONF_SERV_NATARS_WW_SPAWN_TIME","World Wonders Spawn (Days)"); +define("CONF_SERV_NATARS_WW_SPAWN_TIME_TOOLTIP",""); +define("CONF_SERV_NATARS_WW_BUILDING_PLAN_SPAWN_TIME","WW Building Plan Spawn (Days)"); +define("CONF_SERV_NATARS_WW_BUILDING_PLAN_SPAWN_TIME_TOOLTIP",""); define("CONF_SERV_MAPSIZE","Map Size"); define("CONF_SERV_MAPSIZE_TOOLTIP","The size of the map of the game world. Can not be changed on an already installed game server."); define("CONF_SERV_VILLEXPSPEED","Village Expanding Speed"); @@ -1323,6 +1329,14 @@ define("CONF_SERV_WWSTATS","World Wonder - Statistics"); define("CONF_SERV_WWSTATS_TOOLTIP","Enable (True) or disable (False) the display in the statistics of villages with a Wonder of the World."); define("CONF_SERV_NTRTIME","Nature Troops Regeneration Time"); define("CONF_SERV_NTRTIME_TOOLTIP","Time through which the nature troops will be restored in oases."); +define("CONF_SERV_OASIS_WOOD_PROD_MULT","Oasis Wood Production Multiplier"); +define("CONF_SERV_OASIS_WOOD_PROD_MULT_TOOLTIP",""); +define("CONF_SERV_OASIS_CLAY_PROD_MULT","Oasis Clay Production Multiplier"); +define("CONF_SERV_OASIS_CLAY_PROD_MULT_TOOLTIP",""); +define("CONF_SERV_OASIS_IRON_PROD_MULT","Oasis Iron Production Multiplier"); +define("CONF_SERV_OASIS_IRON_PROD_MULT_TOOLTIP",""); +define("CONF_SERV_OASIS_CROP_PROD_MULT","Oasis Crop Production Multiplier"); +define("CONF_SERV_OASIS_CROP_PROD_MULT_TOOLTIP",""); define("CONF_SERV_MEDALINTERVAL","Medal Interval"); define("CONF_SERV_MEDALINTERVAL_TOOLTIP","The time interval for issuing medals for the top players and alliances. If this parameter is changed on the installed server, the time interval changes after the subsequent issuance of the medals."); define("CONF_SERV_TOURNTHRES","Tourn Threshold"); diff --git a/install/templates/config.tpl b/install/templates/config.tpl index 633c4964..0e8653bf 100644 --- a/install/templates/config.tpl +++ b/install/templates/config.tpl @@ -102,13 +102,13 @@ echo "
Error creating constant.php - WW building plan spawn (Days): - + WW spawn (Days): + - WW spawn (Days): - - + WW building plan spawn (Days): + + World size: