This method seems pretty redundant, could just be called directly. (#677)

This commit is contained in:
rodolphito 2019-03-27 11:06:42 -07:00 committed by Paul Pacheco
parent 49f39f9c09
commit 40d2ec54e5

View File

@ -13,7 +13,7 @@ public static class NetworkTime
// average out the last few results from Ping
public static int PingWindowSize = 10;
internal static double lastPingTime;
static double lastPingTime;
// Date and time when the application started
@ -45,16 +45,11 @@ public static void Reset()
offsetMax = double.MaxValue;
}
internal static NetworkPingMessage GetPing()
{
return new NetworkPingMessage(LocalTime());
}
internal static void UpdateClient()
{
if (Time.time - lastPingTime >= PingFrequency)
{
NetworkPingMessage pingMessage = GetPing();
NetworkPingMessage pingMessage = new NetworkPingMessage(LocalTime());
NetworkClient.Send(pingMessage);
lastPingTime = Time.time;
}