Skip to main content

Unity.Multiplayer.Tools.NetworkSimulator.Runtime.INetworkEventsApi

API that can be used to inspect the state of the simulated network and trigger events.

Namespace: System.Dynamic.ExpandoObject#
Assembly: Tools.dll#
Syntax#
public interface INetworkEventsApi

Properties#

CurrentPreset#

Returns the current connection preset used to simulate network conditions.

Declaration#

INetworkSimulatorPreset CurrentPreset { get; }

Property Value#

TypeDescription
INetworkSimulatorPreset

IsAvailable#

Returns whether the Network Simulator fulfills all required dependencies and is available to be used.

Declaration#

bool IsAvailable { get; }

Property Value#

TypeDescription
System.Boolean

IsConnected#

Returns true when Network Simulator is connected.

Declaration#

bool IsConnected { get; }

Property Value#

TypeDescription
System.Boolean

Methods#

ChangeConnectionPreset(INetworkSimulatorPreset)#

Changes the current connection preset used to simulate network condition parameters.

Declaration#

void ChangeConnectionPreset(INetworkSimulatorPreset preset)

Parameters#

TypeNameDescription
INetworkSimulatorPresetpresetThe Network Simulator Preset being set.

Disconnect()#

Simulates a network disconnection.

Declaration#

void Disconnect()

Reconnect()#

Reconnects after simulating a network disconnection.

Declaration#

void Reconnect()

TriggerLagSpike(TimeSpan)#

Simulates a lag spike for the specified duration.

Declaration#

void TriggerLagSpike(TimeSpan duration)

Parameters#

TypeNameDescription
System.TimeSpandurationThe duration for which the lag spike shall last.

TriggerLagSpikeAsync(TimeSpan)#

Simulates a lag spike for the specified duration.

Declaration#

Task TriggerLagSpikeAsync(TimeSpan duration)

Parameters#

TypeNameDescription
System.TimeSpandurationThe duration for which the lag spike shall last.

Returns#

TypeDescription
TaskThe task that runs for the duration of the lag spike.