commit
355f2e8868
3 changed files with 18 additions and 5 deletions
|
|
@ -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
|
$match_stats = Invoke-RestMethod -Uri "https://api.pubg.com/shards/steam/matches/$winid" -Method GET -Headers $headers
|
||||||
if ($winmatches[0].gameMode -eq 'tdm' ) {
|
if ($winmatches[0].gameMode -eq 'tdm' ) {
|
||||||
continue
|
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
|
} #skip tdm matches
|
||||||
if ($winmatches[0].matchType -eq 'custom') {
|
if ($winmatches[0].matchType -eq 'custom') {
|
||||||
$players_to_report = $match_stats.included.attributes.stats | where-object { $_.playerId -notlike "ai.*" }
|
$players_to_report = $match_stats.included.attributes.stats | where-object { $_.playerId -notlike "ai.*" }
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,11 @@ foreach ($player in $player_data) {
|
||||||
$stats.included = $sortedStats
|
$stats.included = $sortedStats
|
||||||
$stats | ConvertTo-Json -Depth 100 | Out-File "$scriptroot/../data/matches/$match.json"
|
$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'){
|
if (
|
||||||
write-output 'Skipping because of event'
|
($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
|
continue
|
||||||
}
|
}
|
||||||
$playermatches += [PSCustomObject]@{
|
$playermatches += [PSCustomObject]@{
|
||||||
|
|
|
||||||
|
|
@ -162,8 +162,11 @@ $last_month = (get-date).AddMonths($monthsback)
|
||||||
foreach ($file in $matchfiles) {
|
foreach ($file in $matchfiles) {
|
||||||
$json = get-content $file | ConvertFrom-Json
|
$json = get-content $file | ConvertFrom-Json
|
||||||
|
|
||||||
if($json.stats.matchType -eq 'event' -or $json.stats.gameMode -eq 'tdm'){
|
if (
|
||||||
write-output 'match is event or tdm skipping'
|
($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
|
continue
|
||||||
}
|
}
|
||||||
if ($json.created -gt $last_month) {
|
if ($json.created -gt $last_month) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue