MingweiSamuel / Camille

C# Riot API Library. Thread safe, automatic retries, autogenerated nightly releases.
Other
102 stars 8 forks source link

New Nexus Blitz missing in Enum GameMode and Queues causing JSON serialization errors #36

Closed aPinat closed 4 years ago

aPinat commented 4 years ago

Unfortunately http://static.developer.riotgames.com/docs/lol/gameModes.json and http://static.developer.riotgames.com/docs/lol/queues.json don't contain it yet, but NEXUSBLITZ is the game mode string and 1300 is the queue id for the current Nexus Blitz released in 10.15.

Those being missing cause JSON serialization errors currently; is it possible to manually add those?

MingweiSamuel commented 4 years ago

Yes, I can fix that tonight. Out of curiosity, can you post the exception message here?

MingweiSamuel commented 4 years ago

Also you can make an issue here: https://github.com/RiotGames/developer-relations/issues

aPinat commented 4 years ago
System.Text.Json.JsonException: The JSON value could not be converted to Camille.Enums.GameMode. Path: $.gameMode | LineNumber: 0 | BytePositionInLine: 55.
   at System.Text.Json.ThrowHelper.ThrowJsonException(String message)
   at System.Text.Json.Serialization.Converters.EnumConverter`1.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
   at System.Text.Json.JsonPropertyInfo`1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader)
   at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.ReadPropertyValue(Object obj, ReadStack& state, Utf8JsonReader& reader, JsonPropertyInfo jsonPropertyInfo, Boolean useExtensionProperty)
   at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.JsonSerializer.ReadCore[TValue](Utf8JsonReader& reader, Type returnType, JsonSerializerOptions options)
   at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, Type returnType, JsonSerializerOptions options)
   at Camille.RiotApi.RiotApi.Send[T](Region region, String methodId, HttpRequestMessage request, Nullable`1 token, Boolean ignoreAppRateLimits)

I'm assuming the same would happen for Camille.Enums.Queues too.

Right yeah, I should open an issue there too...

MingweiSamuel commented 4 years ago

https://github.com/RiotGames/developer-relations/issues/340 https://github.com/MingweiSamuel/riotapi-schema/issues/16

MingweiSamuel commented 4 years ago

Alright, new prerelease: https://www.nuget.org/packages/Camille.RiotApi/3.0.0-nightly-2020-07-23-daf75f8b8d

This has some breaking changes. This changes regions, now there are seperate XyzRoute enums to separate the routes for different games. Some Queue enums are renamed as well to be more coincise.

Let me know if there's any trouble, otherwise marking resolved for now

aPinat commented 4 years ago

Thanks! Looks good, just 2 small things (mostly just me being picky): The new Nexus Blitz Map is actually called the "Temple of Lily and Lotus", not sure whether you want to change that though, just noticed since it says "Nexus Blitz on Nexus Blitz". And second, the queue description now contains the map, making the description for the custom games a little weird: "Games on Custom games". I would actually suggest leaving "games on.." (matching the Enum name missing _GAMES now too) out in the description and have it say only "Co-op vs. AI Beginner Bot" since the map name is already in the Name tag as well and then revert Customs to just say "Custom" or "Custom games".

MingweiSamuel commented 4 years ago

Going to leave it for now, but want to find a better solution in the future. I've found several sources of truth with different subsets of queue IDs:

Bitmask of queue ids: image

Can see that the three sources generally agree, but each has some queueIds not shared with the others