I am trying to get a list of all users in a zone back into my flash client.
I am using a server side extension to get a list of all users in a zone.
var response = {};
response._cmd = "getAllUsersResponse";
//send a response to all clients in the zone
var zone = _server.getCurrentZone();
var userList = zone.getUserList();
trace("total users=" + zone.getUserCount()); //this bit works
//send response to submitting user
_server.sendResponse(response, -1, null, [user]);
I get a reply back in my flash client but nothing in the response containing a userlist.
I really need an urgent answer on this one, so grateful for any help.
Sending user list back to flash
Hi. If the code you posted is the full code, then you're forgetting adding the userList to the response Object.
try something like:
response.userList = zone.getUserList();
then in the client you get the user list by:
smartfox.onExtensionResponse(o:Object){
if(o._cmd == "getAllUsersResponse"){
var receivedUserList = o.userList;
}
}
try something like:
response.userList = zone.getUserList();
then in the client you get the user list by:
smartfox.onExtensionResponse(o:Object){
if(o._cmd == "getAllUsersResponse"){
var receivedUserList = o.userList;
}
}
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.