Sign In Register

How can we help you today?

Start a new topic
Answered

How to disable player account lock?

Hi,

How can i disable locking player account after too many failed login attemps?


Regards

Rafal


Best Answer

Hi Rafal,


You can do this is Cloud Code by using "Spark.getPlayer().unlock();" ,you can read more about it here.


Thanks,

Liam


Answer

Hi Rafal,


You can do this is Cloud Code by using "Spark.getPlayer().unlock();" ,you can read more about it here.


Thanks,

Liam

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

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

Hi Liam,


Thanks for explanation. We can mark this topic as answered.


Thanks,

Rafal

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?

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.


Thanks,

Liam

Hello, the links you give doesn't work anymore.


1 person likes this
Login to post a comment