Optimizations

-Removed the "sort_type" 6 from the movement table, looted resources
will now be saved in the "sort_type" 4 returing attack.
This reduces a lot the spam in the tables "send" and "movement" of the
database
-Removed some useless methods in Database.php and Message.php
+Optimized report loading, own report will be loaded only once (and not
twice at random) and allied reports aren't loaded anymore
+Minor improovements and better indentation
This commit is contained in:
iopietro
2018-05-05 17:54:34 +02:00
parent cf74514451
commit f7e05c9802
14 changed files with 437 additions and 624 deletions
+19 -20
View File
@@ -503,27 +503,26 @@ class Units {
$troopsTime = $this->getWalkingTroopsTime($enforce['from'], $enforce['vref'], $to['owner'], $tribe, $post, 1, 't');
$time = $database->getArtifactsValueInfluence($session->uid, $village->wid, 2, $troopsTime);
$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, $village->wid, $enforce['from'], $reference, time(), ($time + time()));
$technology->checkReinf($post['ckey'], false );
$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, $village->wid, $enforce['from'], $reference, time(), ($time + time()));
$technology->checkReinf($post['ckey'], false);
header( "Location: build.php?id=39&refresh=1" );
exit;
}
} else {
$form->addError( "error", "You cant change someones troops." );
if ( $form->returnErrors() > 0 ) {
$_SESSION['errorarray'] = $form->getErrors();
$_SESSION['valuearray'] = $_POST;
header( "Location: a2b.php" );
exit;
}
}
} else {
header( "Location: banned.php" );
exit;
}
header("Location: build.php?id=39&refresh=1");
exit();
}
}else{
$form->addError("error", "You cant change someones troops.");
if($form->returnErrors() > 0){
$_SESSION['errorarray'] = $form->getErrors();
$_SESSION['valuearray'] = $_POST;
header("Location: a2b.php");
exit();
}
}
}else{
header("Location: banned.php");
exit();
}
}
public function Settlers($post) {