From c4ed5551ae4570e17b858b1dff3794aaecc11c73 Mon Sep 17 00:00:00 2001 From: Lanta Date: Fri, 17 Oct 2025 13:37:34 +0200 Subject: [PATCH 1/2] tdm --- discord/report_new_matches.ps1 | 9 ++++++++- update/matchparser.ps1 | 7 +++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/discord/report_new_matches.ps1 b/discord/report_new_matches.ps1 index 8b7e97e..d631d09 100644 --- a/discord/report_new_matches.ps1 +++ b/discord/report_new_matches.ps1 @@ -252,6 +252,13 @@ foreach ($winid in $new_win_matches) { $match_stats = Invoke-RestMethod -Uri "https://api.pubg.com/shards/steam/matches/$winid" -Method GET -Headers $headers if ($winmatches[0].gameMode -eq 'tdm' ) { continue + } + if ( + ($winmatches[0].matchtype -eq 'event' -and $winmatches[0].gameMode -ne 'ibr') -or + ($winmatches[0].gameMode -eq 'tdm') + ) { + Write-Output 'Skipping because of event or tdm' + continue } #skip tdm matches if ($winmatches[0].matchType -eq 'custom') { $players_to_report = $match_stats.included.attributes.stats | where-object { $_.playerId -notlike "ai.*" } @@ -263,7 +270,7 @@ foreach ($winid in $new_win_matches) { if ($new_win_matches.count -le 10) { #fail safe $winnerswithurl = @() - foreach($winner in $winners){ + foreach ($winner in $winners) { $winnerswithurl += "[$winner]()" } send-discord -content ":chicken: :chicken: **WINNER WINNER CHICKEN DINNER!!** :chicken: :chicken:" diff --git a/update/matchparser.ps1 b/update/matchparser.ps1 index 41b960a..f77dc3c 100644 --- a/update/matchparser.ps1 +++ b/update/matchparser.ps1 @@ -162,8 +162,11 @@ $last_month = (get-date).AddMonths($monthsback) foreach ($file in $matchfiles) { $json = get-content $file | ConvertFrom-Json - if($json.stats.matchType -eq 'event' -or $json.stats.gameMode -eq 'tdm'){ - write-output 'match is event or tdm skipping' + if ( + ($stats.data.attributes.matchtype -eq 'event' -and $stats.data.attributes.gameMode -ne 'ibr') -or + ($stats.data.attributes.gameMode -eq 'tdm') + ) { + Write-Output 'Skipping because of event or tdm' continue } if ($json.created -gt $last_month) { From ca8ae31e9ec627d4f9d2f54312da2471ebee3ff2 Mon Sep 17 00:00:00 2001 From: Lanta Date: Fri, 17 Oct 2025 13:37:45 +0200 Subject: [PATCH 2/2] win filter --- update/get_matches.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/update/get_matches.ps1 b/update/get_matches.ps1 index 5692223..d999ea6 100644 --- a/update/get_matches.ps1 +++ b/update/get_matches.ps1 @@ -48,8 +48,11 @@ foreach ($player in $player_data) { $stats.included = $sortedStats $stats | ConvertTo-Json -Depth 100 | Out-File "$scriptroot/../data/matches/$match.json" } - if($stats.data.attributes.matchtype -eq 'event' -or $stats.data.attributes.gameMode -eq 'tdm'){ - write-output 'Skipping because of event' + if ( + ($stats.data.attributes.matchtype -eq 'event' -and $stats.data.attributes.gameMode -ne 'ibr') -or + ($stats.data.attributes.gameMode -eq 'tdm') + ) { + Write-Output 'Skipping because of event or tdm' continue } $playermatches += [PSCustomObject]@{