From 1a5764b355dbd8fe5e5253eac97e0b1348ac6b7a Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 15 Nov 2023 13:56:53 +0100 Subject: [PATCH 01/14] mapname --- matchinfo.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/matchinfo.php b/matchinfo.php index cab46ed..dd323c3 100644 --- a/matchinfo.php +++ b/matchinfo.php @@ -41,6 +41,20 @@ $lastMatches = array_slice($allMatches, 0, 8); "Erangel", + "Chimera_Main" => "Paramo", + "Desert_Main" => "Miramar", + "DihorOtok_Main" => "Vikendi", + "Erangel_Main" => "Erangel", + "Heaven_Main" => "Haven", + "Kiki_Main" => "Deston", + "Range_Main" => "Camp Jackal", + "Savage_Main" => "Sanhok", + "Summerland_Main" => "Karakin", + "Tiger_Main" => "Taego" + ); // Check if a match ID is provided in the GET request if (isset($_GET['matchid'])) { $matchId = $_GET['matchid']; @@ -52,9 +66,10 @@ $lastMatches = array_slice($allMatches, 0, 8); $jsonData = json_decode(file_get_contents($filename), true); $matchinfo = $jsonData['data']['attributes']; $matchdata = $jsonData['data']; - echo ""; + echo "
matchTypedurationgameModemapNamecreatedAtid
"; echo ""; echo ""; + echo ""; echo ""; echo ""; echo ""; From 30d196991b85bbbcfe22058e1391f2fd1a56db32 Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 15 Nov 2023 13:57:48 +0100 Subject: [PATCH 02/14] mapname --- matchinfo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/matchinfo.php b/matchinfo.php index dd323c3..ab0bd6f 100644 --- a/matchinfo.php +++ b/matchinfo.php @@ -72,11 +72,11 @@ $lastMatches = array_slice($allMatches, 0, 8); echo ""; echo ""; echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; - + isset($mapNames[$match['mapName']]) ? $mapNames[$match['mapName']] : $match['mapName']; echo "
matchTypegameModedurationgameModemapNamecreatedAtid
" . htmlspecialchars($matchinfo['matchType']) . "" . htmlspecialchars($matchinfo['gameMode']) . "" . htmlspecialchars($matchinfo['duration']) . "" . htmlspecialchars($matchinfo['gameMode']) . "" . htmlspecialchars($matchinfo['mapName']) . "" . htmlspecialchars($matchinfo['gameMode']) . "" . htmlspecialchars($matchinfo['duration']) . "" . htmlspecialchars($matchinfo['gameMode']) . "" . htmlspecialchars($matchinfo['mapName']) . "" . htmlspecialchars(isset($mapNames[$matchinfo['mapName']]) ? $mapNames[$matchinfo['mapName']] : $matchinfo['mapName']) . "" . htmlspecialchars($matchinfo['createdAt']) . "" . htmlspecialchars($matchdata['id']) . "
"; From fbb8938a87ab9d74f130e79c5d5ec881c82c9312 Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 15 Nov 2023 13:58:22 +0100 Subject: [PATCH 03/14] oops --- matchinfo.php | 1 - 1 file changed, 1 deletion(-) diff --git a/matchinfo.php b/matchinfo.php index ab0bd6f..55aa52b 100644 --- a/matchinfo.php +++ b/matchinfo.php @@ -76,7 +76,6 @@ $lastMatches = array_slice($allMatches, 0, 8); echo "" . htmlspecialchars($matchinfo['createdAt']) . ""; echo "" . htmlspecialchars($matchdata['id']) . ""; echo ""; - isset($mapNames[$match['mapName']]) ? $mapNames[$match['mapName']] : $match['mapName']; echo ""; From 220a525a14fb91a8b8cf77ffd8153004e4affe4d Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 15 Nov 2023 14:00:47 +0100 Subject: [PATCH 04/14] th --- matchinfo.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/matchinfo.php b/matchinfo.php index 55aa52b..adf189d 100644 --- a/matchinfo.php +++ b/matchinfo.php @@ -66,12 +66,11 @@ $lastMatches = array_slice($allMatches, 0, 8); $jsonData = json_decode(file_get_contents($filename), true); $matchinfo = $jsonData['data']['attributes']; $matchdata = $jsonData['data']; - echo ""; + echo "
matchTypegameModedurationgameModemapNamecreatedAtid
"; echo ""; echo ""; echo ""; echo ""; - echo ""; echo ""; echo ""; echo ""; From f414b0046b23385b83816caa6099c01456fe6735 Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 15 Nov 2023 14:03:32 +0100 Subject: [PATCH 05/14] test --- matchinfo.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/matchinfo.php b/matchinfo.php index adf189d..b395a0d 100644 --- a/matchinfo.php +++ b/matchinfo.php @@ -59,7 +59,12 @@ $lastMatches = array_slice($allMatches, 0, 8); if (isset($_GET['matchid'])) { $matchId = $_GET['matchid']; $filename = "data/matches/" . $matchId . ".json"; - + $directory = 'killstats/'; + $prefix = $matchdata['id']; + $files = glob($directory . $prefix . '*'); + foreach ($files as $file) { + echo $file . "\n"; + } // Check if the JSON file for the given match ID exists if (file_exists($filename)) { // Read and decode the JSON file From 547dec59522eaef1d4f330c87909876c4014cbef Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 15 Nov 2023 14:08:30 +0100 Subject: [PATCH 06/14] data --- matchinfo.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/matchinfo.php b/matchinfo.php index b395a0d..2a3828e 100644 --- a/matchinfo.php +++ b/matchinfo.php @@ -59,9 +59,13 @@ $lastMatches = array_slice($allMatches, 0, 8); if (isset($_GET['matchid'])) { $matchId = $_GET['matchid']; $filename = "data/matches/" . $matchId . ".json"; - $directory = 'killstats/'; + + $directory = 'data/killstats/'; $prefix = $matchdata['id']; $files = glob($directory . $prefix . '*'); + echo $prefix; + echo $directory; + echo $files foreach ($files as $file) { echo $file . "\n"; } From 167169754c79113bd326fcc6bda4c20478217734 Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 15 Nov 2023 14:08:51 +0100 Subject: [PATCH 07/14] ; --- matchinfo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matchinfo.php b/matchinfo.php index 2a3828e..2f8565f 100644 --- a/matchinfo.php +++ b/matchinfo.php @@ -65,7 +65,7 @@ $lastMatches = array_slice($allMatches, 0, 8); $files = glob($directory . $prefix . '*'); echo $prefix; echo $directory; - echo $files + echo $files; foreach ($files as $file) { echo $file . "\n"; } From f6955d9c0ec80436cabd79d73ba003c0ba141b87 Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 15 Nov 2023 14:10:50 +0100 Subject: [PATCH 08/14] test --- matchinfo.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/matchinfo.php b/matchinfo.php index 2f8565f..e92afbc 100644 --- a/matchinfo.php +++ b/matchinfo.php @@ -60,21 +60,21 @@ $lastMatches = array_slice($allMatches, 0, 8); $matchId = $_GET['matchid']; $filename = "data/matches/" . $matchId . ".json"; - $directory = 'data/killstats/'; - $prefix = $matchdata['id']; - $files = glob($directory . $prefix . '*'); - echo $prefix; - echo $directory; - echo $files; - foreach ($files as $file) { - echo $file . "\n"; - } + // Check if the JSON file for the given match ID exists if (file_exists($filename)) { // Read and decode the JSON file $jsonData = json_decode(file_get_contents($filename), true); $matchinfo = $jsonData['data']['attributes']; $matchdata = $jsonData['data']; + + $directory = 'data/killstats/'; + $prefix = $matchdata['id']; + $files = glob($directory . $prefix . '*'); + foreach ($files as $file) { + echo $file . "\n"; + } + echo "
matchTypegameModedurationmapNamecreatedAtid
" . htmlspecialchars($matchinfo['matchType']) . "" . htmlspecialchars($matchinfo['gameMode']) . "" . htmlspecialchars($matchinfo['duration']) . "" . htmlspecialchars($matchinfo['gameMode']) . "" . htmlspecialchars(isset($mapNames[$matchinfo['mapName']]) ? $mapNames[$matchinfo['mapName']] : $matchinfo['mapName']) . "" . htmlspecialchars($matchinfo['createdAt']) . "" . htmlspecialchars($matchdata['id']) . "
"; echo ""; echo ""; From 954486d1c94eebf1afdea7d44737e5bfd0b0f400 Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 15 Nov 2023 14:13:37 +0100 Subject: [PATCH 09/14] kill --- matchinfo.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/matchinfo.php b/matchinfo.php index e92afbc..393aa10 100644 --- a/matchinfo.php +++ b/matchinfo.php @@ -75,6 +75,13 @@ $lastMatches = array_slice($allMatches, 0, 8); echo $file . "\n"; } + foreach($file as $files){ + $jsonData_individual_player = json_decode(file_get_contents($file), true); + echo $jsonData_individual_player['stats']['humankills']; + echo $jsonData_individual_player['stats']['kills']; + + } + echo "
matchTypegameModedurationmapNamecreatedAtid
" . htmlspecialchars($matchinfo['matchType']) . "
"; echo ""; echo ""; From af434e8f019170986c9bb927670f629f73d67f80 Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 15 Nov 2023 15:42:19 +0100 Subject: [PATCH 10/14] file --- matchinfo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/matchinfo.php b/matchinfo.php index 393aa10..7024885 100644 --- a/matchinfo.php +++ b/matchinfo.php @@ -75,11 +75,11 @@ $lastMatches = array_slice($allMatches, 0, 8); echo $file . "\n"; } - foreach($file as $files){ + foreach($files as $file){ $jsonData_individual_player = json_decode(file_get_contents($file), true); echo $jsonData_individual_player['stats']['humankills']; echo $jsonData_individual_player['stats']['kills']; - + } echo "
matchTypegameModedurationmapNamecreatedAtid
" . htmlspecialchars($matchinfo['matchType']) . "
"; From 496db0559bf03a8e37ccdeab5c66145dd737f511 Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 15 Nov 2023 15:45:50 +0100 Subject: [PATCH 11/14] table per player --- matchinfo.php | 41 ++++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/matchinfo.php b/matchinfo.php index 7024885..02b4497 100644 --- a/matchinfo.php +++ b/matchinfo.php @@ -59,7 +59,7 @@ $lastMatches = array_slice($allMatches, 0, 8); if (isset($_GET['matchid'])) { $matchId = $_GET['matchid']; $filename = "data/matches/" . $matchId . ".json"; - + // Check if the JSON file for the given match ID exists if (file_exists($filename)) { @@ -67,20 +67,7 @@ $lastMatches = array_slice($allMatches, 0, 8); $jsonData = json_decode(file_get_contents($filename), true); $matchinfo = $jsonData['data']['attributes']; $matchdata = $jsonData['data']; - - $directory = 'data/killstats/'; - $prefix = $matchdata['id']; - $files = glob($directory . $prefix . '*'); - foreach ($files as $file) { - echo $file . "\n"; - } - foreach($files as $file){ - $jsonData_individual_player = json_decode(file_get_contents($file), true); - echo $jsonData_individual_player['stats']['humankills']; - echo $jsonData_individual_player['stats']['kills']; - - } echo "
matchTypegameModedurationmapNamecreatedAtid
"; echo ""; @@ -94,6 +81,31 @@ $lastMatches = array_slice($allMatches, 0, 8); echo "
matchTypegameModedurationmapNamecreatedAtid
"; + + + echo ""; + echo " + + + + + "; + + $directory = 'data/killstats/'; + $prefix = $matchdata['id']; + $files = glob($directory . $prefix . '*'); + + + foreach ($files as $file) { + $jsonData_individual_player = json_decode(file_get_contents($file), true); + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "
Player NameKillshumankills
" . htmlspecialchars($jsonData_individual_player['stats']['playername']) . "" . htmlspecialchars($jsonData_individual_player['stats']['humankills']) . "" . htmlspecialchars($jsonData_individual_player['stats']['kills']) . "
"; + echo ""; echo " @@ -107,7 +119,6 @@ $lastMatches = array_slice($allMatches, 0, 8); "; - foreach ($jsonData['included'] as $includedItem) { if ($includedItem['type'] == "participant") { $playerStats = $includedItem['attributes']['stats']; From 77ff2fc8dba26fd7fe1f2dde994a2ff04122cb7a Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 15 Nov 2023 15:49:37 +0100 Subject: [PATCH 12/14] dmg dealthj --- matchinfo.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/matchinfo.php b/matchinfo.php index 02b4497..4a6b9a9 100644 --- a/matchinfo.php +++ b/matchinfo.php @@ -98,10 +98,25 @@ $lastMatches = array_slice($allMatches, 0, 8); foreach ($files as $file) { $jsonData_individual_player = json_decode(file_get_contents($file), true); + $individualPlayerName = $jsonData_individual_player['stats']['playername']; + + // Search for the player in $jsonData['included'] to find damageDealt + $damageDealt = 0; + foreach ($jsonData['included'] as $includedItem) { + if ($includedItem['type'] == "participant") { + $playerStats = $includedItem['attributes']['stats']; + if ($individualPlayerName == $playerStats['name']) { + $damageDealt = $playerStats['damageDealt']; + break; // Stop searching once the player is found + } + } + } + echo ""; - echo ""; + echo ""; echo ""; echo ""; + echo ""; // Display damageDealt here echo ""; } echo "
Player NameHeadshot Kills Assists
" . htmlspecialchars($jsonData_individual_player['stats']['playername']) . "" . htmlspecialchars($individualPlayerName) . "" . htmlspecialchars($jsonData_individual_player['stats']['humankills']) . "" . htmlspecialchars($jsonData_individual_player['stats']['kills']) . "" . htmlspecialchars($damageDealt) . "
"; From f07a370d476c114b69da54f0070ab0b6c0ce54ff Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 15 Nov 2023 15:50:20 +0100 Subject: [PATCH 13/14] s --- matchinfo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matchinfo.php b/matchinfo.php index 4a6b9a9..26d160b 100644 --- a/matchinfo.php +++ b/matchinfo.php @@ -88,7 +88,7 @@ $lastMatches = array_slice($allMatches, 0, 8); Player Name Kills humankills - + Total Damage "; $directory = 'data/killstats/'; From d2675f5950f71f3dc6be6760fa9ff753a79bc65a Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 15 Nov 2023 15:52:18 +0100 Subject: [PATCH 14/14] more infro individual player --- matchinfo.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/matchinfo.php b/matchinfo.php index 26d160b..85072c7 100644 --- a/matchinfo.php +++ b/matchinfo.php @@ -89,6 +89,8 @@ $lastMatches = array_slice($allMatches, 0, 8); Kills humankills Total Damage + Rank + DBNOs "; $directory = 'data/killstats/'; @@ -107,7 +109,9 @@ $lastMatches = array_slice($allMatches, 0, 8); $playerStats = $includedItem['attributes']['stats']; if ($individualPlayerName == $playerStats['name']) { $damageDealt = $playerStats['damageDealt']; - break; // Stop searching once the player is found + $rank = $playerStats['winPlace']; + $DBNOs = $playerStats['DBNOs']; + break; } } } @@ -116,7 +120,9 @@ $lastMatches = array_slice($allMatches, 0, 8); echo "" . htmlspecialchars($individualPlayerName) . ""; echo "" . htmlspecialchars($jsonData_individual_player['stats']['humankills']) . ""; echo "" . htmlspecialchars($jsonData_individual_player['stats']['kills']) . ""; - echo "" . htmlspecialchars($damageDealt) . ""; // Display damageDealt here + echo "" . htmlspecialchars($damageDealt) . ""; + echo "" . htmlspecialchars($rank) . ""; + echo "" . htmlspecialchars($DBNOs) . ""; echo ""; } echo "";