Ranked+Refactor matchparser+logo800x800

This commit is contained in:
Thijs Stobbelaar 2023-11-20 10:54:59 +01:00
parent 792ec73ec9
commit 0acd8900b4
3 changed files with 57 additions and 182 deletions

BIN
images/logo800x800.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 KiB

View file

@ -15,6 +15,8 @@
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap" rel="stylesheet">
<meta property="og:title" content="DTCH CLAN"> <meta property="og:title" content="DTCH CLAN">
<meta property="og:description" content="DTCH CLAN STATS"> <meta property="og:description" content="DTCH CLAN STATS">
<meta property="og:image" content="https://dtch.online/images/logo.png"> <meta property="og:image:width" content="800">
<meta property="og:image:height" content="800">
<meta property="og:image" content="https://dtch.online/images/logo800x800.png" >
<script defer src="./lib/sorttable.js"></script> <script defer src="./lib/sorttable.js"></script>
</head> </head>

View file

@ -154,195 +154,67 @@ foreach ($file in $matchfiles) {
} }
} }
$playerstats_all = @()
foreach ($player in $all_player_matches.playername) {
if ($null -eq $player) {
continue
}
$deaths = (($killstats.stats | where-object { $_.playername -eq $player }).deaths | Measure-Object -sum).sum
$kills = (($killstats.stats | where-object { $_.playername -eq $player }).kills | Measure-Object -sum).sum
$dbno = (($killstats.stats | where-object { $_.playername -eq $player }).dbno | Measure-Object -sum).sum
$humankills = (($killstats.stats | where-object { $_.playername -eq $player }).humankills | Measure-Object -sum).sum
$player_matches = ($killstats.stats | where-object { $_.playername -eq $player }).count
$player_wins = ($killstats | where-object { $_.stats.playername -eq $player -and $_.winplace -eq 1 }).count
$winratio_old = (($oldstats.all | Where-Object { $_.playername -eq $player }).winratio)
$winratio = Get-winratio -player_wins $player_wins -player_matches $player_matches
$change = get-change -OldWinRatio $winratio_old -NewWinRatio $winratio
write-output 'all' function Get-MatchStatsPlayer {
write-output "Calculating for player $player" param (
write-output "new winratio $winratio" [switch] $GameMode,
write-output "Old winratio $winratio_old" [switch] $MatchType,
write-output $change [string] $typemodevalue,
[array] $playernames
)
$playerstats_all += [PSCustomObject]@{ $MatchStatsPlayer = @()
playername = $player foreach ($player in $playernames) {
deaths = $deaths if ($null -eq $player) {
kills = $kills continue
humankills = $humankills }
matches = $player_matches if($GameMode){
KD_H = $humankills / $deaths $filterProperty = 'gameMode'
KD_ALL = $kills / $deaths }
winratio = $winratio if($MatchType){
wins = $player_wins $filterProperty = 'matchType'
dbno = $dbno }
change = $change $deaths = (($killstats.stats | where-object { $_.playername -eq $player -and $_.$filterProperty -like $typemodevalue }).deaths | Measure-Object -sum).sum
$kills = (($killstats.stats | where-object { $_.playername -eq $player -and $_.$filterProperty -like $typemodevalue }).kills | Measure-Object -sum).sum
} $dbno = (($killstats.stats | where-object { $_.playername -eq $player -and $_.$filterProperty -like $typemodevalue }).dbno | Measure-Object -sum).sum
} $humankills = (($killstats.stats | where-object { $_.playername -eq $player -and $_.$filterProperty -like $typemodevalue }).humankills | Measure-Object -sum).sum
$playerstats_all = $playerstats_all | Sort-Object winratio -Descending $player_matches = ($killstats.stats | where-object { $_.playername -eq $player -and $_.$filterProperty -like $typemodevalue }).count
$player_wins = ($killstats | where-object { $_.stats.playername -eq $player -and $_.winplace -eq 1 -and $_.stats.$filterProperty -like $typemodevalue }).count
##IBR $winratio_old = (($oldstats.Intense | Where-Object { $_.playername -eq $player }).winratio)
$winratio = Get-winratio -player_wins $player_wins -player_matches $player_matches
$playerstats_event_ibr = @() $change = get-change -OldWinRatio $winratio_old -NewWinRatio $winratio
foreach ($player in $all_player_matches.playername) {
if ($null -eq $player) { write-host 'event'
continue write-host "Calculating for player $player"
} write-host "new winratio $winratio"
$deaths = (($killstats.stats | where-object { $_.playername -eq $player -and $_.gameMode -eq 'ibr' -and $_.matchType -eq 'event' }).deaths | Measure-Object -sum).sum write-host "Old winratio $winratio_old"
$kills = (($killstats.stats | where-object { $_.playername -eq $player -and $_.gameMode -eq 'ibr' -and $_.matchType -eq 'event' }).kills | Measure-Object -sum).sum write-host $change
$dbno = (($killstats.stats | where-object { $_.playername -eq $player -and $_.gameMode -eq 'ibr' -and $_.matchType -eq 'event' }).dbno | Measure-Object -sum).sum
$humankills = (($killstats.stats | where-object { $_.playername -eq $player -and $_.gameMode -eq 'ibr' -and $_.matchType -eq 'event' }).humankills | Measure-Object -sum).sum
$player_matches = ($killstats.stats | where-object { $_.playername -eq $player -and $_.gameMode -eq 'ibr' -and $_.matchType -eq 'event' }).count
$player_wins = ($killstats | where-object { $_.stats.playername -eq $player -and $_.winplace -eq 1 -and $_.stats.gameMode -eq 'ibr' -and $_.stats.matchType -eq 'event' }).count
$winratio_old = (($oldstats.Intense | Where-Object { $_.playername -eq $player }).winratio)
$winratio = Get-winratio -player_wins $player_wins -player_matches $player_matches
$change = get-change -OldWinRatio $winratio_old -NewWinRatio $winratio
write-output 'event' $MatchStatsPlayer += [PSCustomObject]@{
write-output "Calculating for player $player" playername = $player
write-output "new winratio $winratio" deaths = $deaths
write-output "Old winratio $winratio_old" kills = $kills
write-output $change humankills = $humankills
matches = $player_matches
$playerstats_event_ibr += [PSCustomObject]@{ KD_H = $humankills / $deaths
playername = $player KD_ALL = $kills / $deaths
deaths = $deaths winratio = $winratio
kills = $kills wins = $player_wins
humankills = $humankills dbno = $dbno
matches = $player_matches change = $change
KD_H = $humankills / $deaths }
KD_ALL = $kills / $deaths
winratio = $winratio
wins = $player_wins
dbno = $dbno
change = $change
} }
return $MatchStatsPlayer | Sort-Object winratio -Descending
} }
$playerstats_event_ibr = $playerstats_event_ibr | Sort-Object winratio -Descending
##airoyale
$playerstats_airoyale = @()
foreach ($player in $all_player_matches.playername) {
if ($null -eq $player) {
continue
}
$deaths = (($killstats.stats | where-object { $_.playername -eq $player -and $_.matchType -eq 'airoyale' }).deaths | Measure-Object -sum).sum
$kills = (($killstats.stats | where-object { $_.playername -eq $player -and $_.matchType -eq 'airoyale' }).kills | Measure-Object -sum).sum
$dbno = (($killstats.stats | where-object { $_.playername -eq $player -and $_.matchType -eq 'airoyale' }).dbno | Measure-Object -sum).sum
$humankills = (($killstats.stats | where-object { $_.playername -eq $player -and $_.matchType -eq 'airoyale' }).humankills | Measure-Object -sum).sum
$player_matches = ($killstats.stats | where-object { $_.playername -eq $player -and $_.matchType -eq 'airoyale' }).count
$player_wins = ($killstats | where-object { $_.stats.playername -eq $player -and $_.winplace -eq 1 -and $_.stats.matchType -eq 'airoyale' }).count
$winratio_old = (($oldstats.Casual | Where-Object { $_.playername -eq $player }).winratio)
$winratio = Get-winratio -player_wins $player_wins -player_matches $player_matches
$change = get-change -OldWinRatio $winratio_old -NewWinRatio $winratio
write-output 'airoyale'
write-output "Calculating for player $player"
write-output "new winratio $winratio"
write-output "Old winratio $winratio_old"
write-output $change
$playerstats_airoyale += [PSCustomObject]@{ $playerstats_event_ibr = Get-MatchStatsPlayer -GameMode -typemodevalue 'ibr' -playernames $all_player_matches.playername
playername = $player $playerstats_airoyale = Get-MatchStatsPlayer -MatchType -typemodevalue 'airoyale' -playernames $all_player_matches.playername
deaths = $deaths $playerstats_official = Get-MatchStatsPlayer -MatchType -typemodevalue 'official' -playernames $all_player_matches.playername
kills = $kills $playerstats_custom = Get-MatchStatsPlayer -MatchType -typemodevalue 'custom' -playernames $all_player_matches.playername
humankills = $humankills $playerstats_all = Get-MatchStatsPlayer -MatchType -typemodevalue '*' -playernames $all_player_matches.playername
matches = $player_matches $playerstats_ranked = Get-MatchStatsPlayer -MatchType -typemodevalue 'competitive' -playernames $all_player_matches.playername
KD_H = $humankills / $deaths
KD_ALL = $kills / $deaths
winratio = $winratio
wins = $player_wins
dbno = $dbno
change = $change
}
}
$playerstats_airoyale = $playerstats_airoyale | Sort-Object winratio -Descending
$playerstats_official = @()
foreach ($player in $all_player_matches.playername) {
if ($null -eq $player) {
continue
}
$deaths = (($killstats.stats | where-object { $_.playername -eq $player -and $_.matchType -eq 'official' }).deaths | Measure-Object -sum).sum
$kills = (($killstats.stats | where-object { $_.playername -eq $player -and $_.matchType -eq 'official' }).kills | Measure-Object -sum).sum
$dbno = (($killstats.stats | where-object { $_.playername -eq $player -and $_.matchType -eq 'official' }).dbno | Measure-Object -sum).sum
$humankills = (($killstats.stats | where-object { $_.playername -eq $player -and $_.matchType -eq 'official' }).humankills | Measure-Object -sum).sum
$player_matches = ($killstats.stats | where-object { $_.playername -eq $player -and $_.matchType -eq 'official' }).count
$player_wins = ($killstats | where-object { $_.stats.playername -eq $player -and $_.winplace -eq 1 -and $_.stats.matchType -eq 'official' }).count
$winratio_old = (($oldstats.official | Where-Object { $_.playername -eq $player }).winratio)
$winratio = Get-winratio -player_wins $player_wins -player_matches $player_matches
$change = get-change -OldWinRatio $winratio_old -NewWinRatio $winratio
write-output 'official'
write-output "Calculating for player $player"
write-output "new winratio $winratio"
write-output "Old winratio $winratio_old"
write-output $change
$playerstats_official += [PSCustomObject]@{
playername = $player
deaths = $deaths
kills = $kills
humankills = $humankills
matches = $player_matches
KD_H = $humankills / $deaths
KD_ALL = $kills / $deaths
winratio = $winratio
wins = $player_wins
dbno = $dbno
change = $change
}
}
$playerstats_official = $playerstats_official | Sort-Object winratio -Descending
##CUSTOM GAMES
$playerstats_custom = @()
foreach ($player in $all_player_matches.playername) {
if ($null -eq $player) {
continue
}
$deaths = (($killstats.stats | where-object { $_.playername -eq $player -and $_.matchType -eq 'custom' }).deaths | Measure-Object -sum).sum
$kills = (($killstats.stats | where-object { $_.playername -eq $player -and $_.matchType -eq 'custom' }).kills | Measure-Object -sum).sum
$dbno = (($killstats.stats | where-object { $_.playername -eq $player -and $_.matchType -eq 'custom' }).dbno | Measure-Object -sum).sum
$humankills = (($killstats.stats | where-object { $_.playername -eq $player -and $_.matchType -eq 'custom' }).humankills | Measure-Object -sum).sum
$player_matches = ($killstats.stats | where-object { $_.playername -eq $player -and $_.matchType -eq 'custom' }).count
$player_wins = ($killstats | where-object { $_.stats.playername -eq $player -and $_.winplace -eq 1 -and $_.stats.matchType -eq 'custom' }).count
$winratio_old = (($oldstats.custom | Where-Object { $_.playername -eq $player }).winratio)
$winratio = Get-winratio -player_wins $player_wins -player_matches $player_matches
$change = get-change -OldWinRatio $winratio_old -NewWinRatio $winratio
write-output 'custom'
write-output "Calculating for player $player"
write-output "new winratio $winratio"
write-output "Old winratio $winratio_old"
write-output $change
$playerstats_custom += [PSCustomObject]@{
playername = $player
deaths = $deaths
kills = $kills
humankills = $humankills
matches = $player_matches
KD_H = $humankills / $deaths
KD_ALL = $kills / $deaths
winratio = $winratio
wins = $player_wins
dbno = $dbno
change = $change
}
}
$playerstats_custom = $playerstats_custom | Sort-Object winratio -Descending $playerstats_custom = $playerstats_custom | Sort-Object winratio -Descending
$currentDateTime = Get-Date $currentDateTime = Get-Date
@ -362,6 +234,7 @@ $playerstats = [PSCustomObject]@{
official = $playerstats_official official = $playerstats_official
custom = $playerstats_custom custom = $playerstats_custom
updated = $formattedString updated = $formattedString
Ranked = $playerstats_ranked
} }
write-output "Writing file" write-output "Writing file"