MingweiSamuel / Camille

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

GameMode `PRACTICETOOL` Enum issue #84

Closed lorenblue closed 1 year ago

lorenblue commented 2 years ago

Hey there! I am very much a noob with all of this, but this does seem very similar to an issue that is currently open with Camille right now. It only happens when trying to retrieve match data from a certain match ID (match IDs in question all belong to same summoner), but I am not able to distinguish what exactly is different about this particular match. Thanks so much!

Unhandled exception. System.AggregateException: One or more errors occurred. (The JSON value could not be converted to Camille.Enums.GameMode. Path: $.info.gameMode | LineNumber: 0 | BytePositionInLine: 291.) ---> System.Text.Json.JsonException: The JSON value could not be converted to Camille.Enums.GameMode. Path: $.info.gameMode | LineNumber: 0 | BytePositionInLine: 291. at System.Text.Json.ThrowHelper.ThrowJsonException(String message) at System.Text.Json.Serialization.Converters.EnumConverter1.ReadAsPropertyNameCore(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options) at System.Text.Json.Serialization.Converters.EnumConverter1.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options) at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state) at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 utf8Json, JsonTypeInfo jsonTypeInfo, Nullable1 actualByteCount) at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 json, JsonTypeInfo jsonTypeInfo) at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options) at Camille.Core.JsonHandler.Deserialize[T](String content) at Camille.RiotGames.RiotGamesApi.Send[T](String route, String methodId, HttpRequestMessage request, Nullable1 token, Boolean ignoreAppRateLimits) --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task1.get_Result() at Program.<>c.<UpdateMatchDatabase>b__3_0(String id) in C:\Users\Lorenzo\Documents\RiotAPI\RiotAPINew\Program.cs:line 34 at System.Linq.Enumerable.SelectArrayIterator2.GetCount(Boolean onlyIfCheap) at System.Linq.Enumerable.Count[TSource](IEnumerable`1 source) at Program.UpdateMatchDatabase(String summonerName) in C:\Users\Lorenzo\Documents\RiotAPI\RiotAPINew\Program.cs:line 37 at Program.Main() in C:\Users\Lorenzo\Documents\RiotAPI\RiotAPINew\Program.cs:line 15

lorenblue commented 2 years ago

The match in question:

Match ID: "NA1_4252152378" Summoner Name: "XtremeDawg"

MingweiSamuel commented 2 years ago

Ah, looks like the gamemmode is PRACTICETOOL which is missing from the enum. Didn't realize practice tool games could be public

MingweiSamuel commented 2 years ago

Should be fixed in 3.0.0-nightly-2022-04-12-9fe967ddf9