colyseus / colyseus-defold

⚔ Colyseus SDK for Defold Engine
https://docs.colyseus.io/getting-started/defold-client/
MIT License
63 stars 10 forks source link

Unable to get client.sessionId #9

Closed holyxiaoxin closed 6 years ago

holyxiaoxin commented 6 years ago

I am able to retrieve client.id but not able to get client.sessionId. Is this deliberate since there is no need for client.sessionId?

endel commented 6 years ago

Hi @holyxiaoxin, the sessionId attribute is attached to the room instance.

local room = client:join("room_name")

room:on("join", function() 
  print(client.id) -- id of the client
  print(room.sessionId) -- id of the session
end)

Cheers!

holyxiaoxin commented 6 years ago

My bad, they clarified this in the next line. And thanks for sharing this library!

http://colyseus.io/docs/api-client/#sessionid-string