[How] Auto leave room
nene last edited by nene
i have a room with
maxClients = 2and room was locked. And i want to when have
a clientleave room, room will automatic dispose. How i can do this ?
And how i can known that who was created room ? (Ex: A created room, B joined room, how i can known A created room ?)
Thanks in adavanced.
plyoung last edited by
Check the docs, http://colyseus.io/docs/api-room/#disconnect
As for tracking who created it you could simply keep a variable in the room class which, if not set, you set it to the
client.sessionIdof the joining client in
onJoin. Of course if your variable is already set you know that this is the 2nd joining player and should not use its session id.