From 340cce84f0f18965f60ca469292338436a1fc909 Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Tue, 11 Jan 2022 06:29:24 -0500 Subject: [PATCH] fix: parse "points" for final score --- app/Models/GameTeam.php | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/app/Models/GameTeam.php b/app/Models/GameTeam.php index c3716c2a..aac464c5 100644 --- a/app/Models/GameTeam.php +++ b/app/Models/GameTeam.php @@ -83,25 +83,13 @@ public static function fromHaloDotApi(array $payload): ?self $gameTeam->score = Arr::get($payload, 'stats.core.score'); // We are going to check what type of category this is to extract the mode specific final value - // This is like kills for slayer, rounds won in Oddball & points in Strongholds. switch ($game->category->name) { - case 'Slayer': - $key = 'stats.core.summary.kills'; - break; - - case 'Strongholds': - $key = 'stats.mode.zones.occupation.duration.seconds'; - break; - - case 'CTF': - $key = 'stats.mode.flags.captures.total'; + case 'Oddball': + $key = 'stats.core.rounds.won'; break; - case 'Total Control': - case 'Stockpile': - case 'Oddball': default: - $key = 'stats.core.rounds.won'; + $key = 'stats.core.points'; break; }