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
fix: SceneEventProgress was triggering twice when running a host and no clients were connected (Unity-Technologies#2292)
* fix
Exclude the host-client from being processed as one of the clients to test for when the scene event has completed.
GetClientsWithStatus needed to add the host-client to the list of clients that completed once the scene event was completed. Also fixed a bug in GetClientsWithStatus where, when checking for clients that did not complete, it would include the clients that completed and the clients that did not complete in the list of client identifiers it returned.
Fixing issue where integration tests could lag by more than 1 network tick and the AsyncOperation could not yet be assigned.
* test
Added HostReceivesOneLoadEventCompletedNotification integration test to validate the fix for this PR.
Updated NetcodeIntegrationTest virtual methods to be able to gain access to a newly created client (via NetcodeIntegrationTest.CreateAndStartNewClient) when it is first created, started, and when it has been connected.
The updates to SceneEventProgress exposed an issue with ClientSynchronizationValidationTest. It was written before many NetcodeIntegrationTest helpers, so there are adjustments here to leverage from those which greatly simplifies the test.
Switched the scene that was not validated by the client-side to one that did not contain an in-scene placed NetworkObject.
Co-authored-by: Unity Netcode CI <74025435+netcode-ci-service@users.noreply.github.com>
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
14
14
15
15
### Fixed
16
16
17
+
- Fixed issue where the host would receive more than one event completed notification when loading or unloading a scene only when no clients were connected. (#2292)
17
18
- Fixed issue where in-scene placed `NetworkObjects` were not honoring the `AutoObjectParentSync` property. (#2281)
18
19
- Fixed the issue where `NetworkManager.OnClientConnectedCallback` was being invoked before in-scene placed `NetworkObject`s had been spawned when starting `NetworkManager` as a host. (#2277)
19
20
- Creating a `FastBufferReader` with `Allocator.None` will not result in extra memory being allocated for the buffer (since it's owned externally in that scenario). (#2265)
Assert.IsFalse(m_ValidSceneEventCount[k_SecondSceneToSkip]>0,$"Client still loaded the invalidated scene {k_SecondSceneToSkip}!");
120
-
Assert.IsTrue(m_ValidSceneEventCount[k_FirstSceneToLoad]==1,$"Client did not load and process the validated scene {k_FirstSceneToLoad}! Expected (1) but was ({m_ValidSceneEventCount[k_FirstSceneToLoad]})");
121
-
Assert.IsTrue(m_ValidSceneEventCount[k_ThirdSceneToLoad]==1,$"Client did not load and process the validated scene {k_ThirdSceneToLoad}! Expected (1) but was ({m_ValidSceneEventCount[k_ThirdSceneToLoad]})");
93
+
Assert.IsTrue(m_ValidSceneEventCount[k_ThirdSceneToSkip]==0,$"Client still loaded the invalidated scene {k_ThirdSceneToSkip}!");
94
+
Assert.IsTrue(m_ValidSceneEventCount[k_FirstSceneToLoad]==2,$"Client did not load and process the validated scene {k_FirstSceneToLoad}! Expected (1) but was ({m_ValidSceneEventCount[k_FirstSceneToLoad]})");
95
+
Assert.IsTrue(m_ValidSceneEventCount[k_SecondSceneToLoad]==2,$"Client did not load and process the validated scene {k_SecondSceneToLoad}! Expected (1) but was ({m_ValidSceneEventCount[k_SecondSceneToLoad]})");
AssertOnTimeout($"Host timed out loading scene {k_AdditiveScene1} additively!");
162
+
163
+
// Wait one tick to make sure any other notifications are not triggered.
164
+
yieldreturns_DefaultWaitForTick;
165
+
166
+
Assert.IsTrue(m_LoadEventCompletedInvocationCount==1,$"Expected OnLoadEventCompleted to be triggered once but was triggered {m_LoadEventCompletedInvocationCount} times!");
0 commit comments