question

MertCorekci avatar image
MertCorekci asked

How to get ban details in Unity?

Hey, I'm getting this error "AccountBanned" when trying to authenticate player. I can set ban hours details etc but i dont know how to get ban details.

I tried this:

PlayFabClientAPI.GetAccountInfo(request,OnGetAccountInfoSuccess,OnGetAccountInfoFailure);


voidOnGetAccountInfoSuccess(GetAccountInfoResult result){

result doesnt have isbanned info.

}

Can you give me example?

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

No, I am afraid you cannot get ban details using client API. You must login successfully to get the session ticket so that you can call client APIs. As a result, once the player is banned, he will not able to call any client API.

You may notice that at the header of the Client API http request, there is always a field named “X-Authentication”, where session ticket should be set. You can not get any successful callback unless a valid session ticket is given.

The only way is to use server/admin APIs, which apparently is not recommended to implement in your client.

>An alternative solution is to send ban information to the player’s contact email.

1. create a Rule at [Game Manager] -> [Automation] -> [Rules]:

2. Edit your Email template to add Ban expiration time (via $Profile.BannedUntil$):


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.