From d07f10b7bef01fe787f48ee0cb3380393a8d5a33 Mon Sep 17 00:00:00 2001 From: vis2k Date: Wed, 16 Jun 2021 16:58:20 +0800 Subject: [PATCH] use NetworkTime.localTime where local time was previously implied when using NetworkTime.time on the server. for clarity. --- .../InterestManagement/Distance/DistanceInterestManagement.cs | 4 ++-- .../SpatialHashing/SpatialHashingInterestManagement.cs | 4 ++-- .../Runtime/Transport/KCP/MirrorTransport/KcpTransport.cs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Assets/Mirror/Components/InterestManagement/Distance/DistanceInterestManagement.cs b/Assets/Mirror/Components/InterestManagement/Distance/DistanceInterestManagement.cs index 6aa8d7d11..48a7cf31a 100644 --- a/Assets/Mirror/Components/InterestManagement/Distance/DistanceInterestManagement.cs +++ b/Assets/Mirror/Components/InterestManagement/Distance/DistanceInterestManagement.cs @@ -50,10 +50,10 @@ void Update() if (!NetworkServer.active) return; // rebuild all spawned NetworkIdentity's observers every interval - if (NetworkTime.time >= lastRebuildTime + rebuildInterval) + if (NetworkTime.localTime >= lastRebuildTime + rebuildInterval) { RebuildAll(); - lastRebuildTime = NetworkTime.time; + lastRebuildTime = NetworkTime.localTime; } } } diff --git a/Assets/Mirror/Components/InterestManagement/SpatialHashing/SpatialHashingInterestManagement.cs b/Assets/Mirror/Components/InterestManagement/SpatialHashing/SpatialHashingInterestManagement.cs index 4761f7a85..d7e19a2b4 100644 --- a/Assets/Mirror/Components/InterestManagement/SpatialHashing/SpatialHashingInterestManagement.cs +++ b/Assets/Mirror/Components/InterestManagement/SpatialHashing/SpatialHashingInterestManagement.cs @@ -103,10 +103,10 @@ internal void Update() // rebuild all spawned entities' observers every 'interval' // this will call OnRebuildObservers which then returns the // observers at grid[position] for each entity. - if (NetworkTime.time >= lastRebuildTime + rebuildInterval) + if (NetworkTime.localTime >= lastRebuildTime + rebuildInterval) { RebuildAll(); - lastRebuildTime = NetworkTime.time; + lastRebuildTime = NetworkTime.localTime; } } diff --git a/Assets/Mirror/Runtime/Transport/KCP/MirrorTransport/KcpTransport.cs b/Assets/Mirror/Runtime/Transport/KCP/MirrorTransport/KcpTransport.cs index a1a42f57c..34cd70fca 100644 --- a/Assets/Mirror/Runtime/Transport/KCP/MirrorTransport/KcpTransport.cs +++ b/Assets/Mirror/Runtime/Transport/KCP/MirrorTransport/KcpTransport.cs @@ -291,7 +291,7 @@ void OnLogStatistics() { if (ServerActive()) { - string log = "kcp SERVER @ time: " + NetworkTime.time + "\n"; + string log = "kcp SERVER @ time: " + NetworkTime.localTime + "\n"; log += $" connections: {server.connections.Count}\n"; log += $" MaxSendRate (avg): {PrettyBytes(GetAverageMaxSendRate())}/s\n"; log += $" MaxRecvRate (avg): {PrettyBytes(GetAverageMaxReceiveRate())}/s\n"; @@ -304,7 +304,7 @@ void OnLogStatistics() if (ClientConnected()) { - string log = "kcp CLIENT @ time: " + NetworkTime.time + "\n"; + string log = "kcp CLIENT @ time: " + NetworkTime.localTime + "\n"; log += $" MaxSendRate: {PrettyBytes(client.connection.MaxSendRate)}/s\n"; log += $" MaxRecvRate: {PrettyBytes(client.connection.MaxReceiveRate)}/s\n"; log += $" SendQueue: {client.connection.SendQueueCount}\n";