diff --git a/com.unity.netcode.gameobjects/CHANGELOG.md b/com.unity.netcode.gameobjects/CHANGELOG.md index c4edcc652c..93ed4d1732 100644 --- a/com.unity.netcode.gameobjects/CHANGELOG.md +++ b/com.unity.netcode.gameobjects/CHANGELOG.md @@ -8,6 +8,18 @@ Additional documentation and release notes are available at [Multiplayer Documen ## [Unreleased] +### Added + + +### Fixed + + +### Changed + + + +## [2.3.0] - 2025-04-09 + ### Added - Added `NetworkManager.OnPreShutdown` which is called before the NetworkManager cleans up and shuts down. (#3366) diff --git a/com.unity.netcode.gameobjects/Runtime/Components/Interpolator/BufferedLinearInterpolator.cs b/com.unity.netcode.gameobjects/Runtime/Components/Interpolator/BufferedLinearInterpolator.cs index b07eca8250..f96bb55392 100644 --- a/com.unity.netcode.gameobjects/Runtime/Components/Interpolator/BufferedLinearInterpolator.cs +++ b/com.unity.netcode.gameobjects/Runtime/Components/Interpolator/BufferedLinearInterpolator.cs @@ -101,7 +101,7 @@ protected internal struct BufferedItem public double TimeSent; /// - /// The constructor. + /// Constructor that accepts an item identifier. /// /// The item value. /// The time the item was sent. @@ -112,6 +112,19 @@ public BufferedItem(T item, double timeSent, int itemId) TimeSent = timeSent; ItemId = itemId; } + + /// + /// The original constructor. + /// + /// The item value. + /// The time the item was sent. + public BufferedItem(T item, double timeSent) + { + Item = item; + TimeSent = timeSent; + // Generate a unique item id based on the time to the 2nd decimal place + ItemId = (int)(timeSent * 100); + } } /// diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVisibilityTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVisibilityTests.cs index a19f856ad1..670bd9d091 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVisibilityTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkVisibilityTests.cs @@ -87,8 +87,9 @@ public IEnumerator HideShowAndDeleteTest() sessionOwnerNetworkObject.NetworkShow(m_ClientNetworkManagers[clientIndex].LocalClientId); sessionOwnerNetworkObject.Despawn(true); - // Expect no exceptions - yield return s_DefaultWaitForTick; + // Expect no exceptions while waiting to show the object and wait for the client id to be removed + yield return WaitForConditionOrTimeOut(() => !m_SessionOwner.SpawnManager.ObjectsToShowToClient.ContainsKey(m_ClientNetworkManagers[clientIndex].LocalClientId)); + AssertOnTimeout($"Timed out waiting for client-{m_ClientNetworkManagers[clientIndex].LocalClientId} to be removed from the {nameof(NetworkSpawnManager.ObjectsToShowToClient)} table!"); // Now force a scenario where it normally would have caused an exception m_SessionOwner.SpawnManager.ObjectsToShowToClient.Add(m_ClientNetworkManagers[clientIndex].LocalClientId, new System.Collections.Generic.List()); diff --git a/com.unity.netcode.gameobjects/package.json b/com.unity.netcode.gameobjects/package.json index c20e366c3c..b8b6581016 100644 --- a/com.unity.netcode.gameobjects/package.json +++ b/com.unity.netcode.gameobjects/package.json @@ -2,7 +2,7 @@ "name": "com.unity.netcode.gameobjects", "displayName": "Netcode for GameObjects", "description": "Netcode for GameObjects is a high-level netcode SDK that provides networking capabilities to GameObject/MonoBehaviour workflows within Unity and sits on top of underlying transport layer.", - "version": "2.2.0", + "version": "2.3.0", "unity": "6000.0", "dependencies": { "com.unity.nuget.mono-cecil": "1.11.4",