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

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

JSON - how to access roomId data

Postby udikantz » 03 Dec 2009, 15:17

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: 21591
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 05 Dec 2009, 06:54

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

Postby udikantz » 07 Dec 2009, 10:39

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: 21591
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 07 Dec 2009, 10:53

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

Postby yaswanth » 12 Oct 2011, 12:51

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

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 17 guests