From 550c6544f76ad3853698f0c938b47389497d050b Mon Sep 17 00:00:00 2001 From: in0finite Date: Wed, 4 May 2022 09:32:48 +0200 Subject: [PATCH] fix ping sending frequency --- Assets/Scripts/Networking/NetManager.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Networking/NetManager.cs b/Assets/Scripts/Networking/NetManager.cs index 5d56fcec..80f2fa0d 100644 --- a/Assets/Scripts/Networking/NetManager.cs +++ b/Assets/Scripts/Networking/NetManager.cs @@ -99,6 +99,9 @@ namespace SanAndreasUnity.Net F.InvokeEventExceptionSafe(this.onServerStatusChanged); } + // we need more agile ping measurement + // the reason we assign this here, is because Mirror resets the value after scene load + Mirror.NetworkTime.PingFrequency = 0.5f; } @@ -160,7 +163,6 @@ namespace SanAndreasUnity.Net CheckIfIPAddressIsValid (ip); CheckIfPortIsValid (serverPortNumber); SetupNetworkManger( ip, serverPortNumber ); - Mirror.NetworkTime.PingFrequency = 0.5f; // we need more agile ping measurement NetworkManager.singleton.StartClient (); }