question

julianrota120 avatar image
julianrota120 asked

getting the ban reason of a user?

so im working on a banning system and it keeps giving me an error saying

" NullReferenceException: Object reference not set to an instance of an object getBanReason.OnLoginFailure (PlayFab.PlayFabError error) (at Assets/Scripts/getBanReason.cs:43) PlayFab.Internal.PlayFabUnityHttp.OnResponse (System.String response, PlayFab.Internal.CallRequestContainer reqContainer) (at Assets/PlayFabSDK/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:220) UnityEngine.Debug:LogException(Exception) PlayFab.Internal.PlayFabUnityHttp:OnResponse(String, CallRequestContainer) (at Assets/PlayFabSDK/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:226) PlayFab.Internal.<Post>d__12:MoveNext() (at Assets/PlayFabSDK/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:159) "

and this is the script
"
private void OnLoginFailure(PlayFabError error)
{
if (error.Error == PlayFabErrorCode.AccountBanned)
{
foreach (var item in error.ErrorDetails)
{
Debug.Log("Reason : " + item.Key + "\t" + "Expires : " + item.Value[0]);
}
}
}

"

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

·
Made Wang avatar image
Made Wang answered

You need to check Allow client to view ban reason and duration in Game Manager-> Title settings-> API Features.

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.