Fixed some bugs

+Returning troops time will now flow correctly in the rally point
+Resources won't be set to 0 anymore if overflow (this could have
happened in high speed servers)
+Fixed a distorted view of the right part  of the page, while reading a
mass message
This commit is contained in:
iopietro
2018-05-03 14:35:19 +02:00
parent 554a8a8d7f
commit e751a0c01f
6 changed files with 212 additions and 261 deletions
+8 -8
View File
@@ -13,7 +13,7 @@ $res1 = mysqli_query($database->dblink,"SELECT wood, clay, iron, crop FROM " . T
$res = mysqli_fetch_array($res1);
}
}
$timer = $y+1;
$session->timer++;
if ($units[$y]['sort_type']==3){
if ($units[$y]['attack_type']==3){
$actionType = ATTACK_ON;
@@ -79,7 +79,7 @@ if ($units[$y]['sort_type']==3){
<tr>
<th>'.ARRIVAL.'</th>
<td colspan='.$colspan.'>
<div class="in small"><span id=timer'.$timer.'>'.$generator->getTimeFormat($units[$y]['endtime']-time()).'</span> h</div>';
<div class="in small"><span id=timer'.$session->timer.'>'.$generator->getTimeFormat($units[$y]['endtime']-time()).'</span> h</div>';
$datetime = $generator->procMtime($units[$y]['endtime']);
echo "<div class=\"at small\">";
if($datetime[0] != "today") {
@@ -114,7 +114,7 @@ if ($units[$y]['sort_type']==3){
<tr>
<th>'.ARRIVAL.'</th>
<td colspan="10">
<div class="in small"><span id=timer'.$timer.'>'.$generator->getTimeFormat($units[$y]['endtime']-time()).'</span> h</div>';
<div class="in small"><span id=timer'.$session->timer.'>'.$generator->getTimeFormat($units[$y]['endtime']-time()).'</span> h</div>';
$datetime = $generator->procMtime($units[$y]['endtime']);
echo "<div class=\"at small\">";
if($datetime[0] != "today") {
@@ -201,7 +201,7 @@ $to = $database->getMInfo($units[$y]['vref']);
<th><?php echo ARRIVAL;?></th>
<td colspan="<?php echo $units[$y]['t11'] == 0 ? 10 : 11 ?>">
<?php
echo "<div class=\"in small\"><span id=timer".$timer.">".$generator->getTimeFormat($units[$y]['endtime']-time())."</span> h</div>";
echo "<div class=\"in small\"><span id=timer".$session->timer.">".$generator->getTimeFormat($units[$y]['endtime']-time())."</span> h</div>";
$datetime = $generator->procMtime($units[$y]['endtime']);
echo "<div class=\"at\">";
if($datetime[0] != "today") {
@@ -222,7 +222,7 @@ foreach($array as $conqured){
$oasis = $database->getMovement("6",$conqured['wref'],0);
$total_for = count($oasis);
for($y=0;$y < $total_for;$y++){
$timer = $y+1;
$session->timer++;
$to = $database->getOMInfo($oasis[$y]['to']);
if ($oasis[$y]['attack_type']==2){
$actionType = REINFORCEMENTFOR;
@@ -286,7 +286,7 @@ $to = $database->getOMInfo($oasis[$y]['to']);
<tr>
<th>'.ARRIVAL.'</th>
<td colspan="'.$colspan.'">
<div class="in small"><span id=timer'.$timer.'>'.$generator->getTimeFormat($oasis[$y]['endtime']-time()).'</span> h</div>';
<div class="in small"><span id=timer'.$session->timer.'>'.$generator->getTimeFormat($oasis[$y]['endtime']-time()).'</span> h</div>';
$datetime = $generator->procMtime($oasis[$y]['endtime']);
echo "<div class=\"at\">";
if($datetime[0] != "today") {
@@ -304,7 +304,7 @@ $to = $database->getOMInfo($oasis[$y]['to']);
$settlers = $database->getMovement("7",$village->wid,1);
$total_for3 = count($settlers);
for($x=0;$x < $total_for3;$x++){
$timer = $x+1;
$session->timer++;
$to = $database->getMInfo($settlers[$x]['to']);
?>
<table class="troop_details" cellpadding="1" cellspacing="1">
@@ -348,7 +348,7 @@ $to = $database->getMInfo($settlers[$x]['to']);
<th><?php echo ARRIVAL;?></th>
<td colspan="10">
<?php
echo "<div class=\"in small\"><span id=timer".$timer.">".$generator->getTimeFormat($settlers[$x]['endtime']-time())."</span> h</div>";
echo "<div class=\"in small\"><span id=timer".$session->timer.">".$generator->getTimeFormat($settlers[$x]['endtime']-time())."</span> h</div>";
$datetime = $generator->procMtime($settlers[$x]['endtime']);
echo "<div class=\"at\">";
if($datetime[0] != "today") {
+4 -5
View File
@@ -1,10 +1,9 @@
<?php
$units = $database->getMovement(3,$village->wid,0);
$total_for = count($units);
$timer = 0;
for($y=0;$y<$total_for;$y++){
$timer += 1;
$session->timer++;
if($units[$y]['attack_type'] == 2){
$attack_type = REINFORCEMENTFOR;
@@ -78,7 +77,7 @@ $to = $database->getOMInfo($units[$y]['to']);}
<th><?php echo ARRIVAL;?></th>
<td colspan="<?php if($units[$y]['t11'] == 0) {echo"10";}else{echo"11";}?>">
<?php
echo "<div class=\"in small\"><span id=timer$timer>".$generator->getTimeFormat($units[$y]['endtime']-time())."</span> h</div>";
echo "<div class=\"in small\"><span id=timer$session->timer>".$generator->getTimeFormat($units[$y]['endtime']-time())."</span> h</div>";
$datetime = $generator->procMtime($units[$y]['endtime']);
echo "<div class=\"at\">";
if($datetime[0] != "today") {
@@ -104,7 +103,7 @@ $to = $database->getOMInfo($units[$y]['to']);}
$total_for = count($settlers);
for($y=0;$y<$total_for;$y++){
$timer += 1;
$session->timer++;
?>
<table class="troop_details" cellpadding="1" cellspacing="1">
@@ -147,7 +146,7 @@ $timer += 1;
<th><?php echo ARRIVAL;?></th>
<td colspan="<?php if($units[$y]['t11'] == 0) {echo"10";}else{echo"11";}?>">
<?php
echo "<div class=\"in small\"><span id=timer$timer>".$generator->getTimeFormat($settlers[$y]['endtime']-time())."</span> h</div>";
echo "<div class=\"in small\"><span id=timer$session->timer>".$generator->getTimeFormat($settlers[$y]['endtime']-time())."</span> h</div>";
$datetime = $generator->procMtime($settlers[$y]['endtime']);
echo "<div class=\"at small\">";
if($datetime[0] != "today") {