You can do this is Cloud Code by using "Spark.getPlayer().unlock();" ,you can read more about it here.
Thanks,
Liam
R
Rafal Gawel
said
over 6 years ago
Hi Liam,
So, i have to unlock every player account every time it is locked? Is there no way to permamently disable locking player accounts?
Thanks,
Rafal
Customer Support
said
over 6 years ago
Hi Rafal,
You can't disable it, the lock is only a temporary measure so you don't have to do this every time, I believe it lasts for 5 minutes then the user can try to login again. The code above will do it instantly if the situation requires it.
Thanks,
Liam
R
Rafal Gawel
said
over 6 years ago
Hi Liam,
Thanks for explanation. We can mark this topic as answered.
Thanks,
Rafal
T
Tony Pitman
said
about 6 years ago
I am confused about how to use this. How does Spark.getPlayer().unlock() know which player I am talking about? And if I am just trying to manually unlock a player account where do I run this cloud code?
Customer Support
said
about 6 years ago
Hi Tony,
If a player has locked their account, you would need to authenticate as another user and unlock the original account by using "Spark.loadPlayer()". You can use the following to do this in Cloud Code.
//load the locked player by supplying their playerId, pass the id in through the event or set it manually in Cloud Code
var player = Spark.loadPlayer(playerID)
//unlock the account
player.unlock()
Now the locked player should be able to authenticate once again. Does that make sense ? If you have any further questions just let me know.
Rafal Gawel
Hi,
How can i disable locking player account after too many failed login attemps?
Regards
Rafal
Hi Rafal,
You can do this is Cloud Code by using "Spark.getPlayer().unlock();" ,you can read more about it here.
Thanks,
Liam
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
Hi Rafal,
You can do this is Cloud Code by using "Spark.getPlayer().unlock();" ,you can read more about it here.
Thanks,
Liam
Rafal Gawel
Hi Liam,
So, i have to unlock every player account every time it is locked? Is there no way to permamently disable locking player accounts?
Thanks,
Rafal
Customer Support
Hi Rafal,
You can't disable it, the lock is only a temporary measure so you don't have to do this every time, I believe it lasts for 5 minutes then the user can try to login again. The code above will do it instantly if the situation requires it.
Thanks,
Liam
Rafal Gawel
Hi Liam,
Thanks for explanation. We can mark this topic as answered.
Thanks,
Rafal
Tony Pitman
I am confused about how to use this. How does Spark.getPlayer().unlock() know which player I am talking about? And if I am just trying to manually unlock a player account where do I run this cloud code?
Customer Support
Hi Tony,
If a player has locked their account, you would need to authenticate as another user and unlock the original account by using "Spark.loadPlayer()". You can use the following to do this in Cloud Code.
Now the locked player should be able to authenticate once again. Does that make sense ? If you have any further questions just let me know.
Thanks,
Liam
barudy diego
Hello, the links you give doesn't work anymore.
1 person likes this
-
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