Sign In Register

How can we help you today?

Start a new topic
Answered

prevent parallel login using same username and password

i can do  paralle login using same user name and password from different computer. and it works.

game1:  logged  in with "user1" and pass "zzz"

game2:  logged  in with "user1" and pass "zzz"


how to prevent that?


Best Answer

Hi Ahsan,


You can prevent concurrent logins by using Spark.getPlayer().disconnect(true) this is explained in our documentation here


Kind regards,

 - Steve


Answer

Hi Ahsan,


You can prevent concurrent logins by using Spark.getPlayer().disconnect(true) this is explained in our documentation here


Kind regards,

 - Steve

hi thanks.
but in which cloud event i need to put it?

@ahsan:


If I had to guess, I'd say "Player Connected", but I'm not sure if that code is run before or after establishing the connection with the new player. I'd be afraid of just always terminating the connection with a player.


Give it a test and see what happens?

Hi Ahsan,

It would be best placed in the cloud code of your authentication Response.


Best Regards, Patrick. 

Login to post a comment