From 06c09ec7be6b3777b4d8e03c66c2ab25ca1c865e Mon Sep 17 00:00:00 2001 From: Lanta Date: Tue, 16 Jul 2024 21:21:32 +0200 Subject: [PATCH 1/8] dev --- update/matchparser.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/update/matchparser.ps1 b/update/matchparser.ps1 index 1a152e3..7a8d6f6 100644 --- a/update/matchparser.ps1 +++ b/update/matchparser.ps1 @@ -181,6 +181,7 @@ function Get-MatchStatsPlayer { if ($MatchType) { $filterProperty = 'matchType' } + $alives = (($killstats.stats | where-object { $_.playername -eq $player -and $_.$filterProperty -like $typemodevalue }).alive | Measure-Object -sum).sum $deaths = (($killstats.stats | where-object { $_.playername -eq $player -and $_.$filterProperty -like $typemodevalue }).deaths | Measure-Object -sum).sum $kills = (($killstats.stats | where-object { $_.playername -eq $player -and $_.$filterProperty -like $typemodevalue }).kills | Measure-Object -sum).sum $dbno = (($killstats.stats | where-object { $_.playername -eq $player -and $_.$filterProperty -like $typemodevalue }).dbno | Measure-Object -sum).sum @@ -204,7 +205,7 @@ function Get-MatchStatsPlayer { kills = $kills humankills = $humankills matches = $player_matches - KD_H = $humankills / $deaths + KD_H = $humankills / ($deaths + $alives) KD_ALL = $kills / $deaths winratio = $winratio wins = $player_wins From fa4ef7aa861294cddac0627514cdb6f74e5e22ba Mon Sep 17 00:00:00 2001 From: Lanta Date: Tue, 16 Jul 2024 22:37:29 +0200 Subject: [PATCH 2/8] its alive --- update/matchparser.ps1 | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/update/matchparser.ps1 b/update/matchparser.ps1 index 7a8d6f6..a09c29f 100644 --- a/update/matchparser.ps1 +++ b/update/matchparser.ps1 @@ -46,7 +46,7 @@ function get-killstats { $gameMode ) $LOGPLAYERKILLV2 = $telemetry | where-object { $_._T -eq 'LOGPLAYERKILLV2' } - $kills = $LOGPLAYERKILLV2 | where-object { $_.killer.name -eq $player_name} + $kills = $LOGPLAYERKILLV2 | where-object { $_.killer.name -eq $player_name } $deaths = $LOGPLAYERKILLV2 | where-object { $_.victim.name -eq $player_name -and $_.finisher.name.count -ge 1 } $HumanDmg = $([math]::Round(($telemetry | Where-Object { $_._T -eq 'LOGPLAYERTAKEDAMAGE' -and $_.attacker.name -eq $player_name -and $_.victim.accountId -notlike "ai.*" -and $_.victim.teamId -ne $_.attacker.teamId } | Measure-Object -Property damage -Sum).Sum)) return @{ @@ -130,11 +130,11 @@ foreach ($player in $all_player_matches) { $savekillstats = @{ - - matchid = $match.id - created = $match.createdAt - stats = $killstat - winplace = (($all_player_matches | where-object { $_.playername -eq $player_name } ).player_matches | where-object { $_.id -eq $match.id }).stats.winplace + matchid = $match.id + created = $match.createdAt + stats = $killstat + deathType = $match.stats.deathType + winplace = (($all_player_matches | where-object { $_.playername -eq $player_name } ).player_matches | where-object { $_.id -eq $match.id }).stats.winplace } Write-Output "Writing to file $scriptroot/../data/killstats/$($match.id)_$player_name.json" $savekillstats | ConvertTo-Json | out-file "$scriptroot/../data/killstats/$($match.id)_$player_name.json" @@ -181,7 +181,7 @@ function Get-MatchStatsPlayer { if ($MatchType) { $filterProperty = 'matchType' } - $alives = (($killstats.stats | where-object { $_.playername -eq $player -and $_.$filterProperty -like $typemodevalue }).alive | Measure-Object -sum).sum + #$alives = (($killstats.stats | where-object { $_.playername -eq $player -and $_.$filterProperty -like $typemodevalue }).deathType | Measure-Object -sum).sum $deaths = (($killstats.stats | where-object { $_.playername -eq $player -and $_.$filterProperty -like $typemodevalue }).deaths | Measure-Object -sum).sum $kills = (($killstats.stats | where-object { $_.playername -eq $player -and $_.$filterProperty -like $typemodevalue }).kills | Measure-Object -sum).sum $dbno = (($killstats.stats | where-object { $_.playername -eq $player -and $_.$filterProperty -like $typemodevalue }).dbno | Measure-Object -sum).sum @@ -200,6 +200,7 @@ function Get-MatchStatsPlayer { write-host $change $MatchStatsPlayer += [PSCustomObject]@{ + alives = $alives playername = $player deaths = $deaths kills = $kills From 76e758d527e36daaabb1ca68e625ef58f4724584 Mon Sep 17 00:00:00 2001 From: Lanta Date: Tue, 16 Jul 2024 22:44:51 +0200 Subject: [PATCH 3/8] death --- update/matchparser.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update/matchparser.ps1 b/update/matchparser.ps1 index a09c29f..798d18e 100644 --- a/update/matchparser.ps1 +++ b/update/matchparser.ps1 @@ -206,7 +206,7 @@ function Get-MatchStatsPlayer { kills = $kills humankills = $humankills matches = $player_matches - KD_H = $humankills / ($deaths + $alives) + KD_H = $humankills / $deaths KD_ALL = $kills / $deaths winratio = $winratio wins = $player_wins From 98f327466da367efa69ffb1eec89a2e6ff76e494 Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 17 Jul 2024 16:22:53 +0200 Subject: [PATCH 4/8] kd calculated per match --- update/matchparser.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/update/matchparser.ps1 b/update/matchparser.ps1 index 798d18e..34e4520 100644 --- a/update/matchparser.ps1 +++ b/update/matchparser.ps1 @@ -181,8 +181,8 @@ function Get-MatchStatsPlayer { if ($MatchType) { $filterProperty = 'matchType' } - #$alives = (($killstats.stats | where-object { $_.playername -eq $player -and $_.$filterProperty -like $typemodevalue }).deathType | Measure-Object -sum).sum - $deaths = (($killstats.stats | where-object { $_.playername -eq $player -and $_.$filterProperty -like $typemodevalue }).deaths | Measure-Object -sum).sum + $alives = (($killstats | where-object { $_.stats.playername -eq $player -and $_.stats.$filterProperty -like $typemodevalue }).deathType | where-object {$_ -eq 'alive'}).count + $deaths = (($killstats | where-object { $_.stats.playername -eq $player -and $_.stats.$filterProperty -like $typemodevalue }).deathType | where-object {$_ -ne 'alive'}).count $kills = (($killstats.stats | where-object { $_.playername -eq $player -and $_.$filterProperty -like $typemodevalue }).kills | Measure-Object -sum).sum $dbno = (($killstats.stats | where-object { $_.playername -eq $player -and $_.$filterProperty -like $typemodevalue }).dbno | Measure-Object -sum).sum $humankills = (($killstats.stats | where-object { $_.playername -eq $player -and $_.$filterProperty -like $typemodevalue }).humankills | Measure-Object -sum).sum @@ -206,8 +206,8 @@ function Get-MatchStatsPlayer { kills = $kills humankills = $humankills matches = $player_matches - KD_H = $humankills / $deaths - KD_ALL = $kills / $deaths + KD_H = $humankills / ($deaths + $alives) # KD_Human calculated per match (kills / (deaths + alives)) + KD_ALL = $kills / ($deaths + $alives) # KD_ALL calculated per match (kills / (deaths + alives)) winratio = $winratio wins = $player_wins dbno = $dbno From 29ffb7723fbd585649c165b66f144fef6e3d91c0 Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 17 Jul 2024 16:33:38 +0200 Subject: [PATCH 5/8] all not necesery --- last_stats.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/last_stats.php b/last_stats.php index 79bc9aa..f9e123a 100644 --- a/last_stats.php +++ b/last_stats.php @@ -27,9 +27,9 @@ $ogDescription = "Explore detailed player statistics over the past month includi } echo "
"; - if ($key == 'all') { - echo "Stats for $key (minimal 20 matches)"; - } + // if ($key == 'all') { + // echo "Stats for $key (minimal 20 matches)"; + // } if ($key == 'Intense') { echo "Stats for $key (minimal 8 matches)"; } @@ -65,9 +65,9 @@ $ogDescription = "Explore detailed player statistics over the past month includi continue; // Skip this iteration and move to the next } - if ($key == 'all' && $player_data['matches'] < 20) { - continue; - } + // if ($key == 'all' && $player_data['matches'] < 20) { + // continue; + // } if ($key == 'Intense' && $player_data['matches'] < 8) { continue; } From 3bd28d02994f9b14500b290a736418a5de4c53e9 Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 17 Jul 2024 16:35:30 +0200 Subject: [PATCH 6/8] skipp all --- last_stats.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/last_stats.php b/last_stats.php index f9e123a..43adfc0 100644 --- a/last_stats.php +++ b/last_stats.php @@ -65,9 +65,9 @@ $ogDescription = "Explore detailed player statistics over the past month includi continue; // Skip this iteration and move to the next } - // if ($key == 'all' && $player_data['matches'] < 20) { - // continue; - // } + if ($key == 'all' && $player_data['matches'] > 0) { #skip all + continue; + } if ($key == 'Intense' && $player_data['matches'] < 8) { continue; } From f6be19e681afeeddd84399cbea88d32a67e6782b Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 17 Jul 2024 16:36:13 +0200 Subject: [PATCH 7/8] 10000 --- last_stats.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/last_stats.php b/last_stats.php index 43adfc0..dc0c6ef 100644 --- a/last_stats.php +++ b/last_stats.php @@ -65,7 +65,7 @@ $ogDescription = "Explore detailed player statistics over the past month includi continue; // Skip this iteration and move to the next } - if ($key == 'all' && $player_data['matches'] > 0) { #skip all + if ($key == 'all' && $player_data['matches'] < 1000) { #skip all continue; } if ($key == 'Intense' && $player_data['matches'] < 8) { From 373513cc6a735c7c72db8c920f81851fef522f63 Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 17 Jul 2024 16:37:27 +0200 Subject: [PATCH 8/8] skip all --- last_stats.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/last_stats.php b/last_stats.php index dc0c6ef..edc2d7e 100644 --- a/last_stats.php +++ b/last_stats.php @@ -25,6 +25,9 @@ $ogDescription = "Explore detailed player statistics over the past month includi if ($key == 'updated') { continue; } + if ($key == 'all') { + continue; + } echo "
"; // if ($key == 'all') { @@ -65,7 +68,7 @@ $ogDescription = "Explore detailed player statistics over the past month includi continue; // Skip this iteration and move to the next } - if ($key == 'all' && $player_data['matches'] < 1000) { #skip all + if ($key == 'all' && $player_data['matches'] < 20) { continue; } if ($key == 'Intense' && $player_data['matches'] < 8) {