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 ?
how to get JSON format response ?
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
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.
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 67 guests