diff --git a/Assets/Mirror/Core/NetworkManager.cs b/Assets/Mirror/Core/NetworkManager.cs
index d5c66d198..48b1c8a49 100644
--- a/Assets/Mirror/Core/NetworkManager.cs
+++ b/Assets/Mirror/Core/NetworkManager.cs
@@ -268,21 +268,6 @@ void UpdateConnectionQuality()
}
}
- // users can overwrite this to run their own connection quality estimation.
- protected virtual void CalculateConnectionQuality()
- {
- // NetworkClient.connectionQuality = ConnectionQualityHeuristics.Pragmatic(NetworkClient.initialBufferTime, NetworkClient.bufferTime);
- NetworkClient.connectionQuality = ConnectionQualityHeuristics.Simple(NetworkTime.rtt, NetworkTime.rttVariance);
- }
-
- // users can overwrite this to display connection quality warnings, etc.
- protected virtual void OnConnectionQualityChanged(ConnectionQuality previous, ConnectionQuality current)
- {
- // logging the change is very useful to track down user's lag reports.
- // we want to include as much detail as possible for debugging.
- Debug.Log($"[Mirror] Connection Quality changed from {previous} to {current}:\n rtt={(NetworkTime.rtt*1000):F1}ms\n rttVar={(NetworkTime.rttVariance*1000):F1}ms\n bufferTime={(NetworkClient.bufferTime*1000):F1}ms");
- }
-
////////////////////////////////////////////////////////////////////////
// keep the online scene change check in a separate function.
@@ -1400,6 +1385,21 @@ public virtual void OnClientConnect()
/// Called on clients when disconnected from a server.
public virtual void OnClientDisconnect() { }
+ /// Called on client when connection quality is calculated. Override to use your own measurements.
+ public virtual void CalculateConnectionQuality()
+ {
+ // NetworkClient.connectionQuality = ConnectionQualityHeuristics.Pragmatic(NetworkClient.initialBufferTime, NetworkClient.bufferTime);
+ NetworkClient.connectionQuality = ConnectionQualityHeuristics.Simple(NetworkTime.rtt, NetworkTime.rttVariance);
+ }
+
+ /// Called on client when connection quality changes. Override to show your own warnings or UI visuals.
+ public virtual void OnConnectionQualityChanged(ConnectionQuality previous, ConnectionQuality current)
+ {
+ // logging the change is very useful to track down user's lag reports.
+ // we want to include as much detail as possible for debugging.
+ Debug.Log($"[Mirror] Connection Quality changed from {previous} to {current}:\n rtt={(NetworkTime.rtt * 1000):F1}ms\n rttVar={(NetworkTime.rttVariance * 1000):F1}ms\n bufferTime={(NetworkClient.bufferTime * 1000):F1}ms");
+ }
+
/// Called on client when transport raises an exception.
public virtual void OnClientError(TransportError error, string reason) { }