Dev #276

Merged
OpzekerIT merged 2 commits from dev into main 2025-10-17 11:39:18 +00:00
3 changed files with 18 additions and 5 deletions

View file

@ -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.*" }
@ -263,7 +270,7 @@ foreach ($winid in $new_win_matches) {
if ($new_win_matches.count -le 10) { if ($new_win_matches.count -le 10) {
#fail safe #fail safe
$winnerswithurl = @() $winnerswithurl = @()
foreach($winner in $winners){ foreach ($winner in $winners) {
$winnerswithurl += "[$winner](<https://dtch.online/latestmatches.php?selected_player=$($winner)>)" $winnerswithurl += "[$winner](<https://dtch.online/latestmatches.php?selected_player=$($winner)>)"
} }
send-discord -content ":chicken: :chicken: **WINNER WINNER CHICKEN DINNER!!** :chicken: :chicken:" send-discord -content ":chicken: :chicken: **WINNER WINNER CHICKEN DINNER!!** :chicken: :chicken:"

View file

@ -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]@{

View file

@ -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) {