Problems with custom login and onRoomListUpdate

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

Post Reply
cpdavidd
Posts: 31
Joined: 25 Feb 2010, 08:03

Problems with custom login and onRoomListUpdate

Post 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?
cpdavidd
Posts: 31
Joined: 25 Feb 2010, 08:03

Post 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
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post 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).
Smartfox's forum is my daily newspaper.
cpdavidd
Posts: 31
Joined: 25 Feb 2010, 08:03

Post by cpdavidd »

Oh, so the code what i used its only for getting room data.

So its there any way to invoke the onRoomListUpdate?
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post 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).
Smartfox's forum is my daily newspaper.
Post Reply