noobie question

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

Moderators: Lapo, Bax

Post Reply
hamish
Posts: 6
Joined: 13 Dec 2010, 16:49
Location: UK

noobie question

Post by hamish »

Hi this might sound dumb. But what is best practice for sending an event to all clients that originates from a timed event on the server when you don't have a user?
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Check the last "HowTo" in this article from the docs:
http://docs2x.smartfoxserver.com/Gettin ... wtos#item7

cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
hamish
Posts: 6
Joined: 13 Dec 2010, 16:49
Location: UK

Post by hamish »

Thanks for getting back to me, but it didn't answer the question. Setting up the timer is shown in the howto. but how do you raise an event in all connected clients for a room or zone without having a user object?

Actually i think i've got it... update the room variables?
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Without having a user object? This is not very clear to me.

In order to send messages to one or more clients you use the server side send(...) method from your extension which takes a List<User> as the recipient list.
You can obtain the list by taking all users from a Room, a Group of Rooms, an entire Zone etc...

What you suggest is also valid too. If you use Room Variables you will immediately update all clients in a specific Room.

hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply