IOnlineSession

Interface definition for the online services session services Session services are defined as anything related managing a session and its state within a platform service

Windows
MacOS
Linux

References

Module

OnlineSubsystem

Header

/Engine/Plugins/Online/OnlineSubsystem/Source/Public/Interfaces/OnlineSessionInterface.h

Include

#include "Interfaces/OnlineSessionInterface.h"

Syntax

class IOnlineSession

Remarks

Interface definition for the online services session services Session services are defined as anything related managing a session and its state within a platform service

Variables

Name Description

Public variable

FOnCancelFindSe...

 

OnCancelFindSessionsCompleteDelegates

Delegate fired when the cancellation of a search for an online session has completed

Public variable

FOnCancelMatchm...

 

OnCancelMatchmakingCompleteDelegates

Delegate fired when the cloud matchmaking has been canceled

Public variable

FOnCreateSessio...

 

OnCreateSessionCompleteDelegates

Delegate fired when a session create request has completed

Public variable

FOnDestroySessi...

 

OnDestroySessionCompleteDelegates

Delegate fired when a destroying an online session has completed

Public variable

FOnEndSessionCo...

 

OnEndSessionCompleteDelegates

Delegate fired when the online session has transitioned to the ending state

Public variable

FOnFindFriendSe...

 

OnFindFriendSessionCompleteDelegates

Delegate fired once the find friend task has completed Session has not been joined at this point, and still requires a call to JoinSession()

Public variable

FOnFindSessions...

 

OnFindSessionsCompleteDelegates

Delegate fired when the search for an online session has completed

Public variable

FOnJoinSessionC...

 

OnJoinSessionCompleteDelegates

Delegate fired when the joining process for an online session has completed

Public variable

FOnMatchmakingC...

 

OnMatchmakingCompleteDelegates

Delegate fired when the cloud matchmaking has completed

Public variable

FOnPingSearchRe...

 

OnPingSearchResultsCompleteDelegates

Delegate fired when an individual server's query has completed

Public variable

FOnRegisterPlay...

 

OnRegisterPlayersCompleteDelegates

Delegate fired when the session registration process has completed

Public variable

FOnSessionFailu...

 

OnSessionFailureDelegates

Delegate fired when an unexpected error occurs that impacts session connectivity or use

Public variable

FOnSessionInvit...

 

OnSessionInviteReceivedDelegates

Called when a user receives a session invitation.

Public variable

FOnSessionUserI...

 

OnSessionUserInviteAcceptedDelegates

Called when a user accepts a session invitation.

Public variable

FOnStartSession...

 

OnStartSessionCompleteDelegates

Delegate fired when the online session has transitioned to the started state

Public variable

FOnUnregisterPl...

 

OnUnregisterPlayersCompleteDelegates

Delegate fired when the un-registration process has completed

Public variable

FOnUpdateSessio...

 

OnUpdateSessionCompleteDelegates

Delegate fired when a update request has completed

Constructors

Name Description

Protected function

IOnlineSession()

Hidden on purpose

Destructors

Name Description

Public function Virtual

~IOnlineSession()

Functions

Name Description

Protected function

FNamedOnline...

 

AddNamedSession

(
    FName SessionName,
    const FOnlineSession& Session
)

Adds a new named session to the list (from existing session data)

Protected function

FNamedOnline...

 

AddNamedSession

(
    FName SessionName,
    const FOnlineSessionSettings& Sess...
)

Adds a new named session to the list (new session)

Public function Virtual

FDelegateHan...

 

AddOnCancelFindSessionsCompleteDelegate_Handle

(
    const FOnCancelFindSessionsComplete...
)

Public function Virtual

FDelegateHan...

 

AddOnCancelMatchmakingCompleteDelegate_Handle

(
    const FOnCancelMatchmakingCompleteD...
)

Public function Virtual

FDelegateHan...

 

AddOnCreateSessionCompleteDelegate_Handle

(
    const FOnCreateSessionCompleteDeleg...
)

Public function Virtual

FDelegateHan...

 

AddOnDestroySessionCompleteDelegate_Handle

(
    const FOnDestroySessionCompleteDele...
)

