Skip to content

Commit

Permalink
fix: filter out new FF + Undead from top ten (#1376)
Browse files Browse the repository at this point in the history
  • Loading branch information
iBotPeaches authored Jul 3, 2024
1 parent 60ea16b commit a2b1108
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
14 changes: 9 additions & 5 deletions app/Models/Player.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,20 +288,24 @@ public function updateFromDotApi(bool $forceUpdate = false, ?string $type = null

$client->careerRank($this);

// We will ignore Firefight from this calculation as FF medals are ignored in the Service Record.
// Thus including FF matches would skew the data in detection of a "Bot Farmer".
$firefightUuids = [
// We will ignore Firefight (+ others) from this calculation as those medals are ignored in the Service Record.
// Thus including these matches would skew the data in detection of a "Bot Farmer".
$skippedPlaylistUuids = [
config('services.halo.playlists.survive-the-dead'),
config('services.halo.playlists.firefight-koth'),
config('services.halo.playlists.firefight-heroic'),
config('services.halo.playlists.firefight-legendary'),
config('services.halo.playlists.firefight-grunt-koth'),
config('services.halo.playlists.firefight-grunt-heroic'),
config('services.halo.playlists.firefight-grunt-legendary'),
config('services.halo.playlists.firefight-composer-normal'),
config('services.halo.playlists.firefight-composer-heroic'),
config('services.halo.playlists.firefight-composer-legendary'),
];

$firefightIds = Playlist::query()
->select('id')
->whereIn('uuid', $firefightUuids)
->whereIn('uuid', $skippedPlaylistUuids)
->get()
->pluck('id');

Expand All @@ -320,7 +324,7 @@ public function updateFromDotApi(bool $forceUpdate = false, ?string $type = null
->groupBy('games.playlist_id')
->get();

// We now filter out Firefight playlists from the breakdown.
// We now filter out skipped playlists from the breakdown.
$playlistBreakdown = $playlistBreakdown->filter(function (\stdClass $row) use ($firefightIds) {
return ! $firefightIds->contains($row->playlist_id);
});
Expand Down
3 changes: 3 additions & 0 deletions app/Support/Analytics/BaseGameStat.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ public function getPlaylistsToIgnore(): array
config('services.halo.playlists.firefight-grunt-koth'),
config('services.halo.playlists.firefight-grunt-heroic'),
config('services.halo.playlists.firefight-grunt-legendary'),
config('services.halo.playlists.firefight-composer-normal'),
config('services.halo.playlists.firefight-composer-heroic'),
config('services.halo.playlists.firefight-composer-legendary'),
];
}
}
4 changes: 4 additions & 0 deletions config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,16 @@
'halo' => [
'playlists' => [
'bot-bootcamp' => env('HALO_PLAYLISTS_BOT_BOOTCAMP', 'a446725e-b281-414c-a21e-31b8700e95a1'),
'survive-the-dead' => env('HALO_PLAYLISTS_SURVIVE_THE_DEAD', '3089c3e1-dafa-42a0-98ed-f29948f344a7'),
'firefight-koth' => env('HALO_PLAYLISTS_FF_KOTH', '96aedf55-1c7e-46d5-bdaf-19a1329fb95d'),
'firefight-heroic' => env('HALO_PLAYLISTS_FF_HEROIC', 'd8ac67e8-647c-4602-8af0-f42012ba8dd8'),
'firefight-legendary' => env('HALO_PLAYLISTS_FF_LEGENDARY', '759021fe-1d82-470f-a2e6-e431300b384b'),
'firefight-grunt-koth' => env('HALO_PLAYLISTS_FF_GRUNT_KOTH', 'e3a9b265-5883-4248-afde-37abafc122ab'),
'firefight-grunt-heroic' => env('HALO_PLAYLISTS_FF_GRUNT_HEROIC', '78b10320-8bc4-491b-a3d5-80fa1ca847f8'),
'firefight-grunt-legendary' => env('HALO_PLAYLISTS_FF_GRUNT_LEGENDARY', '014f22c9-1ed1-4cfd-9e3a-c1b744d78d8c'),
'firefight-composer-normal' => env('HALO_PLAYLISTS_FF_COMPOSER_NORMAL', '1f58f2e2-324d-4770-bca7-e36c63662626'),
'firefight-composer-heroic' => env('HALO_PLAYLISTS_FF_COMPOSER_HEROIC', '4ec3a07b-edec-4fdd-aa7e-668dc6398ac2'),
'firefight-composer-legendary' => env('HALO_PLAYLISTS_FF_COMPOSER_LEGENDARY', 'd3c44874-7f46-4f8b-b9a8-92db24cf807e'),
],
'botfarmer_threshold' => env('HALO_BOTFARMER_THRESHOLD', .50),
],
Expand Down

0 comments on commit a2b1108

Please sign in to comment.