From c353bb227b3029c576ba6f756226ad07912cb033 Mon Sep 17 00:00:00 2001 From: Kalane Date: Tue, 14 Sep 2021 01:19:47 +0200 Subject: [PATCH] feat(basic-matches): add runes --- client/src/helpers/summoner.js | 9 ++++++++- server-v2/app/Parsers/MatchParser.ts | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/client/src/helpers/summoner.js b/client/src/helpers/summoner.js index fd631a8..d191680 100644 --- a/client/src/helpers/summoner.js +++ b/client/src/helpers/summoner.js @@ -1,6 +1,7 @@ -import { secToTime, timeDifference } from '@/helpers/functions.js' +import { createCDragonAssetUrl, secToTime, timeDifference } from '@/helpers/functions.js' import { maps, gameModes } from '@/data/data.js' import summonerSpells from '@/data/summonerSpells.json' +import store from '@/store' const leaguesNumbers = { 'I': 1, 'II': 2, 'III': 3, 'IV': 4 } @@ -10,6 +11,12 @@ const leaguesNumbers = { 'I': 1, 'II': 2, 'III': 3, 'IV': 4 } */ export function createMatchData(matches) { for (const match of matches) { + // Runes + const primaryRune = match.perks.selected.length ? store.state.cdragon.runes.perks[match.perks.selected[0]] : null + const secondaryRune = store.state.cdragon.runes.perkstyles[match.perks.secondaryStyle] + match.primaryRune = primaryRune ? createCDragonAssetUrl(primaryRune.icon) : null + match.secondaryRune = secondaryRune ? createCDragonAssetUrl(secondaryRune.icon) : null + const date = new Date(match.date) const dateOptions = { day: '2-digit', month: '2-digit', year: 'numeric' } const timeOptions = { hour12: false, hour: '2-digit', minute: '2-digit' } diff --git a/server-v2/app/Parsers/MatchParser.ts b/server-v2/app/Parsers/MatchParser.ts index c7782fc..6271301 100644 --- a/server-v2/app/Parsers/MatchParser.ts +++ b/server-v2/app/Parsers/MatchParser.ts @@ -114,7 +114,7 @@ class MatchParser { time_spent_living: player.longestTimeSpentLiving, perks_primary_style: primaryStyle!.style, perks_secondary_style: secondaryStyle!.style, - perks_selected: perksSelected, + perks_selected: perksSelected.concat(Object.values(player.perks.statPerks)), }) } await Database.table('match_players').multiInsert(matchPlayers)