updates
This commit is contained in:
parent
246ab2be65
commit
59ef4d670c
2 changed files with 5 additions and 4 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
Start-Transcript -Path '/var/log/dtch/report_new_matches.log' -Append
|
Start-Transcript -Path '/var/log/dtch/report_new_matches.log' -Append
|
||||||
|
|
||||||
if ($PSScriptRoot.length -eq 0) {
|
if ($PSScriptRoot.length -eq 0) {
|
||||||
$scriptroot = Get-Location
|
$scriptroot = Get-Location
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,9 @@ else {
|
||||||
|
|
||||||
. $scriptroot\..\includes\ps1\lockfile.ps1
|
. $scriptroot\..\includes\ps1\lockfile.ps1
|
||||||
new-lock
|
new-lock
|
||||||
|
##SETTINGS
|
||||||
|
$monthsback = -1 # how many months back to look for matches
|
||||||
|
##END OF SETTINGS
|
||||||
function Get-Change {
|
function Get-Change {
|
||||||
param (
|
param (
|
||||||
[double]$OldWinRatio,
|
[double]$OldWinRatio,
|
||||||
|
|
@ -142,7 +143,7 @@ foreach ($player in $all_player_matches) {
|
||||||
|
|
||||||
$killstats = @()
|
$killstats = @()
|
||||||
$matchfiles = Get-ChildItem "$scriptroot/../data/killstats/" -File -Filter *.json
|
$matchfiles = Get-ChildItem "$scriptroot/../data/killstats/" -File -Filter *.json
|
||||||
$last_month = (get-date).AddMonths(-1)
|
$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.created -gt $last_month) {
|
if ($json.created -gt $last_month) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue