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
Fixing issue with the updated InScenePlacedNetworkObjectTests that were using the server-side player for some of the tests which doesn't exist when it is just a server.
Fixing issue with the expected number of spawned objects since the base value was derived from TotalClients that changes when running a server.
Assert.IsTrue(status==SceneEventProgressStatus.Started,$"When attempting to load scene {k_SceneToLoad} was returned the following progress status: {status}");
86
-
88
+
// We removed a client from the initial spawn and server should spawn too
89
+
varclientCount=TotalClients-(m_UseHost?1:0);
87
90
// This verifies the scene loaded and the in-scene placed NetworkObjects spawned.
AssertOnTimeout($"Timed out waiting for total spawned in-scene placed NetworkObjects to reach a count of {TotalClients-1} and is currently {NetworkObjectTestComponent.SpawnedInstances.Count}");
AssertOnTimeout($"Timed out waiting for total spawned in-scene placed NetworkObjects to reach a count of {clientCount} and is currently {NetworkObjectTestComponent.SpawnedInstances.Count}");
90
93
91
94
// Get the server-side instance of the in-scene NetworkObject
92
95
Assert.True(s_GlobalNetworkObjects.ContainsKey(m_ServerNetworkManager.LocalClientId),$"Could not find server instance of the test in-scene NetworkObject!");
@@ -103,6 +106,9 @@ public IEnumerator InSceneNetworkObjectSynchAndSpawn()
AssertOnTimeout($"Timed out waiting for all in-scene instances to be spawned! Current spawned count: {NetworkObjectTestComponent.SpawnedInstances.Count()} | Expected spawn count: {TotalClients}");
AssertOnTimeout($"Timed out waiting for all in-scene instances to be spawned! Current spawned count: {NetworkObjectTestComponent.SpawnedInstances.Count()} | Expected spawn count: {clientCount}");
AssertOnTimeout($"[NetworkHide] Timed out waiting for Client-{firstClientId} to despawn the in-scene placed NetworkObject! Current spawned count: {NetworkObjectTestComponent.SpawnedInstances.Count()} | Expected spawn count: {TotalClients-1}");
AssertOnTimeout($"[NetworkHide] Timed out waiting for Client-{firstClientId} to despawn the in-scene placed NetworkObject! Current spawned count: {NetworkObjectTestComponent.SpawnedInstances.Count()} | Expected spawn count: {clientCount}");
134
141
135
142
// Validate that the first client can spawn the "netcode hidden" in-scene placed NetworkObject
AssertOnTimeout($"[NetworkShow] Timed out waiting for Client-{firstClientId} to spawn the in-scene placed NetworkObject! Current spawned count: {NetworkObjectTestComponent.SpawnedInstances.Count()} | Expected spawn count: {TotalClients}");
AssertOnTimeout($"[NetworkShow] Timed out waiting for Client-{firstClientId} to spawn the in-scene placed NetworkObject! Current spawned count: {NetworkObjectTestComponent.SpawnedInstances.Count()} | Expected spawn count: {clientCount}");
139
148
140
149
CleanUpLoadedScene();
141
150
}
@@ -152,7 +161,7 @@ public IEnumerator ParentedInSceneObjectLateJoiningClient()
152
161
// will be targeting to join late from the m_ClientNetworkManagers array, start the server
153
162
// and the remaining client, despawn the in-scene NetworkObject, and then start and synchronize
154
163
// the clientToTest.
155
-
varclientToTest=m_ClientNetworkManagers[1];
164
+
varclientToTest=m_ClientNetworkManagers[2];
156
165
varclients=m_ClientNetworkManagers.ToList();
157
166
clients.Remove(clientToTest);
158
167
m_ClientNetworkManagers=clients.ToArray();
@@ -174,12 +183,22 @@ public IEnumerator ParentedInSceneObjectLateJoiningClient()
174
183
Assert.IsNotNull(firstClientInSceneObjectInstance,$"Could not get the client-side registration of {nameof(NetworkObjectTestComponent)}!");
AssertOnTimeout($"Timed out waiting for the client-side id ({m_ClientNetworkManagers[0].LocalClientId}) server player transform to be set on the client-side in-scene object!");
Assert.IsNotNull(lateJoinClientInSceneObjectInstance,$"Could not get the client-side registration of {nameof(NetworkObjectTestComponent)} for the late joining client!");
196
215
197
216
// Now get the late-joining client's instance for the server player
AssertOnTimeout($"Timed out waiting for the client-side id ({m_ClientNetworkManagers[0].LocalClientId}) server player transform to be set on the client-side in-scene object!");
AssertOnTimeout($"Timed out waiting for the client-side id ({m_ClientNetworkManagers[0].LocalClientId}) player transform to be set on the client-side in-scene object!");
203
222
}
204
223
205
224
privatevoidOnSceneEvent(SceneEventsceneEvent)
@@ -485,9 +504,6 @@ public IEnumerator ParentedInSceneObjectUnderGameObject([Values(k_InSceneUnder,
485
504
Assert.IsNotNull(firstClientInSceneObjectInstance,$"Could not get the client-side registration of {nameof(NetworkObjectTestComponent)}!");
0 commit comments