You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/CHANGELOG.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,11 +12,20 @@ Additional documentation and release notes are available at [Multiplayer Documen
12
12
13
13
### Fixed
14
14
15
+
### Changed
16
+
17
+
18
+
## [1.12.2] - 2025-01-17
19
+
20
+
### Fixed
21
+
22
+
- Fixed issue where `NetworkVariableBase` derived classes were not being re-initialized if the associated `NetworkObject` instance was not destroyed and re-spawned. (#3217)
15
23
- Fixed issue where a spawned `NetworkObject` that was registered with a prefab handler and owned by a client would invoke destroy more than once on the host-server side if the client disconnected while the `NetworkObject` was still spawned. (#3202)
16
24
- Fixed issue where `NetworkRigidBody2D` was still using the deprecated `isKinematic` property in Unity versions 2022.3 and newer. (#3199)
17
25
- Fixed issue where an exception was thrown when calling `NetworkManager.Shutdown` after calling `UnityTransport.Shutdown`. (#3118)
18
26
19
-
### Changed
27
+
28
+
- Changed the `NetworkTimeSystem.Sync` method to use half RTT to calculate the desired local time offset as opposed to the full RTT. (#3206)
Debug.LogWarning($"[{m_NetworkBehaviour.name}][{m_NetworkBehaviour.GetType().Name}][{GetType().Name}][Initialize] {nameof(NetworkManager)} has no {nameof(NetworkTimeSystem)} assigned!");
121
+
}
122
+
}
123
+
124
+
/// <summary>
125
+
/// Deinitialize is invoked when a NetworkObject is despawned.
126
+
/// This allows for a recyled NetworkObject (in-scene or pooled)
127
+
/// to be properly initialized upon the next use/spawn.
128
+
/// </summary>
129
+
internalvoidDeinitialize()
130
+
{
131
+
// When despawned, reset the HasBeenInitialized so if the associated NetworkObject instance
132
+
// is recylced (i.e. in-scene placed or pooled) it will re-initialize the LastUpdateSent time.
// server speedup/slowdowns should not be affected by RTT
45
+
Assert.True(Math.Abs(offsetToTarget)<k_AcceptableRttOffset,$"Expected offset time to be less than {k_AcceptableRttOffset}ms but it was {offsetToTarget}!");
44
46
45
47
// run again, test that we never need to speed up or slow down under stable RTT
// server speedup/slowdowns should not be affected by RTT
59
+
Assert.True(Math.Abs(offsetToTarget)<k_AcceptableRttOffset,$"Expected offset time to be less than {k_AcceptableRttOffset}ms but it was {offsetToTarget}!");
57
60
58
61
// difference between first and second offset should be minimal
Assert.True(expectedSpeedUpTime<k_AcceptableRttOffset,$"Expected local speed up time to be less than {k_AcceptableRttOffset}ms but it was {expectedSpeedUpTime}!");
112
+
// server speedup/slowdowns should not be affected by RTT
113
+
Assert.True(Math.Abs(totalServerSpeedUpTime)<k_AcceptableRttOffset,$"Expected server speed up time to be less than {k_AcceptableRttOffset}ms but it was {expectedServerSpeedUpTime}!");
107
114
108
115
109
-
// run again with RTT ~100ms and see whether we slow down by -0.1f
116
+
// run again with RTT ~100ms and see whether we slow down by -halfRtt
110
117
unscaledLocalTime=timeSystem.LocalTime;
111
118
unscaledServerTime=timeSystem.ServerTime;
112
119
@@ -121,13 +128,13 @@ public void RttCatchupSlowdownTest()
Assert.True(expectedSpeedUpTime<k_AcceptableRttOffset,$"Expected local speed up time to be less than {k_AcceptableRttOffset}ms but it was {expectedSpeedUpTime}!");
136
+
// server speedup/slowdowns should not be affected by RTT
137
+
Assert.True(Math.Abs(totalServerSpeedUpTime)<k_AcceptableRttOffset,$"Expected server speed up time to be less than {k_AcceptableRttOffset}ms but it was {expectedServerSpeedUpTime}!");
0 commit comments