1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-15 22:56:30 +09:00

ConnectionLatencyUpdated message type added; WriteTime() ReadTime() added

This commit is contained in:
lidgren
2010-12-20 10:35:51 +00:00
parent 772d80835b
commit 330c5cf83e
11 changed files with 85 additions and 25 deletions

View File

@@ -534,6 +534,17 @@ namespace Lidgren.Network
Write((ushort)endPoint.Port);
}
/// <summary>
/// Writes the local time to a message; readable (and convertable to local time) by the remote host using ReadTime()
/// </summary>
public void WriteTime(double localTime, bool highPrecision)
{
if (highPrecision)
Write(localTime);
else
Write((float)localTime);
}
/// <summary>
/// Pads data with enough bits to reach a full byte. Decreases cpu usage for subsequent byte writes.
/// </summary>