Dev #212

Merged
OpzekerIT merged 3 commits from dev into main 2025-04-03 09:38:14 +00:00

View file

@ -1,15 +1,21 @@
$logprefix = get-date -Format ddMMyyy_HHmmss $logprefix = Get-Date -Format "ddMMyyyy_HHmmss"
#up
Start-Transcript -Path "../logs/report_new_matches_$logprefix.log" -Append
if ($PSScriptRoot.length -eq 0) { if ($PSScriptRoot.length -eq 0) {
$scriptroot = Get-Location $scriptroot = Get-Location
} }
else { else {
$scriptroot = $PSScriptRoot $scriptroot = $PSScriptRoot
} }
$RelativeLogdir = Join-Path -Path $scriptroot -ChildPath "..\logs"
$logDir = (Resolve-Path -Path $RelativeLogdir).Path
Start-Transcript -Path "$logDir/report_new_matches_$logprefix.log" -Append
. $scriptroot\..\includes\ps1\lockfile.ps1 . $scriptroot\..\includes\ps1\lockfile.ps1
new-lock -by "report_new_matches" new-lock -by "report_new_matches"
write-output "Scriptroot: $scriptroot"
write-output "Scriptname: $($MyInvocation.MyCommand)"
write-output "Script: $($MyInvocation.MyCommand.Path)"
write-output "PSScriptroot: $PSScriptRoot"
write-output "Logdir: $logDir"
$fileContent = Get-Content -Path "$scriptroot/../config/config.php" -Raw $fileContent = Get-Content -Path "$scriptroot/../config/config.php" -Raw
@ -66,11 +72,14 @@ $map_map = @{
} }
try { try {
get-content "$scriptroot/../data/player_matches.json" #debug purposes
$player_matches = get-content "$scriptroot/../data/player_matches.json" | convertfrom-json -Depth 100 $player_matches = get-content "$scriptroot/../data/player_matches.json" | convertfrom-json -Depth 100
} }
catch { catch {
Write-Output 'Unable to read file exitin' Write-Output 'Unable to read file exitin'
} }
write-output $player_matches
Write-Output $new_win_matches
$new_win_matches = $player_matches[-1].new_win_matches $new_win_matches = $player_matches[-1].new_win_matches