Closed wI2L closed 10 years ago
Hi @wI2L,
Sorry, that's a typo in the doc, it should say
If
clientTime
is omitted ...
It's reactive if you don't pass in a client time, and will show the server's current time. Otherwise, it shows the server time for whatever client time was passed in, and this depends only on the computed offset, not the current time.
Does that make sense?
I arrived to this conclusion after i looked in the source code indeed. I just wanted to point out the error in the doc, which leaded me to this problem.
Anyway, thanks for your answer and the precisions.
What do you mean by 'the precisions'?
Sorry, i meant your explanations :)
Ah, right. My French is a bit rusty.
Hi.
I have noticed an error in the doc. For
TimeSync.serverTime(clientTime)
it says: returns the server time for a given client time. A reactive variable. If clientTime is not omitted, returns the current time on the server which reactively updates every second.I first tried to pass
Date.now()
to get a reactive return (i'm using the function in an helper), but it didnt reactively update.When i remove
Date.now()
and calledTimeSync.serverTime()
it worked. Also, after checking the source, i've read :if (!clientTime) timeTick.depend()
.Regards,
William