Skip to content

Commit 91186ba

Browse files
author
unknown
committed
update match v5
1 parent 8e3e920 commit 91186ba

File tree

1,125 files changed

+138759
-34
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,125 files changed

+138759
-34
lines changed

button_action.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,10 @@ button.addEventListener("click", function(){
8080
const gameAPI = await fetch("https://"+settings.server+".api.riotgames.com/lol/spectator/v4/active-games/by-summoner/"+SummonerId+"?api_key="+settings.APIKey);
8181
game = await gameAPI.json();
8282
} else if (settings.matchId != ""){
83-
const gameAPI = await fetch("https://"+settings.server+".api.riotgames.com/lol/match/v4/matches/"+settings.matchId+"?api_key="+settings.APIKey);
83+
const gameAPI = await fetch("https://"+settings.serverMatch+".api.riotgames.com/lol/match/v5/matches/"+settings.matchId+"?api_key="+settings.APIKey);
84+
console.log(gameAPI);
8485
game = await gameAPI.json();
86+
game = game.info;
8587
if (game.hasOwnProperty('status')) {
8688
if((game.status["status_code"] == 403)||(game.status["status_code"] == 401)){
8789
await changeETA("API Key not valid");
@@ -94,8 +96,11 @@ button.addEventListener("click", function(){
9496
return
9597
}
9698
}
97-
const timelineAPI = await fetch("https://"+settings.server+".api.riotgames.com/lol/match/v4/timelines/by-match/"+settings.matchId+"?api_key="+settings.APIKey);
99+
console.log("https://"+settings.serverMatch+".api.riotgames.com/lol/match/v5/matches/"+settings.matchId+"/timeline?api_key="+settings.APIKey);
100+
const timelineAPI = await fetch("https://"+settings.serverMatch+".api.riotgames.com/lol/match/v5/matches/"+settings.matchId+"/timeline?api_key="+settings.APIKey);
101+
98102
timeline = await timelineAPI.json();
103+
timeline = timeline.info;
99104
var folder = await mkdirp(path+'/graphs/', { recursive: true });
100105
try {
101106
await createArrayPlayer()
@@ -205,18 +210,21 @@ button.addEventListener("click", function(){
205210
if(settings.accountName != ""){
206211
list_perks = summoner.perks.perkIds;
207212
} else if (settings.matchId != ""){
213+
save_perks = summoner.perks.styles.slice();
214+
console.log(save_perks);
208215
summoner.perks = {};
209-
summoner.summonerName = game.participantIdentities[summoner.participantId-1].player.summonerName;
210-
tab_str_perks = ["perk0","perk1","perk2","perk3","perk4","perk5"];
211-
tab_str_perks.forEach(item =>{
212-
list_perks.push(summoner.stats[item]);
216+
save_perks.forEach(sty =>{
217+
sty.selections.forEach(item =>{
218+
list_perks.push(item.perk);
219+
})
213220
})
221+
214222
}
215223
console.log(list_perks);
216224
summoner.perks.perkIds = translatePerkz(list_perks);
217225
summoner.champImg = translateChamp(summoner.championId);
218-
summoner.spell1Img = translateSpell(summoner.spell1Id);
219-
summoner.spell2Img = translateSpell(summoner.spell2Id);
226+
summoner.spell1Img = translateSpell(summoner.summoner1Id);
227+
summoner.spell2Img = translateSpell(summoner.summoner2Id);
220228
//console.log(summoner);
221229
//console.log(summoner.perks);
222230
});
157 KB
Binary file not shown.

0 commit comments

Comments
 (0)