question

TheL0w3R avatar image
TheL0w3R asked

Check if a player already exists before login

Hi, I'm currently coding my login system and I would like to check if the username or email already exists, but not when they hit "create account", I would like to check it when they finish typing the username (using unity event function call)

Is that possible? I would like to show an error mark if the user exists.

 

Hope you understood me, sorry for my bad english and thanks!! :D

10 |1200

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

brendan avatar image
brendan answered

For this to work in realtime (most people type faster than the turnaround time of a Web API call), you would really need to host the full list of usernames on the local device, which isn't an option. If the intent is that you would make one call to "check if this username is available" after the user has stopped typing for a second or two, one way you could potentially do this is by calling LoginWithPlayFab, with a randomly generated max-length (30 characters) password. There is a microscopic chance that you could inadvertently generate that user's actual password (and so incorrectly sign the user into an account he doesn't own), but you could account for this by making sure to invalidate the Session Ticket right after receiving it.

If you choose to go this route though, please be sure to use it as described - after a delay indicating the user is done typing. Otherwise, a) you'll have to manage a confusing set of responses, and b) you would likely be calling at too high of a rate, which could cause your title to be throttled.

10 |1200

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

TheL0w3R avatar image
TheL0w3R answered

Hmm, I'll think about it!

Thanks for answering :D

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.