save killstats and some interface things #81

Merged
OpzekerIT merged 5 commits from dev into main 2023-11-06 08:58:49 +00:00
2 changed files with 34 additions and 9 deletions

View file

@ -63,21 +63,35 @@ header .banner {
header, main, footer {
max-width: 1200px;
min-width: 800px;
margin: 5px 5px;
margin: 5px auto;
padding: 10px;
border: 1px solid rgb(255, 255, 255);
border-radius: 10px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
header h1, section h2 {
header h1 {
border-bottom: 1px solid white;
margin-bottom: 10px;
padding-bottom: 5px;
font-family: 'Bungee Spice'
font-family: 'Bungee Spice';
text-align: center; /* Centers the text horizontally */
margin-left: auto;
margin-right: auto;
}
section h2 {
border-bottom: 1px solid white;
margin-bottom: 10px;
padding-bottom: 5px;
font-family: 'Bungee Spice';
text-align: center; /* Centers the text horizontally */
margin-left: auto;
margin-right: auto;
}
footer {
text-align: center;
}

View file

@ -47,10 +47,12 @@ function get-killstats {
}
}
# Get the latest file in the directory by last modification time
try { $latestFile = Get-ChildItem -Path "$scriptroot/../data/archive/" -File -ErrorAction Stop | Sort-Object LastWriteTime -Descending | Select-Object -First 1
Write-Output "Found file $($latestFile.FullName)"
try {
$latestFile = Get-ChildItem -Path "$scriptroot/../data/archive/" -File -ErrorAction Stop | Sort-Object LastWriteTime -Descending | Select-Object -First 1
Write-Output "Found file $($latestFile.FullName)"
} catch {
}
catch {
$latestFile = @()
}
@ -70,7 +72,7 @@ $all_player_matches = get-content "$scriptroot/../data/player_matches.json" | c
$killstats = @()
$i = 0
foreach ($player in ($all_player_matches)) {
foreach ($player in $all_player_matches) {
if ($player.psobject.properties.name -eq 'new_win_matches') {
continue
}
@ -96,7 +98,16 @@ foreach ($player in ($all_player_matches)) {
}
write-output "Analyzing for player $player_name telemetry: $($match.telemetry_url)"
$killstats += get-killstats -player_name $player_name -telemetry ($telemetry | where-object { $_._T -eq 'LOGPLAYERKILLV2' }) -gameMode $match.gameMode -matchType $match.matchType
$killstat = get-killstats -player_name $player_name -telemetry ($telemetry | where-object { $_._T -eq 'LOGPLAYERKILLV2' }) -gameMode $match.gameMode -matchType $match.matchType
$killstats += $killstat
if ($true) {
$savekillstats = @{
matchid = $match.id
created = $match.createdAt
stats = $killstat
}
$savekillstats | ConvertTo-Json | out-file "$scriptroot/../data/killstats/$($match.id).json"
}
}
}