docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class MultiplayerPlayModePreferences

    Developer preferences for the MultiplayerPlayModeWindow. Only applicable in editor.

    Inheritance
    object
    MultiplayerPlayModePreferences
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Unity.NetCode
    Assembly: Unity.NetCode.dll
    Syntax
    public static class MultiplayerPlayModePreferences

    Fields

    DefaultSimulatorEnabled

    Declaration
    public const bool DefaultSimulatorEnabled = true
    Field Value
    Type Description
    bool

    DefaultSimulatorView

    Declaration
    public const SimulatorView DefaultSimulatorView = PingView
    Field Value
    Type Description
    SimulatorView

    Properties

    ApplyLoggerSettings

    If true, will force NetDebugSystem to set these values on boot.

    Declaration
    public static bool ApplyLoggerSettings { get; set; }
    Property Value
    Type Description
    bool

    AutoConnectionAddress

    Declaration
    public static string AutoConnectionAddress { get; set; }
    Property Value
    Type Description
    string

    AutoConnectionPort

    Declaration
    public static ushort AutoConnectionPort { get; set; }
    Property Value
    Type Description
    ushort

    ClientSimulatorParameters

    Configuration parameters for the simulator pipeline stage.

    Declaration
    public static SimulatorUtility.Parameters ClientSimulatorParameters { get; }
    Property Value
    Type Description
    SimulatorUtility.Parameters

    CurrentNetworkSimulatorPreset

    Maps to a SimulatorPreset.

    Declaration
    public static string CurrentNetworkSimulatorPreset { get; set; }
    Property Value
    Type Description
    string

    IsCurrentNetworkSimulatorPresetCustom

    True if is user-defined, custom preset.

    Declaration
    public static bool IsCurrentNetworkSimulatorPresetCustom { get; }
    Property Value
    Type Description
    bool

    LagSpikeSelectionIndex

    There is a hardcoded list of lag spike values. This is the saved indexer.

    Declaration
    public static int LagSpikeSelectionIndex { get; set; }
    Property Value
    Type Description
    int

    PacketDelayMs

    Fixed delay to apply to all packets which pass through.

    Declaration
    public static int PacketDelayMs { get; set; }
    Property Value
    Type Description
    int

    Delay in milliseconds.

    PacketDropPercentage

    Percentage of packets that will be dropped.

    Declaration
    public static int PacketDropPercentage { get; set; }
    Property Value
    Type Description
    int

    Percentage (0-100).

    PacketFuzzPercentage

    The fuzz factor is a percentage that represents both the proportion of packets that should be fuzzed, and the probability of any bit being flipped in the packet. For example, a value of 5 means about 5% of packets will be modified, and for each packet modified, each bit has a 5% chance of being flipped.

    Declaration
    public static int PacketFuzzPercentage { get; set; }
    Property Value
    Type Description
    int

    Percentage (0-100).

    Remarks

    The presence of this parameter in the simulator pipeline stage should not be understood as this being a condition that should be tested against when doing network simulations. In real networks, corrupted packets basically never make it all the way to the user (they'll get dropped before that). This parameter is mostly useful to test a netcode solution against maliciously-crafted packets.

    PacketJitterMs

    Variance of the delay that gets added to all packets that pass through. For example, setting this value to 5 will result in the delay being a random value within 5 milliseconds of the value set with Unity.Networking.Transport.Utilities.SimulatorUtility.Parameters.PacketDelayMs.

    Declaration
    public static int PacketJitterMs { get; set; }
    Property Value
    Type Description
    int

    Jitter in milliseconds.

    RequestedNumThinClients

    Denotes how many thin client worlds are created in the editor (via the AutomaticThinClientWorldsUtility utility), assuming that feature is enabled.

    Declaration
    public static int RequestedNumThinClients { get; set; }
    Property Value
    Type Description
    int

    RequestedPlayType

    Denotes what type of worlds are created by ClientServerBootstrap when entering playmode in the editor.

    Declaration
    public static ClientServerBootstrap.PlayType RequestedPlayType { get; set; }
    Property Value
    Type Description
    ClientServerBootstrap.PlayType

    RequestedSimulatorView

    Editor "mode". Stores the preferred mode that the Simulator is in.

    Declaration
    public static SimulatorView RequestedSimulatorView { get; set; }
    Property Value
    Type Description
    SimulatorView

    ShowAllSimulatorPresets

    If true, all simulator presets will be visible, rather than only platform specific ones.

    Declaration
    public static bool ShowAllSimulatorPresets { get; set; }
    Property Value
    Type Description
    bool

    SimulateDedicatedServer

    Declaration
    public static bool SimulateDedicatedServer { get; set; }
    Property Value
    Type Description
    bool

    SimulatorEnabled

    Stores whether or not the user wishes to use the client simulator UTP module.

    Declaration
    public static bool SimulatorEnabled { get; set; }
    Property Value
    Type Description
    bool

    TargetLogLevel

    If ApplyLoggerSettings, forces all NetDebugSystem loggers to this log level.

    Declaration
    public static NetDebug.LogLevelType TargetLogLevel { get; set; }
    Property Value
    Type Description
    NetDebug.LogLevelType

    TargetShouldDumpPackets

    If ApplyLoggerSettings, forces all NetDebugSystem loggers to have this value for ShouldDumpPackets.

    Declaration
    public static bool TargetShouldDumpPackets { get; set; }
    Property Value
    Type Description
    bool

    ThinClientCreationFrequency

    Denotes how many thin client worlds to spawn per second when in the editor (via the AutomaticThinClientWorldsUtility utility), assuming that feature is enabled.

    Declaration
    public static float ThinClientCreationFrequency { get; set; }
    Property Value
    Type Description
    float

    WarnAboveAverageBatchedTicksPerFrame

    If the average is above this percent a warning will be displayed. Set to 0 to always warn when ticks are batched.

    Declaration
    public static float WarnAboveAverageBatchedTicksPerFrame { get; set; }
    Property Value
    Type Description
    float

    WarnBatchedTicks

    If true, will force NetDebugSystem to display a warning when prediction ticks are batched.

    Declaration
    public static bool WarnBatchedTicks { get; set; }
    Property Value
    Type Description
    bool

    WarnBatchedTicksRollingWindow

    Specifies the number of frames the rolling average is calculated over.

    Declaration
    public static int WarnBatchedTicksRollingWindow { get; set; }
    Property Value
    Type Description
    int

    Methods

    ApplySimulatorPresetToPrefs(SimulatorPreset)

    Apply the selected preset to the static, saved fields. Clobbers any custom values the user may have entered.

    Declaration
    public static void ApplySimulatorPresetToPrefs(SimulatorPreset preset)
    Parameters
    Type Name Description
    SimulatorPreset preset

    Preset to apply.

    IsEditorInputtedAddressValidForConnect(out NetworkEndpoint)

    Returns true if the editor-inputted address is a valid connection address.

    Declaration
    public static bool IsEditorInputtedAddressValidForConnect(out NetworkEndpoint ep)
    Parameters
    Type Name Description
    NetworkEndpoint ep
    Returns
    Type Description
    bool
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)