Public function Virtual

FDelegateHan...

 

AddOnEndSessionCompleteDelegate_Handle

(
    const FOnEndSessionCompleteDelegate...
)

Public function Virtual

FDelegateHan...

 

AddOnFindFriendSessionCompleteDelegate_Handle

(
    int32 LocalUserNum,
    const FOnFindFriendSessionCompleteD...
)

Public function Virtual

FDelegateHan...

 

AddOnFindSessionsCompleteDelegate_Handle

(
    const FOnFindSessionsCompleteDelega...
)

Public function Virtual

FDelegateHan...

 

AddOnJoinSessionCompleteDelegate_Handle

(
    const FOnJoinSessionCompleteDelegat...
)

Public function Virtual

FDelegateHan...

 

AddOnMatchmakingCompleteDelegate_Handle

(
    const FOnMatchmakingCompleteDelegat...
)

Public function Virtual

FDelegateHan...

 

AddOnPingSearchResultsCompleteDelegate_Handle

(
    const FOnPingSearchResultsCompleteD...
)

Public function Virtual

FDelegateHan...

 

AddOnRegisterPlayersCompleteDelegate_Handle

(
    const FOnRegisterPlayersCompleteDel...
)

Public function Virtual

FDelegateHan...

 

AddOnSessionFailureDelegate_Handle

(
    const FOnSessionFailureDelegate& D...
)

Public function Virtual

FDelegateHan...

 

AddOnSessionInviteReceivedDelegate_Handle

(
    const FOnSessionInviteReceivedDeleg...
)

Public function Virtual

FDelegateHan...

 

AddOnSessionUserInviteAcceptedDelegate_Handle

(
    const FOnSessionUserInviteAcceptedD...
)

Public function Virtual

FDelegateHan...

 

AddOnStartSessionCompleteDelegate_Handle

(
    const FOnStartSessionCompleteDelega...
)

Public function Virtual

FDelegateHan...

 

AddOnUnregisterPlayersCompleteDelegate_Handle

(
    const FOnUnregisterPlayersCompleteD...
)

Public function Virtual

FDelegateHan...

 

AddOnUpdateSessionCompleteDelegate_Handle

(
    const FOnUpdateSessionCompleteDeleg...
)

Public function

bool

 

CancelFindSessions()

Cancels the current search in progress if possible for that search type

Public function

bool

 

CancelMatchmaking

(
    int32 SearchingPlayerNum,
    FName SessionName
)

Cancel a Matchmaking request for a given session name

Public function

bool

 

CancelMatchmaking

(
    const FUniqueNetId& SearchingPlaye...,
    FName SessionName
)

Cancel a Matchmaking request for a given session name

Public function Virtual

void

 

ClearOnCancelFindSessionsCompleteDelegate_Handle

(
    FDelegateHandle& Handle
)

Public function Virtual

void

 

ClearOnCancelFindSessionsCompleteDelegates

(
    void* Object
)

Public function Virtual

void

 

ClearOnCancelMatchmakingCompleteDelegate_Handle

(
    FDelegateHandle& Handle
)

Public function Virtual

void

 

ClearOnCancelMatchmakingCompleteDelegates

(
    void* Object
)

Public function Virtual

void

 

ClearOnCreateSessionCompleteDelegate_Handle

(
    FDelegateHandle& Handle
)

Public function Virtual

void

 

ClearOnCreateSessionCompleteDelegates

(
    void* Object
)

Public function Virtual

void

 

ClearOnDestroySessionCompleteDelegate_Handle

(
    FDelegateHandle& Handle
)

Public function Virtual

void

 

ClearOnDestroySessionCompleteDelegates

(
    void* Object
)

Public function Virtual

void

 

ClearOnEndSessionCompleteDelegate_Handle

(
    FDelegateHandle& Handle
)

Public function Virtual

void

 

ClearOnEndSessionCompleteDelegates

(
    void* Object
)

Public function Virtual

void

 

ClearOnFindFriendSessionCompleteDelegate_Handle

(
    int32 LocalUserNum,
    FDelegateHandle& Handle
)

Public function Virtual

