question

Ozan Yilmaz avatar image
Ozan Yilmaz asked

How to limit the number of friends?

Hello everyone,

Is there a way to limit how many players can a player add as friends? We would like to limit the number to 100. We can do a simple if check on the client side; however, the clients can pass this check if they want, so that we're looking for something on the server side

10 |1200

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

brandon@uprootstudios.com avatar image
brandon@uprootstudios.com answered

You could use CloudScript to handle adding friends, then just have your CloudScript function not add the friend and return an error to the client if the client has > 99 friends

10 |1200

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

Citrus Yan avatar image
Citrus Yan answered

Yes, you should handle this with server authoritative logics, CloudScript is a good choice.

10 |1200

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

Ozan Yilmaz avatar image
Ozan Yilmaz answered

That makes sense. Also, can I block the client side AddFriend API?

1 comment
10 |1200

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

Citrus Yan avatar image Citrus Yan commented ·

Yes, you can configure the API Access Policy to block the client side AddFriend API, please read this doc: https://docs.microsoft.com/en-us/gaming/playfab/api-references/api-access-policy for more details.

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.