Extension response to everyone except self...

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Devon
Posts: 41
Joined: 12 Apr 2011, 16:18

Extension response to everyone except self...

Postby Devon » 31 Dec 2012, 13:54

Is there an easy way to send an extensions response to everyone except the sender or do I have to loop through all users in the List with a conditional to avoid sending the response to the sender?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Extension response to everyone except self...

Postby Lapo » 01 Jan 2013, 12:52

Yes, it's quite easy, whether you are sending to the users of a Room or an entire Zone...
1) grab the list of users you want to sent to. Example:

Code: Select all

List<User> recipients = theRoom.getUserList();

2) remove the sender from the list and send

Code: Select all

recipients.remove(sender)

3) send the message

Happy new year
Lapo
--
gotoAndPlay()
...addicted to flash games
Devon
Posts: 41
Joined: 12 Apr 2011, 16:18

Re: Extension response to everyone except self...

Postby Devon » 01 Jan 2013, 21:14

Thanks and happy new year to you too!

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Thomasea and 54 guests