Class DisconnectTests
Validates the client disconnection process. This assures that:
- When a client disconnects from the server that the server: -- Detects the client disconnected. -- Cleans up the transport to NGO client (and vice versa) mappings.
- When a server disconnects a client that: -- The client detects this disconnection. -- The server cleans up the transport to NGO client (and vice versa) mappings.
- When Destroy
With the server-side player object is destroyedOwner - When Dont
Destroy the server-side player object ownership is transferred back to the serverWith Owner
Inherited Members
Namespace: Unity.Netcode.RuntimeTests
Assembly: Unity.Netcode.RuntimeTests.dll
Syntax
[TestFixture(new object[] { DisconnectTests.OwnerPersistence.DestroyWithOwner })]
[TestFixture(new object[] { DisconnectTests.OwnerPersistence.DontDestroyWithOwner })]
public class DisconnectTests : NetcodeIntegrationTest
Constructors
DisconnectTests(OwnerPersistence)
Declaration
public DisconnectTests(DisconnectTests.OwnerPersistence ownerPersistence)
Parameters
Type | Name | Description |
---|---|---|
Disconnect |
ownerPersistence |
Properties
NumberOfClients
Declaration
protected override int NumberOfClients { get; }
Property Value
Type | Description |
---|---|
int |
Overrides
Methods
ClientPlayerDisconnected(ClientDisconnectType)
Declaration
[UnityTest]
public IEnumerator ClientPlayerDisconnected(DisconnectTests.ClientDisconnectType clientDisconnectType)
Parameters
Type | Name | Description |
---|---|---|
Disconnect |
clientDisconnectType |
Returns
Type | Description |
---|---|
IEnumerator |
OnCreatePlayerPrefab()
Override this to add components or adjustments to the default player prefab
m_Player
Declaration
protected override void OnCreatePlayerPrefab()
Overrides
OnServerAndClientsCreated()
This is invoked before the server and client(s) are started. Override this method if you want to make any adjustments to their NetworkManager instances.
Declaration
protected override void OnServerAndClientsCreated()
Overrides
OnSetup()
Called before creating and starting the server and clients
Note: For All
Declaration
protected override IEnumerator OnSetup()
Returns
Type | Description |
---|---|
IEnumerator |