docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class CreateSessionOptions

    Session Creation Options

    Inheritance
    object
    CreateSessionOptions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Services.Multiplayer
    Assembly: Unity.Services.Multiplayer.dll
    Syntax
    public class CreateSessionOptions

    Constructors

    CreateSessionOptions(int)

    Declaration
    public CreateSessionOptions(int maxPlayers)
    Parameters
    Type Name Description
    int maxPlayers

    Properties

    HasConnection

    True if the session options was provided connection options, false otherwise.

    Declaration
    public bool HasConnection { get; }
    Property Value
    Type Description
    bool

    IsLocked

    A locked session does not allow any more players to join. True if the session is locked, false otherwise.

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

    IsPrivate

    True if the session is private, false otherwise.

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

    MaxPlayers

    The max number of players (including host) allowed in the session.

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

    Name

    The name of the session.

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

    Password

    The session password.

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

    PlayerProperties

    Custom game-specific properties that apply to the player (e.g. role or skill).

    Declaration
    public Dictionary<string, PlayerProperty> PlayerProperties { get; set; }
    Property Value
    Type Description
    Dictionary<string, PlayerProperty>

    SessionProperties

    The session custom data.

    Declaration
    public Dictionary<string, SessionProperty> SessionProperties { get; set; }
    Property Value
    Type Description
    Dictionary<string, SessionProperty>

    Methods

    WithDirectConnection(string, int, string)

    Provides a direct connection to the session

    Declaration
    public CreateSessionOptions WithDirectConnection(string ip, int port, string listenAddress = null)
    Parameters
    Type Name Description
    string ip

    The ip to connect to.

    int port

    The port to connect to.

    string listenAddress

    The address to listen for messages.

    Returns
    Type Description
    CreateSessionOptions

    The session creation options

    WithRelayConnection(string)

    Provides a relayed connection to the session

    Declaration
    public CreateSessionOptions WithRelayConnection(string region = null)
    Parameters
    Type Name Description
    string region

    The region used to create the relay session.

    Returns
    Type Description
    CreateSessionOptions

    The session creation options

    In This Article
    Back to top
    Copyright © 2024 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)