I create a game, where I need the username to be unique for all users. It's somewhat similar to this question , except that I don’t want to register the user. I basically only want to ask the backend, if the username is taken, and then get a bool in response. The reason for this is, that choosing username is only a step in the registration flow, which later concludes in the actual registration.
I’m working in Unity. So any help on both the call from Unity and the CloudCode setup would be most valued!
Thanks in advance!
Best Answer
C
Customer Support
said
almost 6 years ago
So, you can preform a registration request as usual. One of the error-code that comes back will tell you if the username is taken, you can use that error code to let the player know they need to choose another name. You can check out the API for RegistrationRequest here.
One way you can track usernames of players is to mirror the Player collection on Registration, so that you can perform queries in Cloud Code on fields such as "userName".
Sorry for reopen this thread, but there is still one detail i`m in doubt.
Every request must be done with authenticated users, right?
So how can an unregistered user check if an username is already in use?
Consider I will use RegistrationRequest and my game username will be an email.
There's no way to check that before send the RegistrationRequest, right?
Thanks in advance.
Customer Support
said
almost 6 years ago
Answer
So, you can preform a registration request as usual. One of the error-code that comes back will tell you if the username is taken, you can use that error code to let the player know they need to choose another name. You can check out the API for RegistrationRequest here.
Morten Mygind
One of the error-code that comes back will tell you if the username is taken, you can use that error code to let the player know they need to choose another name.
You can check out the API for RegistrationRequest here.
Sean
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
Hi Morten,
One way you can track usernames of players is to mirror the Player collection on Registration, so that you can perform queries in Cloud Code on fields such as "userName".
Spark.runtimeCollection("playerList").find({"userName": input})
-Pádraig
Nelson Ciofi
Sorry for reopen this thread, but there is still one detail i`m in doubt.
Every request must be done with authenticated users, right?
So how can an unregistered user check if an username is already in use?
Consider I will use RegistrationRequest and my game username will be an email.
There's no way to check that before send the RegistrationRequest, right?
Thanks in advance.
Customer Support
One of the error-code that comes back will tell you if the username is taken, you can use that error code to let the player know they need to choose another name.
You can check out the API for RegistrationRequest here.
Sean
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics