Page 1 of 1

Problems with custom login and onRoomListUpdate

Posted: 25 Apr 2010, 07:04
by cpdavidd
Hello,

I got a problem with avatarChat example and with my own login extension.

If the client recognise, that the response is: LogOK , it automaticallly goes to the next frame without calling the onRoomListUpdate.

Code: Select all

[Sending]: <msg t='sys'><body action='verChk' r='0'><ver v='158' /></body></msg>

[Received]: <cross-domain-policy><allow-access-from domain="*" to-ports="9339" /></cross-domain-policy>

[Received]: <msg t="sys"><body action="apiOK" r="0" /></msg>

[Sending]: <msg t='sys'><body action='login' r='0'><login z='testzone'><nick><![CDATA[username]]></nick><pword><![CDATA[password]]></pword></login></body></msg>

[Received]: <msg t="xt"><body action="xtRes" r="-1"><dataObj><var n=&apos;_cmd&apos; t=&apos;s&apos;>logOK</var></dataObj></body></msg>


****************************************************************
Internal error:
The room list is empty!
The client API cannot function properly until the room list is populated.
Please consult the documentation for more infos.
****************************************************************

So its there any way to call RoomListUpdate? Or its neccessary to call it in extension?

Posted: 25 Apr 2010, 07:13
by cpdavidd
I tryed:

Code: Select all

smartfox.getRoomList()
And succeffully gets the roomlist. But now the username and all variables in avatarChat are undefined.

Image

Code: Select all

Variables SET
---------------------------------------------
myID : null
User Obj: undefined
Vars: undefined
px: undefined
py: undefined

Posted: 25 Apr 2010, 19:41
by BigFIsh
you get a list of users and their variables (if any) upon joining a room, not when receiving the list of room data and its variables (if configured).

Posted: 26 Apr 2010, 15:11
by cpdavidd
Oh, so the code what i used its only for getting room data.

So its there any way to invoke the onRoomListUpdate?

Posted: 26 Apr 2010, 21:50
by BigFIsh
Correct, the code you used is to get the room list from the server. onRoomListUpdate is invoked once you get the room list from the server, and this should generally only be called once in the same frame location in your timeline.

In order to get users and their variables, get them after the onJoinRoom smartfox event. You'll need to join a room first (and after you get the room list).