kRapaille / LeagueOfLegendsAPI

Portable C# Library for League of legends API
http://xeex.github.io/LeagueOfLegendsAPI
MIT License
19 stars 7 forks source link

Deserialization of the json-response failes when requesting the summoner/champion spell cooldown #33

Closed haefele closed 10 years ago

haefele commented 10 years ago

The cooldown is an int, but it gets returned as 0.0. JSON.NET then throws an exception, because 0.0 is treated as a double/float and not as an integer.

The same problem exists with the cooldown of the champion spells.

kRapaille commented 10 years ago

Thank you for your feedback. Nice catch !

Apparently, Riot did an update of this property a few days ago but did not mention it in the change history.

I'll update it when I'm back from work.

Relevant link

ghost commented 10 years ago

Hey! I got your libary using til NuGet version about 4 days ago, but im still encountring the problem. It should have been fixed right? Or is the NuGet version behind? Thanks for the amazing work!

kRapaille commented 10 years ago

I didn't update the NuGet version for 21 days. Did you do all the updates ? What is your Remake.PortableLeagueAPI.Interfaces package version ?

Note : A new version is coming soon with League 2.4 and Team 2.3. Riot still updates his API without updating the Change History :(

ghost commented 10 years ago

Hmm.. tried finding the package version, does this look right? Remake.PortableLeagueAPI.Interfaces.1.1.2 Is it possible that my NuGet version is not up to date when i downloaded it lees than a week ago? I havent updated anything since..

Im getting the error when trying to get all data about a Champion: IChampion champion = await service._leagueApi.Static.GetChampionAsync(App.selectedChampion.Id, ChampDataEnum.All, RegionEnum.Euw, LanguageEnum.EnglishUS);

Throws the following error: A first chance exception of type 'Newtonsoft.Json.JsonReaderException' occurred in mscorlib.ni.dll Input string '14.0' is not a valid integer. Path 'spells[0].cooldown', line 1, position 5436.

kRapaille commented 10 years ago

Current Remake.PortableLeagueAPI.Interfaces version is 1.1.3 (1.1.4 in a few minutes :D)

When you installed it a week ago, it didn't update automatically the last dependencies. If you check the available updates in your NuGet Package Manager, you should see them.

ghost commented 10 years ago

Great thanks! It's all working like a charm now. I had no idea that i needed to update the dependencies after downloading the the package :)

Keep up the good work!