황성연

MATCH-V4 api 추가

...@@ -128,9 +128,6 @@ module.exports = function(app){ ...@@ -128,9 +128,6 @@ module.exports = function(app){
128 } 128 }
129 } 129 }
130 } 130 }
131 - console.log(rotation_name);
132 -
133 - console.log("챔프길이:" + champ_count);
134 131
135 var userLeagueUrl = "https://kr.api.riotgames.com/lol/league/v4/entries/by-summoner/"+ urlenconde(id)+"?api_key=" + apikey; 132 var userLeagueUrl = "https://kr.api.riotgames.com/lol/league/v4/entries/by-summoner/"+ urlenconde(id)+"?api_key=" + apikey;
136 request(userLeagueUrl,function(error,response,body){ 133 request(userLeagueUrl,function(error,response,body){
...@@ -240,8 +237,6 @@ module.exports = function(app){ ...@@ -240,8 +237,6 @@ module.exports = function(app){
240 var spec_selectedChamp_image = new Array(); 237 var spec_selectedChamp_image = new Array();
241 238
242 for(var i=0; i<10; i++) { 239 for(var i=0; i<10; i++) {
243 - if((spec_bannedChamp[i]).championId == -1)
244 - continue;
245 240
246 for(var key in champion) { 241 for(var key in champion) {
247 if(champion.hasOwnProperty(key) && champion[key].key == spec_bannedChamp[i].championId) { 242 if(champion.hasOwnProperty(key) && champion[key].key == spec_bannedChamp[i].championId) {
...@@ -252,13 +247,26 @@ module.exports = function(app){ ...@@ -252,13 +247,26 @@ module.exports = function(app){
252 } 247 }
253 } 248 }
254 } 249 }
255 - console.log(spec_bannedChamp_image);
256 - console.log(spec_selectedChamp_image);
257 -
258 } 250 }
259 251
252 + var matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matchlists/by-account/" + accountId + "?api_key=" + apikey;
253 + request(matchUrl,function(error,response,body) {
254 + var match_json = JSON.parse(body).matches;
255 + console.log(match_json);
256 +
257 + var match_gameId = new Array();
258 + var match_mychamp = new Array();
259 +
260 + for(var i=0; i<10; i++){
261 + match_gameId.push(match_json[i].gameId);
262 + match_mychamp.push(match_json[i].champion);
263 + }
264 + console.log(match_gameId);
265 + console.log(match_mychamp);
266 +
260 267
261 268
269 +
262 270
263 271
264 272
...@@ -281,6 +289,7 @@ module.exports = function(app){ ...@@ -281,6 +289,7 @@ module.exports = function(app){
281 c_rank: rank, 289 c_rank: rank,
282 c_leaguePoint: leaguePoints 290 c_leaguePoint: leaguePoints
283 }); 291 });
292 + });
284 }); 293 });
285 }); 294 });
286 }); 295 });
......