From 2d108c11bf5b791da725b48ea33612ac48424df9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Sep 2012 23:15:34 +0300 Subject: [PATCH 01/33] fix WW problem --- GameEngine/Building.php | 2 +- Templates/Build/wwupgrade.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/GameEngine/Building.php b/GameEngine/Building.php index 0a03643c..5c154b97 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{ diff --git a/Templates/Build/wwupgrade.tpl b/Templates/Build/wwupgrade.tpl index a1989801..fcac1893 100644 --- a/Templates/Build/wwupgrade.tpl +++ b/Templates/Build/wwupgrade.tpl @@ -1,7 +1,7 @@ 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{ From 1ef5eff48551368cbcc55f8e8578869806c7aaf8 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Sep 2012 11:57:55 +0300 Subject: [PATCH 02/33] add show natars option --- GameEngine/Ranking.php | 30 +- install/data/constant_format.tpl | 3 + install/process.php | 1 + install/templates/config.tpl | 6 + install/winner.php | 1178 ------------------------------ 5 files changed, 36 insertions(+), 1182 deletions(-) delete mode 100644 install/winner.php diff --git a/GameEngine/Ranking.php b/GameEngine/Ranking.php index 06cbd100..30a15d68 100644 --- a/GameEngine/Ranking.php +++ b/GameEngine/Ranking.php @@ -180,8 +180,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 +201,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; } 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 + Show Natars in Statistics: + + Peace system: + Warning: password with & can cause problems! getError('pw'); ?> From 9b48213fdd3742f9bacb3d177df9882b47de349c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 20 Sep 2012 16:22:38 +0300 Subject: [PATCH 04/33] update --- GameEngine/Ranking.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/GameEngine/Ranking.php b/GameEngine/Ranking.php index 1a9f0da3..dea1e65c 100644 --- a/GameEngine/Ranking.php +++ b/GameEngine/Ranking.php @@ -171,10 +171,15 @@ return $key; break; } else { + if($field != "userid"){ if(!next($this->rankarray)) { return $name; break; } + }else{ + return 0; + break; + } } } } @@ -183,7 +188,7 @@ global $database, $multisort; if($database->countUser() > 0){ $holder = array(); - if(Show_Natars == True){ + 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 2f510f3ec8ff13e589f933ad200f069c5ea6d5bf Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 22 Sep 2012 00:13:44 +0300 Subject: [PATCH 05/33] more updates --- GameEngine/Automation.php | 8 ++++++++ GameEngine/Ranking.php | 8 ++++---- Templates/Build/upgrade.tpl | 4 ++++ Templates/Build/wwupgrade.tpl | 4 ++++ Templates/a2b/startRaid.tpl | 6 +++--- 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index 96bb9ebf..e7dedc20 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -395,6 +395,14 @@ class Automation { $database->addMovement(4,$enforce['vref'],$enforce['from'],$reference,$time,$time+$time2); } } + 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']); diff --git a/GameEngine/Ranking.php b/GameEngine/Ranking.php index dea1e65c..4369d77f 100644 --- a/GameEngine/Ranking.php +++ b/GameEngine/Ranking.php @@ -171,15 +171,15 @@ return $key; break; } else { - if($field != "userid"){ if(!next($this->rankarray)) { + if($field != "userid"){ return $name; break; - } - }else{ + }else{ return 0; break; - } + } + } } } } 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){ ?>
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){ ?>
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']; From a08c9614529bffaf26f8e1ecbaeefbcd2266d12a Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 22 Sep 2012 13:11:42 +0300 Subject: [PATCH 06/33] optimize oasis (need to install again and then the game will be really faster) --- GameEngine/Database/db_MYSQL.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GameEngine/Database/db_MYSQL.php b/GameEngine/Database/db_MYSQL.php index 439dcdd5..ff8d751e 100644 --- a/GameEngine/Database/db_MYSQL.php +++ b/GameEngine/Database/db_MYSQL.php @@ -2756,7 +2756,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); } } From b503ddf56a9b016015bf49d8d715edbf6698e44a Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 22 Sep 2012 13:18:41 +0300 Subject: [PATCH 07/33] update --- Admin/Templates/search.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 @@ - + From 9a44851cecc4248900e8cb05fd36a78dad7a8722 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 22 Sep 2012 23:12:00 +0300 Subject: [PATCH 08/33] update --- GameEngine/Automation.php | 11 +++++------ Templates/Plus/10.tpl | 2 +- Templates/Plus/11.tpl | 2 +- Templates/Plus/12.tpl | 2 +- Templates/Plus/9.tpl | 2 +- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index e7dedc20..4602c2d5 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -145,7 +145,7 @@ class Automation { public function Automation() { - $this->procClimbers(); + $this->ClearUser(); $this->ClearInactive(); $this->oasisResoucesProduce(); @@ -1587,8 +1587,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']); } @@ -2657,8 +2656,8 @@ $crannyimg = "setMovementProc($data['moveid']); if($chiefing_village != 1 && $village_destroyed != 1){ + $database->setMovementProc($data['moveid']); $database->addMovement(4,$to['wref'],$from['wref'],$data['ref'],time(),$endtime); // send the bounty on type 6. if($type !== 1) @@ -2720,6 +2719,7 @@ $crannyimg = "setMovementProc($data['moveid']); $database->addMovement(4,$movedata['to'],$movedata['from'],$movedata['ref'],$time,$time+$time2); $database->setMovementProc($movedata['moveid']); } @@ -2869,7 +2869,6 @@ $crannyimg = "=1){ if($hdata['health']<100 and $hdata['health']>0){ - $reg = $hdata['health']+$hdata['regeneration']*5*ceil(SPEED/10)/86400*(time()-$hdata['lastupdate']); + $reg = $hdata['health']+$hdata['regeneration']*5*SPEED/86400*(time()-$hdata['lastupdate']); if($reg <= 100){ $database->modifyHero("health",$reg,$hdata['heroid']); }else{ 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()); } From 28661bb63618f99ad1a5f9bc0f4dcd4ac3d2965f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Sep 2012 15:21:26 +0200 Subject: [PATCH 09/33] update --- Admin/Templates/playerinfo.tpl | 51 +++++++++++++++--------------- GameEngine/Admin/Mods/editPlus.php | 37 +++++++++++++++++----- Templates/Ajax/quest_core.tpl | 2 +- 3 files changed, 55 insertions(+), 35 deletions(-) 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/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/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} Date: Thu, 27 Sep 2012 02:10:55 +0200 Subject: [PATCH 10/33] more update for new ally owner when the previous one get delete from the game --- GameEngine/Automation.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index 4602c2d5..225736ff 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -145,7 +145,7 @@ class Automation { public function Automation() { - + $this->procClimbers(); $this->ClearUser(); $this->ClearInactive(); $this->oasisResoucesProduce(); @@ -410,7 +410,7 @@ class Automation { $newleader = $newowner['id']; $q = "UPDATE " . TB_PREFIX . "alidata set leader = ".$newleader." where id = ".$alliance.""; $database->query($q); - $database->updateAlliPermissions($newleader, 1, 1, 1, 1, 1, 1, 1, 1, 1); + $database->updateAlliPermissions($newleader, $alliance, "Leader", 1, 1, 1, 1, 1, 1, 1); } $database->deleteAlliance($alliance); $q = "DELETE FROM ".TB_PREFIX."hero where uid = ".$need['uid']; @@ -3837,7 +3837,7 @@ $crannyimg = "=1){ if($hdata['health']<100 and $hdata['health']>0){ - $reg = $hdata['health']+$hdata['regeneration']*5*SPEED/86400*(time()-$hdata['lastupdate']); + $reg = $hdata['health']+$hdata['regeneration']*5*ceil(SPEED/10)/86400*(time()-$hdata['lastupdate']); if($reg <= 100){ $database->modifyHero("health",$reg,$hdata['heroid']); }else{ From 09f9c03692c5c8df8043950958b66f6ddaea230f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 27 Sep 2012 12:29:37 +0200 Subject: [PATCH 11/33] update --- GameEngine/Automation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index 225736ff..aaedcf87 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -3837,7 +3837,7 @@ $crannyimg = "=1){ if($hdata['health']<100 and $hdata['health']>0){ - $reg = $hdata['health']+$hdata['regeneration']*5*ceil(SPEED/10)/86400*(time()-$hdata['lastupdate']); + $reg = $hdata['health']+$hdata['regeneration']*5*SPEED/86400*(time()-$hdata['lastupdate']); if($reg <= 100){ $database->modifyHero("health",$reg,$hdata['heroid']); }else{ From 84253ec0dba1756ab264d0c7012e1c40cc26f2fb Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 29 Sep 2012 20:52:12 +0200 Subject: [PATCH 12/33] update --- GameEngine/Automation.php | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index aaedcf87..ab4bf603 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -393,6 +393,8 @@ 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++){ @@ -2695,7 +2697,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); @@ -2743,22 +2745,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{ From 79cc6d5c0dc4446ea9fe6ad87b567de1e843436d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Oct 2012 03:39:29 +0200 Subject: [PATCH 13/33] more updates --- GameEngine/Alliance.php | 2 +- GameEngine/Ranking.php | 2 +- GameEngine/Technology.php | 2 +- Templates/Ajax/mapscroll.tpl | 3 +++ Templates/Ajax/mapscroll2.tpl | 3 +++ 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/GameEngine/Alliance.php b/GameEngine/Alliance.php index 6888004b..1db9c47c 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); diff --git a/GameEngine/Ranking.php b/GameEngine/Ranking.php index 4369d77f..21d42b05 100644 --- a/GameEngine/Ranking.php +++ b/GameEngine/Ranking.php @@ -383,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/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."\""; From 3fbf4ce80e0428ac98af3733cd35e74b843083d8 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Oct 2012 14:30:00 +0200 Subject: [PATCH 14/33] update --- Templates/Ranking/ww.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"); ?> From e32f577e98709d007de7f8c7d98a549d99bd0dcf Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Oct 2012 00:05:37 +0200 Subject: [PATCH 15/33] more updates --- GameEngine/Alliance.php | 34 +++++++++++++++++++++++++++++- GameEngine/Automation.php | 44 ++++++++++++++++++++++++++++++--------- 2 files changed, 67 insertions(+), 11 deletions(-) diff --git a/GameEngine/Alliance.php b/GameEngine/Alliance.php index 1db9c47c..013e2ba0 100644 --- a/GameEngine/Alliance.php +++ b/GameEngine/Alliance.php @@ -362,7 +362,15 @@ $database->deleteAlliPermissions($post['a_user']); $database->deleteAlliance($session->alliance); // log the notice - $database->insertAlliNotice($session->alliance, '' . $UserData['username'] . ' 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"); @@ -400,6 +408,7 @@ $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->deleteAlliPermissions($session->uid); // log the notice @@ -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 ab4bf603..7a307283 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -208,7 +208,7 @@ class Automation { $this->updateStore(); $this->CheckBan(); $this->regenerateOasisTroops(); - $this->updateMax(); + $this->artefactOfTheFool(); } @@ -413,6 +413,7 @@ class Automation { $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']; @@ -660,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; } @@ -1915,6 +1920,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') @@ -1952,6 +1960,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; @@ -2040,6 +2051,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') { @@ -2079,6 +2093,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; @@ -2165,6 +2182,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') { @@ -2205,6 +2225,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']); } @@ -3800,6 +3823,9 @@ $crannyimg = "query_return($q); - foreach($array as $ally) { - $owner = $ally['leader']; - $villages = $database->getVillagesID2($owner); + $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']); @@ -4276,11 +4300,11 @@ $crannyimg = " $max){ $max = $attri; } - $q = "UPDATE ".TB_PREFIX."alidata set max = $max where leader = $owner"; + } + $q = "UPDATE ".TB_PREFIX."alidata set max = $max where leader = $leader"; $database->query($q); } } From 0db8ffe8d124a5a885936eeb0f7815ac21281d30 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Oct 2012 00:53:23 +0200 Subject: [PATCH 16/33] update --- GameEngine/Units.php | 2 +- a2b.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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/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 =""; From c55ad7504c67b6ad46e05f204e2e8e346f2cfba7 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Oct 2012 01:46:57 +0200 Subject: [PATCH 17/33] update --- GameEngine/Building.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/GameEngine/Building.php b/GameEngine/Building.php index 5c154b97..28b06904 100644 --- a/GameEngine/Building.php +++ b/GameEngine/Building.php @@ -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"); From 8261195cb0ddf2de7be9a4b94127c2ca3012d359 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Oct 2012 03:38:37 +0200 Subject: [PATCH 18/33] update --- GameEngine/Automation.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index 7a307283..eb0cc8c0 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -883,9 +883,6 @@ class Automation { $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']); } @@ -1902,7 +1899,7 @@ class Automation { { $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'].""); @@ -2033,7 +2030,7 @@ class Automation { { $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'].""); @@ -2164,7 +2161,7 @@ class Automation { $info_cat .= "
"; $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'].""); From abda7aed943a84a77312808eed17d6be83b8de56 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Oct 2012 01:47:59 +0200 Subject: [PATCH 19/33] update --- GameEngine/Automation.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index eb0cc8c0..36242eae 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -2677,9 +2677,9 @@ $crannyimg = "addNotice($from['owner'],$to['wref'],$ownally,2,''.addslashes($from['name']).' attacks '.addslashes($to['name']).'',$data2,$AttackArrivalTime); } } - - if($chiefing_village != 1 && $village_destroyed != 1){ + $database->setMovementProc($data['moveid']); + if($chiefing_village != 1 && $village_destroyed != 1){ $database->addMovement(4,$to['wref'],$from['wref'],$data['ref'],time(),$endtime); // send the bounty on type 6. if($type !== 1) From 1de4cc88f42d20e74527a44551b743b757589e57 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Oct 2012 02:29:26 +0200 Subject: [PATCH 20/33] update --- Templates/Build/avaliable/brewery.tpl | 4 ++-- build.php | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) 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

Information \"Catapult\" ".$this->procResType($tbgid)." destroyed.
- + "; @@ -2270,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."; From 8d1f9f2d3a9eb108f9810d8f093063d5f590967c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Oct 2012 17:18:50 +0200 Subject: [PATCH 29/33] update --- Templates/Build/avaliable/tsquare.tpl | 2 +- Templates/Build/soon/tsquare.tpl | 2 +- Templates/Manual/414.tpl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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

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/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(); From 9c53363203e9a84a16c8af47ea75c2d2e57561bf Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Oct 2012 02:46:14 +0200 Subject: [PATCH 21/33] update --- GameEngine/Battle.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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']; From c11f100f2e0147225fb68db6353c74bc65937bf9 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 7 Oct 2012 12:03:10 +0200 Subject: [PATCH 22/33] more updates --- allianz.php | 4 +++- spieler.php | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) 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/spieler.php b/spieler.php index 214fccb5..bee0d8a5 100644 --- a/spieler.php +++ b/spieler.php @@ -149,6 +149,8 @@ else if (isset($_GET['s'])) { if($_GET['s'] > 4 or $session->sit == 1) { header("Location: ".$_SERVER['PHP_SELF']."?uid=".preg_replace("/[^a-zA-Z0-9_-]/","",$session->uid)); } +}else{ +header("Location: ".$_SERVER['PHP_SELF']."?uid=".preg_replace("/[^a-zA-Z0-9_-]/","",$session->uid)); } ?> From 605201290b24ba0761609cbc04bbe9049e313bbd Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Oct 2012 12:05:39 +0200 Subject: [PATCH 23/33] update for hero --- GameEngine/Automation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index 36242eae..dba61a2b 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -3855,7 +3855,7 @@ $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']."'"); } From 58d63dab6d12bfbc8884449b98e14db06a10159b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Oct 2012 13:04:45 +0200 Subject: [PATCH 24/33] fix ally pop climbers --- GameEngine/Automation.php | 5 ++--- GameEngine/Database/db_MYSQL.php | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index dba61a2b..3bf8cf91 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -4241,9 +4241,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); @@ -4256,6 +4254,7 @@ $crannyimg = "connection); return $this->mysql_fetch_all($result); } From c06f9b869be507a6363aec4bea86491fd086c47c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Oct 2012 15:14:45 +0200 Subject: [PATCH 25/33] fix Templates/Build/available.tpl --- GameEngine/Database/db_MYSQL.php | 12 +++ Templates/Build/avaliable.tpl | 125 ++++++++++++++++++++----------- 2 files changed, 92 insertions(+), 45 deletions(-) diff --git a/GameEngine/Database/db_MYSQL.php b/GameEngine/Database/db_MYSQL.php index 16775fcb..3589d8b2 100644 --- a/GameEngine/Database/db_MYSQL.php +++ b/GameEngine/Database/db_MYSQL.php @@ -1868,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"; diff --git a/Templates/Build/avaliable.tpl b/Templates/Build/avaliable.tpl index 796da1f7..fd49a14e 100644 --- a/Templates/Build/avaliable.tpl +++ b/Templates/Build/avaliable.tpl @@ -43,25 +43,60 @@ $greatwarehouse = $building->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 From a85f401ef68fe4897e9b3b870e296eacf89c53ba Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Oct 2012 15:27:27 +0200 Subject: [PATCH 26/33] update --- Admin/function.php | 1 + GameEngine/Admin/function.php | 1 + 2 files changed, 2 insertions(+) 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/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']); From 215a2129d24dbb01bd750cfc971f5d93e71ffe24 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Oct 2012 16:18:11 +0200 Subject: [PATCH 27/33] update --- GameEngine/Automation.php | 92 ++++++++++++++++++++++++++++++++++----- warsim.php | 4 +- 2 files changed, 84 insertions(+), 12 deletions(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index 3bf8cf91..bff81e83 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); @@ -1890,10 +1890,34 @@ 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); + $artowner = $database->getVillageField($DefenderWref,"owner"); + $bartefact = count($database->getOwnUniqueArtefactInfo2($artowner,1,3,0)); + $bartefact1 = count($database->getOwnUniqueArtefactInfo2($DefenderWref,1,1,1)); + $bartefact2 = count($database->getOwnUniqueArtefactInfo2($artowner,1,2,0)); + if($bartefact > 0){ + $strongerbuildings = 5; + }else if($bartefact1 > 0){ + $strongerbuildings = 4; + }else if($bartefact2 > 0){ + $strongerbuildings = 3; }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); + $strongerbuildings = 1; + } + $good_effect = $bad_effect = 1; + $foolartefact = $database->getFoolArtefactInfo(3,$DefenderWref,$artowner); + if(count($foolartefact) > 0){ + foreach($foolartefact as $arte){ + if($arte['bad_effect'] == 1){ + $bad_effect = $arte['effect2']; + }else{ + $good_effect = $arte['effect2']; + } + } + } + if($stonemason==0){ + $needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / $strongerbuildings / $good_effect * $bad_effect)) + 0.5); + }else{ + $needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / ($bid34[$stonemason]['attri']/100) / $strongerbuildings / $good_effect * $bad_effect)) + 0.5); } if ($battlepart[4]>$needed_cata) { @@ -2021,10 +2045,34 @@ 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); + $artowner = $database->getVillageField($DefenderWref,"owner"); + $bartefact = count($database->getOwnUniqueArtefactInfo2($artowner,1,3,0)); + $bartefact1 = count($database->getOwnUniqueArtefactInfo2($DefenderWref,1,1,1)); + $bartefact2 = count($database->getOwnUniqueArtefactInfo2($artowner,1,2,0)); + if($bartefact > 0){ + $strongerbuildings = 5; + }else if($bartefact1 > 0){ + $strongerbuildings = 4; + }else if($bartefact2 > 0){ + $strongerbuildings = 3; }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); + $strongerbuildings = 1; + } + $good_effect = $bad_effect = 1; + $foolartefact = $database->getFoolArtefactInfo(3,$DefenderWref,$artowner); + if(count($foolartefact) > 0){ + foreach($foolartefact as $arte){ + if($arte['bad_effect'] == 1){ + $bad_effect = $arte['effect2']; + }else{ + $good_effect = $arte['effect2']; + } + } + } + if($stonemason==0){ + $needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / $strongerbuildings / $good_effect * $bad_effect)) + 0.5); + }else{ + $needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / ($bid34[$stonemason]['attri']/100) / $strongerbuildings / $good_effect * $bad_effect)) + 0.5); } if (($battlepart[4]/2)>$needed_cata) { @@ -2151,10 +2199,34 @@ 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); + $artowner = $database->getVillageField($DefenderWref,"owner"); + $bartefact = count($database->getOwnUniqueArtefactInfo2($artowner,1,3,0)); + $bartefact1 = count($database->getOwnUniqueArtefactInfo2($DefenderWref,1,1,1)); + $bartefact2 = count($database->getOwnUniqueArtefactInfo2($artowner,1,2,0)); + if($bartefact > 0){ + $strongerbuildings = 5; + }else if($bartefact1 > 0){ + $strongerbuildings = 4; + }else if($bartefact2 > 0){ + $strongerbuildings = 3; }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); + $strongerbuildings = 1; + } + $good_effect = $bad_effect = 1; + $foolartefact = $database->getFoolArtefactInfo(3,$DefenderWref,$artowner); + if(count($foolartefact) > 0){ + foreach($foolartefact as $arte){ + if($arte['bad_effect'] == 1){ + $bad_effect = $arte['effect2']; + }else{ + $good_effect = $arte['effect2']; + } + } + } + if($stonemason==0){ + $needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / $strongerbuildings / $good_effect * $bad_effect)) + 0.5); + }else{ + $needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / ($bid34[$stonemason]['attri']/100) / $strongerbuildings / $good_effect * $bad_effect)) + 0.5); } if (($battlepart[4]/2)>$needed_cata) { diff --git a/warsim.php b/warsim.php index ce47ff80..0092bc85 100644 --- a/warsim.php +++ b/warsim.php @@ -72,9 +72,9 @@ if(isset($_POST['result'])) { echo "

