From 4df489a5c3b7e643f1eab525476943479338718d Mon Sep 17 00:00:00 2001 From: Lanta Date: Thu, 18 Jul 2024 13:20:00 +0200 Subject: [PATCH 1/2] prep next phase --- update/matchparser.ps1 | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/update/matchparser.ps1 b/update/matchparser.ps1 index ab75901..68f1986 100644 --- a/update/matchparser.ps1 +++ b/update/matchparser.ps1 @@ -150,17 +150,27 @@ foreach ($player in $all_player_matches) { $killstats = @() $matchfiles = Get-ChildItem "$scriptroot/../data/killstats/" -File -Filter *.json -$killstats_only_full_clan_matches = @() +$killstats_clan_matches_gt_1 = @() +$killstats_clan_matches_gt_2 = @() +$killstats_clan_matches_gt_3 = @() $guids = $matchfiles.Name | ForEach-Object { $_.Split("_")[0] } -$groupedGuids_full_clan_matches = $guids | Group-Object | Where-Object { $_.Count -gt 1 } +$groupedGuids_clan_matches_gt_1 = $guids | Group-Object | Where-Object { $_.Count -gt 1 } +$groupedGuids_clan_matches_gt_2 = $guids | Group-Object | Where-Object { $_.Count -gt 2 } +$groupedGuids_clan_matches_gt_3 = $guids | Group-Object | Where-Object { $_.Count -gt 3 } $last_month = (get-date).AddMonths($monthsback) foreach ($file in $matchfiles) { $json = get-content $file | ConvertFrom-Json if ($json.created -gt $last_month) { $killstats += $json - if ($groupedGuids_full_clan_matches.Name -contains $json.matchid) { - $killstats_only_full_clan_matches += $json + if ($groupedGuids_clan_matches_gt_1.Name -contains $json.matchid) { + $killstats_clan_matches_gt_1 += $json + } + if ($groupedGuids_clan_matches_gt_2.Name -contains $json.matchid) { + $killstats_clan_matches_gt_2 += $json + } + if ($groupedGuids_clan_matches_gt_3.Name -contains $json.matchid) { + $killstats_clan_matches_gt_3 += $json } } else { @@ -241,7 +251,7 @@ $playerstats_custom = Get-MatchStatsPlayer -MatchType -typemodevalue 'custom' -p $playerstats_all = Get-MatchStatsPlayer -MatchType -typemodevalue '*' -playernames $all_player_matches.playername -friendlyname 'all' -killstats $killstats -sortstat 'randomkey' $playerstats_ranked = Get-MatchStatsPlayer -MatchType -typemodevalue 'competitive' -playernames $all_player_matches.playername -friendlyname 'Ranked' -killstats $killstats -sortstat 'randomkey' -$playerstats_airoyale_clan = Get-MatchStatsPlayer -MatchType -typemodevalue 'airoyale' -playernames $all_player_matches.playername -friendlyname 'Casual' -killstats $killstats_only_full_clan_matches -sortstat 'winratio' +$playerstats_airoyale_clan_gt_1 = Get-MatchStatsPlayer -MatchType -typemodevalue 'airoyale' -playernames $all_player_matches.playername -friendlyname 'Casual' -killstats $killstats_clan_matches_gt_1 -sortstat 'winratio' $playerstats_custom = $playerstats_custom | Sort-Object winratio -Descending @@ -256,14 +266,14 @@ $formattedString = "$currentDateTime - Time Zone: $currentTimezone" # Output the formatted string $playerstats = [PSCustomObject]@{ - all = $playerstats_all - clan_casual = $playerstats_airoyale_clan - Intense = $playerstats_event_ibr - Casual = $playerstats_airoyale - official = $playerstats_official - custom = $playerstats_custom - updated = $formattedString - Ranked = $playerstats_ranked + all = $playerstats_all + clan_casual = $playerstats_airoyale_clan_gt_1 + Intense = $playerstats_event_ibr + Casual = $playerstats_airoyale + official = $playerstats_official + custom = $playerstats_custom + updated = $formattedString + Ranked = $playerstats_ranked } From 618c36cb1815e8a6d8b75042480d49f9aea66778 Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 21 Aug 2024 14:53:32 +0200 Subject: [PATCH 2/2] skip tdm report --- discord/report_new_matches.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/discord/report_new_matches.ps1 b/discord/report_new_matches.ps1 index 2441836..91a2253 100644 --- a/discord/report_new_matches.ps1 +++ b/discord/report_new_matches.ps1 @@ -85,6 +85,9 @@ foreach ($winid in $new_win_matches) { $2D_replay_url = $2D_replay_url + "?follow=$($winners[0])" $match_stats = Invoke-RestMethod -Uri "https://api.pubg.com/shards/steam/matches/$winid" -Method GET -Headers $headers + if($winmatches[0].gameMode -eq 'tdm' ){ + continue + } #skip tdm matches if ($winmatches[0].matchType -eq 'custom') { $players_to_report = $match_stats.included.attributes.stats }