how to get JSON format response ?

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

Moderators: Lapo, Bax

hitme
Posts: 6
Joined: 18 May 2011, 01:42
Contact:

how to get JSON format response ?

Postby hitme » 18 May 2011, 02:07

Hi,

I am building a html5 game client which requests the SFS through bluebox. Since I am coding in javascript, I expect the SFS to return JSON-format data all the time though our server extenstions can return JSON data.

for example, a poll request returns:

<msg t='sys'><body action='rVarsUpdate' r='2'><vars><var n='seat3' t='s'><![CDATA[4%0%100%0]]></var></vars></body></msg>

My question is: how can the sfs always return JSON-format data ?
User avatar
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Postby BigFIsh » 19 May 2011, 03:52

Sorry, but what you're asking for is not possible at the moment. You can send JSON objects using client's sendXtMessage or server's sendResponse method. Everything else are sent as XML.

If you want fast data exchange, you may want to consider SFS2X as it's data protocol is much more compressed than JSON - see http://docs2x.smartfoxserver.com/Overview/sfs2x-protocol
Smartfox's forum is my daily newspaper.
hitme
Posts: 6
Joined: 18 May 2011, 01:42
Contact:

Postby hitme » 24 May 2011, 08:34

BigFIsh wrote:Sorry, but what you're asking for is not possible at the moment. You can send JSON objects using client's sendXtMessage or server's sendResponse method. Everything else are sent as XML.

If you want fast data exchange, you may want to consider SFS2X as it's data protocol is much more compressed than JSON - see http://docs2x.smartfoxserver.com/Overview/sfs2x-protocol



sorry to hear that, it's tough work for me to analize the communication protocol since no javascript-based client library is provided. Anyway thanks for your kind help.

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 32 guests