• Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Darkly)
  • No Skin
Collapse
brainCloud Forums

How do I look-up a player?

Scheduled Pinned Locked Moved Solved APIs
api
2 Posts 2 Posters 336 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Ima Need-SupportI Offline
    Ima Need-SupportI Offline
    Ima Need-Support
    wrote on last edited by Paul Winterhalder
    #1

    Hi,

    Is there an API that I can use to look-up a player by name?

    Ima

    1 Reply Last reply
    0
  • Paul WinterhalderP Offline
    Paul WinterhalderP Offline
    Paul Winterhalder brainCloudAdmin
    wrote on last edited by
    #2

    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.

    1 Reply Last reply
    0

  • Login

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users