Merge pull request #81 from OpzekerIT/dev

save killstats and some interface things
This commit is contained in:
Lanta 2023-11-06 09:58:48 +01:00 committed by GitHub
commit d9c5ef00de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 9 deletions

View file

@ -63,21 +63,35 @@ header .banner {
header, main, footer { header, main, footer {
max-width: 1200px; max-width: 1200px;
min-width: 800px; min-width: 800px;
margin: 5px 5px; margin: 5px auto;
padding: 10px; padding: 10px;
border: 1px solid rgb(255, 255, 255); border: 1px solid rgb(255, 255, 255);
border-radius: 10px; border-radius: 10px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
} }
header h1, section h2 { header h1 {
border-bottom: 1px solid white; border-bottom: 1px solid white;
margin-bottom: 10px; margin-bottom: 10px;
padding-bottom: 5px; 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 { footer {
text-align: center; text-align: center;
} }

View file

@ -47,10 +47,12 @@ function get-killstats {
} }
} }
# Get the latest file in the directory by last modification time # 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 try {
Write-Output "Found file $($latestFile.FullName)" $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 = @() $latestFile = @()
} }
@ -70,7 +72,7 @@ $all_player_matches = get-content "$scriptroot/../data/player_matches.json" | c
$killstats = @() $killstats = @()
$i = 0 $i = 0
foreach ($player in ($all_player_matches)) { foreach ($player in $all_player_matches) {
if ($player.psobject.properties.name -eq 'new_win_matches') { if ($player.psobject.properties.name -eq 'new_win_matches') {
continue continue
} }
@ -96,7 +98,16 @@ foreach ($player in ($all_player_matches)) {
} }
write-output "Analyzing for player $player_name telemetry: $($match.telemetry_url)" 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"
}
} }
} }