About The Same ClientID
-
Hi @endel ,
It's said in the document that there will be the same ClientID when I connect to the same device twice. But it's not the same when I open two browser tabs for testing. Is my understanding wrong? Thank you
-
Hi @BlueBang, thanks for pointing out, this piece of documentation is outdated. I've just removed this paragraph, as it is no longer valid. The only way to ensure you have the same client on multiple sessions is through authentication
-
Hi @endel thank you for report,
How to understand 'the sample client on multiple sessions', for example//client let ws= new Colyseus.Client("ws://localhost:2567") ws.joinOrCreate("room"); ws.joinOrCreate("room"); //server onAuth(client){ console.log(client.id) //the clientId will be same,right? }
Thanks a million.
-
Hi @BlueBang,
The easiest way to have authentication is by installing MongoDB and using
colyseus/social
.colyseus/social
client-side API: https://docs.colyseus.io/authentication/#client-side-apicolyseus/social
server-side API: https://docs.colyseus.io/authentication/#server-side-api
Hope this helps! Cheers!