RPC and the timestamp info

Options
Hello people :smile:
I'm new with photon and is the first time I'm writing in this forum.
At the moment I'm working in a fps multiplayer project where I need to implement a sort of Lag compensation (https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking)

To acomplish this, the master client needs to know exactly "When" the RPC was sent from the client.
I have elaborated several theories, but none of them are completely perfect:

1. By trial and error I have found that: RPCSendTime=PhotonNetwork.time-(RoundTripTime/1000)*2,2

2. Reading the parameter PhotonMessageInfo info.timestamp when I receive the RPC

Sometimes they work, and sometimes they are far away from be correct.

So my question is, How could I determine in the Master client "When" the RPC was sent from the client?
I know I should do in the Master client something like:

PhotonNetwork.time-(latency of the packets)

or should I use the attribute info.timestamp?
or is there another attribute I am missing?

Thanks in advance guys!

Comments