docs.unity3d.com
    Show / Hide Table of Contents

    Class NetworkBehaviourUpdaterTests

    Inheritance
    Object
    NetcodeIntegrationTest
    NetworkBehaviourUpdaterTests
    Inherited Members
    NetcodeIntegrationTest.s_GlobalTimeoutHelper
    NetcodeIntegrationTest.s_DefaultWaitForTick
    NetcodeIntegrationTest.NetcodeLogAssert
    NetcodeIntegrationTest.s_GlobalNetworkObjects
    NetcodeIntegrationTest.RegisterNetworkObject(NetworkObject)
    NetcodeIntegrationTest.DeregisterNetworkObject(NetworkObject)
    NetcodeIntegrationTest.DeregisterNetworkObject(UInt64, UInt64)
    NetcodeIntegrationTest.TotalClients
    NetcodeIntegrationTest.k_DefaultTickRate
    NetcodeIntegrationTest.m_CreateServerFirst
    NetcodeIntegrationTest.m_PlayerPrefab
    NetcodeIntegrationTest.m_ServerNetworkManager
    NetcodeIntegrationTest.m_ClientNetworkManagers
    NetcodeIntegrationTest.m_PlayerNetworkObjects
    NetcodeIntegrationTest.m_UseHost
    NetcodeIntegrationTest.m_TargetFrameRate
    NetcodeIntegrationTest.m_EnableVerboseDebug
    NetcodeIntegrationTest.m_BypassConnectionTimeout
    NetcodeIntegrationTest.VerboseDebug(String)
    NetcodeIntegrationTest.OnSetVerboseDebug()
    NetcodeIntegrationTest.OnSetIntegrationTestMode()
    NetcodeIntegrationTest.OnOneTimeSetup()
    NetcodeIntegrationTest.OneTimeSetup()
    NetcodeIntegrationTest.OnSetup()
    NetcodeIntegrationTest.SetUp()
    NetcodeIntegrationTest.OnCreatePlayerPrefab()
    NetcodeIntegrationTest.OnPlayerPrefabGameObjectCreated()
    NetcodeIntegrationTest.OnServerAndClientsCreated()
    NetcodeIntegrationTest.CreateServerAndClients()
    NetcodeIntegrationTest.OnNewClientCreated(NetworkManager)
    NetcodeIntegrationTest.OnNewClientStarted(NetworkManager)
    NetcodeIntegrationTest.OnNewClientStartedAndConnected(NetworkManager)
    NetcodeIntegrationTest.CreateAndStartNewClient()
    NetcodeIntegrationTest.StopOneClient(NetworkManager, Boolean)
    NetcodeIntegrationTest.CreateServerAndClients(Int32)
    NetcodeIntegrationTest.OnStartedServerAndClients()
    NetcodeIntegrationTest.OnServerAndClientsConnected()
    NetcodeIntegrationTest.ClientNetworkManagerPostStartInit()
    NetcodeIntegrationTest.LogAllMessages
    NetcodeIntegrationTest.StartServerAndClients()
    NetcodeIntegrationTest.CanClientsLoad()
    NetcodeIntegrationTest.CanClientsUnload()
    NetcodeIntegrationTest.DeRegisterSceneManagerHandler()
    NetcodeIntegrationTest.RegisterSceneManagerHandler()
    NetcodeIntegrationTest.OnCanSceneCleanUpUnload(Scene)
    NetcodeIntegrationTest.ShutdownAndCleanUp()
    NetcodeIntegrationTest.OnTearDown()
    NetcodeIntegrationTest.TearDown()
    NetcodeIntegrationTest.OnOneTimeTearDown()
    NetcodeIntegrationTest.OneTimeTearDown()
    NetcodeIntegrationTest.CanDestroyNetworkObject(NetworkObject)
    NetcodeIntegrationTest.DestroySceneNetworkObjects()
    NetcodeIntegrationTest.EnableMessageLogging()
    NetcodeIntegrationTest.WaitForConditionOrTimeOut(Func<Boolean>, TimeoutHelper)
    NetcodeIntegrationTest.WaitForConditionOrTimeOut(IConditionalPredicate, TimeoutHelper)
    NetcodeIntegrationTest.WaitForClientsConnectedOrTimeOut(NetworkManager[])
    NetcodeIntegrationTest.WaitForClientsConnectedOrTimeOut()
    NetcodeIntegrationTest.CreateNetworkObjectPrefab(String)
    NetcodeIntegrationTest.SpawnObject(GameObject, NetworkManager, Boolean)
    NetcodeIntegrationTest.SpawnObjects(GameObject, NetworkManager, Int32, Boolean)
    NetcodeIntegrationTest.AssertOnTimeout(String, TimeoutHelper)
    NetcodeIntegrationTest.WaitForTicks(NetworkManager, Int32)
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.Netcode.RuntimeTests
    Syntax
    public class NetworkBehaviourUpdaterTests : NetcodeIntegrationTest

    Fields

    NetVarCombinationTypeValues

    This list replaces the original NetworkVariable types to be checked. Both NetworkVariables are of type int and the original version of this test was testing the NetworkBehaviour Update when there were 1 or more (i.e two) on the same NetworkBehaviour. After reviewing, we really only needed to test a much smaller combination of types and so this pre-generated array represents the reduced set of combinations to test. Note: The original test was also testing for no NetworkVariables of type int, which there ended up being no reason to do that and only added to the length of the execution time for this test.

    Declaration
    public static NetVarCombinationTypes[] NetVarCombinationTypeValues
    Field Value
    Type Description
    NetVarCombinationTypes[]

    NetVarValueToSet

    Declaration
    public const int NetVarValueToSet = 1
    Field Value
    Type Description
    Int32

    Properties

    NumberOfClients

    Declaration
    protected override int NumberOfClients { get; }
    Property Value
    Type Description
    Int32
    Overrides
    NetcodeIntegrationTest.NumberOfClients

    Methods

    BehaviourUpdaterAllTests(Boolean, NetVarCombinationTypes, Int32, Int32)

    The updated BehaviourUpdaterAllTests was re-designed to replicate the same functionality being tested in the original version of this test with additional time out handling and a re-organization in the order of operations. Things like making sure all clients have spawned the NetworkObjects in question prior to testing for the NetworkVariable value changes helped to eliminate the timing issues that were happening when this test was run in a stand alone test runner build (i.e. all consoles run the stand alone version as opposed to the in-editor version like the desktop tests use). This update also updated how the server and clients were being constructed to help reduce the execution time.

    Declaration
    public IEnumerator BehaviourUpdaterAllTests(bool useHost, NetVarCombinationTypes varCombinationTypes, int nbClients, int numToSpawn)
    Parameters
    Type Name Description
    Boolean useHost

    whether to run the server as a host or not

    NetVarCombinationTypes varCombinationTypes

    the NetworkVariable combination types

    Int32 nbClients

    number of clients to use for the test

    Int32 numToSpawn

    number of NetworkObjects to be spawned

    Returns
    Type Description
    IEnumerator

    CanStartServerAndClients()

    Declaration
    protected override bool CanStartServerAndClients()
    Returns
    Type Description
    Boolean
    Overrides
    NetcodeIntegrationTest.CanStartServerAndClients()

    ClientSideNotifyObjectSpawned(GameObject)

    Clients will call this when NetworkObjects are spawned on their end

    Declaration
    public static void ClientSideNotifyObjectSpawned(GameObject objectSpaned)
    Parameters
    Type Name Description
    GameObject objectSpaned

    the GameObject of the NetworkObject spawned

    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on 26 October 2023