Merge pull request #4 from BrainiacX/patch-3

Update build.php
This commit is contained in:
yi12345
2012-04-07 07:17:06 -07:00
+28
View File
@@ -47,6 +47,34 @@ if(isset($_GET['id'])) {
if (isset($_POST['a']) == 533374 && isset($_POST['id']) == 39){
$units->Settlers($_POST);
}
if ($_GET['mode']=='troops'&&$_GET['cancel']==1){
$oldmovement=$database->getMovementById($_GET['moveid']);
$now=time();
if (($now-$oldmovement[0]['starttime'])<60){
$qc="SELECT * FROM " . TB_PREFIX . "movement where proc = 0 and moveid = ".$_GET['moveid'];
$resultc=$database->query($qc) or die(mysql_error());
if (mysql_num_rows($resultc)==1){
$q = "UPDATE " . TB_PREFIX . "movement set proc = 1 where proc = 0 and moveid = ".$_GET['moveid'];
$database->query($q);
$end=$now+($now-$oldmovement[0]['starttime']);
//echo "6,".$oldmovement[0]['to'].",".$oldmovement[0]['from'].",0,".$now.",".$end;
$q2 = "SELECT id FROM " . TB_PREFIX . "send ORDER BY id DESC";
$lastid=mysql_fetch_array(mysql_query($q2));
$newid=$lastid['id']+1;
$q2 = "INSERT INTO " . TB_PREFIX . "send values ($newid,0,0,0,0,0)";
$database->query($q2);
$database->addMovement(4,$oldmovement[0]['to'],$oldmovement[0]['from'],$oldmovement[0]['ref'],$end);
$database->addMovement(6,$oldmovement[0]['to'],$oldmovement[0]['from'],$newid,$end);
}
}
header("Location: ".$_SERVER['PHP_SELF']."?id=".$_GET['id']);
}
if(isset($_GET['id'])){
$automation->isWinner();
}