Files
iopietro 77136a9784 Artifacts update and optimizations
+Added the "Artifacts" section in the Admin Panel, which contains two
options: return a deleted artifact to the Natars and create new
Artifacts, assigned to a specified player
+Return to Natars coded, in the village section of the Admin Panel
+Moved a lot of functions and costants from Automation.php to the "new"
class Artifacts.php
+Optimized a lot the whole Natars creation process, decreased the number
of query of about 600
+Optimized a lot the function which deletes a player's account, it's now
executed almost instantly, even with players with a lot of villages
+Redesigned the map spawn system, using a more Travian-like village
distribution
+Fixed a bug that did show a broken village in the artifact chronology,
if that village was destroyed
+Reduced the amount of redundant code (about 230 lines) for
27_1.tpl/27_2.tpl and 27_3.tpl
+Fixed a bug that permitted to build the Great Granary and the Great
Warehouse in the whole account, with only a village effect artifact
+Fixed a bug in the Admin Panel map that didn't permit to show village
informations, if that village contained single quotes in its name
2018-07-24 03:04:25 +02:00

103 lines
3.2 KiB
Smarty

<?php
include_once("GameEngine/Artifacts.php");
$ownArtifacts = $database->getOwnArtefactsInfo($session->uid);
$wref = $village->wid;
$coor = $database->getCoor($wref);
?>
<body>
<div class="gid27">
<table id="own" cellpadding="1" cellspacing="1">
<thead>
<tr>
<th colspan="4"><?php echo OWN_ARTIFACTS; ?></th>
</tr>
<tr>
<td></td>
<td><?php echo NAME; ?></td>
<td><?php echo VILLAGE; ?></td>
<td><?php echo CONQUERED; ?></td>
</tr>
</thead>
<tbody>
<?php
if (empty($ownArtifacts)) echo '<tr><td colspan="4" class="none">'.ANY_ARTIFACTS.'</td></tr>';
else
{
foreach($ownArtifacts as $ownArtifact){
$coor2 = $database->getCoor($ownArtifact['vref']);
$ownArtifactInfo = Artifacts::getArtifactInfo($ownArtifact);
echo '<tr><td class="icon"><img class="artefact_icon_' . $ownArtifact['type'] . '" src="img/x.gif"></td>';
echo '<td class="nam">
<a href="build.php?id='.$id . '&show='.$ownArtifact['id'].'">' . $ownArtifact['name'] . '</a> <span class="bon">' . $ownArtifact['effect'] . '</span>
<div class="info">
Treasury <b>'.$ownArtifactInfo['requiredLevel'].'</b>, Effect <b>'.$ownArtifactInfo['effectInfluence'].'</b>
</div>
</td>';
echo '<td class="pla"><a href="karte.php?d=' . $ownArtifact['vref'] . '&c=' . $generator->getMapCheck($ownArtifact['vref']) . '">' . $database->getVillageField($ownArtifact['vref'], "name") . '</a></td>';
echo '<td class="dist">'.date("d.m.Y H:i", $ownArtifact['conquered']) . '</td></tr>';
}
}
?>
</tbody>
</table>
<table id="near" cellpadding="1" cellspacing="1">
<thead>
<tr>
<th colspan="4"><?php echo ARTIFACTS_AREA; ?></th>
</tr>
<tr>
<td></td>
<td><?php echo NAME; ?></td>
<td><?php echo PLAYER; ?></td>
<td><?php echo DISTANCE; ?></td>
</tr>
</thead>
<tbody>
<?php
$artifacts = $database->getArtifactsBysize([1, 2, 3]);
if(count($artifacts) == 0) echo '<td colspan="4" class="none">'.NO_ARTIFACTS_AREA.'</td>';
else
{
$rows = [];
foreach($artifacts as $artifact){
$coordinates = $database->getCoor($artifact['vref']);
$distance = $database->getDistance($village->coor['x'], $village->coor['y'], $coordinates['x'], $coordinates['y']);
$rows[(string)$distance] = $artifact;
}
ksort($rows);
foreach($rows as $distance => $row) {
echo '<tr>
<td class="icon"><img class="artefact_icon_'.$row['type'].'" src="img/x.gif" alt="" title=""></td>
<td class="nam">
<a href="build.php?id='.$id.'&show='.$row['id'].'">'.$row['name'].'</a> <span class="bon">'.$row['effect'].'</span>
<div class="info">';
$artifactInfo = Artifacts::getArtifactInfo($row);
echo '<div class="info">'.TREASURY.' <b>'.$artifactInfo['requiredLevel'] . '</b>, '.EFFECT.' <b>'.$artifactInfo['effectInfluence'].'</b>
</div></td><td class="pla">
<a href="karte.php?d='.$row['vref'].'&c='.$generator->getMapCheck($row['vref']).'">'.$database->getUserField($row['owner'], "username", 0).'</a>
</td>
<td class="dist">'.$distance.'</td>
</tr>';
}
}
?>
</tbody>
</table>
</div>