docs.unity3d.com
    Show / Hide Table of Contents

    Class ClientServerBootstrap

    Inheritance
    Object
    ClientServerBootstrap
    Namespace: Unity.NetCode
    Syntax
    [Preserve]
    public class ClientServerBootstrap : ICustomBootstrap

    Fields

    AutoConnectPort

    The default port to use for auto connection. The default value is zero, which means do not auto connect. If this is set to a valid port any call to CreateClientWorld - including CreateDefaultWorlds and Initialize - will try to connect to the specified port and address - assuming DefaultConnectAddress is valid. Any call to CreateServerWorld - including CreateDefaultWorlds and Initialize - will listen on the specified port and listen address.

    Declaration
    public static ushort AutoConnectPort
    Field Value
    Type Description
    UInt16

    DefaultConnectAddress

    The default address to connect to when using auto connect (AutoConnectPort is not zero). If this valud is NetworkEndPoint.AnyIpv4 auto connect will not be used even if the port is specified. This is to allow auto listen without auto connect. The address specified in the Multiplayer PlayMode Tools takes precedence over this when running in the editor, if that address is not valid or you are running in a player DefaultConnectAddress will be used instead. An invalid DefaultConnectAddress will disable auto connect even if the address in Multiplayer PlayMode Tools is valid.

    Declaration
    public static NetworkEndPoint DefaultConnectAddress
    Field Value
    Type Description
    NetworkEndPoint

    DefaultListenAddress

    The default address to listen on when using auto connect (AutoConnectPort is not zero).

    Declaration
    public static NetworkEndPoint DefaultListenAddress
    Field Value
    Type Description
    NetworkEndPoint

    Properties

    DefaultWorldSystems

    Declaration
    public static List<Type> DefaultWorldSystems { get; }
    Property Value
    Type Description
    List<Type>

    ExplicitDefaultWorldSystems

    Declaration
    public static List<Type> ExplicitDefaultWorldSystems { get; }
    Property Value
    Type Description
    List<Type>

    RequestedPlayType

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

    Methods

    CreateClientWorld(World, String, World)

    Declaration
    public static World CreateClientWorld(World defaultWorld, string name, World worldToUse = null)
    Parameters
    Type Name Description
    World defaultWorld
    String name
    World worldToUse
    Returns
    Type Description
    World

    CreateDefaultClientServerWorlds(World)

    Utility method for creating the default client and server worlds based on the settings in the playmode tools in the editor or client / server defined in a player. Can be used in custom implementations of Initialize.

    Declaration
    public virtual void CreateDefaultClientServerWorlds(World defaultWorld)
    Parameters
    Type Name Description
    World defaultWorld

    CreateDefaultWorld(String, World)

    Utility method for creating the default way when bootstrapping. Can be used in custom implementations of Initialize to generate systems lists and populate the default world. If the world parameter specified that world will be used and populated with systems instead of creating a new one.

    Declaration
    public World CreateDefaultWorld(string defaultWorldName, World world = null)
    Parameters
    Type Name Description
    String defaultWorldName
    World world
    Returns
    Type Description
    World

    CreateServerWorld(World, String, World)

    Declaration
    public static World CreateServerWorld(World defaultWorld, string name, World worldToUse = null)
    Parameters
    Type Name Description
    World defaultWorld
    String name
    World worldToUse
    Returns
    Type Description
    World

    GenerateSystemLists(IReadOnlyList<Type>)

    Declaration
    protected static void GenerateSystemLists(IReadOnlyList<Type> systems)
    Parameters
    Type Name Description
    IReadOnlyList<Type> systems

    GetSystemAttribute<T>(Type)

    Declaration
    protected static T GetSystemAttribute<T>(Type systemType)
        where T : Attribute
    Parameters
    Type Name Description
    Type systemType
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    Initialize(String)

    Declaration
    public virtual bool Initialize(string defaultWorldName)
    Parameters
    Type Name Description
    String defaultWorldName
    Returns
    Type Description
    Boolean
    Implements
    ICustomBootstrap.Initialize(String)
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023