Skip to content

Commit

Permalink
fix: parse "points" for final score
Browse files Browse the repository at this point in the history
  • Loading branch information
iBotPeaches committed Jan 11, 2022
1 parent 9ab63df commit 340cce8
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions app/Models/GameTeam.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 340cce8

Please sign in to comment.