How do I look-up a player?
-
Hi,
Is there an API that I can use to look-up a player by name?
Ima
-
Hi,
brainCloud offers a number of APIs for looking up other players. You'll find them all in the Friend service.
As far as looking up players by name, it isn't highly recommended - since names in brainCloud are not guaranteed to be unique (and thus lookups are less deterministic and slower).
It's generally more useful to look up other players by UniversalId - which are guaranteed to be unique.
Now - maybe your app isn't using Universal Identities - so it seems odd to lookup by the UniversalId. Luckily, brainCloud supports a non-login version of a UniversalId - so you can have the user pick a Display Name which will be associated with their account, but they don't actually log in via it (and there's no password for it stored).
To use non-login UniversalIds...
- Attach the non-login identity via AttachNonLoginUniversalId()
- Later on, to update the id, use UpdateUniversalIdLogin() <-- disregard the misleading name - it works for both login and non-login versions of UniversalId
- Set the player's name to match the universalId (useful for leaderboards) via UpdateUserName()
- Finally, to look-up a player, use FindUserByExactUniversalId() or FindUserByUniversalIdStartingWith()
Hope that helps!
Paul.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login