Lidgren.Network.NetBuffer.ReadTime C# (CSharp) Method

ReadTime() public method

Reads a value, in local time comparable to NetTime.Now, written using WriteTime() for the connection supplied
public ReadTime ( NetConnection connection, bool highPrecision ) : double
connection NetConnection
highPrecision bool
return double
        public double ReadTime(NetConnection connection, bool highPrecision)
        {
            double remoteTime = (highPrecision ? ReadDouble() : (double)ReadSingle());

            if (connection == null)
                throw new NetException("Cannot call ReadTime() on message without a connected sender (ie. unconnected messages)");

            // lets bypass NetConnection.GetLocalTime for speed
            return remoteTime - connection.m_remoteTimeOffset;
        }