commit
dd918f70d7
1 changed files with 36 additions and 33 deletions
|
|
@ -80,53 +80,56 @@ $lastMatches = array_slice($allMatches, 0, 8);
|
||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
echo "</table>";
|
echo "</table>";
|
||||||
|
|
||||||
|
$directory = 'data/killstats/';
|
||||||
|
$prefix = $matchdata['id'];
|
||||||
|
$files = glob($directory . $prefix . '*');
|
||||||
|
|
||||||
|
if (count($files) == 0) {
|
||||||
|
echo "No individual player data available (yet) check back in half hour.";
|
||||||
|
} else {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo "<table class='sortable'>";
|
|
||||||
echo "<tr>
|
echo "<table class='sortable'>";
|
||||||
|
echo "<tr>
|
||||||
<th>Player Name</th>
|
<th>Player Name</th>
|
||||||
<th>Kills</th>
|
|
||||||
<th>humankills</th>
|
<th>humankills</th>
|
||||||
|
<th>Kills</th>
|
||||||
<th>Total Damage</th>
|
<th>Total Damage</th>
|
||||||
<th>Rank</th>
|
<th>Rank</th>
|
||||||
<th>DBNOs</th>
|
<th>DBNOs</th>
|
||||||
</tr>";
|
</tr>";
|
||||||
|
|
||||||
$directory = 'data/killstats/';
|
foreach ($files as $file) {
|
||||||
$prefix = $matchdata['id'];
|
$jsonData_individual_player = json_decode(file_get_contents($file), true);
|
||||||
$files = glob($directory . $prefix . '*');
|
$individualPlayerName = $jsonData_individual_player['stats']['playername'];
|
||||||
|
|
||||||
|
// Search for the player in $jsonData['included'] to find damageDealt
|
||||||
foreach ($files as $file) {
|
$damageDealt = 0;
|
||||||
$jsonData_individual_player = json_decode(file_get_contents($file), true);
|
foreach ($jsonData['included'] as $includedItem) {
|
||||||
$individualPlayerName = $jsonData_individual_player['stats']['playername'];
|
if ($includedItem['type'] == "participant") {
|
||||||
|
$playerStats = $includedItem['attributes']['stats'];
|
||||||
// Search for the player in $jsonData['included'] to find damageDealt
|
if ($individualPlayerName == $playerStats['name']) {
|
||||||
$damageDealt = 0;
|
$damageDealt = $playerStats['damageDealt'];
|
||||||
foreach ($jsonData['included'] as $includedItem) {
|
$rank = $playerStats['winPlace'];
|
||||||
if ($includedItem['type'] == "participant") {
|
$DBNOs = $playerStats['DBNOs'];
|
||||||
$playerStats = $includedItem['attributes']['stats'];
|
break;
|
||||||
if ($individualPlayerName == $playerStats['name']) {
|
}
|
||||||
$damageDealt = $playerStats['damageDealt'];
|
|
||||||
$rank = $playerStats['winPlace'];
|
|
||||||
$DBNOs = $playerStats['DBNOs'];
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
echo "<tr>";
|
||||||
|
echo "<td>" . htmlspecialchars($individualPlayerName) . "</td>";
|
||||||
|
echo "<td>" . htmlspecialchars($jsonData_individual_player['stats']['humankills']) . "</td>";
|
||||||
|
echo "<td>" . htmlspecialchars($jsonData_individual_player['stats']['kills']) . "</td>";
|
||||||
|
echo "<td>" . htmlspecialchars($damageDealt) . "</td>";
|
||||||
|
echo "<td>" . htmlspecialchars($rank) . "</td>";
|
||||||
|
echo "<td>" . htmlspecialchars($DBNOs) . "</td>";
|
||||||
|
echo "</tr>";
|
||||||
}
|
}
|
||||||
|
echo "</table>";
|
||||||
echo "<tr>";
|
|
||||||
echo "<td>" . htmlspecialchars($individualPlayerName) . "</td>";
|
|
||||||
echo "<td>" . htmlspecialchars($jsonData_individual_player['stats']['humankills']) . "</td>";
|
|
||||||
echo "<td>" . htmlspecialchars($jsonData_individual_player['stats']['kills']) . "</td>";
|
|
||||||
echo "<td>" . htmlspecialchars($damageDealt) . "</td>";
|
|
||||||
echo "<td>" . htmlspecialchars($rank) . "</td>";
|
|
||||||
echo "<td>" . htmlspecialchars($DBNOs) . "</td>";
|
|
||||||
echo "</tr>";
|
|
||||||
}
|
}
|
||||||
echo "</table>";
|
|
||||||
|
|
||||||
echo "<table class='sortable'>";
|
echo "<table class='sortable'>";
|
||||||
echo "<tr>
|
echo "<tr>
|
||||||
<th>Player Name</th>
|
<th>Player Name</th>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue