Merge pull request #8 from yi12345/master

Update
This commit is contained in:
akshay9
2013-04-23 01:17:56 -07:00
25 changed files with 137 additions and 100 deletions
+23 -32
View File
@@ -473,32 +473,6 @@ class Automation {
$q = "UPDATE " . TB_PREFIX . "odata set maxstore = $maxstore, maxcrop = $maxcrop where wref = ".$getoasis['wref']."";
$database->query($q);
}
$q = "SELECT * FROM ".TB_PREFIX."odata WHERE wood > maxstore OR clay > maxstore OR iron > maxstore OR crop > maxcrop";
$array = $database->query_return($q);
foreach($array as $getoasis) {
if($getoasis['wood'] > $getoasis['maxstore']){
$wood = $getoasis['maxstore'];
}else{
$wood = $getoasis['wood'];
}
if($getoasis['clay'] > $getoasis['maxstore']){
$clay = $getoasis['maxstore'];
}else{
$clay = $getoasis['clay'];
}
if($getoasis['iron'] > $getoasis['maxstore']){
$iron = $getoasis['maxstore'];
}else{
$iron = $getoasis['iron'];
}
if($getoasis['crop'] > $getoasis['maxstore']){
$crop = $getoasis['maxstore'];
}else{
$crop = $getoasis['crop'];
}
$q = "UPDATE " . TB_PREFIX . "odata set wood = $wood, clay = $clay, iron = $iron, crop = $crop where wref = ".$getoasis['wref']."";
$database->query($q);
}
$q = "SELECT * FROM ".TB_PREFIX."odata WHERE wood < 0 OR clay < 0 OR iron < 0 OR crop < 0";
$array = $database->query_return($q);
foreach($array as $getoasis) {
@@ -698,6 +672,9 @@ class Automation {
if($indi['type'] == 40 and ($indi['level'] % 5 == 0 or $indi['level'] > 95) and $indi['level'] != 100){
$this->startNatarAttack($indi['level'], $indi['wid'], $indi['timestamp']);
}
if($indi['type'] == 40 && $indi['level'] == 100){ //now can't be more than one winners if ww to level 100 is build by 2 users or more on same time
mysql_query("TRUNCATE ".TB_PREFIX."bdata");
}
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'];
$database->query($q4);
@@ -914,6 +891,7 @@ class Automation {
$q = "SELECT * FROM ".TB_PREFIX."route where timestamp < $time";
$dataarray = $database->query_return($q);
foreach($dataarray as $data) {
$database->modifyResource($data['from'],$data['wood'],$data['clay'],$data['iron'],$data['crop'],0);
$targettribe = $database->getUserField($database->getVillageField($data['from'],"owner"),"tribe",0);
$this->sendResource2($data['wood'],$data['clay'],$data['iron'],$data['crop'],$data['from'],$data['wid'],$targettribe,$data['deliveries']);
$database->editTradeRoute($data['id'],"timestamp",86400,1);
@@ -1626,7 +1604,7 @@ class Automation {
$cranny = 0;
for($i=19;$i<39;$i++){
if($buildarray['f'.$i.'t']==23){
$cranny += $bid23[$buildarray['f'.$i.'']]['attri'];
$cranny += $bid23[$buildarray['f'.$i.'']]['attri']*CRANNY_CAPACITY;
}
}
@@ -3929,11 +3907,24 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
$q = "SELECT * FROM ".TB_PREFIX."odata WHERE wood < 800 OR clay < 800 OR iron < 800 OR crop < 800";
$array = $database->query_return($q);
foreach($array as $getoasis) {
$oasiswood = (8*SPEED/3600)*(time()-$getoasis['lastupdated']);
$oasisclay = (8*SPEED/3600)*(time()-$getoasis['lastupdated']);
$oasisiron = (8*SPEED/3600)*(time()-$getoasis['lastupdated']);
$oasiscrop = (8*SPEED/3600)*(time()-$getoasis['lastupdated']);
$database->modifyOasisResource($getoasis['wref'],$oasiswood,$oasisclay,$oasisiron,$oasiscrop,1);
$oasiswood = $getoasis['wood'] + (8*SPEED/3600)*(time()-$getoasis['lastupdated']);
$oasisclay = $getoasis['clay'] + (8*SPEED/3600)*(time()-$getoasis['lastupdated']);
$oasisiron = $getoasis['iron'] + (8*SPEED/3600)*(time()-$getoasis['lastupdated']);
$oasiscrop = $getoasis['crop'] + (8*SPEED/3600)*(time()-$getoasis['lastupdated']);
if($oasiswood > $getoasis['maxstore']){
$oasiswood = $getoasis['maxstore'];
}
if($oasisclay > $getoasis['maxstore']){
$oasisclay = $getoasis['maxstore'];
}
if($oasisiron > $getoasis['maxstore']){
$oasisiron = $getoasis['maxstore'];
}
if($oasiscrop > $getoasis['maxcrop']){
$oasiscrop = $getoasis['maxcrop'];
}
$q = "UPDATE " . TB_PREFIX . "odata set wood = $oasiswood, clay = $oasisclay, iron = $oasisiron, crop = $oasiscrop where wref = ".$getoasis['wref']."";
$database->query($q);
$database->updateOasis($getoasis['wref']);
}
}
+2
View File
@@ -695,6 +695,8 @@ class Building {
$buildiron = $buildarray[$level]['iron'];
$buildcrop = $buildarray[$level]['crop'];
if($buildwood < $villwood && $buildclay < $villclay && $buildiron < $villiron && $buildcrop < $villcrop){
$newgold = $session->gold-1;
$database->updateUserField($session->uid, "gold", $newgold, 1);
$enought_res = 1;
$q = "UPDATE ".TB_PREFIX."fdata set f".$jobs['field']." = ".$jobs['level'].", f".$jobs['field']."t = ".$jobs['type']." where vref = ".$jobs['wid'];
}
+2 -2
View File
@@ -20,7 +20,7 @@ class MYSQL_DB {
function register($username, $password, $email, $tribe, $act) {
$time = time();
$timep = (time() + PROTECTION);
$timep = (strtotime(START_TIME) + PROTECTION);
$q = "INSERT INTO " . TB_PREFIX . "users (username,password,access,email,timestamp,tribe,act,protect,lastupdate,regtime) VALUES ('$username', '$password', " . USER . ", '$email', $time, $tribe, '$act', $timep, $time, $time)";
if(mysql_query($q, $this->connection)) {
return mysql_insert_id($this->connection);
@@ -2151,7 +2151,7 @@ class MYSQL_DB {
}
function getARanking() {
$q = "SELECT id,name,tag,oldrank FROM " . TB_PREFIX . "alidata where id != '' ORDER BY id DESC";
$q = "SELECT id,name,tag,oldrank,Aap,Adp FROM " . TB_PREFIX . "alidata where id != '' ORDER BY id DESC";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
+16 -12
View File
@@ -118,6 +118,22 @@ class Message {
if($message['id'] == $id) {
$message = preg_replace('/\[message\]/', '', $message);
$message = preg_replace('/\[\/message\]/', '', $message);
for($i=1;$i<=$message['alliance'];$i++){
$message = preg_replace('/\[alliance'.$i.'\]/', '[alliance0]', $message);
$message = preg_replace('/\[\/alliance'.$i.'\]/', '[/alliance0]', $message);
}
for($i=0;$i<=$message['player'];$i++){
$message = preg_replace('/\[player'.$i.'\]/', '[player0]', $message);
$message = preg_replace('/\[\/player'.$i.'\]/', '[/player0]', $message);
}
for($i=0;$i<=$message['coor'];$i++){
$message = preg_replace('/\[coor'.$i.'\]/', '[coor0]', $message);
$message = preg_replace('/\[\/coor'.$i.'\]/', '[/coor0]', $message);
}
for($i=0;$i<=$message['report'];$i++){
$message = preg_replace('/\[report'.$i.'\]/', '[report0]', $message);
$message = preg_replace('/\[\/report'.$i.'\]/', '[/report0]', $message);
}
$this->reply = $_SESSION['reply'] = $message;
header("Location: nachrichten.php?t=1&id=" . $message['owner']);
}
@@ -392,18 +408,6 @@ class Message {
$alliance = $player = $coor = $report = 0;
for($i=0;$i<=$alliance;$i++){
if(preg_match('/\[alliance'.$i.'\]/',$text) && preg_match('/\[\/alliance'.$i.'\]/',$text)){
$alliance1 = preg_replace('/\[alliance'.$i.'\]/', '', $input);
$alliance1 = preg_replace('/\[\/alliance'.$i.'\]/', '', $alliance1);
if(preg_match('/\[alliance'.$i.'\]/',$alliance1) && preg_match('/\[\/alliance'.$i.'\]/',$alliance1)){
$j = $i+1;
$text = preg_replace('/\[alliance'.$i.'\]/', '/\[alliance'.$j.'\]/', $text);
$text = preg_replace('/\[\/alliance'.$i.'\]/', '/\[\/alliance'.$j.'\]/', $text);
$alliance += 1;
}
}
}
for($i=0;$i<=$alliance;$i++){
if(preg_match('/\[alliance'.$i.'\]/',$text) && preg_match('/\[\/alliance'.$i.'\]/',$text)){
$alliance1 = preg_replace('/\[message\](.*?)\[\/alliance'.$i.'\]/is', '', $text);
if(preg_match('/\[alliance'.$i.'\]/',$alliance1) && preg_match('/\[\/alliance'.$i.'\]/',$alliance1)){
$j = $i+1;
+3 -9
View File
@@ -484,10 +484,7 @@
$holder = array();
foreach($array as $value) {
$memberlist = $database->getAllMember($value['id']);
$totalap = 0;
foreach($memberlist as $member) {
$totalap += $member['ap'];
}
$totalap = $value['Aap'];
$value['players'] = count($memberlist);
$value['totalap'] = $totalap;
if($value['avg'] > 0) {
@@ -512,14 +509,11 @@
$holder = array();
foreach($array as $value) {
$memberlist = $database->getAllMember($value['id']);
$totaldp = 0;
foreach($memberlist as $member) {
$totaldp += $member['dp'];
}
$totaldp = $value['Adp'];
$value['players'] = count($memberlist);
$value['totaldp'] = $totaldp;
if($value['avg'] > 0) {
$value['avg'] = round($totalap / count($memberlist));
$value['avg'] = round($totaldp / count($memberlist));
} else {
$value['avg'] = 0;
}
+4
View File
@@ -179,7 +179,11 @@ class Technology {
}else{
$cropcalc = 0;
}
if($unit != "u99"){
$popcalc = floor($village->getProd("crop")/$unitarray['pop']);
}else{
$popcalc = $village->getProd("crop");
}
return min($woodcalc,$claycalc,$ironcalc,$cropcalc);
}
+4 -2
View File
@@ -6,10 +6,12 @@ $post_id = $_GET['pod'];
$topics = $database->ShowTopic($topic_id);
$posts = $database->ShowPostEdit($post_id);
foreach($topics as $top) {
$title = $top['title'];
$title = stripslashes($top['title']);
}
foreach($posts as $pos) {
$poss = $pos['post'];
$poss = stripslashes($pos['post']);
$poss = preg_replace('/\[message\]/', '', $poss);
$poss = preg_replace('/\[\/message\]/', '', $poss);
}
?>
<form method="post" name="post" action="allianz.php?s=2&fid2=<?php echo $_GET['fid2']; ?>&pid=<?php echo $_GET['pid']; ?>&tid=<?php echo $_GET['idt']; ?>">
+4 -4
View File
@@ -54,7 +54,7 @@ if($database->CheckEditRes($aid)=="1"){
}else{
echo '<img class="folder" src="img/x.gif" title="Thread without new posts" alt="Thread without new posts">';
}
echo '</td><td class="tit"><a href="allianz.php?s=2&fid='.$arr['id'].'&pid='.$aid.'" title="'.$arr['forum_name'].'">'.$arr['forum_name'].'</a><br />'.$arr['forum_des'].'</td>
echo '</td><td class="tit"><a href="allianz.php?s=2&fid='.$arr['id'].'&pid='.$aid.'" title="'.stripslashes($arr['forum_name']).'">'.stripslashes($arr['forum_name']).'</a><br />'.stripslashes($arr['forum_des']).'</td>
<td class="cou">'.$countop.'</td>
<td class="last">'.$lpost.'</span><span><br /><a href="spieler.php?uid='.$owner['id'].'">'.$owner['username'].'</a> <img class="latest_reply" src="img/x.gif" alt="Show last post" title="Show last post" /></td>
</tr>';
@@ -105,7 +105,7 @@ if($database->CheckEditRes($aid)=="1"){
}else{
echo '<img class="folder" src="img/x.gif" title="Thread without new posts" alt="Thread without new posts">';
}
echo '</td><td class="tit"><a href="allianz.php?s=2&fid='.$arr['id'].'&pid='.$aid.'" title="'.$arr['forum_name'].'">'.$arr['forum_name'].'</a><br />'.$arr['forum_des'].'</td>
echo '</td><td class="tit"><a href="allianz.php?s=2&fid='.$arr['id'].'&pid='.$aid.'" title="'.stripslashes($arr['forum_name']).'">'.stripslashes($arr['forum_name']).'</a><br />'.stripslashes($arr['forum_des']).'</td>
<td class="cou">'.$countop.'</td>
<td class="last">'.$lpost.'</span><span><br /><a href="spieler.php?uid='.$owner['id'].'">'.$owner['username'].'</a> <img class="latest_reply" src="img/x.gif" alt="Show last post" title="Show last post" /></td>
</tr>';
@@ -156,7 +156,7 @@ if($database->CheckEditRes($aid)=="1"){
}else{
echo '<img class="folder" src="img/x.gif" title="Thread without new posts" alt="Thread without new posts">';
}
echo '</td><td class="tit"><a href="allianz.php?s=2&fid='.$arr['id'].'&pid='.$aid.'" title="'.$arr['forum_name'].'">'.$arr['forum_name'].'</a><br />'.$arr['forum_des'].'</td>
echo '</td><td class="tit"><a href="allianz.php?s=2&fid='.$arr['id'].'&pid='.$aid.'" title="'.stripslashes($arr['forum_name']).'">'.stripslashes($arr['forum_name']).'</a><br />'.stripslashes($arr['forum_des']).'</td>
<td class="cou">'.$countop.'</td>
<td class="last">'.$lpost.'</span><span><br /><a href="spieler.php?uid='.$owner['id'].'">'.$owner['username'].'</a> <img class="latest_reply" src="img/x.gif" alt="Show last post" title="Show last post" /></td>
</tr>';
@@ -207,7 +207,7 @@ if($database->CheckEditRes($aid)=="1"){
}else{
echo '<img class="folder" src="img/x.gif" title="Thread without new posts" alt="Thread without new posts">';
}
echo '</td><td class="tit"><a href="allianz.php?s=2&fid='.$arr['id'].'&pid='.$aid.'" title="'.$arr['forum_name'].'">'.$arr['forum_name'].'</a><br />'.$arr['forum_des'].'</td>
echo '</td><td class="tit"><a href="allianz.php?s=2&fid='.$arr['id'].'&pid='.$aid.'" title="'.stripslashes($arr['forum_name']).'">'.stripslashes($arr['forum_name']).'</a><br />'.stripslashes($arr['forum_des']).'</td>
<td class="cou">'.$countop.'</td>
<td class="last">'.$lpost.'</span><span><br /><a href="spieler.php?uid='.$owner['id'].'">'.$owner['username'].'</a> <img class="latest_reply" src="img/x.gif" alt="Show last post" title="Show last post" /></td>
</tr>';
+3 -3
View File
@@ -4,7 +4,7 @@ if($session->access!=BANNED){
$topic_id = $_GET['idt'];
$show_topic = $database->ShowTopic($topic_id);
foreach($show_topic as $topi) {
$title = $topi['title'];
$title = stripslashes($topi['title']);
}
?>
<form method="post" action="allianz.php?s=2&fid=<?php echo $_GET['idf']; ?>&pid=<?php echo $aid; ?>">
@@ -29,9 +29,9 @@ foreach($show_topic as $topi) {
$show_cat = $database->ForumCat($session->alliance);
foreach($show_cat as $cats) {
if($cats['id'] == $_GET['idf']){
echo '<option value="'.$cats['id'].'" selected>'.$cats['forum_name'].'</option>';
echo '<option value="'.$cats['id'].'" selected>'.stripslashes($cats['forum_name']).'</option>';
}else{
echo '<option value="'.$cats['id'].'">'.$cats['forum_name'].'</option>';
echo '<option value="'.$cats['id'].'">'.stripslashes($cats['forum_name']).'</option>';
}
}
?>
+3 -3
View File
@@ -2,7 +2,7 @@
//////////////// made by TTMTT ////////////////
if($session->access!=BANNED){
$cat_id = $_GET['fid'];
$CatName = $database->ForumCatName($cat_id);
$CatName = stripslashes($database->ForumCatName($cat_id));
$ChckTopic = $database->CheckCatTopic($cat_id);
$Topics = $database->ForumCatTopic($cat_id);
$TopicsStick = $database->ForumCatTopicStick($cat_id);
@@ -46,7 +46,7 @@ if($ChckTopic){
echo '<img class="folder_sticky" src="img/x.gif" alt="Important Thread without new posts" title="Important Thread without new posts" />';
}
echo '</td>
<td class="tit"><a href="allianz.php?s=2&fid2='.$arrs['cat'].'&pid='.$aid.'&tid='.$arrs['id'].'">'.$arrs['title'].'</a><br></td>
<td class="tit"><a href="allianz.php?s=2&fid2='.$arrs['cat'].'&pid='.$aid.'&tid='.$arrs['id'].'">'.stripslashes($arrs['title']).'</a><br></td>
<td class="cou">'.$CountPosts.'</td>
<td class="last">'.$post_dates.'<br /><a href="spieler.php?uid='.$arrs[owner].'">'.$owner_topics['username'].'</a> <a href="allianz.php?s=2&fid2='.$arrs['cat'].'&pid='.$aid.'&tid='.$arrs['id'].'&seite=max"><img class="latest_reply" src="img/x.gif" alt="Show last post" title="Show last post" /></a>
</td></tr>';
@@ -80,7 +80,7 @@ if($ChckTopic){
echo '<img class="folder" src="img/x.gif" title="Thread without new posts" alt="Thread without new posts">';
}
echo '</td>
<td class="tit"><a href="allianz.php?s=2&fid2='.$arr['cat'].'&pid='.$aid.'&tid='.$arr['id'].'">'.$arr['title'].'</a><br></td>
<td class="tit"><a href="allianz.php?s=2&fid2='.$arr['cat'].'&pid='.$aid.'&tid='.$arr['id'].'">'.stripslashes($arr['title']).'</a><br></td>
<td class="cou">'.$CountPost.'</td>
<td class="last">'.$post_date.'<br /><a href="spieler.php?uid='.$arr['owner'].'">'.$owner_topic['username'].'</a> <a href="allianz.php?s=2&aid='.$aid.'&tid='.$arr['id'].'&seite=max"><img class="latest_reply" src="img/x.gif" alt="Show last post" title="Show last post" /></a>
</td></tr>';
+5 -5
View File
@@ -8,7 +8,7 @@ $posts = $database->ShowPost($tid);
foreach($topics as $arr) {
$cat_id = $arr['cat'];
$owner = $database->getUserArray($arr['owner'],1);
$CatName = $database->ForumCatName($cat_id);
$CatName = stripslashes($database->ForumCatName($cat_id));
$allianceinfo = $database->getAlliance($owner['alliance']);
}
$date = date('m/d/y H:i a',$arr['date']);
@@ -20,7 +20,7 @@ foreach($varray as $vil) {
$countAu = $database->CountTopic($arr['owner']);
$displayarray = $database->getUserArray($arr['owner'],1);
if($displayarray['tribe'] == 1) {
$trip = "Roman";
$trip = "Romans";
}else if($displayarray['tribe'] == 2) {
$trip = "Teutons";
}else if($displayarray['tribe'] == 3) {
@@ -29,11 +29,11 @@ if($displayarray['tribe'] == 1) {
$input = $arr['post'];
$bbcoded = $input;
include("GameEngine/BBCode.php");
$bbcode_topic = nl2br($bbcoded);
$bbcode_topic = stripslashes(nl2br($bbcoded));
?>
<h4><a href="allianz.php?s=2&pid=<?php echo $arr['alliance']; ?>">Alliance</a> -> <a href="allianz.php?s=2&pid=<?php echo $arr['alliance']; ?>&fid=<?php echo $arr['cat']; ?>"><?php echo $CatName; ?></a></h4><table cellpadding="1" cellspacing="1" id="posts"><thead>
<tr>
<th colspan="2"><?php echo $arr['title']; ?></th>
<th colspan="2"><?php echo stripslashes($arr['title']); ?></th>
</tr><tr>
<td>Author</td>
@@ -76,7 +76,7 @@ foreach($posts as $po) {
$allianceinfo = $database->getAlliance($owner['alliance']);
$input = $po['post'];
include("GameEngine/BBCode.php");
$bbcode_post = nl2br($bbcoded);
$bbcode_post = stripslashes(nl2br($bbcoded));
echo '<tr><td class="pinfo"><a class="name" href="spieler.php?uid='.$po['owner'].'">'.$owner['username'].'</a><br /><a href="allianz.php?aid='.$allianceinfo['id'].'">'.$allianceinfo['tag'].'</a><br />
Posts: '.$countAu.'<br />
+1 -1
View File
@@ -4,7 +4,7 @@ if($session->access!=BANNED){
$tid = $_GET['tid'];
$topics = $database->ShowTopic($tid);
foreach($topics as $arr) {
$title = $arr['title'];
$title = stripslashes($arr['title']);
}
?>
<form method="post" name="post" action="allianz.php?s=2&fid2=<?php echo $_GET['fid2']; ?>&pid=<?php echo $_GET['pid']; ?>&tid=<?php echo $_GET['tid']; ?>">
+2 -2
View File
@@ -3,8 +3,8 @@
if($session->access!=BANNED){
$forum_data = $database->ForumCatEdit($_GET['idf']);
foreach($forum_data as $cats) {
$cat_name = $cats['forum_name'];
$cat_des = $cats['forum_des'];
$cat_name = stripslashes($cats['forum_name']);
$cat_des = stripslashes($cats['forum_des']);
}
?>
<script language="JavaScript" type="text/javascript">
+4 -2
View File
@@ -4,8 +4,10 @@ if($session->access!=BANNED){
$topic_id = $_GET['idt'];
$topics = $database->ShowTopic($topic_id);
foreach($topics as $top) {
$title = $top['title'];
$ans = $top['post'];
$title = stripslashes($top['title']);
$ans = stripslashes($top['post']);
$ans = preg_replace('/\[message\]/', '', $ans);
$ans = preg_replace('/\[\/message\]/', '', $ans);
}
?>
<form method="post" name="post" action="allianz.php?s=2&fid2=<?php echo $_GET['fid2']; ?>&pid=<?php echo $_GET['pid']; ?>&tid=<?php echo $_GET['idt']; ?>">
+2 -2
View File
@@ -37,7 +37,7 @@ Standard this holds on for 7 days, but you can extend it with 7 days for the cos
<?php
$routes = $database->getTradeRoute($session->uid);
if(count($routes) == 0) {
echo "<td colspan=\"5\" class=\"none\">No active trade route.</td></tr>";
echo "<td colspan=\"5\" class=\"none\">No active trade routes.</td></tr>";
}else{
foreach($routes as $route){
?>
@@ -45,7 +45,7 @@ foreach($routes as $route){
<th><label><input class="radio" type="radio" onclick="window.location.href = '?id=<?php echo $id; ?>&t=4&routeid=<?php echo $route['id']; ?>';" name="routeid" value="<?php echo $route['id']; ?>" <?php if($routeid == $route['id']) { echo "checked"; } ?>></label></th>
<th>
<?php
echo "Trade route to <a href=karte.php?d=".$route['wid']."&c=".$generator->getMapCheck($route['wid']).">".$database->getVillageField($route['wid'],"name")."</a>"
echo "Trade route to <a href=karte.php?d=".$route['wid']."&c=".$generator->getMapCheck($route['wid']).">".$database->getVillageField($route['wid'],"name")."</a>";
?>
</th>
<th><?php if($route['start'] > 9){ echo $route['start'];}else{ echo "0".$route['start'];} echo ":00"; ?></th>
+1 -1
View File
@@ -38,7 +38,7 @@
<th>
Resources: </th>
<td>
<img src="../../<?php echo GP_LOCATE; ?>img/r/1.gif" alt="Lumber" title="Lumber"> <input class="text" type="text" name="r1" id="r1" value="" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/2.gif" alt="Clay" title="CLay"> <input class="text" type="text" name="r2" id="r2" value="" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/3.gif" alt="Iron" title="Iron"> <input class="text" type="text" name="r3" id="r3" value="" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/4.gif" alt="Crop" title="Crop"> <input class="text" type="text" name="r4" id="r4" value="" maxlength="5" tabindex="1" style="width:50px;">
<img src="../../<?php echo GP_LOCATE; ?>img/r/1.gif" alt="Lumber" title="Lumber"> <input class="text" type="text" name="r1" id="r1" value="" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/2.gif" alt="Clay" title="Clay"> <input class="text" type="text" name="r2" id="r2" value="" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/3.gif" alt="Iron" title="Iron"> <input class="text" type="text" name="r3" id="r3" value="" maxlength="5" tabindex="1" style="width:50px;"> <img src="../../<?php echo GP_LOCATE; ?>img/r/4.gif" alt="Crop" title="Crop"> <input class="text" type="text" name="r4" id="r4" value="" maxlength="5" tabindex="1" style="width:50px;">
</td>
</tr>
<tr>
+6 -6
View File
@@ -37,11 +37,11 @@ include("next.tpl");
<?php
if($session->tribe == 3) {
?>
<td><b><?php echo $bid23[$village->resarray['f'.$id]]['attri']*2; ?></b> units</td>
<td><b><?php echo $bid23[$village->resarray['f'.$id]]['attri']*2*CRANNY_CAPACITY; ?></b> units</td>
<?php
}else{
?>
<td><b><?php echo $bid23[$village->resarray['f'.$id]]['attri']; ?></b> units</td>
<td><b><?php echo $bid23[$village->resarray['f'.$id]]['attri']*CRANNY_CAPACITY; ?></b> units</td>
<?php
}
?>
@@ -55,11 +55,11 @@ include("next.tpl");
<?php
if($session->tribe == 3) {
?>
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master]['attri']*2*$artefact_bouns*$good_effect/$bad_effect; ?></b> units</td>
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master]['attri']*2*CRANNY_CAPACITY*$artefact_bouns*$good_effect/$bad_effect; ?></b> units</td>
<?php
}else{
?>
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master]['attri']*$artefact_bouns*$good_effect/$bad_effect; ?></b> units</td>
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master]['attri']*CRANNY_CAPACITY*$artefact_bouns*$good_effect/$bad_effect; ?></b> units</td>
<?php
}}else{
?>
@@ -67,11 +67,11 @@ include("next.tpl");
<?php
if($session->tribe == 3) {
?>
<td><b><?php echo $bid23[10]['attri']*2*$artefact_bouns*$good_effect/$bad_effect; ?></b> units</td>
<td><b><?php echo $bid23[10]['attri']*2*CRANNY_CAPACITY*$artefact_bouns*$good_effect/$bad_effect; ?></b> units</td>
<?php
}else{
?>
<td><b><?php echo $bid23[10]['attri']*$artefact_bouns*$good_effect/$bad_effect; ?></b> units</td>
<td><b><?php echo $bid23[10]['attri']*CRANNY_CAPACITY*$artefact_bouns*$good_effect/$bad_effect; ?></b> units</td>
<?php
}}}
?>
+5 -5
View File
@@ -14,7 +14,7 @@ include("next.tpl");
<tr>
<th>Currect maximum traps to train:</th>
<td><b><?php echo $bid36[$village->resarray['f'.$id]]['attri']; ?></b> Traps</td>
<td><b><?php echo $bid36[$village->resarray['f'.$id]]['attri']*TRAPPER_CAPACITY; ?></b> Traps</td>
</tr>
<tr>
<?php
@@ -23,12 +23,12 @@ include("next.tpl");
if($next<=20){
?>
<th>Maximum traps to train at level <?php echo $next; ?>:</th>
<td><b><?php echo $bid36[$next]['attri']; ?></b> Traps</td>
<td><b><?php echo $bid36[$next]['attri']*TRAPPER_CAPACITY; ?></b> Traps</td>
<?php
}else{
?>
<th>Maximum traps to train at level 20:</th>
<td><b><?php echo $bid36[20]['attri']; ?></b> Traps</td>
<td><b><?php echo $bid36[20]['attri']*TRAPPER_CAPACITY; ?></b> Traps</td>
<?php
}
}
@@ -66,7 +66,7 @@ include("next.tpl");
alt="Iron" title="Iron" />10|</span><span><img class="r4" src="img/x.gif"
alt="Crop" title="Crop" />20|</span><span><img class="r5" src="img/x.gif" alt="Crop consumption"
title="Crop consumption" />0|<img class="clock" src="img/x.gif"
alt="Duration" title="Duration" /><?php $dur=$generator->getTimeFormat(round(${'u99'}['time'] * ($bid19[$village->resarray['f'.$id]]['attri'] / 100) / SPEED));
alt="Duration" title="Duration" /><?php $dur=$generator->getTimeFormat(round(${'u99'}['time'] * ($bid19[$village->resarray['f'.$id]]['attri']*TRAPPER_CAPACITY / 100) / SPEED));
echo ($dur=="0:00:00")? "0:00:01":$dur; ?></span>
</div>
@@ -81,7 +81,7 @@ include("next.tpl");
$max1 = 0;
for($i=19;$i<41;$i++){
if($village->resarray['f'.$i.'t'] == 36){
$max1 += $bid36[$village->resarray['f'.$i]]['attri'];
$max1 += $bid36[$village->resarray['f'.$i]]['attri']*TRAPPER_CAPACITY;
}
}
if($max > $max1 - ($village->unitarray['u99'] + $train_amt)){
+31 -1
View File
@@ -373,7 +373,37 @@ if($greatworkshop == 0 && $workshop >= 18 && $village->capital == 0 && GREAT_WKS
include("soon/academy.tpl");
}
if($palace == 0 && ($embassy == 0 || $mainbuilding <= 2)) {
include("soon/palace.tpl");
//Fix Castle
//id user
$user = $session->uid;
//connect to DB
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
//loop search village user
$query = mysql_query("SELECT * FROM ".TB_PREFIX."vdata WHERE owner = ".$user."");
while($villaggi_array = mysql_fetch_array($query)){
//loop structure village
$query1 = mysql_query("SELECT * FROM ".TB_PREFIX."fdata WHERE vref = ".$villaggi_array['wref']."");
$strutture= mysql_fetch_array($query1);
//search Castle in array structure village
$test = in_array(26,$strutture);
if ($test){
break;
}
}
//if Castle no ready include palace.tpl
if (!$test){
include("soon/palace.tpl");
}
//end Fix
}
if($blacksmith == 0 && ($academy == 0 || $mainbuilding == 1)) {
include("soon/blacksmith.tpl");
-2
View File
@@ -51,7 +51,6 @@ if($session->goldclub == 1 && count($session->villages) > 1){
if(isset($_GET['routeid'])){
$routeid = $_GET['routeid'];
}
if($routeaccess = 1){
if(isset($_POST['action']) && $_POST['action'] == 'addRoute') {
if($session->access != BANNED){
if($session->gold >= 2) {
@@ -160,7 +159,6 @@ if($routeaccess = 1){
}
}
}
}
if($session->goldclub == 1){
if(isset($_GET['t'])==99) {
+1 -1
View File
@@ -20,7 +20,7 @@ if(isset($_GET['newdid'])) {
}else{
$building->procBuild($_GET);
}
if(isset($_GET['master']) && isset($_GET['id']) && isset($_GET['time']) && $session->gold >= 1 && $session->goldclub) {
if(isset($_GET['master']) && isset($_GET['id']) && isset($_GET['time']) && $session->gold >= 1 && $session->goldclub && $village->master == 0) {
if($session->access!=BANNED){
$level = $database->getResourceLevel($village->wid);
$database->addBuilding($village->wid, $_GET['id'], $_GET['master'], 1, $_GET['time'], 1, $level['f'.$_GET['id']] + 1 + count($database->getBuildingByField($village->wid,$_GET['id'])));
+5 -4
View File
@@ -17,7 +17,7 @@ if(isset($_GET['newdid'])) {
}else{
$building->procBuild($_GET);
}
if(isset($_GET['master']) && isset($_GET['id']) && isset($_GET['time']) && $session->gold >= 1 && $session->goldclub) {
if(isset($_GET['master']) && isset($_GET['id']) && isset($_GET['time']) && $session->gold >= 1 && $session->goldclub && $village->master == 0) {
if($session->access!=BANNED){
$level = $database->getResourceLevel($village->wid);
$database->addBuilding($village->wid, $_GET['id'], $_GET['master'], 1, $_GET['time'], 1, $level['f'.$_GET['id']] + 1 + count($database->getBuildingByField($village->wid,$_GET['id'])));
@@ -96,13 +96,14 @@ include("Templates/res.tpl");
<div id="stime">
<div id="ltime">
<div id="ltimeWrap">
<?php echo CALCULATED_IN;?> <b><?php
Calculated in <b><?php
echo round(($generator->pageLoadTimeEnd()-$start)*1000);
?></b> ms
<br /><?php echo SEVER_TIME;?> <span id="tp1" class="b"><?php echo date('H:i:s'); ?></span>
<br />Server time: <span id="tp1" class="b"><?php echo date('H:i:s'); ?></span>
</div>
</div>
</div>
<div id="ce"></div>
</body>
</html>
</html>
+5
View File
@@ -64,6 +64,11 @@ define("EVASION_SPEED","%EVASIONSPEED%");
// Values: 1 (normal), 3 (3x speed) etc...
define("TRADER_CAPACITY","%TRADERCAP%");
// ***** Cranny capacity
define("CRANNY_CAPACITY","%CRANNYCAP%");
// ***** Trapper capacity
define("TRAPPER_CAPACITY","%TRAPPERCAP%");
// ***** Village Expand
// 1 = slow village expanding - more Cultural Points needed for every new village
+2
View File
@@ -43,6 +43,8 @@ class Process {
$text = preg_replace("'%INCSPEED%'", $_POST['incspeed'], $text);
$text = preg_replace("'%EVASIONSPEED%'", $_POST['evasionspeed'], $text);
$text = preg_replace("'%TRADERCAP%'", $_POST['tradercap'], $text);
$text = preg_replace("'%CRANNYCAP%'", $_POST['crannycap'], $text);
$text = preg_replace("'%TRAPPERCAP%'", $_POST['trappercap'], $text);
$text = preg_replace("'%STORAGE_MULTIPLIER%'", $_POST['storage_multiplier'], $text);
$text = preg_replace("'%UTRACK%'", $_POST['trackusers'], $text);
$text = preg_replace("'%UTOUT%'", $_POST['timeout'], $text);
+3 -1
View File
@@ -13,7 +13,9 @@ echo "<div class=\"headline\"><span class=\"f10 c5\">Error creating constant.php
<td><span class="f9 c6">Server speed:</span></td><td><input name="speed" type="text" id="speed" value="1" size="2"></td></tr><tr>
<td><span class="f9 c6">Troop speed:</span></td><td width="140"><input type="text" name="incspeed" id="incspeed" value="1" size="2"></td></tr><tr>
<td><span class="f9 c6">Evasion speed:</span></td><td><input name="evasionspeed" type="text" id="evasionspeed" value="1" size="2"></td></tr><tr>
<td><span class="f9 c6">Trader capacity (1 = 1x...):</span></td><td width="140"><input type="text" name="tradercap" id="tradercap" value="1" size="2"></td></tr><tr>
<td><span class="f9 c6">Trader capacity (1 = 1x...):</span></td><td width="140"><input type="text" name="tradercap" id="tradercap" value="1" size="2"></td>
<td><span class="f9 c6">Cranny capacity:</span></td><td width="140"><input type="text" name="crannycap" id="crannycap" value="1" size="2"></td></tr><tr>
<td><span class="f9 c6">Cranny capacity:</span></td><td width="140"><input type="text" name="trappercap" id="trappercap" value="1" size="2"></td></tr><tr>
<td><span class="f9 c6">World size:</span></td><td>
<select name="wmax">
<option value="10">10x10</option>