UOnlineSessionClient

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

OnlineSubsystemUtils

Header

/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Classes/OnlineSessionClient.h

Include

#include "OnlineSessionClient.h"

Syntax

UCLASS(Config=Game)
class UOnlineSessionClient : public UOnlineSession

Variables

Name Description

Protected variable UProperty Transient

bool

 

bHandlingDisconnect

Have we started returning to main menu already

Protected variable UProperty Transient

bool

 

bIsFromInvite

Is this join from an invite

Protected variable

FOnlineSessionS...

 

CachedSessionResult

Cached invite/search result while in the process of tearing down an existing session

Protected variable

FDelegateHandle

 

EndSessionCompleteHandle

Handle to outstanding end session call

Protected variable

FOnDestroySessi...

 

OnDestroyForJoinSessionCompleteDelegate

Delegate for joining a new session after previously destroying it

Protected variable

FDelegateHandle

 

OnDestroyForJoinSessionCompleteDelegateHandle

Protected variable

FOnDestroySessi...

 

OnDestroyForMainMenuCompleteDelegate

Delegate for returning to main menu after cleaning up

Protected variable

FDelegateHandle

 

OnDestroyForMainMenuCompleteDelegateHandle

Protected variable

FOnEndSessionCo...

 

OnEndForJoinSessionCompleteDelegate

Delegate for destroying a session after previously ending it

Protected variable

FDelegateHandle

 

OnEndForJoinSessionCompleteDelegateHandle

Protected variable

FOnJoinSessionC...

 

OnJoinSessionCompleteDelegate

Delegate after joining a session

Protected variable

FDelegateHandle

 

OnJoinSessionCompleteDelegateHandle

Protected variable

FDelegateHandle

 

OnSessionInviteAcceptedDelegateHandle

Handles to the above delegates.

Protected variable

FOnSessionUserI...

 

OnSessionUserInviteAcceptedDelegate

Delegate for accepting session invites

Protected variable

FDelegateHandle

 

OnSessionUserInviteAcceptedDelegateHandle

Delegate handle that stores delegate for when an invite is accepted by a user

Protected variable

FDelegateHandle

 

StartSessionCompleteHandle

Handle to outstanding start session call

Constructors

Name Description

Public function

UOnlineSessionClient

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Protected function

void

 

DestroyExistingSession

(
    FName SessionName,
    FOnDestroySessionCompleteDelegate&...
)

Destroys an existing session of a given name

Protected function

void

 

DestroyExistingSession_Impl

(
    FDelegateHandle& OutResult,
    FName SessionName,
    FOnDestroySessionCompleteDelegate&...
)

Implementation of DestroyExistingSession

Protected function

void

 

EndExistingSession

(
    FName SessionName,
    FOnEndSessionCompleteDelegate& Del...
)

Ends an existing session of a given name

Protected function Virtual Const

UGameInstanc...

 

GetGameInstance()

Protected function Virtual

IOnlineSessi...

 

GetSessionInt()

Protected function Virtual Const

UWorld *

 

GetWorld()

Protected function Virtual

bool

 

HandleDisconnectInternal

(
    UWorld* World,
    UNetDriver* NetDriver
)

Chance for the session client to handle the disconnect

Protected function Virtual

void

 

JoinSession

(
    FName SessionName,
    const FOnlineSessionSearchResult& ...
)

Join a session of a given name after potentially tearing down an existing one

Protected function

void

 

OnDestroyForJoinSessionComplete

(
    FName SessionName,
    bool bWasSuccessful
)

Transition from destroying a session to joining a new one of the same name

Protected function

void

 

OnDestroyForMainMenuComplete

(
    FName SessionName,
    bool bWasSuccessful
)

Transition from destroying a session to returning to the main menu

Protected function

void

 

OnEndForJoinSessionComplete

(
    FName SessionName,
    bool bWasSuccessful
)

Transition from ending a session to destroying a session

Protected function Virtual

void

 

OnEndSessionComplete

(
    FName InSessionName,
    bool bWasSuccessful
)

Delegate called when EndSession has completed

Protected function

void

 

OnJoinSessionComplete

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

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

Protected function Virtual

void

 

OnStartSessionComplete

(
    FName InSessionName,
    bool bWasSuccessful
)

Delegate called when StartSession has completed

Public function Virtual

void

 

SetInviteFlags

(
    UWorld* World,
    const FJoinabilitySettings& Settin...
)

Update the session settings on the client

Overridden from UOnlineSession

Name Description

Public function Virtual

void

 

ClearOnlineDelegates()

Tear down all delegates used to manage online sessions.

Public function Virtual

void

 

EndOnlineSession

(
    FName SessionName
)

End the online session specified

Public function Virtual

void

 

HandleDisconnect

(
    UWorld* World,
    UNetDriver* NetDriver
)

Called to tear down any online sessions and return to main menu

Protected function Virtual

void

 

OnSessionUserInviteAccepted

(
    const bool bWasSuccess,
    const int32 ControllerId,
    FUniqueNetIdPtr UserId,
    const FOnlineSessionSearchResult& ...
)

Called from GameInstance when the user accepts an invite

Public function Virtual

void

 

RegisterOnlineDelegates()

Register all delegates needed to manage online sessions.

Public function Virtual

void

 

StartOnlineSession

(
    FName SessionName
)

Start the online session specified