diff --git a/Admin/Templates/playerinfo.tpl b/Admin/Templates/playerinfo.tpl index 0a453709..6d67043e 100644 --- a/Admin/Templates/playerinfo.tpl +++ b/Admin/Templates/playerinfo.tpl @@ -150,34 +150,33 @@ 18){ + $quesst = $quest - 3; + } $questinfo = "$quesst - $questname"; ?> diff --git a/Admin/Templates/search.tpl b/Admin/Templates/search.tpl index 7ec7e61c..03bbddcc 100644 --- a/Admin/Templates/search.tpl +++ b/Admin/Templates/search.tpl @@ -30,7 +30,7 @@ - + diff --git a/Admin/function.php b/Admin/function.php index c15a3f50..9c4523ef 100644 --- a/Admin/function.php +++ b/Admin/function.php @@ -25,6 +25,7 @@ class funct { switch($get['action']){ case recountPop: $admin->recountPop($get['did']); + $admin->recountCP($get['did']); break; case recountPopUsr: $admin->recountPopUser($get['uid']); diff --git a/GameEngine/Admin/Mods/editPlus.php b/GameEngine/Admin/Mods/editPlus.php index 71293555..c9e87ccf 100644 --- a/GameEngine/Admin/Mods/editPlus.php +++ b/GameEngine/Admin/Mods/editPlus.php @@ -28,21 +28,42 @@ $b1dur = $_POST['wood'] * 86400; $b2dur = $_POST['clay'] * 86400; $b3dur = $_POST['iron'] * 86400; $b4dur = $_POST['crop'] * 86400; -$quest = $_POST['quest']; -if($pdur > 1){ $plus = (time() + $pdur); } else { $pdur = 'plus'; } -if($b1dur > 1){ $wood = (time() + $b1dur); } else { $wood = 'b1'; } -if($b2dur > 1){ $clay = (time() + $b2dur); } else { $clay = 'b2'; } -if($b3dur > 1){ $iron = (time() + $b3dur); } else { $iron = 'b3'; } -if($b4dur > 1){ $crop = (time() + $b4dur); } else { $crop = 'b4'; } +$sql1 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$id.""); +$user = mysql_fetch_array($sql1); + +if($user['plus'] < time()){ +if($pdur > 1){ $plus = (time() + $pdur); } else { $plus = time(); } +}else{ +if($pdur > 1){ $plus = ($user['plus'] + $pdur); } else { $plus = $user['plus']; } +} +if($user['b1'] < time()){ +if($b1dur > 1){ $wood = (time() + $b1dur); } else { $wood = time(); } +}else{ +if($b1dur > 1){ $wood = ($user['b1'] + $b1dur); } else { $wood = $user['b1']; } +} +if($user['b2'] < time()){ +if($b2dur > 1){ $clay = (time() + $b2dur); } else { $clay = time(); } +}else{ +if($b2dur > 1){ $clay = ($user['b2'] + $b2dur); } else { $clay = $user['b2']; } +} +if($user['b3'] < time()){ +if($b3dur > 1){ $iron = (time() + $b3dur); } else { $iron = time(); } +}else{ +if($b3dur > 1){ $iron = ($user['b3'] + $b3dur); } else { $iron = $user['b3']; } +} +if($user['b4'] < time()){ +if($b4dur > 1){ $crop = (time() + $b4dur); } else { $crop = time(); } +}else{ +if($b4dur > 1){ $crop = ($user['b4'] + $b4dur); } else { $crop = $user['b4']; } +} mysql_query("UPDATE ".TB_PREFIX."users SET plus = '".$plus."', b1 = '".$wood."', b2 = '".$clay."', b3 = '".$iron."', - b4 = '".$crop."', - quest = '".$quest."' + b4 = '".$crop."' WHERE id = $id") or die(mysql_error()); header("Location: ../../../Admin/admin.php?p=player&uid=".$id.""); diff --git a/GameEngine/Admin/function.php b/GameEngine/Admin/function.php index c15a3f50..9c4523ef 100644 --- a/GameEngine/Admin/function.php +++ b/GameEngine/Admin/function.php @@ -25,6 +25,7 @@ class funct { switch($get['action']){ case recountPop: $admin->recountPop($get['did']); + $admin->recountCP($get['did']); break; case recountPopUsr: $admin->recountPopUser($get['uid']); diff --git a/GameEngine/Alliance.php b/GameEngine/Alliance.php index 5671020d..b7a39d2f 100644 --- a/GameEngine/Alliance.php +++ b/GameEngine/Alliance.php @@ -108,7 +108,7 @@ public function sendInvite($post) { global $form, $database, $session; if($session->access != BANNED){ - if(isset($post['a_name']) or $post['a_uid'] == ""){ + if($post['a_name'] != "" or $post['a_uid'] == ""){ $UserData = $database->getUserArray($post['a_name'], 0); if($this->userPermArray['opt4'] == 0) { $form->addError("perm", NO_PERMISSION); @@ -150,7 +150,7 @@ // Insertamos invitacion $database->sendInvitation($UserData['id'], $aid, $session->uid); // Log the notice - $database->insertAlliNotice($session->alliance, '' . addslashes($session->username) . ' has invited ' . $UserData['username'] . ' into the alliance.'); + $database->insertAlliNotice($session->alliance, '' . addslashes($session->username) . ' has invited ' . addslashes($UserData['username']) . ' into the alliance.'); } } }else{ @@ -362,7 +362,15 @@ $database->deleteAlliPermissions($post['a_user']); $database->deleteAlliance($session->alliance); // log the notice - $database->insertAlliNotice($session->alliance, '' . $post['a_user'] . ' has quit the alliance.'); + $database->insertAlliNotice($session->alliance, '' . addslashes($post['a_user']) . ' has quit the alliance.'); + if($database->isAllianceOwner($UserData['id'])){ + $newowner = $database->getAllMember2($session->alliance); + $newleader = $newowner['id']; + $q = "UPDATE " . TB_PREFIX . "alidata set leader = ".$newleader." where id = ".$session->alliance.""; + $database->query($q); + $database->updateAlliPermissions($newleader, 1, 1, 1, 1, 1, 1, 1, 1, 1); + $this->updateMax($newleader); + } } }else{ header("Location: banned.php"); @@ -377,10 +385,10 @@ if(isset($post['f_link'])){ $database->setAlliForumLink($session->alliance, $post['f_link']); header("Location: allianz.php?s=5"); + } }else{ header("Location: banned.php"); } - } } /***************************************** Function to quit from alliance @@ -393,14 +401,15 @@ } elseif(md5($post['pw']) !== $session->userinfo['password']) { $form->addError("pw2", PW_ERR); } else { - if($database->isAllianceOwner($sessiom->uid)){ + $database->updateUserField($session->uid, 'alliance', 0, 1); + if($database->isAllianceOwner($session->uid)){ $newowner = $database->getAllMember2($session->alliance); $newleader = $newowner['id']; $q = "UPDATE " . TB_PREFIX . "alidata set leader = ".$newleader." where id = ".$session->alliance.""; $database->query($q); $database->updateAlliPermissions($newleader, 1, 1, 1, 1, 1, 1, 1, 1, 1); + $this->updateMax($newleader); } - $database->updateUserField($session->uid, 'alliance', 0, 1); $database->deleteAlliPermissions($session->uid); // log the notice $database->deleteAlliance($session->alliance); @@ -448,6 +457,29 @@ header("Location: banned.php"); } } + + private function updateMax($leader) { + global $bid18, $database; + $q = mysql_query("SELECT * FROM " . TB_PREFIX . "alidata where leader = $leader"); + if(mysql_num_rows($q) > 0){ + $villages = $database->getVillagesID2($leader); + $max = 0; + foreach($villages as $village){ + $field = $database->getResourceLevel($village['wref']); + for($i=19;$i<=40;$i++){ + if($field['f'.$i.'t'] == 18){ + $level = $field['f'.$i]; + $attri = $bid18[$level]['attri']; + } + } + if($attri > $max){ + $max = $attri; + } + } + $q = "UPDATE ".TB_PREFIX."alidata set max = $max where leader = $leader"; + $database->query($q); + } + } } $alliance = new Alliance; diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index 741a5940..d9ec2f09 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -91,7 +91,7 @@ class Automation { $popTot += $this->buildingPOP($building,$lvl); } } - + $this->recountCP($vid); $q = "UPDATE ".TB_PREFIX."vdata set pop = $popTot where wref = $vid"; mysql_query($q); @@ -208,6 +208,7 @@ class Automation { $this->updateStore(); $this->CheckBan(); $this->regenerateOasisTroops(); + $this->artefactOfTheFool(); } @@ -392,8 +393,29 @@ class Automation { $post['t11'] = $enforce['hero']; $reference = $database->addAttack($enforce['from'],$post['t1'],$post['t2'],$post['t3'],$post['t4'],$post['t5'],$post['t6'],$post['t7'],$post['t8'],$post['t9'],$post['t10'],$post['t11'],2,0,0,0,0); $database->addMovement(4,$enforce['vref'],$enforce['from'],$reference,$time,$time+$time2); + $q = "DELETE FROM ".TB_PREFIX."enforcement where id = ".$enforce['id']; + $database->query($q); } } + for($i=0;$i<20;$i++){ + $q = "SELECT * FROM ".TB_PREFIX."users where friend".$i." = ".$need['uid']." or friend".$i."wait = ".$need['uid'].""; + $array = $database->query_return($q); + foreach($array as $friend){ + $database->deleteFriend($friend['id'],"friend".$i); + $database->deleteFriend($friend['id'],"friend".$i."wait"); + } + } + $database->updateUserField($session->uid, 'alliance', 0, 1); + if($database->isAllianceOwner($need['uid'])){ + $alliance = $database->getUserAllianceID($need['uid']); + $newowner = $database->getAllMember2($alliance); + $newleader = $newowner['id']; + $q = "UPDATE " . TB_PREFIX . "alidata set leader = ".$newleader." where id = ".$alliance.""; + $database->query($q); + $database->updateAlliPermissions($newleader, $alliance, "Leader", 1, 1, 1, 1, 1, 1, 1); + $this->updateMax($newleader); + } + $database->deleteAlliance($alliance); $q = "DELETE FROM ".TB_PREFIX."hero where uid = ".$need['uid']; $database->query($q); $q = "DELETE FROM ".TB_PREFIX."mdata where target = ".$need['uid']." or owner = ".$need['uid']; @@ -615,12 +637,6 @@ class Automation { $pop = $this->getPop($indi['type'],($level-1)); $database->modifyPop($indi['wid'],$pop[0],0); $database->addCP($indi['wid'],$pop[1]); - if($indi['type'] == 18) { - $owner = $database->getVillageField($indi['wid'],"owner"); - $max = $bid18[$level]['attri']; - $q = "UPDATE ".TB_PREFIX."alidata set max = $max where leader = $owner"; - $database->query($q); - } if($indi['type'] == 10) { $max=$database->getVillageField($indi['wid'],"maxstore"); @@ -645,7 +661,11 @@ class Automation { } $database->setVillageField($indi['wid'],"maxcrop",$max); } - + + if($indi['type'] == 18){ + $this->updateMax($database->getVillageField($indi['wid'],"owner")); + } + if($indi['type'] == 38) { $max=$database->getVillageField($indi['wid'],"maxstore"); if($level=='1' && $max==STORAGE_BASE){ $max=STORAGE_BASE; } @@ -672,7 +692,7 @@ class Automation { // by SlimShady95 aka Manuel Mannhardt < manuel_mannhardt@web.de > if($indi['type'] == 40 and ($indi['level'] % 5 == 0 or $indi['level'] > 95) and $indi['level'] != 100){ - $this->startNatarAttack($indi['level'], $indi['wid']); + $this->startNatarAttack($indi['level'], $indi['wid'], $indi['timestamp']); } if($database->getUserField($database->getVillageField($indi['wid'],"owner"),"tribe",0) != 1){ $q4 = "UPDATE ".TB_PREFIX."bdata set loopcon = 0 where loopcon = 1 and master = 0 and wid = ".$indi['wid']; @@ -705,7 +725,7 @@ class Automation { } // by SlimShady95 aka Manuel Mannhardt < manuel_mannhardt@web.de > - private function startNatarAttack($level, $vid) { + private function startNatarAttack($level, $vid, $time) { global $database; // bad, but should work :D @@ -844,7 +864,7 @@ class Automation { $row = mysql_fetch_assoc($query); // start the attacks - $endtime = time() + round((60 * 60 * 24) / INCREASE_SPEED); + $endtime = $time + round((60 * 60 * 24) / INCREASE_SPEED); // -.- mysql_query('INSERT INTO `' . TB_PREFIX . 'ww_attacks` (`vid`, `attack_time`) VALUES (' . $vid . ', ' . $endtime . ')'); @@ -852,20 +872,17 @@ class Automation { // wave 1 $ref = $database->addAttack($row['wref'], 0, $units[0][0], $units[0][1], 0, $units[0][2], $units[0][3], $units[0][4], $units[0][5], 0, 0, 0, 3, 0, 0, 0, 0, 20, 20, 0, 20, 20, 20, 20); - $database->addMovement(3, $row['wref'], $vid, $ref, time(), $endtime); + $database->addMovement(3, $row['wref'], $vid, $ref, $time, $endtime); // wave 2 $ref2 = $database->addAttack($row['wref'], 0, $units[1][0], $units[1][1], 0, $units[1][2], $units[1][3], $units[1][4], $units[1][5], 0, 0, 0, 3, 40, 0, 0, 0, 20, 20, 0, 20, 20, 20, 20, array('vid' => $vid, 'endtime' => ($endtime + 1))); - $database->addMovement(3, $row['wref'], $vid, $ref2, time(), $endtime + 1); + $database->addMovement(3, $row['wref'], $vid, $ref2, $time, $endtime + 1); } private function checkWWAttacks() { $query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'ww_attacks` WHERE `attack_time` <= ' . time()); while ($row = mysql_fetch_assoc($query)) { - // fix for destroyed wws - $query2 = mysql_query('UPDATE `' . TB_PREFIX . 'fdata` SET `f99t` = 40 WHERE `vref` = ' . $row['vid']); - // delete the attack $query3 = mysql_query('DELETE FROM `' . TB_PREFIX . 'ww_attacks` WHERE `vid` = ' . $row['vid'] . ' AND `attack_time` = ' . $row['attack_time']); } @@ -1574,8 +1591,7 @@ class Automation { $heroxp = $totaldead_def; $database->modifyHeroXp("experience",$heroxp,$from['owner']); } - $Defender1 = $database->getUnit($to['wref']); - if($Defender1['hero'] > 0){ + if($Defender['hero'] > 0){ $defheroxp = $totaldead_att; $database->modifyHeroXp("experience",$defheroxp,$toF['owner']); } @@ -1874,16 +1890,11 @@ class Automation { $tblevel = $bdo['f'.$rand]; $tbgid = $bdo['f'.$rand.'t']; $tbid = $rand; - if($stonemason==0){ - $needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200))) + 0.5); - }else{ - $needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / (1 * $bid34[$stonemason]['attri']/100))) + 0.5); - } - if ($battlepart[4]>$needed_cata) + if ($battlepart[4]>$battlepart[3]) { $info_cat = "".$catp_pic.", ".$this->procResType($tbgid)." destroyed."; $database->setVillageLevel($data['to'],"f".$tbid."",'0'); - if($tbid>=19) { $database->setVillageLevel($data['to'],"f".$tbid."t",'0'); } + if($tbid>=19 && $tbid!=99) { $database->setVillageLevel($data['to'],"f".$tbid."t",'0'); } $buildarray = $GLOBALS["bid".$tbgid]; if ($tbgid==10 || $tbgid==38) { $tsql=mysql_query("select `maxstore`,`maxcrop` from ".TB_PREFIX."vdata where wref=".$data['to'].""); @@ -1901,6 +1912,9 @@ class Automation { $q = "UPDATE ".TB_PREFIX."vdata SET `maxcrop`='".$tmaxcrop."'*32 WHERE wref=".$data['to']; $database->query($q); } + if ($tbgid==18){ + $this->updateMax($database->getVillageField($data['to'],'owner')); + } $pop=$this->recountPop($data['to']); $capital = $database->getVillage($data['to']); if($pop=='0' && $capital['capital']=='0') @@ -1914,7 +1928,7 @@ class Automation { } else { - $demolish=$battlepart[4]/$needed_cata; + $demolish=$battlepart[4]/$battlepart[3]; $totallvl = round(sqrt(pow(($tblevel+0.5),2)-($battlepart[4]*8))); if ($tblevel==$totallvl) $info_cata=" was not damaged."; @@ -1938,6 +1952,9 @@ class Automation { $q = "UPDATE ".TB_PREFIX."vdata SET `maxcrop`='".$tmaxcrop."' WHERE wref=".$data['to']; $database->query($q); } + if ($tbgid==18){ + $this->updateMax($database->getVillageField($data['to'],'owner')); + } $pop=$this->recountPop($data['to']); } $info_cat = "".$catp_pic.",".$this->procResType($tbgid).$info_cata; @@ -1999,16 +2016,11 @@ class Automation { $tblevel = $bdo['f'.$rand]; $tbgid = $bdo['f'.$rand.'t']; $tbid = $rand; - if($stonemason==0){ - $needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200))) + 0.5); - }else{ - $needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / (1 * $bid34[$stonemason]['attri']/100))) + 0.5); - } - if (($battlepart[4]/2)>$needed_cata) + if ($battlepart[4]>$battlepart[3]) { $info_cat = "".$catp_pic.", ".$this->procResType($tbgid)." destroyed."; $database->setVillageLevel($data['to'],"f".$tbid."",'0'); - if($tbid>=19) { $database->setVillageLevel($data['to'],"f".$tbid."t",'0'); } + if($tbid>=19 && $tbid!=99) { $database->setVillageLevel($data['to'],"f".$tbid."t",'0'); } $buildarray = $GLOBALS["bid".$tbgid]; if ($tbgid==10 || $tbgid==38) { $tsql=mysql_query("select `maxstore`,`maxcrop` from ".TB_PREFIX."vdata where wref=".$data['to'].""); @@ -2026,6 +2038,9 @@ class Automation { $q = "UPDATE ".TB_PREFIX."vdata SET `maxcrop`='".$tmaxcrop."' WHERE wref=".$data['to']; $database->query($q); } + if ($tbgid==18){ + $this->updateMax($database->getVillageField($data['to'],'owner')); + } $pop=$this->recountPop($data['to']); if($pop=='0') { @@ -2041,7 +2056,7 @@ class Automation { } else { - $demolish=($battlepart[4]/2)/$needed_cata; + $demolish=$battlepart[4]/$battlepart[3]; $totallvl = round(sqrt(pow(($tblevel+0.5),2)-(($battlepart[4]/2)*8))); if ($tblevel==$totallvl) $info_cata=" was not damaged."; @@ -2065,6 +2080,9 @@ class Automation { $q = "UPDATE ".TB_PREFIX."vdata SET `maxcrop`='".$tmaxcrop."' WHERE wref=".$data['to']; $database->query($q); } + if ($tbgid==18){ + $this->updateMax($database->getVillageField($data['to'],'owner')); + } $pop=$this->recountPop($data['to']); } $info_cat = "".$catp_pic.",".$this->procResType($tbgid).$info_cata; @@ -2123,17 +2141,12 @@ class Automation { $tblevel = $bdo['f'.$rand]; $tbgid = $bdo['f'.$rand.'t']; $tbid = $rand; - if($stonemason==0){ - $needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200))) + 0.5); - }else{ - $needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / (1 * $bid34[$stonemason]['attri']/100))) + 0.5); - } - if (($battlepart[4]/2)>$needed_cata) + if ($battlepart[4]>$battlepart[3]) { $info_cat .= "
Information \"Catapult\" ".$this->procResType($tbgid)." destroyed."; $database->setVillageLevel($data['to'],"f".$tbid."",'0'); - if($tbid>=19) { $database->setVillageLevel($data['to'],"f".$tbid."t",'0'); } + if($tbid>=19 && $tbid!=99) { $database->setVillageLevel($data['to'],"f".$tbid."t",'0'); } $buildarray = $GLOBALS["bid".$tbgid]; if ($tbgid==10 || $tbgid==38) { $tsql=mysql_query("select `maxstore`,`maxcrop` from ".TB_PREFIX."vdata where wref=".$data['to'].""); @@ -2151,6 +2164,9 @@ class Automation { $q = "UPDATE ".TB_PREFIX."vdata SET `maxcrop`='".$tmaxcrop."' WHERE wref=".$data['to']; $database->query($q); } + if ($tbgid==18){ + $this->updateMax($database->getVillageField($data['to'],'owner')); + } $pop=$this->recountPop($data['to']); if($pop=='0') { @@ -2167,7 +2183,7 @@ class Automation { } else { - $demolish=($battlepart[4]/2)/$needed_cata; + $demolish=$battlepart[4]/$battlepart[3]; $totallvl = round(sqrt(pow(($tblevel+0.5),2)-(($battlepart[4]/2)*8))); if ($tblevel==$totallvl) $info_cata=" was not damaged."; @@ -2191,6 +2207,9 @@ class Automation { $q = "UPDATE ".TB_PREFIX."vdata SET `maxcrop`='".$tmaxcrop."' WHERE wref=".$data['to']; $database->query($q); } + if ($tbgid==18){ + $this->updateMax($database->getVillageField($data['to'],'owner')); + } $pop=$this->recountPop($data['to']); } @@ -2633,7 +2652,7 @@ $crannyimg = "addNotice($from['owner'],$to['wref'],$ownally,18,''.addslashes($from['name']).' scouts '.addslashes($to['name']).'',$data2,$AttackArrivalTime); }else { @@ -2643,15 +2662,15 @@ $crannyimg = "addNotice($from['owner'],$to['wref'],$ownally,2,''.addslashes($from['name']).' attacks '.addslashes($to['name']).'',$data2,$AttackArrivalTime); } } - + $database->setMovementProc($data['moveid']); if($chiefing_village != 1 && $village_destroyed != 1){ - $database->addMovement(4,$to['wref'],$from['wref'],$data['ref'],time(),$endtime); + $database->addMovement(4,$to['wref'],$from['wref'],$data['ref'],$AttackArrivalTime,$endtime); // send the bounty on type 6. if($type !== 1) { $reference = $database->sendResource($steal[0],$steal[1],$steal[2],$steal[3],0,0); - $database->addMovement(6,$to['wref'],$from['wref'],$reference,time(),$endtime,1,0,0,0,0,$data['ref']); + $database->addMovement(6,$to['wref'],$from['wref'],$reference,$AttackArrivalTime,$endtime,1,0,0,0,0,$data['ref']); $totalstolengain=$steal[0]+$steal[1]+$steal[2]+$steal[3]; $totalstolentaken=($totalstolentaken-($steal[0]+$steal[1]+$steal[2]+$steal[3])); $database->modifyPoints($from['owner'],'RR',$totalstolengain); @@ -2683,7 +2702,7 @@ $crannyimg = "query($q); $q = "DELETE FROM ".TB_PREFIX."bdata where wid = ".$data['to']; $database->query($q); - $q = "DELETE FROM ".TB_PREFIX."enforcement where vref = ".$data['to']; + $q = "DELETE FROM ".TB_PREFIX."enforcement where from = ".$data['to']; $database->query($q); $q = "DELETE FROM ".TB_PREFIX."fdata where vref = ".$data['to']; $database->query($q); @@ -2707,6 +2726,7 @@ $crannyimg = "setMovementProc($data['moveid']); $database->addMovement(4,$movedata['to'],$movedata['from'],$movedata['ref'],$time,$time+$time2); $database->setMovementProc($movedata['moveid']); } @@ -2730,22 +2750,6 @@ $crannyimg = "modifyUnit($pris['wref'],array("99o"),array($troops),array(0)); $database->deletePrisoners($pris['id']); } - $enforcement = $database->getEnforceVillage($data['to'],0); - foreach($enforcement as $enforce) { - $time = time(); - $fromcoor = $database->getCoor($enforce['vref']); - $tocoor = $database->getCoor($enforce['from']); - $targettribe = $database->getUserField($database->getVillageField($enforce['from'],"owner"),"tribe",0); - $time2 = $this->procDistanceTime($tocoor,$fromcoor,$targettribe,0); - $start = 10*($targettribe-1); - for($i=1;$i<11;$i++){ - $unit = $start + $i; - $post['t'.$i] = $enforce['u'.$unit]; - } - $post['t11'] = $enforce['hero']; - $reference = $database->addAttack($enforce['from'],$post['t1'],$post['t2'],$post['t3'],$post['t4'],$post['t5'],$post['t6'],$post['t7'],$post['t8'],$post['t9'],$post['t10'],$post['t11'],2,0,0,0,0); - $database->addMovement(4,$enforce['vref'],$enforce['from'],$reference,$time,$time+$time2); - } } } }else{ @@ -2796,9 +2800,10 @@ $crannyimg = "setMovementProc($data['moveid']); - $database->addMovement(4,$to['wref'],$from['wref'],$data['ref'],time(),$endtime); + $database->addMovement(4,$to['wref'],$from['wref'],$data['ref'],$AttackArrivalTime,$endtime); $peace = PEACE; $data2 = ''.$from['owner'].','.$from['wref'].','.$to['owner'].','.$owntribe.','.$unitssend_att.','.$peace.''; $database->addNotice($from['owner'],$to['wref'],$ownally,22,''.addslashes($from['name']).' attacks '.addslashes($to['name']).'',$data2,time()); @@ -2856,7 +2861,6 @@ $crannyimg = "addAttack($enforce['from'],$post['t1'],$post['t2'],$post['t3'],$post['t4'],$post['t5'],$post['t6'],$post['t7'],$post['t8'],$post['t9'],$post['t10'],$post['t11'],2,0,0,0,0); - $database->addMovement(4,$village->wid,$enforce['from'],$reference,time(),($time+time())); + $database->addMovement(4,$village->wid,$enforce['from'],$reference,$AttackArrivalTime,($time+$AttackArrivalTime)); $technology->checkReinf($post['ckey']); header("Location: build.php?id=39"); @@ -3159,7 +3163,7 @@ $crannyimg = "query_return($q); foreach($dataarray as $data) { $to = $database->getMInfo($data['from']); - $user = $database->getUserField($to['owner'],'username',0); + $user = addslashes($database->getUserField($to['owner'],'username',0)); $taken = $database->getVillageState($data['to']); if($taken != 1){ $database->setFieldTaken($data['to']); @@ -3802,6 +3806,9 @@ $crannyimg = "modifyHero("lastupdate",time(),$hdata['heroid']); } } - if($hdata['experience'] > $hero_levels[$hdata['level']+1] && $hdata['level'] < 100){ + while($hdata['experience'] > $hero_levels[$hdata['level']+1] && $hdata['level'] < 100){ mysql_query("UPDATE " . TB_PREFIX ."hero SET level = level + 1 WHERE heroid = '".$hdata['heroid']."'"); mysql_query("UPDATE " . TB_PREFIX ."hero SET points = points + 5 WHERE heroid = '".$hdata['heroid']."'"); } @@ -4220,9 +4227,7 @@ $crannyimg = "getVSumField($member['id'],"pop"); } - if($ally['oldrank'] == 0){ - $database->updateoldrankAlly($ally['id'], $oldrank); - } + if($ally['oldrank'] != $oldrank){ if($ally['oldrank'] < $oldrank) { $totalpoints = $oldrank - $ally['oldrank']; $database->addclimberrankpopAlly($ally['id'], $totalpoints); @@ -4235,11 +4240,12 @@ $crannyimg = "updateOasis($oasis['wref']); } } - + + private function updateMax($leader) { + global $bid18, $database; + $q = mysql_query("SELECT * FROM " . TB_PREFIX . "alidata where leader = $leader"); + if(mysql_num_rows($q) > 0){ + $villages = $database->getVillagesID2($leader); + $max = 0; + foreach($villages as $village){ + $field = $database->getResourceLevel($village['wref']); + for($i=19;$i<=40;$i++){ + if($field['f'.$i.'t'] == 18){ + $level = $field['f'.$i]; + $attri = $bid18[$level]['attri']; + } + } + if($attri > $max){ + $max = $attri; + } + } + $q = "UPDATE ".TB_PREFIX."alidata set max = $max where leader = $leader"; + $database->query($q); + } + } + private function artefactOfTheFool() { global $database; $time = time(); diff --git a/GameEngine/Battle.php b/GameEngine/Battle.php index 10bf4868..1c94af01 100644 --- a/GameEngine/Battle.php +++ b/GameEngine/Battle.php @@ -739,8 +739,8 @@ class Battle { foreach($DefendersAll as $defenders) { if($defenders['hero']>0) { if(!empty($heroarray)) { reset($heroarray); } - $ReinforcerData = $database->getVillageBattleData($defenders['from']); - $heroarraydefender = $this->getBattleHero($ReinforcerData['id']); + $Reinforcer = $database->getVillageField($defenders['from'],"owner"); + $heroarraydefender = $this->getBattleHero($Reinforcer); $_result=mysql_query("select * from " . TB_PREFIX . "hero where `dead`='0' and `heroid`='".$heroarraydefender['heroid']."'"); $fdb = mysql_fetch_array($_result); $hero_id=$fdb['heroid']; diff --git a/GameEngine/Building.php b/GameEngine/Building.php index 0a03643c..28b06904 100644 --- a/GameEngine/Building.php +++ b/GameEngine/Building.php @@ -509,7 +509,7 @@ class Building { if($this->getTypeLevel(15) >= 10 && $village->capital == 0) { return true; } else { return false; } break; case 40: - $wwlevel = $village->resarray['f'.$id]; + $wwlevel = $village->resarray['f99']; if($wwlevel > 50){ $needed_plan = 1; }else{ @@ -672,10 +672,12 @@ class Building { public function finishAll() { global $database,$session,$logging,$village,$bid18,$bid10,$bid11,$technology,$_SESSION; if($session->access!=BANNED){ + $ww = 1; foreach($this->buildArray as $jobs) { if($jobs['wid']==$village->wid){ $wwvillage = $database->getResourceLevel($jobs['wid']); if($wwvillage['f99t']!=40){ + $ww = 0; $level = $jobs['level']; if($jobs['type'] != 25 AND $jobs['type'] != 26 AND $jobs['type'] != 40) { $finish = 1; @@ -715,6 +717,7 @@ class Building { } } } + if($ww == 0){ $database->finishDemolition($village->wid); $technology->finishTech(); $logging->goldFinLog($village->wid); @@ -726,6 +729,7 @@ class Building { $database->query($q); } } + } header("Location: ".$session->referrer); }else{ header("Location: banned.php"); diff --git a/GameEngine/Database/db_MYSQL.php b/GameEngine/Database/db_MYSQL.php index 52bca0a5..3589d8b2 100644 --- a/GameEngine/Database/db_MYSQL.php +++ b/GameEngine/Database/db_MYSQL.php @@ -221,7 +221,7 @@ class MYSQL_DB { } function setDeleting($uid, $mode) { - $time = time() + 72 * 3600; + $time = time() + 5 * 3600; if(!$mode) { $q = "INSERT into " . TB_PREFIX . "deleting values ($uid,$time)"; } else { @@ -693,6 +693,13 @@ class MYSQL_DB { } return $newarray; } + + function getVillagesID2($uid) { + $q = "SELECT wref from " . TB_PREFIX . "vdata where owner = $uid order by capital DESC,pop DESC"; + $result = mysql_query($q, $this->connection); + $array = $this->mysql_fetch_all($result); + return $array; + } function getVillage($vid) { $q = "SELECT * FROM " . TB_PREFIX . "vdata where wref = $vid"; @@ -1861,12 +1868,24 @@ class MYSQL_DB { $result = mysql_query($q, $this->connection); return $this->mysql_fetch_all($result); } + + function getBuildingByField2($wid,$field) { + $q = "SELECT * FROM " . TB_PREFIX . "bdata where wid = $wid and field = $field and master = 0"; + $result = mysql_query($q, $this->connection); + return mysql_num_rows($result); + } function getBuildingByType($wid,$type) { $q = "SELECT * FROM " . TB_PREFIX . "bdata where wid = $wid and type = $type and master = 0"; $result = mysql_query($q, $this->connection); return $this->mysql_fetch_all($result); } + + function getBuildingByType2($wid,$type) { + $q = "SELECT * FROM " . TB_PREFIX . "bdata where wid = $wid and type = $type and master = 0"; + $result = mysql_query($q, $this->connection); + return mysql_num_rows($result); + } function getDorf1Building($wid) { $q = "SELECT * FROM " . TB_PREFIX . "bdata where wid = $wid and field < 19 and master = 0"; @@ -2124,7 +2143,7 @@ class MYSQL_DB { } function getARanking() { - $q = "SELECT id,name,tag FROM " . TB_PREFIX . "alidata where id != '' ORDER BY id DESC"; + $q = "SELECT id,name,tag,oldrank FROM " . TB_PREFIX . "alidata where id != '' ORDER BY id DESC"; $result = mysql_query($q, $this->connection); return $this->mysql_fetch_all($result); } @@ -2749,7 +2768,7 @@ class MYSQL_DB { $wid = $row['id']; $basearray = $this->getOMInfo($wid); //We switch type of oasis and instert record with apropriate infomation. - $q = "INSERT into " . TB_PREFIX . "odata VALUES ('" . $basearray['id'] . "'," . $basearray['oasistype'] . ",0,400,400,400,400,400,400," . time() . ",100,2,'Unoccupied Oasis',".rand(0,2).")"; + $q = "INSERT into " . TB_PREFIX . "odata VALUES ('" . $basearray['id'] . "'," . $basearray['oasistype'] . ",0,800,800,800,800,800,800," . time() . ",100,2,'Unoccupied Oasis',".rand(0,2).")"; $result = mysql_query($q, $this->connection); } } diff --git a/GameEngine/Profile.php b/GameEngine/Profile.php index 25814b6d..492b2ffa 100644 --- a/GameEngine/Profile.php +++ b/GameEngine/Profile.php @@ -122,16 +122,11 @@ class Profile { $form->addError("email",EMAIL_ERROR); } if($post['del'] && md5($post['del_pw']) == $session->userinfo['password']) { - if($database->isAllianceOwner($post['uid'])) { - $form->addError("del",ALLI_OWNER); - } - else { if($session->access!=BANNED){ $database->setDeleting($post['uid'],0); }else{ header("Location: banned.php"); } - } } else { $form->addError("del",PASS_MISMATCH); diff --git a/GameEngine/Ranking.php b/GameEngine/Ranking.php index 06cbd100..21d42b05 100644 --- a/GameEngine/Ranking.php +++ b/GameEngine/Ranking.php @@ -58,9 +58,11 @@ break; case 31: $this->procAttRankArray(); + $this->getStart($this->searchRank($session->uid, "userid")); break; case 32: $this->procDefRankArray(); + $this->getStart($this->searchRank($session->uid, "userid")); break; case 2: $this->procVRankArray(); @@ -170,8 +172,13 @@ break; } else { if(!next($this->rankarray)) { + if($field != "userid"){ return $name; break; + }else{ + return 0; + break; + } } } } @@ -180,8 +187,9 @@ public function procRankArray() { global $database, $multisort; if($database->countUser() > 0){ - $holder = array(); - $q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username," . TB_PREFIX . "users.alliance alliance, ( + $holder = array(); + if(SHOW_NATARS == True){ + $q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username," . TB_PREFIX . "users.alliance alliance, ( SELECT SUM( " . TB_PREFIX . "vdata.pop ) FROM " . TB_PREFIX . "vdata @@ -200,10 +208,31 @@ )allitag FROM " . TB_PREFIX . "users WHERE " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . " - AND " . TB_PREFIX . "users.tribe <= 3 ORDER BY totalpop DESC, totalvillages DESC, userid DESC"; + AND " . TB_PREFIX . "users.tribe <= 5 ORDER BY totalpop DESC, totalvillages DESC, userid DESC"; + }else{ + $q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username," . TB_PREFIX . "users.alliance alliance, ( + SELECT SUM( " . TB_PREFIX . "vdata.pop ) + FROM " . TB_PREFIX . "vdata + WHERE " . TB_PREFIX . "vdata.owner = userid + )totalpop, ( - $result = (mysql_query($q)); + SELECT COUNT( " . TB_PREFIX . "vdata.wref ) + FROM " . TB_PREFIX . "vdata + WHERE " . TB_PREFIX . "vdata.owner = userid AND type != 99 + )totalvillages, ( + + SELECT " . TB_PREFIX . "alidata.tag + FROM " . TB_PREFIX . "alidata, " . TB_PREFIX . "users + WHERE " . TB_PREFIX . "alidata.id = " . TB_PREFIX . "users.alliance + AND " . TB_PREFIX . "users.id = userid + )allitag + FROM " . TB_PREFIX . "users + WHERE " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . " + AND " . TB_PREFIX . "users.tribe <= 3 ORDER BY totalpop DESC, totalvillages DESC, userid DESC"; + } + + $result = (mysql_query($q)); while($row = mysql_fetch_assoc($result)) { $datas[] = $row; } @@ -354,7 +383,7 @@ WHERE " . TB_PREFIX . "vdata.owner = userid )pop FROM " . TB_PREFIX . "users - WHERE " . TB_PREFIX . "users.dpall >=0 AND " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . " + WHERE " . TB_PREFIX . "users.dpall >=0 AND " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . " AND " . TB_PREFIX . "users.tribe <= 3 ORDER BY " . TB_PREFIX . "users.dpall DESC, pop DESC, userid DESC"; $result = mysql_query($q) or die(mysql_error()); while($row = mysql_Fetch_assoc($result)) { diff --git a/GameEngine/Technology.php b/GameEngine/Technology.php index a4ede054..a005a1bd 100644 --- a/GameEngine/Technology.php +++ b/GameEngine/Technology.php @@ -566,7 +566,7 @@ private function trainUnit($unit,$amt,$great=false) { if($building->getTypeLevel(22) >= 5 && $building->getTypeLevel(20) >= 5) { return true; } else { return false; } break; case 6: - if($building->getTypeLevel(22) >= 5 && $building->getTypeLevel(20) >= 10) { return true; } else { return false; } + if($building->getTypeLevel(22) >= 15 && $building->getTypeLevel(20) >= 10) { return true; } else { return false; } break; case 9: case 29: diff --git a/GameEngine/Units.php b/GameEngine/Units.php index fc598b5d..e4892b75 100644 --- a/GameEngine/Units.php +++ b/GameEngine/Units.php @@ -77,7 +77,7 @@ class Units { } if($database->isVillageOases($oid) != 0){ $too = $database->getOasisField($oid,"conqured"); - if($_GET['conqured'] == 0){$disabledr ="disabled=disabled"; $disabled ="disabled=disabled";}else{ + if($too['conqured'] == 0){$disabledr ="disabled=disabled"; $disabled ="disabled=disabled";}else{ $disabledr =""; if($session->sit == 0){ $disabled =""; diff --git a/Templates/Ajax/mapscroll.tpl b/Templates/Ajax/mapscroll.tpl index 9135cf22..103bdb0c 100644 --- a/Templates/Ajax/mapscroll.tpl +++ b/Templates/Ajax/mapscroll.tpl @@ -109,6 +109,9 @@ $neutral = (($neutralarray[0]['alli1']>0 and $neutralarray[0]['alli2']>0 and $do $image = ($donnees['map_occupied'] == 1 && $donnees['map_fieldtype'] > 0)?(($donnees['ville_user'] == $_SESSION['id_user'])? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b30': 'b20' :'b10' : 'b00') : (($targetalliance != 0)? ($friend==1? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b31': 'b21' :'b11' : 'b01') : ($war==1? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b32': 'b22' :'b12' : 'b02') : ($neutral==1? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b35': 'b25' :'b15' : 'b05') : ($targetalliance == $_SESSION['alliance_user']? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b33': 'b23' :'b13' : 'b03') : ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b34': 'b24' :'b14' : 'b04'))))) : ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b34': 'b24' :'b14' : 'b04'))) : $donnees['map_image']; +if($donnees['ville_user']==3 && $donnees['ville_name']=='WW Buildingplan'){ +$image = "o99"; +} //Javascript map info if($yrow!=7){ $map_js .= "[".$donnees['map_x'].",".$donnees['map_y'].",".$donnees['map_fieldtype'].",". ((!empty($donnees['map_oasis'])) ? $donnees['map_oasis'] : 0) .",\"d=".$donnees['map_id']."&c=".$generator->getMapCheck($donnees['map_id'])."\",\"".$image."\""; diff --git a/Templates/Ajax/mapscroll2.tpl b/Templates/Ajax/mapscroll2.tpl index 03d9f265..b2645b89 100644 --- a/Templates/Ajax/mapscroll2.tpl +++ b/Templates/Ajax/mapscroll2.tpl @@ -126,6 +126,9 @@ $neutral = (($neutralarray[0]['alli1']>0 and $neutralarray[0]['alli2']>0 and $do $image = ($donnees['map_occupied'] == 1 && $donnees['map_fieldtype'] > 0)?(($donnees['ville_user'] == $_SESSION['id_user'])? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b30': 'b20' :'b10' : 'b00') : (($targetalliance != 0)? ($friend==1? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b31': 'b21' :'b11' : 'b01') : ($war==1? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b32': 'b22' :'b12' : 'b02') : ($neutral==1? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b35': 'b25' :'b15' : 'b05') : ($targetalliance == $_SESSION['alliance_user']? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b33': 'b23' :'b13' : 'b03') : ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b34': 'b24' :'b14' : 'b04'))))) : ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b34': 'b24' :'b14' : 'b04'))) : $donnees['map_image']; +if($donnees['ville_user']==3 && $donnees['ville_name']=='WW Buildingplan'){ +$image = "o99"; +} //Javascript map info if($yrow!=13){ $map_js .= "[".$donnees['map_x'].",".$donnees['map_y'].",".$donnees['map_fieldtype'].",". ((!empty($donnees['map_oasis'])) ? $donnees['map_oasis'] : 0) .",\"d=".$donnees['map_id']."&c=".$generator->getMapCheck($donnees['map_id'])."\",\"".$image."\""; diff --git a/Templates/Ajax/quest_core.tpl b/Templates/Ajax/quest_core.tpl index 8e7ace24..815ab3ff 100644 --- a/Templates/Ajax/quest_core.tpl +++ b/Templates/Ajax/quest_core.tpl @@ -505,7 +505,7 @@ if ($rRes!=$rSubmited){ ?> -{"markup":"\n\t\t

\"\" Task 16: Weapons or Dough<\/h1>
”Now you have to make a decision: Either trade peacefully or become a dreaded warrior.\r\n

\r\nFor the marketplace you need a granary, for the barracks you need a rally point.”<\/i>

<\/span><\/div>\n\t\t
<\/div>\n\t\t","number":"-19","reward":false,"qgsrc":"q_luserinfo['tribe'];?>","msrc":"","altstep":99} +{"markup":"\n\t\t

\"\" Task 15: Weapons or Dough<\/h1>
”Now you have to make a decision: Either trade peacefully or become a dreaded warrior.\r\n

\r\nFor the marketplace you need a granary, for the barracks you need a rally point.”<\/i>

<\/span><\/div>\n\t\t
<\/div>\n\t\t","number":"-19","reward":false,"qgsrc":"q_luserinfo['tribe'];?>","msrc":"","altstep":99} getTypeLevel(38); $greatgranary = $building->getTypeLevel(39); $greatworkshop = $building->getTypeLevel(42); -foreach ($database->getJobs($_SESSION['wid']) as $bdata) { - $UnderConstruction = strtolower(str_replace(array(" ","'"),"",$building->procResType($bdata['type']))); - $$UnderConstruction = ($$UnderConstruction == 0 ? -1 : $$UnderConstruction); -} - +$mainbuilding1 = $database->getBuildingByType2($village->wid,15); +$cranny1 = $database->getBuildingByType2($village->wid,23); +$granary1 = $database->getBuildingByType2($village->wid,11); +$warehouse1 = $database->getBuildingByType2($village->wid,10); +$embassy1 = $database->getBuildingByType2($village->wid,18); +$wall1 = $database->getBuildingByField2($village->wid,40); +$rallypoint1 = $database->getBuildingByType2($village->wid,16); +$hero1 = $database->getBuildingByType2($village->wid,37); +$market1 = $database->getBuildingByType2($village->wid,17); +$barrack1 = $database->getBuildingByType2($village->wid,19); +$cropland1 = $database->getBuildingByType2($village->wid,4); +$grainmill1 = $database->getBuildingByType2($village->wid,8); +$residence1 = $database->getBuildingByType2($village->wid,25); +$academy1 = $database->getBuildingByType2($village->wid,22); +$armoury1 = $database->getBuildingByType2($village->wid,13); +$woodcutter1 = $database->getBuildingByType2($village->wid,1); +$palace1 = $database->getBuildingByType2($village->wid,26); +$claypit1 = $database->getBuildingByType2($village->wid,2); +$ironmine1 = $database->getBuildingByType2($village->wid,3); +$blacksmith1 = $database->getBuildingByType2($village->wid,12); +$stable1 = $database->getBuildingByType2($village->wid,20); +$trapper1 = $database->getBuildingByType2($village->wid,36); +$treasury1 = $database->getBuildingByType2($village->wid,27); +$sawmill1 = $database->getBuildingByType2($village->wid,5); +$brickyard1 = $database->getBuildingByType2($village->wid,6); +$ironfoundry1 = $database->getBuildingByType2($village->wid,7); +$workshop1 = $database->getBuildingByType2($village->wid,21); +$stonemasonslodge1 = $database->getBuildingByType2($village->wid,34); +$townhall1 = $database->getBuildingByType2($village->wid,24); +$tournamentsquare1 = $database->getBuildingByType2($village->wid,14); +$bakery1 = $database->getBuildingByType2($village->wid,9); +$tradeoffice1 = $database->getBuildingByType2($village->wid,28); +$greatbarracks1 = $database->getBuildingByType2($village->wid,29); +$greatstable1 = $database->getBuildingByType2($village->wid,30); +$brewery1 = $database->getBuildingByType2($village->wid,35); +$horsedrinkingtrough1 = $database->getBuildingByType2($village->wid,41); +$herosmansion1 = $database->getBuildingByType2($village->wid,37); +$greatwarehouse1 = $database->getBuildingByType2($village->wid,38); +$greatgranary1 = $database->getBuildingByType2($village->wid,39); +$greatworkshop1 = $database->getBuildingByType2($village->wid,42); ?>

Construct new building

= 1 && $id != 39 && $id != 40) { +if((($cranny == 0 && $cranny1 == 0) || $cranny == 10) && $mainbuilding >= 1 && $id != 39 && $id != 40) { include("avaliable/cranny.tpl"); } -if(($granary == 0 || $granary == 20) && $mainbuilding >= 1 && $id != 39 && $id != 40 ) { +if((($granary == 0 && $granary1 == 0) || $granary == 20) && $mainbuilding >= 1 && $id != 39 && $id != 40 ) { include("avaliable/granary.tpl"); } -if($wall == 0) { +if($wall == 0 && $wall1 == 0) { if($session->tribe == 1 && $id != 39) { include("avaliable/citywall.tpl"); } @@ -78,7 +113,7 @@ if($wall == 0) { include("avaliable/citywall.tpl"); } } -if(($warehouse == 0 || $warehouse == 20) && $mainbuilding >= 1 && $id != 39 && $id != 40) { +if((($warehouse == 0 && $warehouse1 == 0) || $warehouse == 20) && $mainbuilding >= 1 && $id != 39 && $id != 40) { include("avaliable/warehouse.tpl"); } if($mainbuilding >= 10 && $village->capital == 0 && $largeA['owner'] == $session->uid || $normalA['vref'] == $village->wid ) { @@ -86,43 +121,43 @@ if($mainbuilding >= 10 && $village->capital == 0 && $largeA['owner'] == $session } if($mainbuilding >= 10 && $village->capital == 0 && $largeA['owner'] == $session->uid || $normalA['vref'] == $village->wid ) { include("avaliable/greatgranary.tpl"); -} -if(($trapper ==0 || $trapper == 20) && $rallypoint >= 1 && $session->tribe == 3 && $id != 39 && $id != 40) { +} +if((($trapper == 0 && $trapper1 == 0) || $trapper == 20) && $rallypoint >= 1 && $session->tribe == 3 && $id != 39 && $id != 40) { include("avaliable/trapper.tpl"); } -if($rallypoint == 0 && $id != 40) { +if($rallypoint == 0 && $rallypoint1 == 0 && $id != 40) { include("avaliable/rallypoint.tpl"); } -if($embassy == 0 && $id != 39 && $id != 40) { +if($embassy == 0 && $embassy1 == 0 && $id != 39 && $id != 40) { include("avaliable/embassy.tpl"); } //fix hero -if($hero == 0 && $mainbuilding >= 3 && $rallypoint >= 1 && $$UnderConstruction <> -1 && $id != 39 && $id != 40) { +if($hero == 0 && $hero1 == 0 && $mainbuilding >= 3 && $rallypoint >= 1 && $id != 39 && $id != 40) { include("avaliable/hero.tpl"); } //fix barracks -if($rallypoint >= 1 && $mainbuilding >= 3 && $barrack == 0 && $$UnderConstruction <> -1 && $id != 39 && $id != 40) { +if($rallypoint >= 1 && $mainbuilding >= 3 && $barrack == 0 && $barrack1 == 0 && $id != 39 && $id != 40) { include("avaliable/barracks.tpl"); } -if($mainbuilding >= 3 && $academy >= 1 && $armoury == 0 && $id != 39 && $id != 40) { +if($mainbuilding >= 3 && $academy >= 1 && $armoury == 0 && $armoury1 == 0 && $id != 39 && $id != 40) { include("avaliable/armoury.tpl"); } -if($cropland >= 5 && $grainmill == 0 && $id != 39 && $id != 40) { +if($cropland >= 5 && $grainmill == 0 && $grainmill1 == 0 && $id != 39 && $id != 40) { include("avaliable/grainmill.tpl"); } //fix marketplace -if($granary >= 1 && $warehouse >= 1 && $mainbuilding >= 3 && $market == 0 && $$UnderConstruction <> -1 && $id != 39 && $id != 40) { +if($granary >= 1 && $warehouse >= 1 && $mainbuilding >= 3 && $market == 0 && $market1 == 0 && $id != 39 && $id != 40) { include("avaliable/marketplace.tpl"); } //fix residence -if($mainbuilding >= 5 && $residence == 0 && $$UnderConstruction <> -1 && $id != 39 && $id != 40 && $palace == 0) { +if($mainbuilding >= 5 && $residence == 0 && $residence1 == 0 && $id != 39 && $id != 40 && $palace == 0 && $palace1 == 0) { include("avaliable/residence.tpl"); } -if($academy == 0 && $mainbuilding >= 3 && $barrack >= 3 && $id != 39 && $id != 40) { +if($academy == 0 && $academy1 == 0 && $mainbuilding >= 3 && $barrack >= 3 && $id != 39 && $id != 40) { include("avaliable/academy.tpl"); } //fix palace -if($palace == 0 && $embassy >= 1 && $mainbuilding >= 5 && $id != 39 && $id != 40 && $residence == 0) { +if($palace == 0 && $palace1 == 0 && $embassy >= 1 && $mainbuilding >= 5 && $id != 39 && $id != 40 && $residence == 0 && $residence1 == 0) { //Fix Castle //id user @@ -156,55 +191,55 @@ if (!$test){ //end Fix } -if($blacksmith == 0 && $academy >= 3 && $mainbuilding >= 3 && $id != 39 && $id != 40) { +if($blacksmith == 0 && $blacksmith1 == 0 && $academy >= 3 && $mainbuilding >= 3 && $id != 39 && $id != 40) { include("avaliable/blacksmith.tpl"); } -if($stonemasonslodge == 0 && $palace >= 3 && $mainbuilding >= 5 && $id != 39 && $id != 40 && $village->capital == 1) { +if($stonemasonslodge == 0 && $stonemasonslodge1 == 0 && $palace >= 3 && $mainbuilding >= 5 && $id != 39 && $id != 40 && $village->capital == 1) { include("avaliable/stonemason.tpl"); } -if($stable == 0 && $blacksmith >= 3 && $academy >= 5 && $id != 39 && $id != 40) { +if($stable == 0 && $stable1 == 0 && $blacksmith >= 3 && $academy >= 5 && $id != 39 && $id != 40) { include("avaliable/stable.tpl"); } -if($treasury == 0 && $mainbuilding >= 10 && $id != 39 && $id != 40) { +if($treasury == 0 && $treasury1 == 0 && $mainbuilding >= 10 && $id != 39 && $id != 40) { include("avaliable/treasury.tpl"); } -if($brickyard == 0 && $claypit >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40 ) { +if($brickyard == 0 && $brickyard1 == 0 && $claypit >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40 ) { include("avaliable/brickyard.tpl"); } -if($sawmill == 0 && $woodcutter >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) { +if($sawmill == 0 && $sawmill1 == 0 && $woodcutter >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) { include("avaliable/sawmill.tpl"); } -if($ironfoundry == 0 && $ironmine >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) { +if($ironfoundry == 0 && $ironfoundry1 == 0 && $ironmine >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) { include("avaliable/ironfoundry.tpl"); } -if($workshop == 0 && $academy >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) { +if($workshop == 0 && $workshop1 == 0 && $academy >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) { include("avaliable/workshop.tpl"); } -if($tournamentsquare == 0 && $rallypoint >= 15 && $id != 39 && $id != 40) { +if($tournamentsquare == 0 && $tournamentsquare1 == 0 && $rallypoint >= 15 && $id != 39 && $id != 40) { include("avaliable/tsquare.tpl"); } -if($bakery == 0 && $grainmill >= 5 && $cropland >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) { +if($bakery == 0 && $bakery1 == 0 && $grainmill >= 5 && $cropland >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) { include("avaliable/bakery.tpl"); } -if($townhall == 0 && $mainbuilding >= 10 && $academy >= 10 && $id != 39 && $id != 40) { +if($townhall == 0 && $townhall1 == 0 && $mainbuilding >= 10 && $academy >= 10 && $id != 39 && $id != 40) { include("avaliable/townhall.tpl"); } -if($tradeoffice == 0 && $market == 20 && $stable >= 10 && $id != 39 && $id != 40) { +if($tradeoffice == 0 && $tradeoffice1 == 0 && $market == 20 && $stable >= 10 && $id != 39 && $id != 40) { include("avaliable/tradeoffice.tpl"); } -if($session->tribe == 1 && $horsedrinkingtrough == 0 && $rallypoint >= 10 && $stable == 20 && $id != 39 && $id != 40) { +if($session->tribe == 1 && $horsedrinkingtrough == 0 && $horsedrinkingtrough1 == 0 && $rallypoint >= 10 && $stable == 20 && $id != 39 && $id != 40) { include("avaliable/horsedrinking.tpl"); } -if($session->tribe == 2 && $brewery == 0 && $rallypoint >= 10 && $granary == 20 && $id != 39 && $id != 40) { +if($session->tribe == 2 && $brewery == 0 && $brewery1 == 0 && $rallypoint >= 10 && $granary == 20 && $id != 39 && $id != 40) { include("avaliable/brewery.tpl"); } -if($greatbarracks == 0 && $barrack == 20 && $village->capital == 0 && $id != 39 && $id != 40) { +if($greatbarracks == 0 && $greatbarracks1 == 0 && $barrack == 20 && $village->capital == 0 && $id != 39 && $id != 40) { include("avaliable/greatbarracks.tpl"); } -if($greatstable == 0 && $stable == 20 && $village->capital == 0 && $id != 39 && $id != 40) { +if($greatstable == 0 && $greatstable1 == 0 && $stable == 20 && $village->capital == 0 && $id != 39 && $id != 40) { include("avaliable/greatstable.tpl"); } -if($greatworkshop == 0 && $workshop == 20 && $village->capital == 0 && $id != 39 && $id != 40 && GREAT_WKS) { +if($greatworkshop == 0 && $greatworkshop1 == 0 && $workshop == 20 && $village->capital == 0 && $id != 39 && $id != 40 && GREAT_WKS) { include("avaliable/greatworkshop.tpl"); } if($id != 39 && $id != 40) { @@ -213,19 +248,19 @@ if($id != 39 && $id != 40) {
tribe == 3 && $trapper == 0 ) { +if($rallypoint == 0 && $session->tribe == 3 && $trapper == 0) { include("soon/trapper.tpl"); } -if($mainbuilding < 10 && $village->capital == 0 && $largeA['owner'] == $session->uid || $normalA['vref'] == $village->wid ) { +if($mainbuilding < 10 && $village->capital == 0 && $largeA['owner'] == $session->uid || $normalA['vref'] == $village->wid) { include("soon/greatwarehouse.tpl"); } -if($mainbuilding < 10 && $village->capital == 0 && $largeA['owner'] == $session->uid || $normalA['vref'] == $village->wid ) { +if($mainbuilding < 10 && $village->capital == 0 && $largeA['owner'] == $session->uid || $normalA['vref'] == $village->wid) { include("soon/greatgranary.tpl"); } if($hero == 0 && ($mainbuilding <= 2 || $rallypoint == 0)){ include("soon/hero.tpl"); } -if($barrack == 0 && ($rallypoint == 0 || $mainbuilding <= 2) ) { +if($barrack == 0 && ($rallypoint == 0 || $mainbuilding <= 2)) { include("soon/barracks.tpl"); } if($armoury == 0 && ($mainbuilding <= 2 || $academy == 0)) { @@ -237,13 +272,13 @@ if($cropland <= 4) { if($marketplace == 0 && ($mainbuilding <= 2 || $granary <= 0 || $warehouse <= 0)) { include("soon/marketplace.tpl"); } -if($residence == 0 && $mainbuilding <= 4) { +if($residence == 0 && $palace == 0 && $mainbuilding <= 4) { include("soon/residence.tpl"); } if($academy == 0 && ($mainbuilding <= 2 || $barrack <= 2)) { include("soon/academy.tpl"); } -if($embassy == 0 || $mainbuilding >= 2 && $mainbuilding <= 4) { +if($embassy == 0 || $mainbuilding >= 2 && $mainbuilding <= 4 && $palace == 0 && $residence == 0) { //Fix Castle //id user diff --git a/Templates/Build/avaliable/brewery.tpl b/Templates/Build/avaliable/brewery.tpl index 475d8d8a..eff512ec 100644 --- a/Templates/Build/avaliable/brewery.tpl +++ b/Templates/Build/avaliable/brewery.tpl @@ -1,7 +1,7 @@ -

Brewery

+

Brewery

- +
In the Teuton’s brewery mead is brewed, the soldiers drink to give themselves Dutch courage before battle. The higher the level of the brewery, the greater is the attack bonus. The mead-festivals always last 72 hours.In the Teuton’s brewery mead is brewed, the soldiers drink to give themselves Dutch courage before battle. The higher the level of the brewery, the greater is the attack bonus. The mead-festivals always last 72 hours. Brewery diff --git a/Templates/Build/avaliable/tsquare.tpl b/Templates/Build/avaliable/tsquare.tpl index d07b4753..243e6a6f 100644 --- a/Templates/Build/avaliable/tsquare.tpl +++ b/Templates/Build/avaliable/tsquare.tpl @@ -1,7 +1,7 @@

Tournament Square

- +
At the tournament square your troops can train to increase their stamina. The further the building is upgraded the faster your troops are beyond a minimum distance of 30 squares.At the tournament square your troops can train to increase their stamina. The further the building is upgraded the faster your troops are beyond a minimum distance of squares. Tournament Square diff --git a/Templates/Build/soon/tsquare.tpl b/Templates/Build/soon/tsquare.tpl index bccc7c20..112eef91 100644 --- a/Templates/Build/soon/tsquare.tpl +++ b/Templates/Build/soon/tsquare.tpl @@ -1,7 +1,7 @@

Tournament Square

- + diff --git a/Templates/Ranking/ww.tpl b/Templates/Ranking/ww.tpl index 87a7cb41..49073319 100644 --- a/Templates/Ranking/ww.tpl +++ b/Templates/Ranking/ww.tpl @@ -5,7 +5,7 @@ if (WW == True) FROM " . TB_PREFIX . "users INNER JOIN " . TB_PREFIX . "vdata ON " . TB_PREFIX . "users.id = " . TB_PREFIX . "vdata.owner INNER JOIN " . TB_PREFIX . "fdata ON " . TB_PREFIX . "fdata.vref = " . TB_PREFIX . "vdata.wref - WHERE " . TB_PREFIX . "fdata.f99t = 40 ORDER BY " . TB_PREFIX . "fdata.f99 Desc LIMIT 20"); + WHERE " . TB_PREFIX . "fdata.f99t = 40 ORDER BY " . TB_PREFIX . "fdata.f99 Desc, id Desc LIMIT 20"); ?>
At the tournament square your troops can train to increase their stamina. The further the building is upgraded the faster your troops are beyond a minimum distance of 30 squares.At the tournament square your troops can train to increase their stamina. The further the building is upgraded the faster your troops are beyond a minimum distance of squares. Tournament Square diff --git a/Templates/Build/upgrade.tpl b/Templates/Build/upgrade.tpl index 46171c31..3e659c0d 100644 --- a/Templates/Build/upgrade.tpl +++ b/Templates/Build/upgrade.tpl @@ -78,8 +78,12 @@ if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) { echo "Upgrade Granary."; } else if($bindicate == 7) { + if($village->allcrop > 0){ $neededtime = $building->calculateAvaliable($id,$village->resarray['f'.$id.'t'],1+$loopsame+$doublebuild+$master); echo "Enough resources ".$neededtime[0]." at ".$neededtime[1].""; + }else{ + echo "Your crop production is negative, you will never get the required resources."; + } if($session->goldclub == 1){ ?>
resarray['f'.$id.'t']; $bindicate = $building->canBuild($id,$bid); -$wwlevel = $village->resarray['f'.$id]; +$wwlevel = $village->resarray['f99']; if($wwlevel > 50){ $needed_plan = 1; }else{ @@ -109,8 +109,12 @@ if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) { echo "Upgrade Granary."; } else if($bindicate == 7) { + if($village->allcrop > 0){ $neededtime = $building->calculateAvaliable($id,$village->resarray['f'.$id.'t'],1+$loopsame+$doublebuild+$master); echo "Enough resources ".$neededtime[0]." at ".$neededtime[1].""; + }else{ + echo "Your crop production is negative, you will never get the required resources."; + } if($session->goldclub == 1){ ?>
Tournament SquareTournament SquareYour troops can increase their stamina at the tournament square. The further the building is upgraded the faster your troops are beyond a minimum distance of 30 squares.

Costs and construction time for level 1:
Lumber1750 | Clay2250 | Iron1530 | Crop240 | Crop consumption1 | duration0:58:20

+

Tournament Square

Tournament SquareYour troops can increase their stamina at the tournament square. The further the building is upgraded the faster your troops are beyond a minimum distance of squares.

Costs and construction time for level 1:
Lumber1750 | Clay2250 | Iron1530 | Crop240 | Crop consumption1 | duration0:58:20

Prerequisites
Rally Point Level 15

diff --git a/Templates/Plus/10.tpl b/Templates/Plus/10.tpl index 05bdcc6f..78a0d84c 100644 --- a/Templates/Plus/10.tpl +++ b/Templates/Plus/10.tpl @@ -22,7 +22,7 @@ if (mysql_num_rows($MyGold)) { if (mysql_num_rows($MyGold)) { if($golds['b2'] == 0) { -mysql_query("UPDATE ".TB_PREFIX."users set b2 = ('".time()."')+".PLUS_PRODUCTION." where `id`='".$session->uid."'") or die(mysql_error()); +mysql_query("UPDATE ".TB_PREFIX."users set b2 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error()); } else { mysql_query("UPDATE ".TB_PREFIX."users set b2 = '".($golds['b2']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error()); } diff --git a/Templates/Plus/11.tpl b/Templates/Plus/11.tpl index b4d9867b..b511bb83 100644 --- a/Templates/Plus/11.tpl +++ b/Templates/Plus/11.tpl @@ -22,7 +22,7 @@ if (mysql_num_rows($MyGold)) { if (mysql_num_rows($MyGold)) { if($golds['b3'] == 0) { -mysql_query("UPDATE ".TB_PREFIX."users set b3 = ('".time()."')+".PLUS_PRODUCTION." where `id`='".$session->uid."'") or die(mysql_error()); +mysql_query("UPDATE ".TB_PREFIX."users set b3 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error()); } else { mysql_query("UPDATE ".TB_PREFIX."users set b3 = '".($golds['b3']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error()); } diff --git a/Templates/Plus/12.tpl b/Templates/Plus/12.tpl index 5ea8a23d..106f2fca 100644 --- a/Templates/Plus/12.tpl +++ b/Templates/Plus/12.tpl @@ -22,7 +22,7 @@ if (mysql_num_rows($MyGold)) { if (mysql_num_rows($MyGold)) { if($golds['b4'] == 0) { -mysql_query("UPDATE ".TB_PREFIX."users set b4 = ('".time()."')+".PLUS_PRODUCTION." where `id`='".$session->uid."'") or die(mysql_error()); +mysql_query("UPDATE ".TB_PREFIX."users set b4 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error()); } else { mysql_query("UPDATE ".TB_PREFIX."users set b4 = '".($golds['b4']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error()); } diff --git a/Templates/Plus/9.tpl b/Templates/Plus/9.tpl index 1bec9abf..2420d93a 100644 --- a/Templates/Plus/9.tpl +++ b/Templates/Plus/9.tpl @@ -22,7 +22,7 @@ if (mysql_num_rows($MyGold)) { if (mysql_num_rows($MyGold)) { if($golds['b1'] == 0) { -mysql_query("UPDATE ".TB_PREFIX."users set b1 = ('".time()."')+".PLUS_PRODUCTION." where `id`='".$session->uid."'") or die(mysql_error()); +mysql_query("UPDATE ".TB_PREFIX."users set b1 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error()); } else { mysql_query("UPDATE ".TB_PREFIX."users set b1 = '".($golds['b1']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error()); } diff --git a/Templates/Ranking/general.tpl b/Templates/Ranking/general.tpl index cc22b598..2bc7ce71 100644 --- a/Templates/Ranking/general.tpl +++ b/Templates/Ranking/general.tpl @@ -42,7 +42,7 @@
Players online
diff --git a/Templates/a2b/startRaid.tpl b/Templates/a2b/startRaid.tpl index 945b8473..46593a28 100644 --- a/Templates/a2b/startRaid.tpl +++ b/Templates/a2b/startRaid.tpl @@ -4,10 +4,10 @@ $lid = $_POST['lid']; $tribe = $_POST['tribe']; $getFLData = $database->getFLData($lid); - $unitslist = $database->getFLData($lid); - $sql = mysql_query("SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = ".$lid.""); + $sql = "SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = ".$lid." order by id asc"; + $array = $database->query_return($sql); + foreach($array as $row){ $sql1 = mysql_fetch_array(mysql_query("SELECT * FROM ".TB_PREFIX."units WHERE vref = ".$getFLData['wref'])); - while($row = mysql_fetch_array($sql)){ $sid = $row['id']; $wref = $row['towref']; $t1 = $row['t1'];$t2 = $row['t2'];$t3 = $row['t3'];$t4 = $row['t4'];$t5 = $row['t5']; diff --git a/a2b.php b/a2b.php index 07201ea8..7ffa5c29 100644 --- a/a2b.php +++ b/a2b.php @@ -51,7 +51,7 @@ if(isset($_GET['o'])) { $o = preg_replace("/[^a-zA-Z0-9_-]/","",$_GET['o']); $oid = preg_replace("/[^a-zA-Z0-9_-]/","",$_GET['z']); $too = $database->getOasisField($oid,"conqured"); - if($_GET['conqured'] == 0){$disabledr ="disabled=disabled"; $disabled ="disabled=disabled";}else{ + if($too['conqured'] == 0){$disabledr ="disabled=disabled"; $disabled ="disabled=disabled";}else{ $disabledr =""; if($session->sit == 0){ $disabled =""; diff --git a/allianz.php b/allianz.php index 6d113437..40d24114 100644 --- a/allianz.php +++ b/allianz.php @@ -345,4 +345,6 @@ include("Templates/links.tpl"); \ No newline at end of file diff --git a/anmelden.php b/anmelden.php index 2c1e5f37..33ae6a6d 100644 --- a/anmelden.php +++ b/anmelden.php @@ -70,6 +70,7 @@ if(REG_OPEN == true){ ?> diff --git a/build.php b/build.php index 1059cf55..15cfc81f 100644 --- a/build.php +++ b/build.php @@ -17,6 +17,9 @@ if(isset($_GET['newdid'])) { $_SESSION['wid'] = $_GET['newdid']; header("Location: ".$_SERVER['PHP_SELF'].(isset($_GET['id'])?'?id='.$_GET['id']:(isset($_GET['gid'])?'?gid='.$_GET['gid']:''))); } +if($_GET['id'] == 99 && $village->natar == 0){ +header("Location: dorf2.php"); +} if(isset($_GET['buildingFinish'])) { if($session->gold >= 2) { $building->finishAll(); diff --git a/index.php b/index.php index 380992b3..25e4a9d6 100644 --- a/index.php +++ b/index.php @@ -153,7 +153,7 @@ include ("GameEngine/Lang/".LANG.".php"); diff --git a/install/data/constant_format.tpl b/install/data/constant_format.tpl index ffd91ea5..ca63e31c 100644 --- a/install/data/constant_format.tpl +++ b/install/data/constant_format.tpl @@ -95,6 +95,9 @@ define("PROTECTION","%BEGINNER%"); // ***** Enable WW Statistics define("WW",%WW%); +// ***** Show Natars in Statistics +define("SHOW_NATARS",%SHOW_NATARS%); + // ***** Enable T4 is Coming screen define("T4_COMING",%T4_COMING%); diff --git a/install/process.php b/install/process.php index 2fd0cb76..f74139dd 100644 --- a/install/process.php +++ b/install/process.php @@ -92,6 +92,7 @@ class Process { $text = preg_replace("'%GREAT_WKS%'", $_POST['great_wks'], $text); $text = preg_replace("'%TS_THRESHOLD%'", $_POST['ts_threshold'], $text); $text = preg_replace("'%WW%'", $_POST['ww'], $text); + $text = preg_replace("'%SHOW_NATARS%'", $_POST['show_natars'], $text); $text = preg_replace("'%T4_COMING%'", $_POST['t4_coming'], $text); $text = preg_replace("'%REG_OPEN%'", $_POST['reg_open'], $text); $text = preg_replace("'%PEACE%'", $_POST['peace'], $text); diff --git a/install/templates/config.tpl b/install/templates/config.tpl index 8fbed192..4c579f96 100644 --- a/install/templates/config.tpl +++ b/install/templates/config.tpl @@ -91,6 +91,12 @@ echo "
Error creating constant.php
+
+ Warning: password with & can cause problems! getError('pw'); ?>
Show Natars in Statistics: + +
Peace system: