question

brandon@uprootstudios.com avatar image
brandon@uprootstudios.com asked

Unity SDK seems to not contain an Enum type for Matchmaking status 'ServerAllocationFailed'

Hi, when calling GetMatchmakingTicket, we may receive the result 'ServerAllocationFailed' if our match type has an invalid server build number associated with it (or some other issue). However, this response does not seem to be implemented in the SDK, and we receive an error that we cannot catch as it happens inside the PlayFab JSON deserializer.

The exact error is:

ArgumentException: Requested value 'ServerAllocationFailed' was not found.
System.Enum+EnumResult.SetFailure (System.Enum+ParseFailureKind failure, System.String failureMessageID, System.Object failureMessageFormatArgument) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
System.Enum.TryParseEnum (System.Type enumType, System.String value, System.Boolean ignoreCase, System.Enum+EnumResult& parseResult) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
System.Enum.Parse (System.Type enumType, System.String value, System.Boolean ignoreCase) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
PlayFab.Json.SimpleJsonInstance+PlayFabSimpleJsonCuztomization.DeserializeObject (System.Object value, System.Type type) (at Assets/PlayFabSdk/Shared/Internal/ISerializer.cs:30)
PlayFab.Json.SimpleJsonInstance+PlayFabSimpleJsonCuztomization.DeserializeObject (System.Object value, System.Type type) (at Assets/PlayFabSdk/Shared/Internal/ISerializer.cs:28)
PlayFab.Json.PocoJsonSerializerStrategy.DeserializeObject (System.Object value, System.Type type) (at Assets/PlayFabSdk/Shared/Internal/SimpleJson.cs:1473)
PlayFab.Json.SimpleJsonInstance+PlayFabSimpleJsonCuztomization.DeserializeObject (System.Object value, System.Type type) (at Assets/PlayFabSdk/Shared/Internal/ISerializer.cs:24)
PlayFab.Json.PlayFabSimpleJson.DeserializeObject (System.String json, System.Type type, PlayFab.Json.IJsonSerializerStrategy jsonSerializerStrategy) (at Assets/PlayFabSdk/Shared/Internal/SimpleJson.cs:604)
PlayFab.Json.PlayFabSimpleJson.DeserializeObject[T] (System.String json, PlayFab.Json.IJsonSerializerStrategy jsonSerializerStrategy) (at Assets/PlayFabSdk/Shared/Internal/SimpleJson.cs:609)
PlayFab.Json.SimpleJsonInstance.DeserializeObject[T] (System.String json) (at Assets/PlayFabSdk/Shared/Internal/ISerializer.cs:85)
PlayFab.Internal.PlayFabHttp+<>c__DisplayClass23_0`1[TResult].<_MakeApiCall>b__0 () (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabHTTP.cs:212)
PlayFab.Internal.PlayFabUnityHttp.OnResponse (System.String response, PlayFab.Internal.CallRequestContainer reqContainer) (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:227)
UnityEngine.Debug:LogException(Exception)
PlayFab.Internal.PlayFabUnityHttp:OnResponse(String, CallRequestContainer) (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:265)
PlayFab.Internal.<Post>d__12:MoveNext() (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:189)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

While we don't expect this error to ever really occur in a shipped build, it would still be nice to be able to control what happens when/if it occurs.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Seth Du avatar image
Seth Du answered

Thanks for the feedback. I have discussed with our team and will file a bug for the missing Enum type.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.