void

 

ClearOnFindFriendSessionCompleteDelegates

(
    int32 LocalUserNum,
    void* Object
)

Public function Virtual

void

 

ClearOnFindSessionsCompleteDelegate_Handle

(
    FDelegateHandle& Handle
)

Public function Virtual

void

 

ClearOnFindSessionsCompleteDelegates

(
    void* Object
)

Public function Virtual

void

 

ClearOnJoinSessionCompleteDelegate_Handle

(
    FDelegateHandle& Handle
)

Public function Virtual

void

 

ClearOnJoinSessionCompleteDelegates

(
    void* Object
)

Public function Virtual

void

 

ClearOnMatchmakingCompleteDelegate_Handle

(
    FDelegateHandle& Handle
)

Public function Virtual

void

 

ClearOnMatchmakingCompleteDelegates

(
    void* Object
)

Public function Virtual

void

 

ClearOnPingSearchResultsCompleteDelegate_Handle

(
    FDelegateHandle& Handle
)

Public function Virtual

void

 

ClearOnPingSearchResultsCompleteDelegates

(
    void* Object
)

Public function Virtual

void

 

ClearOnRegisterPlayersCompleteDelegate_Handle

(
    FDelegateHandle& Handle
)

Public function Virtual

void

 

ClearOnRegisterPlayersCompleteDelegates

(
    void* Object
)

Public function Virtual

void

 

ClearOnSessionFailureDelegate_Handle

(
    FDelegateHandle& Handle
)

Public function Virtual

void

 

ClearOnSessionFailureDelegates

(
    void* Object
)

Public function Virtual

void

 

ClearOnSessionInviteReceivedDelegate_Handle

(
    FDelegateHandle& Handle
)

Public function Virtual

void

 

ClearOnSessionInviteReceivedDelegates

(
    void* Object
)

Public function Virtual

void

 

ClearOnSessionUserInviteAcceptedDelegate_Handle

(
    FDelegateHandle& Handle
)

Public function Virtual

void

 

ClearOnSessionUserInviteAcceptedDelegates

(
    void* Object
)

Public function Virtual

void

 

ClearOnStartSessionCompleteDelegate_Handle

(
    FDelegateHandle& Handle
)

Public function Virtual

void

 

ClearOnStartSessionCompleteDelegates

(
    void* Object
)

Public function Virtual

void

 

ClearOnUnregisterPlayersCompleteDelegate_Handle

(
    FDelegateHandle& Handle
)

Public function Virtual

void

 

ClearOnUnregisterPlayersCompleteDelegates

(
    void* Object
)

Public function Virtual

void

 

ClearOnUpdateSessionCompleteDelegate_Handle

(
    FDelegateHandle& Handle
)

Public function Virtual

void

 

ClearOnUpdateSessionCompleteDelegates

(
    void* Object
)

Public function

bool

 

CreateSession

(
    const FUniqueNetId& HostingPlayerI...,
    FName SessionName,
    const FOnlineSessionSettings& NewS...
)

Creates an online session based upon the settings object specified.

Public function

bool

 

CreateSession

(
    int32 HostingPlayerNum,
    FName SessionName,
    const FOnlineSessionSettings& NewS...
)

Creates an online session based upon the settings object specified.

Public function

TSharedPtr< ...

 

CreateSessionIdFromString

(
    const FString& SessionIdStr
)

Create a session id from a string

Public function

bool

 

DestroySession

(
    FName SessionName,
    const FOnDestroySessionCompleteDele...
)

Destroys the specified online session NOTE: online session de-registration is an async process and does not complete until the OnDestroySessionComplete delegate is called.

Public function

void

 

DumpSessionState()

Dumps out the session state for all known sessions

Public function

bool

 

EndSession

(
    FName SessionName
)

Marks an online session as having been ended

Public function

bool

 

FindFriendSession

(
    int32 LocalUserNum,
    const FUniqueNetId& Friend
)

Allows the local player to follow a friend into a session

Public function

bool

 

FindFriendSession

(
    const FUniqueNetId& LocalUserId,
    const FUniqueNetId& Friend
)

Allows the local player to follow a friend into a session

