Report losers #215
3 changed files with 20 additions and 9 deletions
|
|
@ -14,9 +14,9 @@ jobs:
|
|||
id: set-destination
|
||||
run: |
|
||||
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
|
||||
echo "DESTINATION=/Lantaeu/dtch/" >> $GITHUB_ENV
|
||||
echo "DESTINATION=/LantaeuSSD/dtch/" >> $GITHUB_ENV
|
||||
else
|
||||
echo "DESTINATION=/Lantaeu/dtch_dev/" >> $GITHUB_ENV
|
||||
echo "DESTINATION=/LantaeuSSD/dtch_dev/" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Checkout
|
||||
|
|
@ -25,6 +25,7 @@ jobs:
|
|||
- name: SFTP upload
|
||||
uses: Dylan700/sftp-upload-action@latest
|
||||
with:
|
||||
dry-run: false
|
||||
server: ${{secrets.SYNADDR}}
|
||||
username: ${{secrets.SYNUSR}}
|
||||
password: ${{secrets.SYNPASS}}
|
||||
|
|
@ -32,7 +33,6 @@ jobs:
|
|||
uploads: |
|
||||
./ => ${{ env.DESTINATION }}
|
||||
ignore: |
|
||||
*.git
|
||||
*/**/*git*
|
||||
.git
|
||||
config.php
|
||||
data/**/*.json
|
||||
|
|
@ -1,13 +1,21 @@
|
|||
Start-Transcript -Path '/var/log/dtch/report_new_matches.log' -Append
|
||||
|
||||
$logprefix = Get-Date -Format "ddMMyyyy_HHmmss"
|
||||
if ($PSScriptRoot.length -eq 0) {
|
||||
$scriptroot = Get-Location
|
||||
}
|
||||
else {
|
||||
$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
|
||||
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
|
||||
|
||||
|
|
@ -85,6 +93,8 @@ try {
|
|||
catch {
|
||||
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
|
||||
|
||||
# Gebruik nu de lijst van nieuwe verloren matches uit het JSON-bestand
|
||||
|
|
@ -123,10 +133,10 @@ foreach ($winid in $new_win_matches) {
|
|||
continue
|
||||
} #skip tdm matches
|
||||
if ($winmatches[0].matchType -eq 'custom') {
|
||||
$players_to_report = $match_stats.included.attributes.stats
|
||||
$players_to_report = $match_stats.included.attributes.stats | where-object { $_.playerId -notlike "ai.*" }
|
||||
}
|
||||
else {
|
||||
$players_to_report = ($match_stats.included.attributes.stats | where-object { $_.winplace -eq 1 })
|
||||
$players_to_report = $match_stats.included.attributes.stats | where-object { $_.winplace -eq 1 }
|
||||
}
|
||||
|
||||
if ($new_win_matches.count -le 10) {
|
||||
|
|
|
|||
1
logs/REAMD.MD
Normal file
1
logs/REAMD.MD
Normal file
|
|
@ -0,0 +1 @@
|
|||
Location for logs
|
||||
Loading…
Add table
Add a link
Reference in a new issue