Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • API and SDK Questions /
avatar image
Question by Brendan · Jul 03, 2017 at 03:50 AM · Account Management

Searching on non-unique title display names

Question from a developer:

Is there as solution to search for players by TitleDisplayName if we enabled “allow non unique display name”? The API GetAccountInfo will not return any valid response when we enable this option.

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Brendan · Jul 03, 2017 at 03:50 AM

You can use GetAccountInfo to look up players by PlayFab ID, Username, Email address, or Title Display Name, but for that last element, it's only if you leave the Title Display Name setting to requiring that they are unique (the default for all titles).

Non-unique Title Display Names cannot be searched on, as the lookup for that call requires uniqueness. In the case of non-unique names, there's no limit on the number of users that could match the provided name, technically.

Comment

People who like this

0 Show 11 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image kfboelter · Sep 19, 2017 at 08:21 AM 0
Share

So what strategy should I use in case I am allowing a user to login via GameCenter, for instance, and taking his GameCenter name and setting that up as his display name, considering I have unique display name set to true?

Seems to my that out of this very simple and common thing to have (unique display name along with GameCenter login) I simply don't have a way to search and find users...

avatar image Brendan ♦♦ kfboelter · Sep 19, 2017 at 08:26 AM 0
Share

You can look up the user's PlayFab ID from their Game Center ID via this API: https://api.playfab.com/documentation/client/method/GetPlayFabIDsFromGameCenterIDs. Game Center IDs are necessarily unique - if you have multiple routes that allow players to create accounts, such that you have to make the Title Display Name be non-unique, we can't really provide a lookup for it at the client level, as that could require a full table search across millions of users (and could result in returning the same number of partial matches).

avatar image kfboelter · Sep 20, 2017 at 08:41 PM 0
Share

Correction:

where I said " unique display name set to true", I meant "set to false". Seems you understood it, though :D

Your suggestion is pretty good, but problem with that is that if I don't know the user PlayFab ID in advance, I cannot search for it. Having several users with the same display name being returned from a search would help me, because I'd the get the rest of the user profile and display it, so then one of the users could be picked accordingly.

Apart from that solution you provided, any other thing I could do, considering my users logged in through gamecenter and do not have unique display names?

avatar image Brendan ♦♦ kfboelter · Sep 20, 2017 at 08:48 PM 0
Share

No worries, I know what you meant. And in this case, you mean that if you don't have their GameCenter ID, you can't look it up, correct? Since Game Center IDs are unique, if you want to have that be the Title Display Name for your users I would use https://api.playfab.com/documentation/client/method/GetPlayFabIDsFromGameCenterIDs to check if there's an existing account for the local user, since you will have their GameCenter ID at that point (and that API call returns the PlayFab ID for the user that is associated with tat Game Center ID). If there is, depending on how you want to manage that, you could potentially unlink the Game Center account from that account and link it to the current player account.

If you want to support players entering Title Display Names and don't want to set the non-unique option, another thing you could do would be to use the option to append a randomly generated set of numbers onto the end of the Title Display Name (also in the title settings in the Game Manager), to help ensure uniqueness.

avatar image JeffMyers · Nov 15, 2018 at 09:08 PM 0
Share

I am looking to implement a player search in my game, in which I'm also using non-unique display names.

I want to do a search for adding a friend, where the player searches by display name, gets all the profiles that have the same display name, looks through results, find the profile he was looking for (by avatar and user data), and adds him as a friend.

So seems there is literally no way to do that? This is very surprising.

avatar image JeffMyers JeffMyers · Nov 15, 2018 at 09:11 PM 0
Share

Not sure what to do here. Non-unique display names are important for the design of my game, and so is player search.

avatar image Brendan ♦♦ JeffMyers · Nov 15, 2018 at 09:26 PM 0
Share

The issue here is that if display names are non-unique, they're no longer index values. If something is an index value, it can be used for rapid lookup from a data table - which would rapidly grow to millions of entries, for a popular title. So indexed lookups are quick and inexpensive.

Searching on a non-indexed value means a far more expensive comparison operation on every entry, until the target is found. And, since you don't know that the first one you find is the correct one, you'd have to do a complete search of the data every time, and return all matching entries - which could be a massive number of hits. As you can imagine, this would be incredibly expensive to support relatively speaking. Since we want to be able to continue offering a free tier, and we want to keep our prices low for everyone, that's not something we can realistically afford to do.

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    3 People are following this question.

    avatar image avatar image avatar image

    Related Questions

    Link cross-device with the same account 1 Answer

    [CloudScript] Playfab Account Initialization 1 Answer

    InvalidAPIEndpoint 1 Answer

    Create non-recoverable account and link with recoverable account 1 Answer

    Can multiple users login with same CustomID? 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges