question

alexander-1 avatar image
alexander-1 asked

How Can I Implement a Player Search Feature

I've recently picked up PlayFab for my Unity project. I've hit sort of a brick wall with a feature I'd like to implement. I want the user to be able to search for other players through a standard "Search For Players" menu where they can input a username and find results of matching, or partially matching, users.

I've seen many responses saying that query features from the client do not support wildcards, that they only match one user, and that getting all users from the client is too many API calls and should not be done. Okay, that's fine, I understand! ...But that's where all the answers ended.

I'm confident this should be possible -- it's a feature almost every game has, and I'd be shocked if PlayFab had no way of supporting this -- but I'm not familiar enough with PlayFab to know what exactly I should be doing as a work-around. Someone had mentioned they solved it using Cloudscript, but that's all they said on the matter.

If anyone has any suggestions as to what I could do to implement this system I'd be really grateful!

Thanks!

apisunity3d
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

The client API GetAccountInfo supports search player via Display Name. Please note that to use this feature, you cannot check “Allow non-unique Display Name” in Title settings.

PlayFab doesn’t support a feature like fuzzy search/auto match, you may still need to know the precise display name of target player. There are many work arounds like using an external cached databased server for the fuzzy search, but it needs additional efforts.

It will be appreciated to send a thread on the Feature Request forum if there isn’t an existing one about your requirement and votes from other developers may help with the priority.

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.