From 2dd65a4b2c78ffcd90f8838ab2875e13d6805560 Mon Sep 17 00:00:00 2001 From: Thijs Stobbelaar Date: Tue, 14 Nov 2023 10:28:51 +0100 Subject: [PATCH] update --- update/matchparser.ps1 | 1 - update/update_clan_members.ps1 | 14 ++++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/update/matchparser.ps1 b/update/matchparser.ps1 index 13f6315..4345b9a 100644 --- a/update/matchparser.ps1 +++ b/update/matchparser.ps1 @@ -389,5 +389,4 @@ foreach ($file in $difference) { } write-output "Operation complete" remove-lock -$Error Stop-Transcript \ No newline at end of file diff --git a/update/update_clan_members.ps1 b/update/update_clan_members.ps1 index 3a95c70..fea573e 100644 --- a/update/update_clan_members.ps1 +++ b/update/update_clan_members.ps1 @@ -23,15 +23,10 @@ else { Write-Output "API Key not found" } -if ($fileContent -match "\`$clanmembers\s*=\s*array\(([^)]+)\)") { - # Remove quotes and split by comma to get individual members - $clanMembers = ($matches[1] -replace '"|\'', '' -split ","').replace(" ", "") - $clanMembersArray = $clanMembers.split(",").trim() - Write-Output "Clan Members: $($clanMembersArray -join ', ')" -} -else { - Write-Output "Clan members not found" -} + +$clanMembersArray = (get-content "$scriptroot/../config/clanmembers.json" | convertfrom-json).clanMembers +$clanMembers = $clanMembersArray -join ',' + if ($clanMembersArray.count -gt 10 ) { write-output "Currently not able to process more then 10 players" exit @@ -131,5 +126,4 @@ $lifetimestats['updated'] = $formattedString $lifetimestats | convertto-json -Depth 100 | out-file "$scriptroot/../data/player_lifetime_data.json" remove-lock -$Error Stop-Transcript \ No newline at end of file