Class NetworkTransformOwnershipTests
Inheritance
NetworkTransformOwnershipTests
Assembly: Unity.Netcode.RuntimeTests.dll
public class NetworkTransformOwnershipTests : IntegrationTestWithApproximation
Properties
Declaration
protected override int NumberOfClients { get; }
Property Value
Overrides
Methods
This test verifies a late joining client cannot change the transform when:
- A NetworkObject is spawned with a host and one or more connected clients
- The NetworkTransform is owner authoritative and spawned with the host as the owner
- The host does not change the transform values
- One of the already connected clients gains ownership of the spawned NetworkObject
- The new client owner does not change the transform values
- A new late joining client connects and is synchronized
- The newly connected late joining client tries to change the transform of the NetworkObject
it does not own
Declaration
[UnityTest]
public IEnumerator LateJoinedNonOwnerClientCannotChangeTransform()
Returns
Clients created during a test need to have their prefabs list updated to
match the server's prefab list.
Declaration
protected override void OnNewClientCreated(NetworkManager networkManager)
Parameters
Overrides
Declaration
protected override void OnServerAndClientsCreated()
Overrides
This verifies that when authority is owner authoritative the owner's
Rigidbody is kinematic and the non-owner's is not.
This also verifies that we can switch between owners and that only the
owner can update the transform while non-owners cannot.
Declaration
[UnityTest]
public IEnumerator OwnerAuthoritativeTest(NetworkTransformOwnershipTests.StartingOwnership startingOwnership)
Parameters
Returns
This verifies that when authority is server authoritative the
client's Rigidbody is kinematic and the server is not.
This also verifies only the server can apply updates to the
transform while the clients cannot.
Declaration
[UnityTest]
public IEnumerator ServerAuthoritativeTest()
Returns