JSON - how to access roomId data

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Post Reply
udikantz
Posts: 153
Joined: 24 Sep 2009, 09:36

JSON - how to access roomId data

Post by udikantz »

hello Im using JSON to send messages from server to client.

when i receive the messages in the client i catch it in the onExtensionResponse event.

i want to get the roomId from the JSON data,
i see that the room id exists in the JSON data, for example:

Code: Select all

{"t":"xt","b":{"r":17,"o":{"cmd":"rwr","btype":[1],"bwin":[0]}}}
I didn't find a way to access the "r" data,
how do i get the roomId from that data
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

The "r" parameter is not accessible from code in the onExtensionResponse handler. If you need to pass yourself room data you should add it to your response object.
Lapo
--
gotoAndPlay()
...addicted to flash games
udikantz
Posts: 153
Joined: 24 Sep 2009, 09:36

Post by udikantz »

i think you should make the "r" parameter available to read, its a waste to duplicate this parameter like that
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Yes, I agree. I have added it to the to-do list.
Thank you
Lapo
--
gotoAndPlay()
...addicted to flash games
yaswanth
Posts: 32
Joined: 27 Sep 2008, 21:02

roomId in extension response

Post by yaswanth »

Dear Lapo,

Any updates to your todo list? :-)

Is there a way to get the roomId from the extensionResponse other than sending it with the response object?

Regards,
Yaswanth
Post Reply