Page 1 of 1
noobie question
Posted: 25 Jan 2011, 18:30
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?
Posted: 26 Jan 2011, 08:09
by Lapo
Check the last "HowTo" in this article from the docs:
http://docs2x.smartfoxserver.com/Gettin ... wtos#item7
cheers
Posted: 26 Jan 2011, 08:33
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?
Posted: 26 Jan 2011, 09:21
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