Public function

bool

 

FindFriendSession

(
    const FUniqueNetId& LocalUserId,
    const TArray< TSharedRef< const FUn...
)

Allows the local player to retrieve the session of multiple friends

Public function

bool

 

FindSessionById

(
    const FUniqueNetId& SearchingUserI...,
    const FUniqueNetId& SessionId,
    const FUniqueNetId& FriendId,
    const FOnSingleSessionResultComplet...
)

Find a single advertised session by session id

Public function Virtual

bool

 

FindSessionById

(
    const FUniqueNetId& SearchingUserI...,
    const FUniqueNetId& SessionId,
    const FUniqueNetId& FriendId,
    const FString& UserData,
    const FOnSingleSessionResultComplet...
)

Find a single advertised session by session id (with userdata)

Public function

bool

 

FindSessions

(
    const FUniqueNetId& SearchingPlaye...,
    const TSharedRef< FOnlineSessionSea...
)

Searches for sessions matching the settings specified

Public function

bool

 

FindSessions

(
    int32 SearchingPlayerNum,
    const TSharedRef< FOnlineSessionSea...
)

Searches for sessions matching the settings specified

Public function

FNamedOnline...

 

GetNamedSession

(
    FName SessionName
)

Searches the named session array for the specified session

Public function

int32

 

GetNumSessions()

Gets the number of known sessions registered with the interface

Public function

bool

 

GetResolvedConnectString

(
    const FOnlineSessionSearchResult& ...,
    FName PortType,
    FString& ConnectInfo
)

Returns the platform specific connection information for joining a search result.

Public function

bool

 

GetResolvedConnectString

(
    FName SessionName,
    FString& ConnectInfo,
    FName PortType
)

Returns the platform specific connection information for joining the match.

Public function

FOnlineSessi...

 

GetSessionSettings

(
    FName SessionName
)

Returns the session settings object for the session with a matching name

Public function Const

EOnlineSessi...

 

GetSessionState

(
    FName SessionName
)

Get the current state of a named session

Public function

bool

 

HasPresenceSession()

Searches the named session array for any presence enabled session

Public function

bool

 

IsPlayerInSession

(
    FName SessionName,
    const FUniqueNetId& UniqueId
)

Determine if the player is registered in the specified session

Public function

bool

 

JoinSession

(
    int32 LocalUserNum,
    FName SessionName,
    const FOnlineSessionSearchResult& ...
)

Joins the session specified

Public function

bool

 

JoinSession

(
    const FUniqueNetId& LocalUserId,
    FName SessionName,
    const FOnlineSessionSearchResult& ...
)

Joins the session specified

Public function

bool

 

PingSearchResults

(
    const FOnlineSessionSearchResult& ...
)

Fetches the additional data a session exposes outside of the online service.

Public function

void

 

RegisterLocalPlayer

(
    const FUniqueNetId& PlayerId,
    FName SessionName,
    const FOnRegisterLocalPlayerComplet...
)

Registers a local player with a session.

Public function

bool

 

RegisterPlayer

(
    FName SessionName,
    const FUniqueNetId& PlayerId,
    bool bWasInvited
)

Registers a player with the online service as being part of the online session

Public function

bool

 

RegisterPlayers

(
    FName SessionName,
    const TArray< TSharedRef< const FUn...,
    bool bWasInvited
)

Registers a group of players with the online service as being part of the online session

Public function

void

 

RemoveNamedSession

(
    FName SessionName
)

Searches the named session array for the specified session and removes it

Public function

bool

 

SendSessionInviteToFriend

(
    int32 LocalUserNum,
    FName SessionName,
    const FUniqueNetId& Friend
)

Sends an invitation to play in the player's current session

Public function

bool

 

SendSessionInviteToFriend

(
    const FUniqueNetId& LocalUserId,
    FName SessionName,
    const FUniqueNetId& Friend
)

Sends an invitation to play in the player's current session

Public function

bool

 

SendSessionInviteToFriends

(
    int32 LocalUserNum,
    FName SessionName,
    const TArray< TSharedRef< const FUn...
)

Sends invitations to play in the player's current session

