I am trying to write an extension that receives some data from a client, then informs ALL users that the data was received.
Is this possible?
The sendResponse needs an array of all users, how do I that?
Many thanks
send a response to all users
Hi.
If you want to inform all the users inside the room, you can get the userList by using:
_server.getCurrentRoom().getAllUsers();
If you want to inform all the users inside the zone, you can get the userList by using:
_server.getCurrentZone().getUserList();
Both this methods return an Array containing all users, so you can use it in the sendResponse method.
For more information, you can check the serverSide API:
http://www.smartfoxserver.com/docs/docP ... /index.htm
Note:
this code i posted is for an ActionScript Extension
If you want to inform all the users inside the room, you can get the userList by using:
_server.getCurrentRoom().getAllUsers();
If you want to inform all the users inside the zone, you can get the userList by using:
_server.getCurrentZone().getUserList();
Both this methods return an Array containing all users, so you can use it in the sendResponse method.
For more information, you can check the serverSide API:
http://www.smartfoxserver.com/docs/docP ... /index.htm
Note:
this code i posted is for an ActionScript Extension
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.
That depends on your implementation. In my environment, for example, moderators don't have any permission/relevance out of Smartfox's operational services. Depending on the situation, using a mod message could be a very efficient way to broadcast a message (without still giving root access to a given user), agaisnt iterating over 10k online users to send individual messages.
Return to “Server Side Extension Development”
Who is online
Users browsing this forum: No registered users and 23 guests