Merge pull request #6 from yi12345/master

Update
This commit is contained in:
akshay9
2012-11-16 23:57:43 -08:00
10 changed files with 41 additions and 17 deletions
+7 -2
View File
@@ -3849,10 +3849,15 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
$database->modifyHero("lastupdate",time(),$hdata['heroid']);
}
}
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']."'");
$herolevel = $hdata['level'];
for($i = $herolevel+1; $i < 100; $i++){
if($hdata['experience'] > $hero_levels[$i]){
mysql_query("UPDATE " . TB_PREFIX ."hero SET level = $i WHERE heroid = '".$hdata['heroid']."'");
if($i < 99){
mysql_query("UPDATE " . TB_PREFIX ."hero SET points = points + 5 WHERE heroid = '".$hdata['heroid']."'");
}
}
}
$villunits = $database->getUnit($hdata['wref']);
if($villunits['hero'] == 0 && $hdata['trainingtime'] < time() && $hdata['inrevive'] == 1){
mysql_query("UPDATE " . TB_PREFIX . "units SET hero = 1 WHERE vref = ".$hdata['wref']."");
+4 -1
View File
@@ -677,7 +677,6 @@ class Building {
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;
@@ -717,6 +716,10 @@ class Building {
}
}
}
$wwvillage1 = $database->getResourceLevel($village->wid);
if($wwvillage1['f99t']!=40){
$ww = 0;
}
if($ww == 0){
$database->finishDemolition($village->wid);
$technology->finishTech();
+8 -2
View File
@@ -31,9 +31,15 @@ if($village->resarray['f'.$id] >= DEMOLISH_LEVEL_REQ) {
echo "<b>";
echo "<a href='build.php?id=26&cancel=1'><img src='img/x.gif' class='del' title='cancel' alt='cancel'></a> ";
echo "Demolition of ".$building->procResType($VillageResourceLevels['f'.$Demolition['buildnumber'].'t']).": <span id=timer1>".$generator->getTimeFormat($Demolition['timetofinish']-time())."</span>";
?>
<a href="?buildingFinish=1" onclick="return confirm('Finish all construction and research orders in this village immediately for 2 Gold?');" title="Finish all construction and research orders in this village immediately for 2 Gold?"><img class="clock" alt="Finish all construction and research orders in this village immediately for 2 Gold?" src="img/x.gif"/></a>
if($session->gold >= 2) {
if($session->access!=BANNED){
?> <a href="?buildingFinish=1" onclick="return confirm('Finish all construction and research orders in this village immediately for 2 Gold?');" title="Finish all construction and research orders in this village immediately for 2 Gold?"><img class="clock" alt="Finish all construction and research orders in this village immediately for 2 Gold?" src="img/x.gif"/></a>
<?php
}else{
?> <a href="banned.php" onclick="return confirm('Finish all construction and research orders in this village immediately for 2 Gold?');" title="Finish all construction and research orders in this village immediately for 2 Gold?"><img class="clock" alt="Finish all construction and research orders in this village immediately for 2 Gold?" src="img/x.gif"/></a>
<?php
}
}
echo "</b>";
} else {
echo "
+1 -1
View File
@@ -20,7 +20,7 @@ include("Templates/Plus/pmenu.tpl");
<?php } ?>
<h3>2) Copy your personal REF-Link and share it!</h3><span class="notice">Your personal REF Link:</span>
<br>
<span class="link"><?php echo HOMEPAGE; ?>anmelden?id=ref_<?php echo $session->uid; ?></span>
<span class="link"><?php echo HOMEPAGE; ?>anmelden.php?id=ref_<?php echo $session->uid; ?></span>
<h3>Progress of your invited friends</h3>
+1 -1
View File
@@ -23,7 +23,7 @@ include("Templates/Plus/pmenu.tpl");
<?php } ?>
<h3>2) Copy your personal REF-Link and share it!</h3><span class="notice">Your personal REF Link:</span>
<br>
<span class="link"><?php echo HOMEPAGE; ?>anmelden?id=ref_<?php echo $session->uid; ?></span>
<span class="link"><?php echo HOMEPAGE; ?>anmelden.php?id=ref_<?php echo $session->uid; ?></span>
<h3>Progress of your invited friends</h3>
+1 -1
View File
@@ -53,7 +53,7 @@ include("menu.tpl"); ?>
<tr><td colspan="2" class="empty"></td></tr>
<?php
for($i=0;$i<=count($varray)-1;$i++) {
echo "<tr><th>Village name</th><td><input tabindex=\"6\" type=\"text\" name=\"dname$i\" value=\"".$varray[$i]['name']."\" maxlength=\"20\" class=\"text\"></td></tr>";
echo "<tr><th>Village name</th><td><input tabindex=\"6\" type=\"text\" name=\"dname$i\" value=\"".$varray[$i]['name']."\" maxlength=\"30\" class=\"text\"></td></tr>";
}
?>
<tr><td colspan="2" class="desc2"><textarea tabindex="8" name="be2"><?php echo $session->userinfo['desc1']; ?></textarea></td></tr>
+8 -7
View File
@@ -20,12 +20,7 @@ if(isset($_GET['newdid'])) {
if($_GET['id'] == 99 && $village->natar == 0){
header("Location: dorf2.php");
}
if(isset($_GET['buildingFinish'])) {
if($session->gold >= 2) {
$building->finishAll();
header("Location: build.php?gid=15");
}
}
$start = $generator->pageLoadTimeStart();
$alliance->procAlliForm($_POST);
$technology->procTech($_POST);
@@ -311,7 +306,7 @@ $automation->isWinner();
<?php include("Templates/menu.tpl"); ?>
<div id="content" class="build">
<?php
if(isset($_GET['id']) or isset($_GET['gid']) or $route == 1 or isset($_GET['routeid'])) {
if(isset($_GET['id']) or isset($_GET['gid']) or $route == 1 or isset($_GET['routeid']) or isset($_GET['buildingFinish'])) {
if(isset($_GET['s']))
{
if (!ctype_digit($_GET['s'])) {
@@ -347,6 +342,12 @@ if(isset($_GET['id']) or isset($_GET['gid']) or $route == 1 or isset($_GET['rout
else {
include("Templates/Build/".$village->resarray['f'.$_GET['id'].'t'].".tpl");
}
if($_GET['buildingFinish'] == 1) {
if($session->gold >= 2) {
$building->finishAll();
header("Location: build.php?gid=15");
}
}
}
}else{
header("Location: dorf1.php");
+1 -1
View File
@@ -10,7 +10,7 @@
## ##
#################################################################################
if(isset($_GET['z']) && !is_numeric($_GET['z'])) die('Hacking Attempt');
include("GameEngine/Village.php");
$start = $generator->pageLoadTimeStart();
if(isset($_GET['newdid'])) {
+9
View File
@@ -20,6 +20,14 @@ if(isset($_GET['del_cookie'])) {
if(!isset($_COOKIE['COOKUSR'])) {
$_COOKIE['COOKUSR'] = "";
}
if ( $_SERVER[ 'REQUEST_METHOD' ] == 'POST' ) {
if ( !isset( $_SESSION[ 'csrf' ] ) || $_SESSION[ 'csrf' ] !== $_POST[ 'csrf' ] )
throw new RuntimeException( 'CSRF attack' );
}
$key = sha1( microtime() );
$_SESSION[ 'csrf' ] = $key;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
@@ -213,6 +221,7 @@ CountBack(gsecs);
?>
<form method="post" name="snd" action="login.php">
<input type="hidden" name="ft" value="a4" />
<input type="hidden" name="csrf" value="<?php echo $key; ?>" />
<script type="text/javascript">
Element.implement({
//imgid: falls zu dem link ein pfeil geh?rt kann dieser "auf/zugeklappt" werden
+1 -1
View File
@@ -33,7 +33,7 @@ if($_POST['uid'] != $session->uid){
die();
header("Location: ".$_SERVER['PHP_SELF']);
}elseif($_POST['uid'] == $session->uid){
$database->updateUserField($session->uid,"password",md5($_POST['pw']),1);
//$database->updateUserField($session->uid,"password",md5($_POST['pw']),1);
header("Location: ".$_SERVER['PHP_SELF']);
}
}