meraki-analytics / orianna

A Java framework for the Riot Games League of Legends API (http://developer.riotgames.com/).
MIT License
182 stars 56 forks source link

Pink ward removal #60

Closed pquadri closed 7 years ago

pquadri commented 8 years ago

Exception in thread "main" com.robrua.orianna.type.exception.APIException: A NOT_FOUND (404) error was received from the server for URI https://global.api.pvp.net/api/lol/static-data/euw/v1.2/item/2043?api_key=RGAPI-611a56a2-3f74-4309-88a9-72f3f4497566&itemData=all at com.robrua.orianna.api.dto.BaseRiotAPI.get(BaseRiotAPI.java:249) at com.robrua.orianna.api.dto.BaseRiotAPI.get(BaseRiotAPI.java:162) at com.robrua.orianna.api.dto.StaticDataAPI.getItem(StaticDataAPI.java:62) at com.robrua.orianna.api.dto.BaseRiotAPI.getItem(BaseRiotAPI.java:375) at com.robrua.orianna.api.core.StaticDataAPI.getItem(StaticDataAPI.java:206) at com.robrua.orianna.api.core.StaticDataAPI.getItems(StaticDataAPI.java:265) at com.robrua.orianna.api.core.RiotAPI.getItems(RiotAPI.java:352) at com.robrua.orianna.api.core.MatchAPI.getMatch(MatchAPI.java:42) at com.robrua.orianna.api.core.MatchAPI.getMatchByReference(MatchAPI.java:72) at com.robrua.orianna.api.core.RiotAPI.getMatchByReference(RiotAPI.java:816) at com.robrua.orianna.type.core.matchlist.MatchReference.getMatch(MatchReference.java:92) at Example.getRankedStatsByData(Example.java:91) at Example.main(Example.java:161)

The error is probably caused by the removal of PinkWards from RiotServers. getMatch tries to fetch the whole items purchase history in the game including pinkwards, and when it gets to them the whole thing stops working. *edit: wrong error

robrua commented 8 years ago

Hey,

You're on point with what's caused this error, and it's a symptom of a bigger problem with Ori that I've been planning to address with a major version update, but haven't gotten around to yet; we don't handle previous ddragon version when calling out to the static-data endpoint.

The way this has been getting handled in the past is to add retired item IDs to the ingore list at https://github.com/meraki-analytics/Orianna/blob/master/src/com/robrua/orianna/api/core/StaticDataAPI.java#L30 and have Ori never request them when encountered. Obviously, this has problems accessing items from games that happened before the removing patch.

I'm a little hesitant to just drop it into that list, since the removing patch was so recent. I'll spend some time tinkering around and seeing if I can find an alternative low impact approach to tide us over until the major version update I've been planning. Otherwise we'll just have to go with the ignore list for now.