Author Topic: GetTime()  (Read 1971 times)

Rannion

  • Not-a-newbie
  • *
  • Posts: 25
  • Karma: 0
    • View Profile
GetTime()
« on: December 13, 2006, 12:30:50 PM »
Is there a way to have in RakPeer a time which would be synchronized ?
Like I have a server and when a client connect to the server, it is automatically in sync with some time on the server.
Like this when the server says that client will start that action at time t, all the client knows excatly when they will have to start that action.

And if it's not existing at the moment, could it be implemented in the future ?

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 292
    • View Profile
    • RakNet
Re: GetTime()
« Reply #1 on: December 13, 2006, 01:15:10 PM »
It's there internally.  See the timestamping packets part of the documentation.

Rannion

  • Not-a-newbie
  • *
  • Posts: 25
  • Karma: 0
    • View Profile
Re: GetTime()
« Reply #2 on: December 18, 2006, 05:37:32 AM »
Excuse me but looking at what's going on in ReplicaManager.cpp, I don't understand how your system is working.
First when we are in the update, just before the call to Serialize() you set sendTimestamp=false;
Also even if we change this to force it to send the timestamp, it is then sending currentTime, when the ping is it taken into account ?

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 292
    • View Profile
    • RakNet
Re: GetTime()
« Reply #3 on: December 18, 2006, 02:06:59 PM »
The recipient takes ping into account.