Page 1 of 1

Custom Login and onJoinRoom event

Posted: 01 Jan 2010, 02:18
by kleelof
Hello,

I have a Zone set-up for custom login and within this zone is a 'lobby' that is set for autoJoin. I never send any joinRoom commands from the client or server.

When the user logs in, everything seems to go well except my client is not responding when the room is joined. I can see in the Flash IDE that it is receiving the 'joinOK' message. Is this what triggers the onJoinRoom event?

take care,
lee

Posted: 02 Jan 2010, 06:11
by Lapo
If you don't call autoJoin() from client side the room will never be auto-joined.
If you prefer you can perform it from the server side:
1. Perform login logic
2. Send the Room List ( via sendRoomList() )
3. Join the Room

Posted: 02 Jan 2010, 08:56
by kleelof
Hello,

I have it set-up as you described. Here is what I am seeing in the Flash IDE:

onRoomListUpdate
[Sending]: <msg t='sys'><body action='autoJoin' r='-1'></body></msg>

[ RECEIVED ]: <msg t='sys'><body action='joinOK' r='1'><pid id='0'/><vars /><uLs r='1'><u i='7' m='0'><n><![CDATA[kleelof]]></n><vars></vars></u></uLs></body></msg>, (len: 150)
[ RECEIVED ]: <msg t='sys'><body action='uCount' r='1' u='1'></body></msg>, (len: 60)

However, it does not seem to be triggering the onJoinRoom event. It is registering in the server-side script as well as the SFS Admin Tool.

I've checked that the event handler is in place.

take care,
lee

Posted: 02 Jan 2010, 08:58
by kleelof
Hello,

Ok, I found the problem. I was killing the eventListener too early. As usual, it works perfectly now.

thanks,
lee