feat: add role identification in spellbook games

This commit is contained in:
Kalane 2021-12-11 19:30:04 +01:00
parent cdfdb814ca
commit e07ae8f359
2 changed files with 9 additions and 2 deletions

View file

@ -1,4 +1,4 @@
import { PlayerRole, queuesWithRole } from 'App/helpers' import { PlayerRole, queuesWithRole, smiteIds } from 'App/helpers'
import CDragonService from 'App/Services/CDragonService' import CDragonService from 'App/Services/CDragonService'
import { CurrentGameInfoDTO } from 'App/Services/Jax/src/Endpoints/SpectatorEndpoint' import { CurrentGameInfoDTO } from 'App/Services/Jax/src/Endpoints/SpectatorEndpoint'
import { RoleComposition } from 'App/Services/RoleIdentificationService' import { RoleComposition } from 'App/Services/RoleIdentificationService'
@ -25,7 +25,7 @@ class LiveMatchSerializer extends MatchSerializer {
liveMatch.participants.map((p) => { liveMatch.participants.map((p) => {
const playerRole = { const playerRole = {
champion: p.championId, champion: p.championId,
jungle: p.spell1Id === 11 || p.spell2Id === 11, jungle: smiteIds.includes(p.spell1Id) || smiteIds.includes(p.spell2Id),
} }
p.teamId === 100 ? blueTeam.push(playerRole) : redTeam.push(playerRole) p.teamId === 100 ? blueTeam.push(playerRole) : redTeam.push(playerRole)
}) })

View file

@ -69,6 +69,7 @@ export const queuesWithRole = [
430, // Blind, 430, // Blind,
440, // Flex 440, // Flex
700, // Clash 700, // Clash
1400, // Ultimate Spellbook
] ]
/** /**
@ -91,6 +92,12 @@ export const seasons = {
*/ */
export const supportItems = [3850, 3851, 3853, 3854, 3855, 3857, 3858, 3859, 3860, 3862, 3863, 3864] export const supportItems = [3850, 3851, 3853, 3854, 3855, 3857, 3858, 3859, 3860, 3862, 3863, 3864]
/**
* League of Legends summoner spell Smite ids
* Note: 55 is for Ultimate Spellbook gamemode
*/
export const smiteIds = [11, 55]
/** /**
* Get season number for a match * Get season number for a match
* @param timestamp * @param timestamp