You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-17 15:46:33 +09:00
Re-added ReadTime()
This commit is contained in:
@@ -601,6 +601,20 @@ namespace Lidgren.Network
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads a value, in local time comparable to NetTime.Now, written using WriteTime() for the connection supplied
|
||||
/// </summary>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads a stored IPv4 endpoint description
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user