mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
perf: synchronize network time over unreliable (#2543)
This commit is contained in:
parent
1cdbcd64ba
commit
7e3b7b9e11
@ -58,7 +58,7 @@ internal static void UpdateClient()
|
||||
if (Time.time - lastPingTime >= PingFrequency)
|
||||
{
|
||||
NetworkPingMessage pingMessage = new NetworkPingMessage(LocalTime());
|
||||
NetworkClient.Send(pingMessage);
|
||||
NetworkClient.Send(pingMessage, Channels.DefaultUnreliable);
|
||||
lastPingTime = Time.time;
|
||||
}
|
||||
}
|
||||
@ -76,7 +76,7 @@ internal static void OnServerPing(NetworkConnection conn, NetworkPingMessage msg
|
||||
serverTime = LocalTime()
|
||||
};
|
||||
|
||||
conn.Send(pongMsg);
|
||||
conn.Send(pongMsg, Channels.DefaultUnreliable);
|
||||
}
|
||||
|
||||
// Executed at the client when we receive a Pong message
|
||||
|
Loading…
Reference in New Issue
Block a user