Author Topic: Network.Time  (Read 2042 times)

Manmax75

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 3
  • Posts: 32
    • View Profile
Network.Time
« on: July 03, 2013, 03:51:11 AM »
Hey everyone.

Does Tnet have a synchronized time value for all clients?
(Like Network.Time in Unity Networking)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Network.Time
« Reply #1 on: July 03, 2013, 04:06:59 AM »
Not built-in, no. Reason being, you can't really sync network time and have it be the same on all clients due to latency -- and if you use Network.Time in Unity, you will see exactly that problem. Gave me quite a few "wtf" moments in the past, actually. :)

If you really want to sync game time, do it on the host (TNManager.isHosting check), and send (Time.time + TNManager.ping). On the clients, add TNManager.ping to it as well. Record the difference between the value and your own Time.time, and use this offset in the future.

Manmax75

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 3
  • Posts: 32
    • View Profile
Re: Network.Time
« Reply #2 on: July 03, 2013, 05:19:56 AM »
Cheers  :)