I'm developing a multiplayer game through Gamecenter in unity with prime31 plugin. This is how I sync the clocks of the two players (right now there will only be 2 player in one match), and I wanted to now if it's ok:
This is done one time at the start of the match.
I have device A and device B.
Device A resets it's game clock to 0.0f.
A sends a reliable message to B saying that A has reset it's game clock.
B recieves the message and resets his game clock as well and sends a message to A saying he has also reseted the clock.
A recieves the message and does the following.
float delayAtoB = getCurrentTime() / 2; setGameClock(delayAtoB);
delayAtoB is actually this the time it took to get to B, so right now the two devices have the same clock. It works ok, but I wanted some opinions because I'm not sure if it's the best way and some exceptions might ocur..