Get Online Users not working on 1.6

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

Moderators: Lapo, Bax

amnesya
Posts: 18
Joined: 10 Dec 2007, 21:54

Get Online Users not working on 1.6

Postby amnesya » 18 Dec 2007, 11:08

I was using this code to get online players :

var conn:XMLSocket = new XMLSocket()
conn.onConnect = connected
conn.onClose = closed
conn.onData = gotData
conn.connect(_parent.ip, 9339)
function connected(ok){
if (ok) {
this.send(request)
}
}
var request:String = '<msg t="sys"><body r="-1" action="zInfo">testscope</body></msg>'
function gotData(msg:String){
trace("zInfo = " + msg);
if (msg.indexOf("zInfo") > -1){
var xml:XML = new XML(msg)
var count:String = xml.firstChild.childNodes[0].toString()
playersonline = count;
conn.close()
}
}


not working on 1.6
User avatar
darnpunk
Posts: 229
Joined: 22 Jun 2007, 02:58
Location: SG

Postby darnpunk » 19 Dec 2007, 05:57

Hi amnesya,

I just tried your code and it's working. Did you set EnableZoneInfo to true?
amnesya
Posts: 18
Joined: 10 Dec 2007, 21:54

Postby amnesya » 19 Dec 2007, 20:26

what an alchoolic I am!!!

thanks man !

that was the problem !

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 37 guests