getAllUsersInZone

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

Moderators: Lapo, Bax

Post Reply
radz
Posts: 16
Joined: 06 Oct 2005, 07:38

getAllUsersInZone

Post by radz »

Hi, I have a little problem with broadcasting an event to all users in a zone.

I have one main room with an extension handling events. There are also game rooms using an other extension.

When a user enters a game room and leaves the main room, currZone.getAllUsersInZone() in the main extension does not include users in the game rooms (even though they are in the same zone). Is it possible to get a list of all users regardless of which extension is being used? Am I missing something?
Virusescu
Posts: 260
Joined: 07 Sep 2005, 09:36
Location: [RO]Bucharest
Contact:

Post by Virusescu »

Hello radz.
The zone class does not provide such a method like getAllUsersInZone(); - Or does it? Maybe I need to update :roll:
You will have to do it manually.

Read this topic for more info and code how to do it
http://forums.smartfoxserver.com/viewto ... etallusers
function onJoin(usr) {if (usr.getName() == "Lapo") trace ("All Hail Lapo");}
radz
Posts: 16
Joined: 06 Oct 2005, 07:38

Post by radz »

getAllUsersInZone() is documented in the java docs anyway. I tried getChannelList() instead and it worked fine. Thanks for your reply.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Yep, that's an alternative.
You're right the getAllUsersInZone actually filters users inside game rooms. At the moment, without the source under my eyes, I can't remember why it was implemented this way.

I will check it and see. It's probably needed a method that returns the full list of users without exceptions
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply