docs.unity3d.com
    Show / Hide Table of Contents

    Class Session

    Base session class for Player and Game sessions

    Inheritance
    Object
    Session
    GameSession
    PlayerSession
    Namespace: Unity.PSN.PS5.Sessions
    Syntax
    public class Session

    Properties

    CreatedTimestamp

    Time the session was created

    Declaration
    public DateTime CreatedTimestamp { get; }
    Property Value
    Type Description
    DateTime

    CustomData1

    Custom binary session data

    Declaration
    public byte[] CustomData1 { get; }
    Property Value
    Type Description
    Byte[]

    CustomData2

    Custom binary session data

    Declaration
    public byte[] CustomData2 { get; }
    Property Value
    Type Description
    Byte[]

    JoinDisabled

    Flag for temporarily prohibiting joining a Player Session or Game Session.

    Declaration
    public bool JoinDisabled { get; }
    Property Value
    Type Description
    Boolean
    Remarks

    For a Player session: When true, the Player Session cannot be joined. When false, users who have received invitation notifications or users who can join without such notifications because of the value set for JoinableUserType can join the Player Session. For a game session: Flag for temporarily prohibiting joining a Game Session. When true, the Game Session cannot be joined.

    MaxPlayers

    Maximum number of supported players. Min 1, Max 100

    Declaration
    public uint MaxPlayers { get; }
    Property Value
    Type Description
    UInt32

    MaxSpectators

    Maximum number of supported spectators. Min 0, Max 50

    Declaration
    public uint MaxSpectators { get; }
    Property Value
    Type Description
    UInt32

    OnRawEvent

    Callback containing the raw notification data if additional processing of the raw data is required.

    Declaration
    public Session.RawSessionEventHandler OnRawEvent { get; set; }
    Property Value
    Type Description
    Session.RawSessionEventHandler

    Players

    List of Session players

    Declaration
    public List<SessionMember> Players { get; }
    Property Value
    Type Description
    List<SessionMember>

    SessionId

    PSN session id

    Declaration
    public string SessionId { get; }
    Property Value
    Type Description
    String

    Spectators

    List of Session spectators

    Declaration
    public List<SessionMember> Spectators { get; }
    Property Value
    Type Description
    List<SessionMember>

    SupportedPlatforms

    Information about the platforms with which users can join a Player or Game Session

    Declaration
    public SessionPlatforms SupportedPlatforms { get; }
    Property Value
    Type Description
    SessionPlatforms

    Methods

    FindFromAccountId(UInt64, out Boolean)

    Find a session member from an account id

    Declaration
    public SessionMember FindFromAccountId(ulong accountId, out bool isSpectator)
    Parameters
    Type Name Description
    UInt64 accountId

    The account id to find

    Boolean isSpectator

    Set true is the member is in the spectators list.

    Returns
    Type Description
    SessionMember

    The found session member or null

    FindFromUserId(Int32)

    Find a session member from a local user id

    Declaration
    public SessionMember FindFromUserId(int userId)
    Parameters
    Type Name Description
    Int32 userId

    The local user id

    Returns
    Type Description
    SessionMember

    The found session member or null

    Back to top Copyright © 2020 Unity Technologies
    Generated by DocFX
    on 25 September 2020