more fixes

This commit is contained in:
unknown
2012-06-21 23:27:58 +03:00
parent 6b384a8fb1
commit 11034d3331
9 changed files with 223 additions and 230 deletions
+13 -13
View File
@@ -2435,23 +2435,13 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
}
$database->setMovementProc($data['moveid']);
if($chiefing_village != 1){
if($chiefing_village != 1 && $village_destroyed != 1){
$database->addMovement(4,$to['wref'],$from['wref'],$data['ref'],time(),$endtime);
}else{
$database->addEnforce2($data,$owntribe,$troopsdead1,$troopsdead2,$troopsdead3,$troopsdead4,$troopsdead5,$troopsdead6,$troopsdead7,$troopsdead8,$troopsdead9,$troopsdead10,$troopsdead11);
}
// send the bounty on type 6.
if($type !== 1)
{
$reference = $database->sendResource($steal[0],$steal[1],$steal[2],$steal[3],0,0);
$isoasis1 = $database->isVillageOases($to['wref']);
if ($isoasis1 == 0){
//$database->modifyResource($to['wref'],$steal[0],$steal[1],$steal[2],$steal[3],0);
}else{
//$database->modifyOasisResource($to['wref'],$steal[0],$steal[1],$steal[2],$steal[3],0);
}
$database->addMovement(6,$to['wref'],$from['wref'],$reference,time(),$endtime);
//$database->updateVillage($to['wref']);
$database->addMovement(6,$to['wref'],$from['wref'],$reference,time(),$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);
@@ -2459,6 +2449,9 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
$database->modifyPointsAlly($targetally,'RR',$totalstolentaken );
$database->modifyPointsAlly($ownally,'RR',$totalstolengain);
}
}else if($chiefing_village == 1){
$database->addEnforce2($data,$owntribe,$troopsdead1,$troopsdead2,$troopsdead3,$troopsdead4,$troopsdead5,$troopsdead6,$troopsdead7,$troopsdead8,$troopsdead9,$troopsdead10,$troopsdead11);
}
}
else //else they die and don't return or report.
{
@@ -2500,7 +2493,14 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
$database->query($q);
$q = "UPDATE ".TB_PREFIX."wdata set occupied = 0 where id = ".$data['to'];
$database->query($q);
$q = "DELETE FROM ".TB_PREFIX."movement where to = ".$data['to']." or from = ".$data['to'];
$getmovement = $database->getMovement(3,$data['to'],1);
foreach($getmovement as $movedata) {
$time = time();
$time2 = $time - $movedata['starttime'];
$database->addMovement(4,$movedata['to'],$movedata['from'],$movedata['ref'],$time,$time+$time2);
$database->setMovementProc($movedata['moveid']);
}
$q = "DELETE FROM ".TB_PREFIX."movement where from = ".$data['to'];
$database->query($q);
}
}
+2 -5
View File
@@ -2061,9 +2061,6 @@ class MYSQL_DB {
case 7:
$q = "SELECT * FROM " . TB_PREFIX . "movement where " . TB_PREFIX . "movement." . $where . " = $village and sort_type = 4 and ref = 0 and proc = 0 ORDER BY endtime ASC";
break;
case 8:
$q = "SELECT * FROM " . TB_PREFIX . "movement, " . TB_PREFIX . "attacks where " . TB_PREFIX . "movement." . $where . " = $village and " . TB_PREFIX . "movement.ref = " . TB_PREFIX . "attacks.id and " . TB_PREFIX . "movement.proc = 0 and " . TB_PREFIX . "movement.sort_type = 4 OR " . TB_PREFIX . "movement." . $where . " = $village and sort_type = 4 and ref = 0 and proc = 0 ORDER BY endtime ASC";
break;
case 34:
$q = "SELECT * FROM " . TB_PREFIX . "movement, " . TB_PREFIX . "attacks where " . TB_PREFIX . "movement." . $where . " = $village and " . TB_PREFIX . "movement.ref = " . TB_PREFIX . "attacks.id and " . TB_PREFIX . "movement.proc = 0 and " . TB_PREFIX . "movement.sort_type = 3 or " . TB_PREFIX . "movement." . $where . " = $village and " . TB_PREFIX . "movement.ref = " . TB_PREFIX . "attacks.id and " . TB_PREFIX . "movement.proc = 0 and " . TB_PREFIX . "movement.sort_type = 4 ORDER BY endtime ASC";
break;
@@ -2089,8 +2086,8 @@ class MYSQL_DB {
}
}
function addMovement($type, $from, $to, $ref, $time, $endtime, $send = 1, $wood = 0, $clay = 0, $iron = 0, $crop = 0) {
$q = "INSERT INTO " . TB_PREFIX . "movement values (0,$type,$from,$to,$ref,$time,$endtime,0,$send,$wood,$clay,$iron,$crop)";
function addMovement($type, $from, $to, $ref, $time, $endtime, $send = 1, $wood = 0, $clay = 0, $iron = 0, $crop = 0, $ref2 = 0) {
$q = "INSERT INTO " . TB_PREFIX . "movement values (0,$type,$from,$to,$ref,$ref2,$time,$endtime,0,$send,$wood,$clay,$iron,$crop)";
return mysql_query($q, $this->connection);
}