Public function

bool

 

SendSessionInviteToFriends

(
    const FUniqueNetId& LocalUserId,
    FName SessionName,
    const TArray< TSharedRef< const FUn...
)

Sends invitations to play in the player's current session

Public function

bool

 

StartMatchmaking

(
    const TArray< TSharedRef< const FUn...,
    FName SessionName,
    const FOnlineSessionSettings& NewS...,
    TSharedRef< FOnlineSessionSearch > ...
)

Begins cloud based matchmaking for a session

Public function

bool

 

StartSession

(
    FName SessionName
)

Marks an online session as in progress (as opposed to being in lobby or pending)

Public function Virtual

void

 

TriggerOnCancelFindSessionsCompleteDelegates

(
    bool Param1
)

Public function Virtual

void

 

TriggerOnCancelMatchmakingCompleteDelegates

(
    FName Param1,
    bool Param2
)

Public function Virtual

void

 

TriggerOnCreateSessionCompleteDelegates

(
    FName Param1,
    bool Param2
)

Public function Virtual

void

 

TriggerOnDestroySessionCompleteDelegates

(
    FName Param1,
    bool Param2
)

Public function Virtual

void

 

TriggerOnEndSessionCompleteDelegates

(
    FName Param1,
    bool Param2
)

Public function Virtual

void

 

TriggerOnFindFriendSessionCompleteDelegates

(
    int32 LocalUserNum,
    bool Param1,
    const TArray< FOnlineSessionSearchR...
)

Public function Virtual

void

 

TriggerOnFindSessionsCompleteDelegates

(
    bool Param1
)

Public function Virtual

void

 

TriggerOnJoinSessionCompleteDelegates

(
    FName Param1,
    EOnJoinSessionCompleteResult::Type ...
)

Public function Virtual

void

 

TriggerOnMatchmakingCompleteDelegates

(
    FName Param1,
    bool Param2
)

Public function Virtual

void

 

TriggerOnPingSearchResultsCompleteDelegates

(
    bool Param1
)

Public function Virtual

void

 

TriggerOnRegisterPlayersCompleteDelegates

(
    FName Param1,
    const TArray< TSharedRef< const FUn...,
    bool Param3
)

Public function Virtual

void

 

TriggerOnSessionFailureDelegates

(
    const FUniqueNetId& Param1,
    ESessionFailure::Type Param2
)

Public function Virtual

void

 

TriggerOnSessionInviteReceivedDelegates

(
    const FUniqueNetId& Param1,
    const FUniqueNetId& Param2,
    const FString& Param3,
    const FOnlineSessionSearchResult& ...
)

Public function Virtual

void

 

TriggerOnSessionUserInviteAcceptedDelegates

(
    const bool Param1,
    const int32 Param2,
    TSharedPtr< const FUniqueNetId > Pa...,
    const FOnlineSessionSearchResult& ...
)

Public function Virtual

void

 

TriggerOnStartSessionCompleteDelegates

(
    FName Param1,
    bool Param2
)

Public function Virtual

void

 

TriggerOnUnregisterPlayersCompleteDelegates

(
    FName Param1,
    const TArray< TSharedRef< const FUn...,
    bool Param3
)

Public function Virtual

void

 

TriggerOnUpdateSessionCompleteDelegates

(
    FName Param1,
    bool Param2
)

Public function

void

 

UnregisterLocalPlayer

(
    const FUniqueNetId& PlayerId,
    FName SessionName,
    const FOnUnregisterLocalPlayerCompl...
)

Unregisters a local player with a session.

Public function

bool

 

UnregisterPlayer

(
    FName SessionName,
    const FUniqueNetId& PlayerId
)

Unregisters a player with the online service as being part of the online session

Public function

bool

 

UnregisterPlayers

(
    FName SessionName,
    const TArray< TSharedRef< const FUn...
)

Unregisters a group of players with the online service as being part of the online session

Public function

bool

 

UpdateSession

(
    FName SessionName,
    FOnlineSessionSettings& UpdatedSes...,
    bool bShouldRefreshOnlineData
)

Updates the localized settings/properties for the session in question

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback