mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkTime.UpdateClient doesn't require NetworkClient anymore
This commit is contained in:
parent
8c125d2fd3
commit
cd56c6a6f7
@ -111,7 +111,7 @@ void OnConnected()
|
||||
// the handler may want to send messages to the client
|
||||
// thus we should set the connected state before calling the handler
|
||||
connectState = ConnectState.Connected;
|
||||
NetworkTime.UpdateClient(this);
|
||||
NetworkTime.UpdateClient();
|
||||
connection.InvokeHandler(new ConnectMessage());
|
||||
}
|
||||
else Debug.LogError("Skipped Connect message handling because m_Connection is null.");
|
||||
@ -178,7 +178,7 @@ internal virtual void Update()
|
||||
// only update things while connected
|
||||
if (active && connectState == ConnectState.Connected)
|
||||
{
|
||||
NetworkTime.UpdateClient(this);
|
||||
NetworkTime.UpdateClient();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,12 +50,12 @@ internal static NetworkPingMessage GetPing()
|
||||
return new NetworkPingMessage(LocalTime());
|
||||
}
|
||||
|
||||
internal static void UpdateClient(NetworkClient networkClient)
|
||||
internal static void UpdateClient()
|
||||
{
|
||||
if (Time.time - lastPingTime >= PingFrequency)
|
||||
{
|
||||
NetworkPingMessage pingMessage = GetPing();
|
||||
networkClient.Send(pingMessage);
|
||||
NetworkClient.Send(pingMessage);
|
||||
lastPingTime = Time.time;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user