question

Canberk Soner avatar image
Canberk Soner asked

Player Ban is shown as active after expiring

Hello,

Ban info returned by GetUserBans has value IsActive set to true after the ban is expired. Is this intended behaviour? If so, what is this meant to represent? What is the correct way to check if a player is currently banned from a web server using PlayFab's admin API?

In addition, if I update a ban (expired or not) and set its expire date, the banned player can still login without the ban taking effect even if the new expire date has not arrived yet. Is it because bans only work in 1 hour intervals and I'm setting the new expire date to a few minutes in future for testing purposes?

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

·
Citrus Yan avatar image
Citrus Yan answered

Hi @Canberk Soner,

>>Ban info returned by GetUserBans has value IsActive set to true after the ban is expired. Is this intended behaviour? If so, what is this meant to represent? What is the correct way to check if a player is currently banned from a web server using PlayFab's Admin API?

Yes, this is intended. The doc here says “Expired bans may still have this value set to true but they will have no effect.” I believe this represents that the state of the ban will always be “active” unless been revoked. The correct way to check if a player is currently banned would still be calling Admin/GetUserBans, you can then search for the farthest out active temporary ban or the oldest active permanent ban from the ban info returned to determine whether the player is currently banned.

>>In addition, if I update a ban (expired or not) and set its expire date, the banned player can still login without the ban taking effect even if the new expire date has not arrived yet. Is it because bans only work in 1 hour intervals and I'm setting the new expire date to a few minutes in future for testing purposes?

No, I don’t think the bans only work in 1 hour intervals based on the test results of mine. Here is the steps I took to test:

  1. I have an initial ban created at 2019-11-07T02:53:45.768Z and expires at 2019-11-07T03:53:45.768Z (with 1 hour duration ),
  2. Then I updated it to make it expires at 2019-11-07T03:00:00.768Z.
  3. The banned player cannot log in before the ban expires, but he/she can log in as soon as the expire date has arrived.

So, looks like it worked for me, could you provide your repro steps for us to investigate? Thanks.

2 comments
10 |1200

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

Canberk Soner avatar image Canberk Soner commented ·

Apparently I forgot to properly close this, sorry for the delay.

It was a problem on our side, our admin website was using invalid time formats. I confirmed that there is no problem on PlayFab side now, thanks for the help.

1 Like 1 ·
Citrus Yan avatar image Citrus Yan Canberk Soner commented ·

Glad to hear that you solved it:)

0 Likes 0 ·

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.