From 1bc70cf2892b12eb818ec236a79e66e1cc86eae0 Mon Sep 17 00:00:00 2001 From: Thijs Stobbelaar Date: Mon, 6 Nov 2023 13:31:14 +0100 Subject: [PATCH 1/4] last 30 days --- update/matchparser.ps1 | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/update/matchparser.ps1 b/update/matchparser.ps1 index 651d7bc..12114e3 100644 --- a/update/matchparser.ps1 +++ b/update/matchparser.ps1 @@ -69,7 +69,7 @@ else { $all_player_matches = get-content "$scriptroot/../data/player_matches.json" | convertfrom-json -Depth 100 -$killstats = @() + $i = 0 foreach ($player in $all_player_matches) { @@ -108,12 +108,23 @@ foreach ($player in $all_player_matches) { winplace = (($all_player_matches | where-object { $_.playername -eq $player_name } ).player_matches | where-object {$_.id -eq $match.id}).stats.winplace } $savekillstats | ConvertTo-Json | out-file "$scriptroot/../data/killstats/$($match.id)_$player_name.json" - $killstats += $killstat + } else{ - write-output "match $($match.id) already in cache" - $killstats += (get-content "$scriptroot/../data/killstats/$($match.id)_$player_name.json" | ConvertFrom-Json).stats + Write-Output "$($match.id) already in cache" } + } +} +$killstats = @() +$matchfiles = Get-ChildItem "$scriptroot/../data/killstats/" -File -Filter *.json +$last_month = (get-date).AddMonths(-1) +foreach($file in $matchfiles){ + $json = get-content $file | ConvertFrom-Json + if($json.created -gt $last_month){ + $killstats += $json.stats + }else{ + write-output "Archiveing $($file.name)" + Move-Item -Path $file.FullName -Destination "$scriptroot/../data/killstats/archive" -Force } } From 33a7e8d3b778d31ceb581d653a1ad27e28c89190 Mon Sep 17 00:00:00 2001 From: Thijs Stobbelaar Date: Mon, 6 Nov 2023 13:31:56 +0100 Subject: [PATCH 2/4] last month --- last_stats.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/last_stats.php b/last_stats.php index 8960920..7be0956 100644 --- a/last_stats.php +++ b/last_stats.php @@ -17,7 +17,7 @@ error_reporting(E_ALL);
-

Player Stats past 14 days

+

Player Stats past 30 days

Date: Mon, 6 Nov 2023 13:33:52 +0100 Subject: [PATCH 3/4] maandelijks --- discord/report_to_discord.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/report_to_discord.ps1 b/discord/report_to_discord.ps1 index d3e2b2f..2811502 100644 --- a/discord/report_to_discord.ps1 +++ b/discord/report_to_discord.ps1 @@ -56,7 +56,7 @@ $most_matches = @{ } $content = " -:rocket: Het 2 wekelijkse raportje :rocket: +:rocket: Het maandelijks raportje :rocket: Hey toppers! From 4db85b71389b9a177cdad8404d0c8182efa7d36a Mon Sep 17 00:00:00 2001 From: Thijs Stobbelaar Date: Mon, 6 Nov 2023 13:34:41 +0100 Subject: [PATCH 4/4] laatste maand --- includes/navigation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/navigation.php b/includes/navigation.php index 20624c7..fa0ef1f 100644 --- a/includes/navigation.php +++ b/includes/navigation.php @@ -14,7 +14,7 @@ if ($host == 'dev.dtch.online') { Top10 Match % T10 Last Matches - Last 14 days % + Last month %