Hi Rafael, Why not simply embed the remaining time on the counter in the initial page, and have the javascript code handle things from there on? You can't trust users' clocks to be set correctly, but you can trust them to tick at the right rate.
-Nick Johnson On Fri, Dec 3, 2010 at 11:27 PM, Rafael Sierra <[email protected]>wrote: > All the users share the same timer (like in the movies when everyone > stare at the television with the countdown in it) > > I need to send that timer so the users know how much time is left. In > my current test I'm going into another aproach, when the timer starts, > I send a message to every user telling how much time is left and when > the timer was started (so I know how much time has passed since the > begin) and when the user access some page it sends the current time at > server (I can't trust in the user's clock), and the real times is done > at the client (with setInterval for example). I know that there are > problems like the user changing variables with firebug, but that will > corrupt data only for him, and this is not a big deal. > > On Fri, Dec 3, 2010 at 4:59 AM, Robert Kluin <[email protected]> > wrote: > > Hi Rafael, > > Do all users care about the same timer, or does each user have their > > own, or is there one timer for a group, or something else? Do you > > need to push the remaining time at particular time for some reason? > > > > > > > > Robert > > > > > > > > > > > > > > On Thu, Dec 2, 2010 at 20:35, Rafael Sierra <[email protected]> > wrote: > >> I know that I cannot share Client IDs between multiple users, but I > >> still need something like a broadcast message system. > >> > >> Today, users make requests in regular intervals to get the update of > >> the information, let's say a timer counting down like a bomb, each > >> client asks the server how much time left to the bomb explodes and the > >> server answer the time, and it is made every second until the bomb > >> explods (oh god, this thread will be tracked by USA). > >> > >> When I first saw Channel API I thought that in the future I could just > >> do a simple send_message("120") (which means 2 minutes) and every > >> client would get the information, but now with the release 1.4 I know > >> that I can't do it. Instead I was wondering how I could use Channel > >> API to reduce my request count. > >> > >> The first solution that came to me is to made an eternal loop (that > >> would eventualy die in 10 minutes) in which I would loop across all > >> the users (yet to know who is online) and send them the time. > >> Actually, this is the only solution I got in mind, does someone have a > >> better idea? > >> > >> -- > >> Rafael Sierra > >> http://blog.rafaelsdm.com > >> > >> -- > >> You received this message because you are subscribed to the Google > Groups "Google App Engine" group. > >> To post to this group, send email to [email protected]. > >> To unsubscribe from this group, send email to > [email protected]<google-appengine%[email protected]> > . > >> For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > >> > >> > > > > -- > > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > [email protected]<google-appengine%[email protected]> > . > > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > > > > > > > > -- > Rafael Sierra > http://blog.rafaelsdm.com > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-appengine%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > > -- Nick Johnson, Developer Programs Engineer, App Engine Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number: 368047 -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
