You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-16 15:16:33 +09:00
tiny additions
This commit is contained in:
@@ -17,9 +17,14 @@ namespace Lidgren.Network
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public float AverageRoundtripTime { get { return m_averageRoundtripTime; } }
|
public float AverageRoundtripTime { get { return m_averageRoundtripTime; } }
|
||||||
|
|
||||||
internal double GetLocalTime(double remoteTimeStamp)
|
public double GetLocalTime(double remoteTimestamp)
|
||||||
{
|
{
|
||||||
return remoteTimeStamp - m_remoteTimeOffset;
|
return remoteTimestamp - m_remoteTimeOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double GetRemoteTime(double localTimestamp)
|
||||||
|
{
|
||||||
|
return localTimestamp + m_remoteTimeOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void InitializePing()
|
internal void InitializePing()
|
||||||
|
|||||||
@@ -476,6 +476,7 @@ namespace Lidgren.Network
|
|||||||
if (m_senderConnection == null)
|
if (m_senderConnection == null)
|
||||||
throw new NetException("Cannot call ReadTime() on message without a connected sender (ie. unconnected messages)");
|
throw new NetException("Cannot call ReadTime() on message without a connected sender (ie. unconnected messages)");
|
||||||
|
|
||||||
|
// lets bypass NetConnection.GetLocalTime for speed
|
||||||
return remoteTime - m_senderConnection.m_remoteTimeOffset;
|
return remoteTime - m_senderConnection.m_remoteTimeOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user