mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
fix: Reset Network Time whenever server starts (#2713)
This commit is contained in:
parent
d33965c800
commit
28f186a76f
@ -69,6 +69,9 @@ static void Initialize()
|
||||
//Make sure connections are cleared in case any old connections references exist from previous sessions
|
||||
connections.Clear();
|
||||
|
||||
// reset NetworkTime
|
||||
NetworkTime.Reset();
|
||||
|
||||
Debug.Assert(Transport.activeTransport != null, "There was no active transport when calling NetworkServer.Listen, If you are calling Listen manually then make sure to set 'Transport.activeTransport' first");
|
||||
AddTransportHandlers();
|
||||
}
|
||||
|
@ -36,6 +36,7 @@ static NetworkTime()
|
||||
|
||||
public static void Reset()
|
||||
{
|
||||
stopwatch.Restart();
|
||||
_rtt = new ExponentialMovingAverage(PingWindowSize);
|
||||
_offset = new ExponentialMovingAverage(PingWindowSize);
|
||||
offsetMin = double.MinValue;
|
||||
|
Loading…
Reference in New Issue
Block a user