Class PlayerSession
Player session instance
Inherited Members
Namespace: Unity.PSN.PS5.Sessions
Syntax
public class PlayerSession : Session
Properties
ExclusiveLeaderPrivileges
Information about the items to exclude from the leader privileges of a Player Session
Declaration
public LeaderPrivilegeFlags ExclusiveLeaderPrivileges { get; }
Property Value
| Type | Description |
|---|---|
| LeaderPrivilegeFlags |
InvitableUserType
Information about who can send invitations to a Player Session
Declaration
public InvitableUserTypes InvitableUserType { get; }
Property Value
| Type | Description |
|---|---|
| InvitableUserTypes |
Remarks
NoOne : No user can send an invite Leader : Only the leader can send invites Member : Any member can send invites
IsActive
Has the player session been created and is currently valid
Declaration
public bool IsActive { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
JoinableSpecifiedUsers
List of account ids allowed to joing the session. Only used when JoinableUserType is SpecifiedUsers
Declaration
public ulong[] JoinableSpecifiedUsers { get; }
Property Value
| Type | Description |
|---|---|
| UInt64[] |
JoinableUserType
Users who can join Player Sessions without invitations
Declaration
public JoinableUserTypes JoinableUserType { get; }
Property Value
| Type | Description |
|---|---|
| JoinableUserTypes |
Remarks
NoOne : No user can join without an invitation Friends : Friends of the leader of the Player Session can join FriendsOfFriends : Friends of friends of the leader of the Player Session can join Anyone : Anyone can join SpecifiedUsers : Users who have been registered on the joinableSpecifiedUsers list can join without invitations
Leader
Current leader of the session as a session memeber
Declaration
public SessionMember Leader { get; }
Property Value
| Type | Description |
|---|---|
| SessionMember |
LeaderAccountId
The account id of the leader.
Declaration
public ulong LeaderAccountId { get; }
Property Value
| Type | Description |
|---|---|
| UInt64 |
LeaderPrivileges
Information about the items to include the leader privileges of a Player Session
Declaration
public LeaderPrivilegeFlags LeaderPrivileges { get; }
Property Value
| Type | Description |
|---|---|
| LeaderPrivilegeFlags |
LocalisedNames
Localisaed session names
Declaration
public LocalisedSessionNames LocalisedNames { get; }
Property Value
| Type | Description |
|---|---|
| LocalisedSessionNames |
OnSessionUpdated
The session notification callback. Note that this type of update doesn't contain any data to the locally cached data doesn't reflect the change. This only notifies what type of data changed. Use PlayerSessionRequests.GetPlayerSessionsRequest to retieve the latest data about the session.
Declaration
public PlayerSession.SessionEventHandler OnSessionUpdated { get; set; }
Property Value
| Type | Description |
|---|---|
| PlayerSession.SessionEventHandler |
SessionName
The name of the session
Declaration
public string SessionName { get; }
Property Value
| Type | Description |
|---|---|
| String |
SwapSupported
Flag indicating whether members who have joined can switch from players to spectators, or from spectators to players, without leaving. When true, swapping is allowed. (Users can swap using the system software UI.)When false, swapping is not allowed
Declaration
public bool SwapSupported { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Methods
IsParamFlagSet(PlayerSession.ParamTypes, PlayerSession.ParamTypes)
Test is a flag is set
Declaration
public static bool IsParamFlagSet(PlayerSession.ParamTypes flags, PlayerSession.ParamTypes flagToCheck)
Parameters
| Type | Name | Description |
|---|---|---|
| PlayerSession.ParamTypes | flags | The session flags to check |
| PlayerSession.ParamTypes | flagToCheck | The session flag to test |
Returns
| Type | Description |
|---|---|
| Boolean | Returns true if the flag to check is set |
UpdateFrom(PlayerSessionRequests.RetrievedSessionData)
Update a player session from data retrieved from PlayerSessionRequests.GetPlayerSessionsRequest
Declaration
public void UpdateFrom(PlayerSessionRequests.RetrievedSessionData sessionData)
Parameters
| Type | Name | Description |
|---|---|---|
| PlayerSessionRequests.RetrievedSessionData | sessionData | The data to update |