"; if (isset($_POST['result'][3])&&isset($_POST['result'][4])){ if ($_POST['result'][4]>$_POST['result'][3]){ - echo "Building destroid"; + echo "

Building destroyed

"; }elseif ($_POST['result'][4]==0){ - echo "The building isn't destroid"; + echo "

The building isn't destroyed

"; }else{ $demolish=$_POST['result'][4]/$_POST['result'][3]; //$Katalife=round($_POST['result'][4]-($_POST['result'][4]*$_POST['result'][1])); From dcafa5ad14e38b688516595c2fb04218eff828ce Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Oct 2012 16:48:42 +0200 Subject: [PATCH 28/33] fix catas (little, but better) --- GameEngine/Automation.php | 99 +++------------------------------------ 1 file changed, 6 insertions(+), 93 deletions(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index bff81e83..1476a2d9 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -1890,36 +1890,7 @@ class Automation { $tblevel = $bdo['f'.$rand]; $tbgid = $bdo['f'.$rand.'t']; $tbid = $rand; - $artowner = $database->getVillageField($DefenderWref,"owner"); - $bartefact = count($database->getOwnUniqueArtefactInfo2($artowner,1,3,0)); - $bartefact1 = count($database->getOwnUniqueArtefactInfo2($DefenderWref,1,1,1)); - $bartefact2 = count($database->getOwnUniqueArtefactInfo2($artowner,1,2,0)); - if($bartefact > 0){ - $strongerbuildings = 5; - }else if($bartefact1 > 0){ - $strongerbuildings = 4; - }else if($bartefact2 > 0){ - $strongerbuildings = 3; - }else{ - $strongerbuildings = 1; - } - $good_effect = $bad_effect = 1; - $foolartefact = $database->getFoolArtefactInfo(3,$DefenderWref,$artowner); - if(count($foolartefact) > 0){ - foreach($foolartefact as $arte){ - if($arte['bad_effect'] == 1){ - $bad_effect = $arte['effect2']; - }else{ - $good_effect = $arte['effect2']; - } - } - } - if($stonemason==0){ - $needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / $strongerbuildings / $good_effect * $bad_effect)) + 0.5); - }else{ - $needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / ($bid34[$stonemason]['attri']/100) / $strongerbuildings / $good_effect * $bad_effect)) + 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'); @@ -1957,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."; @@ -2045,36 +2016,7 @@ class Automation { $tblevel = $bdo['f'.$rand]; $tbgid = $bdo['f'.$rand.'t']; $tbid = $rand; - $artowner = $database->getVillageField($DefenderWref,"owner"); - $bartefact = count($database->getOwnUniqueArtefactInfo2($artowner,1,3,0)); - $bartefact1 = count($database->getOwnUniqueArtefactInfo2($DefenderWref,1,1,1)); - $bartefact2 = count($database->getOwnUniqueArtefactInfo2($artowner,1,2,0)); - if($bartefact > 0){ - $strongerbuildings = 5; - }else if($bartefact1 > 0){ - $strongerbuildings = 4; - }else if($bartefact2 > 0){ - $strongerbuildings = 3; - }else{ - $strongerbuildings = 1; - } - $good_effect = $bad_effect = 1; - $foolartefact = $database->getFoolArtefactInfo(3,$DefenderWref,$artowner); - if(count($foolartefact) > 0){ - foreach($foolartefact as $arte){ - if($arte['bad_effect'] == 1){ - $bad_effect = $arte['effect2']; - }else{ - $good_effect = $arte['effect2']; - } - } - } - if($stonemason==0){ - $needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / $strongerbuildings / $good_effect * $bad_effect)) + 0.5); - }else{ - $needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / ($bid34[$stonemason]['attri']/100) / $strongerbuildings / $good_effect * $bad_effect)) + 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'); @@ -2114,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."; @@ -2199,36 +2141,7 @@ class Automation { $tblevel = $bdo['f'.$rand]; $tbgid = $bdo['f'.$rand.'t']; $tbid = $rand; - $artowner = $database->getVillageField($DefenderWref,"owner"); - $bartefact = count($database->getOwnUniqueArtefactInfo2($artowner,1,3,0)); - $bartefact1 = count($database->getOwnUniqueArtefactInfo2($DefenderWref,1,1,1)); - $bartefact2 = count($database->getOwnUniqueArtefactInfo2($artowner,1,2,0)); - if($bartefact > 0){ - $strongerbuildings = 5; - }else if($bartefact1 > 0){ - $strongerbuildings = 4; - }else if($bartefact2 > 0){ - $strongerbuildings = 3; - }else{ - $strongerbuildings = 1; - } - $good_effect = $bad_effect = 1; - $foolartefact = $database->getFoolArtefactInfo(3,$DefenderWref,$artowner); - if(count($foolartefact) > 0){ - foreach($foolartefact as $arte){ - if($arte['bad_effect'] == 1){ - $bad_effect = $arte['effect2']; - }else{ - $good_effect = $arte['effect2']; - } - } - } - if($stonemason==0){ - $needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / $strongerbuildings / $good_effect * $bad_effect)) + 0.5); - }else{ - $needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / ($bid34[$stonemason]['attri']/100) / $strongerbuildings / $good_effect * $bad_effect)) + 0.5); - } - if (($battlepart[4]/2)>$needed_cata) + if ($battlepart[4]>$battlepart[3]) { $info_cat .= "
Information \"Catapult\" ".$this->procResType($tbgid)." destroyed.
- +
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/index.php b/index.php index 380992b3..25e4a9d6 100644 --- a/index.php +++ b/index.php @@ -153,7 +153,7 @@ include ("GameEngine/Lang/".LANG.".php"); From c15ab66058e0fb79b43fcb9f7233b9fb2fe8e72e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Oct 2012 02:50:15 +0200 Subject: [PATCH 31/33] update --- GameEngine/Alliance.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GameEngine/Alliance.php b/GameEngine/Alliance.php index 013e2ba0..b7a39d2f 100644 --- a/GameEngine/Alliance.php +++ b/GameEngine/Alliance.php @@ -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{ From 85bc356ee478ac3232d278b30f0b7446f8e063a1 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Oct 2012 03:54:30 +0200 Subject: [PATCH 32/33] update --- GameEngine/Automation.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index 1476a2d9..b0fcd3e3 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -692,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']; @@ -725,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 @@ -864,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 . ')'); @@ -872,11 +872,11 @@ 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() { @@ -2652,7 +2652,7 @@ $crannyimg = "addNotice($from['owner'],$to['wref'],$ownally,18,''.addslashes($from['name']).' scouts '.addslashes($to['name']).'',$data2,$AttackArrivalTime); }else { @@ -2665,12 +2665,12 @@ $crannyimg = "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); @@ -2800,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()); @@ -3007,7 +3008,7 @@ $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"); From a2d9a456a0639a615e2a61ba78292ff9a6d94f00 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Oct 2012 23:35:34 +0200 Subject: [PATCH 33/33] update --- GameEngine/Automation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index b0fcd3e3..d9ec2f09 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -3163,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']);
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/Manual/414.tpl b/Templates/Manual/414.tpl index 9ed99982..8d36ca3f 100644 --- a/Templates/Manual/414.tpl +++ b/Templates/Manual/414.tpl @@ -1,4 +1,4 @@ -

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 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

From c213c057736b3e8f64c167d01c9300d7654877e3 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Oct 2012 00:56:11 +0200 Subject: [PATCH 30/33] update --- Templates/Ranking/general.tpl | 2 +- index.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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