Skip to content

Commit

Permalink
Added train to current map pool and fix logical bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
nhamonin committed Nov 16, 2024
1 parent b2912ad commit 42db81d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 2 additions & 0 deletions config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ const currentMapPool = [
'de_dust2',
'de_vertigo',
'de_anubis',
'de_train',
];
const allowedCompetitionNames = [
'5v5 RANKED',
'5v5 RANKED PREMIUM',
'COMPETITIVE 5v5',
'COMPETITIVE 5V5',
'CS2 5v5',
'Europe 5v5',
];
const lvlClasses = {
1: 'first',
Expand Down
Binary file added public/images/maps/de_train.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 13 additions & 5 deletions routes/faceitWebhook.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ async function handleMatchObjectCreated(data) {

const teams = matchData?.payload?.teams;

if (teams && teams[0]?.roster?.length && allowedCompetitionName) {
if (
matchData?.payload?.teams?.faction1 &&
matchData?.payload?.teams?.faction2 &&
allowedCompetitionName
) {
clearInterval(interval);

await updatePlayersInMatch(teams);
Expand Down Expand Up @@ -123,13 +127,17 @@ async function handleMatchStatusFinished(data) {

await performMapPickerAnalytics(match_id);

const teams = data?.payload?.teams;

if (!teams || !teams[0]?.roster?.length) {
if (
!matchData?.payload?.teams?.faction1?.roster?.length ||
!matchData?.payload?.teams?.faction2?.roster?.length
) {
return;
}

const playersRoster = [...teams[0]?.roster];
const playersRoster = [
...matchData.payload.teams.faction1.roster,
...matchData.payload.teams.faction2.roster,
];

const playerIDs = playersRoster.map(({ id }) => id);
const teamsToSendSummary = new Set();
Expand Down

0 comments on commit 42db81d

Please sign in to comment.