Ranked+Refactor matchparser+logo800x800+competitive table + per table minimal matchec adjustable #130

Merged
OpzekerIT merged 7 commits from dev into main 2023-11-20 10:23:39 +00:00
6 changed files with 95 additions and 193 deletions

View file

@ -25,7 +25,7 @@ jobs:
- name: Sync Files from ${{ github.ref }} - name: Sync Files from ${{ github.ref }}
uses: SamKirkland/web-deploy@v1 uses: SamKirkland/web-deploy@v1
with: with:
target-server: lanta.eu target-server: 86.93.122.67
remote-user: stats remote-user: stats
private-ssh-key: ${{ secrets.SSH_KEY }} private-ssh-key: ${{ secrets.SSH_KEY }}
destination-path: ${{ env.DESTINATION }} destination-path: ${{ env.DESTINATION }}

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

@ -14,7 +14,7 @@ error_reporting(E_ALL);
<?php <?php
include './includes/navigation.php'; include './includes/navigation.php';
include './includes/header.php'; include './includes/header.php';
?> ?>
<main> <main>
<section> <section>
@ -30,11 +30,24 @@ error_reporting(E_ALL);
} }
echo "<br>"; echo "<br>";
if($key == 'all'){ if ($key == 'all') {
echo "Stats for $key (minimal 20 matches)"; echo "Stats for $key (minimal 20 matches)";
}else{ }
if ($key == 'Intense') {
echo "Stats for $key (minimal 8 matches)"; echo "Stats for $key (minimal 8 matches)";
} }
if ($key == 'Casual') {
echo "Stats for $key (minimal 8 matches)";
}
if ($key == 'official') {
echo "Stats for $key (minimal 8 matches)";
}
if ($key == 'custom') {
echo "Stats for $key (minimal 8 matches)";
}
if ($key == 'Ranked') {
echo "Stats for $key (minimal 5 matches)";
}
echo "<table border='1' class='sortable'>"; echo "<table border='1' class='sortable'>";
echo "<tr> echo "<tr>
<th>Player</th> <th>Player</th>
@ -54,10 +67,23 @@ error_reporting(E_ALL);
if (!isset($player_data['playername']) || is_null($player_data['playername'])) { if (!isset($player_data['playername']) || is_null($player_data['playername'])) {
continue; // Skip this iteration and move to the next continue; // Skip this iteration and move to the next
} }
if ($player_data['matches'] < 8){
if ($key == 'all' && $player_data['matches'] < 20) {
continue; continue;
} }
if ($key == 'all' && $player_data['matches'] < 20) { if ($key == 'Intense' && $player_data['matches'] < 8) {
continue;
}
if ($key == 'Casual' && $player_data['matches'] < 8) {
continue;
}
if ($key == 'official' && $player_data['matches'] < 8) {
continue;
}
if ($key == 'custom' && $player_data['matches'] < 8) {
continue;
}
if ($key == 'Ranked' && $player_data['matches'] < 5) {
continue; continue;
} }

View file

@ -1 +1,2 @@
sup? sup?
#

View file

@ -154,195 +154,67 @@ foreach ($file in $matchfiles) {
} }
} }
$playerstats_all = @()
foreach ($player in $all_player_matches.playername) { function Get-MatchStatsPlayer {
if ($null -eq $player) { param (
continue [switch] $GameMode,
} [switch] $MatchType,
$deaths = (($killstats.stats | where-object { $_.playername -eq $player }).deaths | Measure-Object -sum).sum [string] $typemodevalue,
$kills = (($killstats.stats | where-object { $_.playername -eq $player }).kills | Measure-Object -sum).sum [array] $playernames
$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 $MatchStatsPlayer = @()
$player_matches = ($killstats.stats | where-object { $_.playername -eq $player }).count foreach ($player in $playernames) {
$player_wins = ($killstats | where-object { $_.stats.playername -eq $player -and $_.winplace -eq 1 }).count if ($null -eq $player) {
$winratio_old = (($oldstats.all | Where-Object { $_.playername -eq $player }).winratio) continue
$winratio = Get-winratio -player_wins $player_wins -player_matches $player_matches }
$change = get-change -OldWinRatio $winratio_old -NewWinRatio $winratio if($GameMode){
$filterProperty = 'gameMode'
write-output 'all' }
write-output "Calculating for player $player" if($MatchType){
write-output "new winratio $winratio" $filterProperty = 'matchType'
write-output "Old winratio $winratio_old" }
write-output $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
$playerstats_all += [PSCustomObject]@{ $humankills = (($killstats.stats | where-object { $_.playername -eq $player -and $_.$filterProperty -like $typemodevalue }).humankills | Measure-Object -sum).sum
playername = $player $player_matches = ($killstats.stats | where-object { $_.playername -eq $player -and $_.$filterProperty -like $typemodevalue }).count
deaths = $deaths $player_wins = ($killstats | where-object { $_.stats.playername -eq $player -and $_.winplace -eq 1 -and $_.stats.$filterProperty -like $typemodevalue }).count
kills = $kills $winratio_old = (($oldstats.Intense | Where-Object { $_.playername -eq $player }).winratio)
humankills = $humankills $winratio = Get-winratio -player_wins $player_wins -player_matches $player_matches
matches = $player_matches $change = get-change -OldWinRatio $winratio_old -NewWinRatio $winratio
KD_H = $humankills / $deaths
KD_ALL = $kills / $deaths write-host 'event'
winratio = $winratio write-host "Calculating for player $player"
wins = $player_wins write-host "new winratio $winratio"
dbno = $dbno write-host "Old winratio $winratio_old"
change = $change write-host $change
$MatchStatsPlayer += [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
}
} }
return $MatchStatsPlayer | Sort-Object winratio -Descending
} }
$playerstats_all = $playerstats_all | Sort-Object winratio -Descending
##IBR
$playerstats_event_ibr = @()
foreach ($player in $all_player_matches.playername) {
if ($null -eq $player) {
continue
}
$deaths = (($killstats.stats | where-object { $_.playername -eq $player -and $_.gameMode -eq 'ibr' -and $_.matchType -eq 'event' }).deaths | Measure-Object -sum).sum
$kills = (($killstats.stats | where-object { $_.playername -eq $player -and $_.gameMode -eq 'ibr' -and $_.matchType -eq 'event' }).kills | Measure-Object -sum).sum
$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'
write-output "Calculating for player $player"
write-output "new winratio $winratio"
write-output "Old winratio $winratio_old"
write-output $change
$playerstats_event_ibr += [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_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"