황성연

대전기록 이미지 불러오기

...@@ -241,7 +241,7 @@ module.exports = function(app){ ...@@ -241,7 +241,7 @@ module.exports = function(app){
241 var spec_selectedChamp_image = new Array(); 241 var spec_selectedChamp_image = new Array();
242 var spec_summonerName = new Array(); 242 var spec_summonerName = new Array();
243 var spec_spellId = new Array(); 243 var spec_spellId = new Array();
244 - var spec_spellimage = new Array(); 244 + var spec_spell_image = new Array();
245 for(var i=0; i<10; i++){ 245 for(var i=0; i<10; i++){
246 spec_summonerName.push(spec_participants[i].summonerName); 246 spec_summonerName.push(spec_participants[i].summonerName);
247 spec_spellId.push(spec_participants[i].spell1Id); 247 spec_spellId.push(spec_participants[i].spell1Id);
...@@ -262,7 +262,7 @@ module.exports = function(app){ ...@@ -262,7 +262,7 @@ module.exports = function(app){
262 for(var i=0; i<20; i++) { 262 for(var i=0; i<20; i++) {
263 for(key in spell){ 263 for(key in spell){
264 if(spell.hasOwnProperty(key) && spell[key].key == spec_spellId[i]){ 264 if(spell.hasOwnProperty(key) && spell[key].key == spec_spellId[i]){
265 - spec_spellimage.push("http://ddragon.leagueoflegends.com/cdn/10.12.1/img/spell/"+spell[key].id+".png"); 265 + spec_spell_image.push("http://ddragon.leagueoflegends.com/cdn/10.12.1/img/spell/"+spell[key].id+".png");
266 } 266 }
267 } 267 }
268 } 268 }
...@@ -295,11 +295,12 @@ module.exports = function(app){ ...@@ -295,11 +295,12 @@ module.exports = function(app){
295 var match1_selectedChamp = new Array(); 295 var match1_selectedChamp = new Array();
296 var match1_spellId = new Array(); 296 var match1_spellId = new Array();
297 var match1_summonerName = new Array(); 297 var match1_summonerName = new Array();
298 - var match1_kills = new Array();
299 - var match1_deaths = new Array();
300 - var match1_assists = new Array();
301 var match1_kda = new Array(); 298 var match1_kda = new Array();
302 299
300 + var match1_bannedChamp_image = new Array();
301 + var match1_selectedChamp_image = new Array();
302 + var match1_spell_image = new Array();
303 +
303 for(var i=0; i<2; i++){ 304 for(var i=0; i<2; i++){
304 var temp = match1_teams[i].bans; 305 var temp = match1_teams[i].bans;
305 for(var j=0; j<5; j++){ 306 for(var j=0; j<5; j++){
...@@ -312,9 +313,6 @@ module.exports = function(app){ ...@@ -312,9 +313,6 @@ module.exports = function(app){
312 match1_spellId.push(match1_participants[i].spell1Id); 313 match1_spellId.push(match1_participants[i].spell1Id);
313 match1_spellId.push(match1_participants[i].spell2Id); 314 match1_spellId.push(match1_participants[i].spell2Id);
314 match1_summonerName.push((match1_participantIdentities[i].player).summonerName); 315 match1_summonerName.push((match1_participantIdentities[i].player).summonerName);
315 - match1_kills.push((match1_participants[i].stats).kills);
316 - match1_deaths.push((match1_participants[i].stats).deaths);
317 - match1_assists.push((match1_participants[i].stats).assists);
318 var obj = { 316 var obj = {
319 'k' : (match1_participants[i].stats).kills, 317 'k' : (match1_participants[i].stats).kills,
320 'd' : (match1_participants[i].stats).deaths, 318 'd' : (match1_participants[i].stats).deaths,
...@@ -324,7 +322,27 @@ module.exports = function(app){ ...@@ -324,7 +322,27 @@ module.exports = function(app){
324 } 322 }
325 console.log(match1_kda); 323 console.log(match1_kda);
326 324
327 - 325 + for(var i=0; i<10; i++) {
326 + for(key in champion) {
327 + if(champion.hasOwnProperty(key) && champion[key].key == match1_bannedChamp[i]) {
328 + match1_bannedChamp_image.push("http://ddragon.leagueoflegends.com/cdn/10.11.1/img/champion/"+champion[key].id+".png");
329 + }
330 + if(champion.hasOwnProperty(key) && champion[key].key == match1_selectedChamp[i]) {
331 + match1_selectedChamp_image.push("http://ddragon.leagueoflegends.com/cdn/10.11.1/img/champion/"+champion[key].id+".png");
332 + }
333 + }
334 + }
335 +
336 + for(var i=0; i<20; i++) {
337 + for(key in spell){
338 + if(spell.hasOwnProperty(key) && spell[key].key == match1_spellId[i]){
339 + match1_spell_image.push("http://ddragon.leagueoflegends.com/cdn/10.12.1/img/spell/"+spell[key].id+".png");
340 + }
341 + }
342 + }
343 + console.log(match1_bannedChamp_image);
344 + console.log(match1_selectedChamp_image);
345 + console.log(match1_spell_image);
328 346
329 347
330 var match2Url = "https://kr.api.riotgames.com/lol/match/v4/matches/" + match_gameId[1] + "?api_key=" + apikey; 348 var match2Url = "https://kr.api.riotgames.com/lol/match/v4/matches/" + match_gameId[1] + "?api_key=" + apikey;
......