I'm trying to create a gameroom with a maxClients.(clients are deleted if the leave the room lobby). When it's reached, I want to lock the room and send each client their id in the game as player (that is their order in the Room.clients array).
The problem I face is the client is added to the array in a async task, so I can't immediately begin the task in the onJoin() method because the last client as not been added yet when onJoin() is called.
I can't seem to find a callback for the room when a client is effectively added to Room.clients, so I can send each client their player id (different from their client id and sessionId) in the game.
It's I think a basic question, but I can't figure it out. I'm new to multiplayer gameserver, so maybe I'm not thinking the right way.
Regards and thanks for any help.