Merge pull request #82 from OpzekerIT/dev

new matchparser + font
This commit is contained in:
Lanta 2023-11-06 11:27:16 +01:00 committed by GitHub
commit 495a535437
3 changed files with 26 additions and 22 deletions

View file

@ -8,7 +8,7 @@
<link rel="stylesheet" href="./includes/topnav.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="https://fonts.googleapis.com/css2?family=Bungee+Spice&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Dosis:wght@400;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;700&display=swap" rel="stylesheet">
<script src="./lib/sorttable.js"></script>

View file

@ -182,7 +182,7 @@ tr:hover {
/* Hacker theme styles */
body {
font-family: 'Dosis', monospace;
font-family: 'Noto Sans', monospace;
background: #0f0f0f; /* Dark background for hacker aesthetic */
color: #e69109; /* Bright green text, reminiscent of old terminals */
}

View file

@ -84,35 +84,39 @@ foreach ($player in $all_player_matches) {
$j++
write-output "$($player.player_matches.count)/ $j"
if (!(Test-Path -path "$scriptroot/../data/killstats/$($match.id)_$player_name.json" )) {
$telemetryfile = "$scriptroot/../data/telemetry_cache/$($match.telemetry_url.split("/")[-1])"
if (!(test-path -Path $telemetryfile)) {
write-output "Saving $telemetryfile"
$telemetry_content = (Invoke-WebRequest -Uri $match.telemetry_url).content
$telemetry_content | out-file $telemetryfile
$telemetry = $telemetry_content | ConvertFrom-Json
}
else {
write-output "Getting from cache $telemetryfile"
$telemetry = get-content $telemetryfile | convertfrom-json
}
write-output "Analyzing for player $player_name telemetry: $($match.telemetry_url)"
$killstat = get-killstats -player_name $player_name -telemetry ($telemetry | where-object { $_._T -eq 'LOGPLAYERKILLV2' }) -gameMode $match.gameMode -matchType $match.matchType
$telemetryfile = "$scriptroot/../data/telemetry_cache/$($match.telemetry_url.split("/")[-1])"
if (!(test-path -Path $telemetryfile)) {
write-output "Saving $telemetryfile"
$telemetry_content = (Invoke-WebRequest -Uri $match.telemetry_url).content
$telemetry_content | out-file $telemetryfile
$telemetry = $telemetry_content | ConvertFrom-Json
}
else {
write-output "Getting from cache $telemetryfile"
$telemetry = get-content $telemetryfile | convertfrom-json
}
write-output "Analyzing for player $player_name telemetry: $($match.telemetry_url)"
$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
winplace = (($all_player_matches | where-object { $_.playername -eq $player_name } ).player_matches | where-object {$_.id -eq $match.id}).stats.winplace
}
$savekillstats | ConvertTo-Json | out-file "$scriptroot/../data/killstats/$($match.id).json"
$savekillstats | ConvertTo-Json | out-file "$scriptroot/../data/killstats/$($match.id)_$player_name.json"
$killstats += $killstat
} else{
write-output "match $($match.id) already in cache"
$killstats += (get-content "$scriptroot/../data/killstats/$($match.id)_$player_name.json" | ConvertFrom-Json).stats
}
}
}
$playerstats_all = @()
foreach ($player in $all_player_matches.playername) {
if ($null -eq $player) {