GameInstance
Summary
| Members | Descriptions |
|---|---|
enum ERH_ServerBootstrapMode | An enum for the handled bootstrapping modes. |
enum ERH_ServerBootstrapFlowStep | An enum for the steps in the bootstrapping flow. |
class URH_BootstrappingSettings | An settings object that contains the settings for the bootstrapping flow. |
class URH_GameInstanceServerBootstrapper | Server Bootstrapper for the Game Instance. |
class URH_GameInstanceClientBootstrapper | Client Boostrapper for the Game Instance. |
class URH_GameInstanceSubsystem | Subsystem for the Game Instance. |
struct FRH_BootstrappingResult | An result object that contains the accumulated results for the bootstrapping flow. |
struct FRH_ActiveSessionStatePlayerContext |
Members
enum ERH_ServerBootstrapMode
| Values | Descriptions |
|---|---|
| Disabled | Bootstrapping is disabled entirely |
| LoginOnly | Bootstrapping is restricted to login only |
| Allocated | Use the GameHostProvider interface to perform an allocation |
| Reserved | Use the GameHostProvider interface to perform a reservation |
An enum for the handled bootstrapping modes.
enum ERH_ServerBootstrapFlowStep
| Values | Descriptions |
|---|---|
| Unstarted | Bootstrapping has not been started |
| Failed | Bootstrapping has failed |
| LoggingIn | Bootstrapping is logging into the RallyHere API |
| Recycling | Bootstrapping is doing an internal recycle of the server state (note: initial boot uses this state to initialize as well) |
| Registration | Bootstrapping is registering the server with the provider |
| WaitingForSession | Bootstrapping has received an allocation and is attempting to lookup the corresponding session |
| SyncingToSession | Bootstrapping has retrieved the session, validated it, and is attempting to synchronize the GameInstanceSessionSubsystem to that session |
| Complete | Bootstrapping has completed (though may be recycled in the future) |
| Cleanup | Bootstrapping is cleaning up, and may potentially recycle |
An enum for the steps in the bootstrapping flow.
class URH_BootstrappingSettings
class URH_BootstrappingSettings
: public UObject
An settings object that contains the settings for the bootstrapping flow.
Summary
| Members | Descriptions |
|---|---|
public float PollIntervalFinalizer | The poll interval for the finalizer that looks up the session based on the allocation info from the provider. |
public int32 PollLogIntervalFinalizer | How often to log progress on the finalizer poll (number of polls between logs) |
public int32 MaxPollCountFinalizer | Maximum number of polls on the finalizer before it is determined to be a failure. |
public URH_BootstrappingSettings(const FObjectInitializer & ObjectInitializer) | Default constructor. |
Members
public float PollIntervalFinalizer
The poll interval for the finalizer that looks up the session based on the allocation info from the provider.
public int32 PollLogIntervalFinalizer
How often to log progress on the finalizer poll (number of polls between logs)
public int32 MaxPollCountFinalizer
Maximum number of polls on the finalizer before it is determined to be a failure.
public URH_BootstrappingSettings(const FObjectInitializer & ObjectInitializer)
Default constructor.
class URH_GameInstanceServerBootstrapper
class URH_GameInstanceServerBootstrapper
: public URH_GameInstanceSubsystemPlugin
: public IRH_SessionOwnerInterface
: public FTickableGameObject
Server Bootstrapper for the Game Instance.
Summary
| Members | Descriptions |
|---|---|
public FRH_OnBootstrapStepChangedDelegate OnBootstrapStepChanged | Delegate for when bootstrap step changes. |
public FRH_GameHostProviderStatsRequested OnGameHostProviderStatsRequested | callback triggered to request stats if default implementation is not sufficient |
public URH_GameInstanceServerBootstrapper() | |
public virtual void Initialize() | Initialize the bootstrapper. |
public virtual void Deinitialize() | Deinitialize the bootstrapper. |
public inline FORCEINLINE ERH_ServerBootstrapFlowStep GetBootstrapStep() const | Get the current bootstrapping step. |
public inline FORCEINLINE ERH_ServerBootstrapMode GetBootstrapMode() const | Get the current bootstrapping mode. |
public bool DetermineJoinParameters(FString & PublicConnStr,FString & PrivateConnStr) | Determines the join parameters to be used for a session that was bootstrapped. |
public virtual void OnGameHostProviderStats(FRH_GameHostProviderStats & Stats) | bound callback triggered to provide stats to the game host provider |
public virtual void Tick(float DeltaTime) | Tick function. |
public virtual bool IsTickable() const | Whether or not to tick this object. |
public virtual TStatId GetStatId() const | What stat id to use to report for the tick. |
public inline virtual FAuthContextPtr GetAuthContext() const | Provides the auth context this bootstrapper owns. |
public inline virtual TSharedPtr< class IAnalyticsProvider > GetAnalyticsProvider() const | Get the Analytics Provider. |
public inline virtual URH_OnlineSession*GetSession() const | Get the current bootstrapping mode. |
public inline virtual FAuthContextPtr GetSessionAuthContext() const | Gets the auth context to use for API calls for the session owner. |
public virtual void ImportAPISession(const FRH_APISessionWithETag & Session) | Imports a session object from the API into the owner (ex: from polling). |
public virtual void ImportAPITemplate(const FRHAPI_SessionTemplate & Template) | Imports the template into the owner's template list (ex: from polling). |
public virtual void ReconcileAPISessions(const TArray< FString > & SessionIds,const TOptional< FString > & ETag) | Updates the list of sessions to only those that are active. |
public virtual void ReconcileAPITemplates(const TArray< FString > & InTemplates,const TOptional< FString > & ETag) | Updates the list of session templates to those that are active. |
public virtual class URH_PlayerInfoSubsystem*GetPlayerInfoSubsystem() const | Gets the PlayerInfo Subsystem. |
public virtual IOnlineSubsystem * GetOSS() const | Gets the Online Subsystem to use for OSS calls. |
public virtual FUniqueNetIdWrapper GetOSSUniqueId() const | Gets the Online Subsystem Unique Id to use for OSS calls. |
public virtual FPlatformUserId GetOSSPlatformUserId() const | Gets the Online Subsystem PlatformUserId to use for OSS calls (equivalent to controller index) |
public inline virtual TOptional< FString > GetETagForAllTemplatesPoll() const | Gets the etag to use for a "Get all Templates" type query. |
public inline virtual TOptional< FString > GetETagForAllSessionsPoll() const | Gets the etag to use for a "Get all Sessions" type query. |
public inline virtual TArray< URH_SessionView* >GetAllSessionsForPolling() const | Used to get all sessions, primarily for get all sessions polling where etag matches. |
public virtual URH_SessionView*GetSessionById(const FString & SessionId) const | Gets a session by its id. |
public virtual void RemoveSessionById(const FString & SessionId) | Removes a cached session for the local player, this does NOT try to leave it. |
public virtual bool GetTemplate(const FString & Type,FRHAPI_SessionTemplate & Template) const | Gets a session template by type. |
public inline virtual URH_PlatformSessionSyncer*GetPlatformSyncerByRHSessionId(const FString & SessionId) const | Gets the platform synchronization object using the rally here session id. |
public inline virtual URH_PlatformSessionSyncer*GetPlatformSyncerByPlatformSessionId(const FUniqueNetIdRepl & PlatformSessionId) const | Gets the platform synchronization object using the platform session id. |
public inline const FRH_BootstrappingResult&GetBootstrappingResult() const | Gets the bootstrapping result from this bootstrapper. |
public inline virtual TOptional< FString > GetBoundAllocationId() const | Gets the allocation id this session owner is bound to, if any. Needed for some specific calls to ensure they are operating on the proper object regardless of our current session view. |
public inline virtual TOptional< FString > GetBoundSessionId() const | Gets the session id this session owner is bound to, if any. Needed for some specific calls to ensure they are operating on the proper object regardless of our current session view. |
public inline virtual TOptional< FString > GetBoundInstanceId() const | Gets the instance id this session owner is bound to, if any. Needed for some specific calls to ensure they are operating on the proper object regardless of our current session view. |
public virtual bool CanAutoUploadServerFiles() const | Gets the directory to use for uploading files for this bootstrapper. |
public virtual FRH_RemoteFileApiDirectory GetAutoUploadDirectory(bool bDeveloperFile) const | Gets the directory to use for uploading files for this bootstrapper. |
public virtual void ConditionalAutoUploadLogFile() const | Capture and upload log file based on settings. |
public virtual void ConditionalAutoUploadTraceFile(const FString & TraceFile) const | Capture and upload trace file based on settings. |
protected ERH_ServerBootstrapMode BootstrapMode | Bootstrap Mode being used |
protected ERH_ServerBootstrapFlowStep BootstrapStep | Current Bootstrap Step |
protected int32 CurrentRecycleCount | The current recycle count (note that the initial boot is considered the first recycle, so this is effectively 1-based) |
protected FAuthContextPtr AuthContext | The auth context for this bootstrapper |
protected TSharedPtr< class IAnalyticsProvider > AnalyticsProvider | The analytics provider for this bootstrapper |
protected TOptional< FDateTime > AnalyticsStartTime | The start time of the AnalyticsProvider |
protected TUniquePtr< IRH_GameHostProviderInterface > GameHostProvider | The game host provider for this bootstrapper |
protected FRH_BootstrappingResult BootstrappingResult | The current bootstrapping result |
protected TMap< FString, FRHAPI_SessionTemplate>Templates | Session templates to use to iniailize the session |
protected TOptional< FString > AllTemplatesETag | ETag for the template list |
protected URH_OnlineSession*RHSession | The current session we are using |
protected FString DefaultAutoCreateSessionType | The default type of session to create when using AutoCreate bootstrapping mode |
protected FString DefaultAutoCreateRegion | The default region of session to create when using AutoCreate bootstrapping mode |
protected ERH_ServerBootstrapMode DefaultBootstrapMode | The default type of bootstrapping mode (only supports Disabled and LoginOnly, as other session types require commandline injection) |
protected int32 MaxRecycleCount | The maximum number of times to recycle this bootstrapper (if less than one, implies 1), checked during cleanup |
protected bool bMultiSessionServerMode | Disables some checks that will cause the process to spin down, for use in cases where multiple game instances are running within a single process |
protected bool bReplaceSIGTERMHandler | Whether to intercept SIGTERM and prevent passing it to engine handler(which will exit immediately) |
protected virtual void ApplicationTerminationNotify() | Callback binding for the default engine SIGTERM / CTRL - C(Windows) handlers - these are indicating an IMMEDIATE shutdown - will defer to game thread if needed. |
protected virtual void HandleAppTerminatedGameThread() | Callback binding for the default engine SIGTERM / CTRL - C(Windows) handlers - these are indicating an IMMEDIATE shutdown - runs in the game thread. |
protected virtual void BestEffortLeaveSession() | Fallback routine that does its best to leave the session we have loaded. |
protected virtual void UpdateBootstrapStep(ERH_ServerBootstrapFlowStep NewStep) | Updates the current bootstrapping step, and handles step change logic. |
protected virtual void DeferBootstrappingFailed(const FString & FailureReason) | Bootstrapping Flow [Failed] - trigger a deferred bootstrapping failure to be processed a later time (generally next tick). Useful for handling failures that occur during a callback or in a different thread. |
protected virtual void OnBootstrappingFailed(const FString & FailureReason) | Bootstrapping Flow [Failed] - trigger bootstrapping failure and handles failure logic. |
protected virtual void OnBootstrappingComplete() | Bootstrapping Flow [Complete] - trigger bootstrapping complete and handles completion logic. Note that recycling may start a new bootstrapping flow. |
protected virtual void BeginServerLogin() | Bootstrapping Flow [LoggingIn] - begin the login process to the RallyHere API. |
protected virtual void OnServerLoginComplete(bool bSuccess,const FRH_ErrorInfo & ErrorInfo) | Bootstrapping Flow [Login] - completion callback for RallyHere API login. |
protected virtual void Recycle() | Bootstrapping Flow [Recycle] - start a new recycle loop. |
protected virtual void BeginRegistration() | Bootstrapping Flow [Registration][Allocation][AutoCreate] - start the process of registering with the game host provider. |
protected virtual void BeginConnecting() | Bootstrapping Flow [Registration][Allocation][AutoCreate] - begin connecting to the provider. |
protected virtual void OnConnectComplete(bool bSuccess) | Bootstrapping Flow [Registration][Allocation][AutoCreate] - completion callback for connecting to the provider. |
protected virtual void BeginRegister() | Bootstrapping Flow [Registration][Allocation] - register with provider and wait for an allocation. |
protected virtual void OnRegisterComplete(bool bSucess) | Bootstrapping Flow [Registration][Allocation] - completion callback for registering with the provider. |
protected virtual void OnAllocationComplete(ERH_AllocationStatus Status,const FRH_GameHostAllocationInfo & AllocationInfo) | Bootstrapping Flow [Registration][Allocation] - completion callback for allocation being ready. |
protected virtual void BeginReservation() | Bootstrapping Flow [Registration][AutoCreate] - begin a reservation so that the provider can know about this server. |
protected virtual void OnReservationComplete(bool bSuccess,const FRH_GameHostAllocationInfo & ReservationInfo) | Bootstrapping Flow [Registration][AutoCreate] - completion callback for reservation creation. |
protected virtual void BeginSelfAllocate() | Bootstrapping Flow [Registration][AutoCreate] - inform the provider that this server is self-allocated. |
protected virtual void OnSelfAllocateComplete(bool bSuccess) | Bootstrapping Flow [Registration][AutoCreate] - completion callback for self allocation. |
protected virtual void OnRegistrationFinalizerComplete(bool bSuccess,const FRH_BootstrappingResult & Result) | Bootstrapping Flow [WaitingForSession] - callback for when registration process has completed and produced a bootstrapping result. Checks the result and then checks for an instance. Either creates and instance, or forwards on to OnSessionInstanceCreationCompleted() |
protected virtual void OnSessionInstanceCreationCompleted(bool bSuccess,URH_SessionView* CreatedRHSession,constFRH_ErrorInfo & ErrorInfo) | Bootstrapping Flow [WaitingForSession] - callback for when registration process has completed and produced a bootstrapping result. |
protected virtual void SyncToSession() | Bootstrapping Flow [SyncingToSession] - begin the process of synchronizing the session state into RH_GameInstanceSessionSubsystem. |
protected virtual void OnSyncToSessionComplete(URH_JoinedSession * Session,bool bSuccess,const FString & Error) | Bootstrapping Flow [SyncingToSession] - completiong callback for session sync. |
protected virtual void OnActiveSessionChanged(URH_JoinedSession * OldSession,URH_JoinedSession * NewSession) | Notification callback that the session manager has had its active session changed. |
protected virtual void OnSessionUpdated(URH_SessionView * Session) | Notification callback that the session we have synced to was updated. |
protected virtual void OnSessionNotFound(URH_SessionView * Session) | Notification callback that the session we have synced to was not found. |
protected virtual void CleanupAfterLogout() | Utility function to clean up state after a logout. |
protected virtual void CleanupAfterSessionUnsynced() | Utility function to clean up state after an the session became unsynced from the manager. |
protected virtual void CleanupAfterInstanceRemoval() | Utility function to clean up state after an instance removal (or something else causing session data to become invalid). Handles unsyncing session state, etc. |
protected virtual void CleanupAfterUnallocatedSoftStop() | Utility function to clean up state after receiving a soft stop request while unallocated. |
protected virtual void OnCleanupSessionSyncComplete(URH_JoinedSession * Session,bool bSuccess,const FString & Error) | Completion callback for session and instance cleanup, triggers Cleanup() |
protected virtual void Cleanup() | Cleans up state, and prepares for a recycle if needed. Assumes session has already been unsynced. |
protected virtual bool ShouldRecycleAfterCleanup() const | Gets whether we should recycle the state after cleanup. |
protected virtual void ConditionalRecycle() | Conditionally triggers a recycle if we are allowed to recycle, otherwise shut down. |
protected virtual void OnLoggedOut(bool bRefreshTokenExpired) | Callback for when the server is logged out (effectively, authorization to the API is lost, and was not automatically recovered) |
protected virtual void OnRefreshTokenExpired(FSimpleDelegate CompleteCallback) | Callback for when a refresh token expires. |
Members
public FRH_OnBootstrapStepChangedDelegate OnBootstrapStepChanged
Delegate for when bootstrap step changes.
public FRH_GameHostProviderStatsRequested OnGameHostProviderStatsRequested
callback triggered to request stats if default implementation is not sufficient
public URH_GameInstanceServerBootstrapper()
public virtual void Initialize()
Initialize the bootstrapper.
public virtual void Deinitialize()
Deinitialize the bootstrapper.
public inline FORCEINLINE ERH_ServerBootstrapFlowStep GetBootstrapStep() const
Get the current bootstrapping step.
public inline FORCEINLINE ERH_ServerBootstrapMode GetBootstrapMode() const
Get the current bootstrapping mode.
public bool DetermineJoinParameters(FString & PublicConnStr,FString & PrivateConnStr)
Determines the join parameters to be used for a session that was bootstrapped.
Parameters
-
PublicConnStrThe public connection string to use -
PrivateConnStrThe private connection string to use
Returns
Whether or not the join parameters were successfully determined from the allocation info
public virtual void OnGameHostProviderStats(FRH_GameHostProviderStats & Stats)
bound callback triggered to provide stats to the game host provider
public virtual void Tick(float DeltaTime)
Tick function.
Parameters
DeltaTimeThe time since the last tick
public virtual bool IsTickable() const
Whether or not to tick this object.
public virtual TStatId GetStatId() const
What stat id to use to report for the tick.
public inline virtual FAuthContextPtr GetAuthContext() const
Provides the auth context this bootstrapper owns.
public inline virtual TSharedPtr< class IAnalyticsProvider > GetAnalyticsProvider() const
Get the Analytics Provider.
public inline virtual URH_OnlineSession*GetSession() const
Get the current bootstrapping mode.
public inline virtual FAuthContextPtr GetSessionAuthContext() const
Gets the auth context to use for API calls for the session owner.
public virtual void ImportAPISession(const FRH_APISessionWithETag & Session)
Imports a session object from the API into the owner (ex: from polling).
Parameters
SessionThe Session to import.
public virtual void ImportAPITemplate(const FRHAPI_SessionTemplate & Template)
Imports the template into the owner's template list (ex: from polling).
Parameters
TemplateWrapperThe Template to import.
public virtual void ReconcileAPISessions(const TArray< FString > & SessionIds,const TOptional< FString > & ETag)
Updates the list of sessions to only those that are active.
Parameters
-
SessionIdsThe list of sessions that we are reconciling against. -
ETagThe ETag to use for the update.
public virtual void ReconcileAPITemplates(const TArray< FString > & InTemplates,const TOptional< FString > & ETag)
Updates the list of session templates to those that are active.
Parameters
-
InTemplatesThe list of templates that we are reconciling against. -
ETagThe ETag to use for the update.
public virtual class URH_PlayerInfoSubsystem*GetPlayerInfoSubsystem() const
Gets the PlayerInfo Subsystem.
public virtual IOnlineSubsystem * GetOSS() const
Gets the Online Subsystem to use for OSS calls.
public virtual FUniqueNetIdWrapper GetOSSUniqueId() const
Gets the Online Subsystem Unique Id to use for OSS calls.
public virtual FPlatformUserId GetOSSPlatformUserId() const
Gets the Online Subsystem PlatformUserId to use for OSS calls (equivalent to controller index)
public inline virtual TOptional< FString > GetETagForAllTemplatesPoll() const
Gets the etag to use for a "Get all Templates" type query.
public inline virtual TOptional< FString > GetETagForAllSessionsPoll() const
Gets the etag to use for a "Get all Sessions" type query.
public inline virtual TArray< URH_SessionView* >GetAllSessionsForPolling() const
Used to get all sessions, primarily for get all sessions polling where etag matches.
public virtual URH_SessionView*GetSessionById(const FString & SessionId) const
Gets a session by its id.
Parameters
SessionIdThe Session Id to get.
Returns
The Session with the given Id.
public virtual void RemoveSessionById(const FString & SessionId)
Removes a cached session for the local player, this does NOT try to leave it.
Parameters
SessionIdThe Session Id to remove.
public virtual bool GetTemplate(const FString & Type,FRHAPI_SessionTemplate & Template) const
Gets a session template by type.
Parameters
-
Typethe Type of template to get. -
TemplateThe session template being retrieved.
Returns
If true, the template was found.
public inline virtual URH_PlatformSessionSyncer*GetPlatformSyncerByRHSessionId(const FString & SessionId) const
Gets the platform synchronization object using the rally here session id.
public inline virtual URH_PlatformSessionSyncer*GetPlatformSyncerByPlatformSessionId(const FUniqueNetIdRepl & PlatformSessionId) const
Gets the platform synchronization object using the platform session id.
public inline const FRH_BootstrappingResult&GetBootstrappingResult() const
Gets the bootstrapping result from this bootstrapper.
public inline virtual TOptional< FString > GetBoundAllocationId() const
Gets the allocation id this session owner is bound to, if any. Needed for some specific calls to ensure they are operating on the proper object regardless of our current session view.
public inline virtual TOptional< FString > GetBoundSessionId() const
Gets the session id this session owner is bound to, if any. Needed for some specific calls to ensure they are operating on the proper object regardless of our current session view.
public inline virtual TOptional< FString > GetBoundInstanceId() const
Gets the instance id this session owner is bound to, if any. Needed for some specific calls to ensure they are operating on the proper object regardless of our current session view.
public virtual bool CanAutoUploadServerFiles() const
Gets the directory to use for uploading files for this bootstrapper.
public virtual FRH_RemoteFileApiDirectory GetAutoUploadDirectory(bool bDeveloperFile) const
Gets the directory to use for uploading files for this bootstrapper.
public virtual void ConditionalAutoUploadLogFile() const
Capture and upload log file based on settings.
public virtual void ConditionalAutoUploadTraceFile(const FString & TraceFile) const
Capture and upload trace file based on settings.
protected ERH_ServerBootstrapMode BootstrapMode
Bootstrap Mode being used
protected ERH_ServerBootstrapFlowStep BootstrapStep
Current Bootstrap Step
protected int32 CurrentRecycleCount
The current recycle count (note that the initial boot is considered the first recycle, so this is effectively 1-based)
protected FAuthContextPtr AuthContext
The auth context for this bootstrapper
protected TSharedPtr< class IAnalyticsProvider > AnalyticsProvider
The analytics provider for this bootstrapper
protected TOptional< FDateTime > AnalyticsStartTime
The start time of the AnalyticsProvider
protected TUniquePtr< IRH_GameHostProviderInterface > GameHostProvider
The game host provider for this bootstrapper
protected FRH_BootstrappingResult BootstrappingResult
The current bootstrapping result
protected TMap< FString, FRHAPI_SessionTemplate>Templates
Session templates to use to iniailize the session
protected TOptional< FString > AllTemplatesETag
ETag for the template list
protected URH_OnlineSession*RHSession
The current session we are using
protected FString DefaultAutoCreateSessionType
The default type of session to create when using AutoCreate bootstrapping mode
protected FString DefaultAutoCreateRegion
The default region of session to create when using AutoCreate bootstrapping mode
protected ERH_ServerBootstrapMode DefaultBootstrapMode
The default type of bootstrapping mode (only supports Disabled and LoginOnly, as other session types require commandline injection)
protected int32 MaxRecycleCount
The maximum number of times to recycle this bootstrapper (if less than one, implies 1), checked during cleanup
protected bool bMultiSessionServerMode
Disables some checks that will cause the process to spin down, for use in cases where multiple game instances are running within a single process
protected bool bReplaceSIGTERMHandler
Whether to intercept SIGTERM and prevent passing it to engine handler(which will exit immediately)
protected virtual void ApplicationTerminationNotify()
Callback binding for the default engine SIGTERM / CTRL - C(Windows) handlers - these are indicating an IMMEDIATE shutdown - will defer to game thread if needed.
protected virtual void HandleAppTerminatedGameThread()
Callback binding for the default engine SIGTERM / CTRL - C(Windows) handlers - these are indicating an IMMEDIATE shutdown - runs in the game thread.
protected virtual void BestEffortLeaveSession()
Fallback routine that does its best to leave the session we have loaded.
protected virtual void UpdateBootstrapStep(ERH_ServerBootstrapFlowStep NewStep)
Updates the current bootstrapping step, and handles step change logic.
Parameters
NewStepThe new step to transition to
protected virtual void DeferBootstrappingFailed(const FString & FailureReason)
Bootstrapping Flow [Failed] - trigger a deferred bootstrapping failure to be processed a later time (generally next tick). Useful for handling failures that occur during a callback or in a different thread.
protected virtual void OnBootstrappingFailed(const FString & FailureReason)
Bootstrapping Flow [Failed] - trigger bootstrapping failure and handles failure logic.
protected virtual void OnBootstrappingComplete()
Bootstrapping Flow [Complete] - trigger bootstrapping complete and handles completion logic. Note that recycling may start a new bootstrapping flow.
protected virtual void BeginServerLogin()
Bootstrapping Flow [LoggingIn] - begin the login process to the RallyHere API.
protected virtual void OnServerLoginComplete(bool bSuccess,const FRH_ErrorInfo & ErrorInfo)
Bootstrapping Flow [Login] - completion callback for RallyHere API login.
Parameters
bSuccessWhether or not the login was successful
protected virtual void Recycle()
Bootstrapping Flow [Recycle] - start a new recycle loop.
protected virtual void BeginRegistration()
Bootstrapping Flow [Registration][Allocation][AutoCreate] - start the process of registering with the game host provider.
protected virtual void BeginConnecting()
Bootstrapping Flow [Registration][Allocation][AutoCreate] - begin connecting to the provider.
protected virtual void OnConnectComplete(bool bSuccess)
Bootstrapping Flow [Registration][Allocation][AutoCreate] - completion callback for connecting to the provider.
Parameters
bSuccessWhether or not the connection was successful
protected virtual void BeginRegister()
Bootstrapping Flow [Registration][Allocation] - register with provider and wait for an allocation.
protected virtual void OnRegisterComplete(bool bSucess)
Bootstrapping Flow [Registration][Allocation] - completion callback for registering with the provider.
Parameters
bSuccessWhether or not the connection was successful
protected virtual void OnAllocationComplete(ERH_AllocationStatus Status,const FRH_GameHostAllocationInfo & AllocationInfo)
Bootstrapping Flow [Registration][Allocation] - completion callback for allocation being ready.
Parameters
-
StatusWhether or not the allocation was successful or had an error -
AllocationInfoThe allocation info that was produced
protected virtual void BeginReservation()
Bootstrapping Flow [Registration][AutoCreate] - begin a reservation so that the provider can know about this server.
protected virtual void OnReservationComplete(bool bSuccess,const FRH_GameHostAllocationInfo & ReservationInfo)
Bootstrapping Flow [Registration][AutoCreate] - completion callback for reservation creation.
Parameters
-
bSuccessWhether or not the reservation was successful -
ReservationInfoThe reservation info that was produced
protected virtual void BeginSelfAllocate()
Bootstrapping Flow [Registration][AutoCreate] - inform the provider that this server is self-allocated.
protected virtual void OnSelfAllocateComplete(bool bSuccess)
Bootstrapping Flow [Registration][AutoCreate] - completion callback for self allocation.
Parameters
bSuccessWhether or not the self allocation was successful
protected virtual void OnRegistrationFinalizerComplete(bool bSuccess,const FRH_BootstrappingResult & Result)
Bootstrapping Flow [WaitingForSession] - callback for when registration process has completed and produced a bootstrapping result. Checks the result and then checks for an instance. Either creates and instance, or forwards on to OnSessionInstanceCreationCompleted()
Parameters
-
bSuccessWhether or not the registration was successful -
ResultThe bootstrapping result that was produced
protected virtual void OnSessionInstanceCreationCompleted(bool bSuccess,URH_SessionView* CreatedRHSession,constFRH_ErrorInfo & ErrorInfo)
Bootstrapping Flow [WaitingForSession] - callback for when registration process has completed and produced a bootstrapping result.
Parameters
-
bSuccessWhether or not the instance was successfully created -
CreatedRHSessionThe session that was created with an instance -
ErrorInfoError information about the instance creation
protected virtual void SyncToSession()
Bootstrapping Flow [SyncingToSession] - begin the process of synchronizing the session state into RH_GameInstanceSessionSubsystem.
protected virtual void OnSyncToSessionComplete(URH_JoinedSession * Session,bool bSuccess,const FString & Error)
Bootstrapping Flow [SyncingToSession] - completiong callback for session sync.
Parameters
bSuccessWhether or not the session sync was successful
protected virtual void OnActiveSessionChanged(URH_JoinedSession * OldSession,URH_JoinedSession * NewSession)
Notification callback that the session manager has had its active session changed.
Parameters
-
OldSessionThe old session that was active -
NewSessionThe new session that is active
protected virtual void OnSessionUpdated(URH_SessionView * Session)
Notification callback that the session we have synced to was updated.
Parameters
SessionThe updated session
protected virtual void OnSessionNotFound(URH_SessionView * Session)
Notification callback that the session we have synced to was not found.
Parameters
SessionThe session that was not found
protected virtual void CleanupAfterLogout()
Utility function to clean up state after a logout.
protected virtual void CleanupAfterSessionUnsynced()
Utility function to clean up state after an the session became unsynced from the manager.
protected virtual void CleanupAfterInstanceRemoval()
Utility function to clean up state after an instance removal (or something else causing session data to become invalid). Handles unsyncing session state, etc.
protected virtual void CleanupAfterUnallocatedSoftStop()
Utility function to clean up state after receiving a soft stop request while unallocated.
protected virtual void OnCleanupSessionSyncComplete(URH_JoinedSession * Session,bool bSuccess,const FString & Error)
Completion callback for session and instance cleanup, triggers Cleanup()
protected virtual void Cleanup()
Cleans up state, and prepares for a recycle if needed. Assumes session has already been unsynced.
protected virtual bool ShouldRecycleAfterCleanup() const
Gets whether we should recycle the state after cleanup.
protected virtual void ConditionalRecycle()
Conditionally triggers a recycle if we are allowed to recycle, otherwise shut down.
protected virtual void OnLoggedOut(bool bRefreshTokenExpired)
Callback for when the server is logged out (effectively, authorization to the API is lost, and was not automatically recovered)
protected virtual void OnRefreshTokenExpired(FSimpleDelegate CompleteCallback)
Callback for when a refresh token expires.
class URH_GameInstanceClientBootstrapper
class URH_GameInstanceClientBootstrapper
: public URH_GameInstanceSubsystemPlugin
Client Boostrapper for the Game Instance.
Summary
| Members | Descriptions |
|---|---|
public virtual void Initialize() | Initialize the bootstrapper. |
public virtual void Deinitialize() | Deinitialize the bootstrapper. |
public virtual void CreateOfflineSession() | Utility function to create an offline session |
Members
public virtual void Initialize()
Initialize the bootstrapper.
public virtual void Deinitialize()
Deinitialize the bootstrapper.
public virtual void CreateOfflineSession()
Utility function to create an offline session
class URH_GameInstanceSubsystem
class URH_GameInstanceSubsystem
: public UGameInstanceSubsystem
Subsystem for the Game Instance.
Summary
| Members | Descriptions |
|---|---|
public virtual bool ShouldCreateSubsystem(UObject * Outer) const | Gets if the subsystem is enabled and should be created. |
public virtual void Initialize(FSubsystemCollectionBase & Collection) | Initialize the subsystem. |
public virtual void Deinitialize() | Safely tears down the subsystem. |
public inline virtual void SetAuthContext(FAuthContextPtr InAuthContext) | Sets the Auth Context for the subsystem. |
public inline FORCEINLINE FAuthContextPtr GetAuthContext() const | Gets the subsystems designated auth context. |
public inline virtual void SetAnalyticsProvider(TSharedPtr< class IAnalyticsProvider > InAnalyticsProvider) | Sets the analytics provider for the subsystem. |
public inline FORCEINLINE TSharedPtr< class IAnalyticsProvider > GetAnalyticsProvider() const | Gets the instance's analytics provider to use. |
public inline FORCEINLINE URH_GameInstanceSessionSubsystem*GetSessionSubsystem() const | Gets the session subsystem on the instance. |
public inline FORCEINLINE URH_SessionBrowserCache*GetSessionSearchCache() const | Gets the session search cache on the instance. |
public inline FORCEINLINE URH_MatchmakingBrowserCache*GetMatchmakingCache() const | Gets the matchmaking cache on the instance. |
public inline FORCEINLINE URH_GameInstanceServerBootstrapper*GetServerBootstrapper() const | Gets the server bootstrapper on the instance. |
public inline FORCEINLINE URH_GameInstanceClientBootstrapper*GetClientBootstrapper() const | Gets the client boostrapper on the instance. |
public inline FORCEINLINE URH_PlayerInfoSubsystem*GetPlayerInfoSubsystem() const | Gets the player info subsystem on the instance. |
public inline FORCEINLINE URH_CatalogSubsystem*GetCatalogSubsystem() const | Gets the catalog subsystem on the instance. |
public inline FORCEINLINE URH_ConfigSubsystem*GetConfigSubsystem() const | Gets the config subsystem on the instance. |
public inline FORCEINLINE URH_SettingsSubsystem*GetSettingsSubsystem() const | Gets the settings subsystem on the instance. |
public inline FORCEINLINE URH_MatchSubsystem*GetMatchSubsystem() const | Gets the match subsystem on the instance. |
public inline FORCEINLINE URH_RemoteFileSubsystem*GetRemoteFileSubsystem() const | Gets the remote file subsystem on the instance. |
public inline virtual bool IsServerBootstrappingEnabled() | Gets if server boostrapping is enabled. |
public inline virtual bool IsClientBootstrappingEnabled() | Gets if client boostrapping is enabled. |
public virtual void CustomEndpoint(const FRH_CustomEndpointRequestWrapper & Request,const RallyHereAPI::FDelegate_CustomEndpointSend & Delegate) | Custom Endpoint wrapper (for custom endpoints that require authentication) |
public virtual void CustomEndpoint(const FRH_CustomEndpointRequestWrapper & Request,const FRH_CustomEndpointDelegateBlock & Delegate) | Custom Endpoint wrapper (for custom endpoints that require authentication) |
public inline FString GetLastKnownIPAddress() const | Gets a last-known IP address for use with reporting. |
public inline FSimpleMulticastDelegate & GetOnLastKnownIpAddressUpdated() | Gets a delegate triggered if the last-known IP address is updated. |
public virtual void QueryIpAddressIfNeeded(bool bForce,FSimpleDelegate Delegate) | Attempts to update the IP address. |
protected FAuthContextPtr AuthContext | Auth context used by the Game Instance Subsystem. |
protected TSharedPtr< class IAnalyticsProvider > AnalyticsProvider | Analytics provider used by the Game Instance Subsystem. |
protected TArray< URH_GameInstanceSubsystemPlugin* >SubsystemPlugins | Array of plugins for the Game Instance Subsystem. |
protected URH_GameInstanceSessionSubsystem*SessionSubsystem | The Session Subsystem. |
protected URH_SessionBrowserCache*SessionSearchCache | The Cache for seasion seaches. |
protected URH_MatchmakingBrowserCache*MatchmakingCache | The Cache to matchmaking. |
protected URH_GameInstanceServerBootstrapper*ServerBootstrapper | The Game Instance Server Boostrapper. |
protected URH_GameInstanceClientBootstrapper*ClientBootstrapper | The Game Instance Client Boostrapper. |
protected URH_PlayerInfoSubsystem*PlayerInfoSubsystem | The Player Info Subsystem. |
protected URH_CatalogSubsystem*CatalogSubsystem | The Catalog Subsystem. |
protected URH_ConfigSubsystem*ConfigSubsystem | The Config Subsystem. |
protected URH_SettingsSubsystem*SettingsSubsystem | The Settings Subsystem. |
protected URH_MatchSubsystem*MatchSubsystem | The Match Subsystem. |
protected URH_RemoteFileSubsystem*RemoteFileSubsystem | The File Subsystem. |
protected FString LastKnownIPAddress | |
protected IpQueryState LastKnownIPAddressQueryState | |
protected FSimpleMulticastDelegate OnLastKnownIpAddressUpdated | |
protected TArray< FSimpleDelegate > LastKnownIpAddressUpdateDelegates | |
protected bool bEnabled | If the Game Instance Subsystem is enabled. |
protected bool bEnableSessionBrowser | If the Session Browser is enabled. |
protected bool bEnableMatchmakingBrowser | If the Matchmaking Browser is enabled. |
protected bool bEnableGameSessions | If the Game Sessions are enabled. |
protected bool bEnableServerBootstrapper | If the Game Instance Server Bootstrapper is enabled. |
protected bool bEnableClientBootstrapper | If the Game Instance Client Bootstrapper is enabled. |
protected template<> inline UClassToUse * AddSubsystemPlugin(const FSoftClassPath & SubsystemClassPath) | Adds a plugin to the Game Instance Subsystem. |
protected inline virtual void AddSubsystemPlugin(URH_GameInstanceSubsystemPlugin * InPlugin) | Adds a plugin to the Game Instance Subsystem. |
protected virtual void AppSuspendCallbackInGameThread() | Handle application going into suspension (these involve the application losing focus). |
protected virtual void AppResumeCallbackInGameThread() | Handle application resuming from suspension (these involve the application losing focus). |
protected virtual void AppDeactivatedCallbackInGameThread() | Handle application deactivating (these involve the game shutting down and pausing (such as when a console is put to sleep)). |
protected virtual void AppReactivatedCallbackInGameThread() | Handle application reactivating (these involve the game shutting down and pausing (such as when a console is put to sleep)). |
Members
public virtual bool ShouldCreateSubsystem(UObject * Outer) const
Gets if the subsystem is enabled and should be created.
public virtual void Initialize(FSubsystemCollectionBase & Collection)
Initialize the subsystem.
public virtual void Deinitialize()
Safely tears down the subsystem.
public inline virtual void SetAuthContext(FAuthContextPtr InAuthContext)
Sets the Auth Context for the subsystem.
Parameters
InAuthContextThe Auth Context to set with.
public inline FORCEINLINE FAuthContextPtr GetAuthContext() const
Gets the subsystems designated auth context.
public inline virtual void SetAnalyticsProvider(TSharedPtr< class IAnalyticsProvider > InAnalyticsProvider)
Sets the analytics provider for the subsystem.
Parameters
InAnalyticsProviderThe analytics provider to set with.
public inline FORCEINLINE TSharedPtr< class IAnalyticsProvider > GetAnalyticsProvider() const
Gets the instance's analytics provider to use.
public inline FORCEINLINE URH_GameInstanceSessionSubsystem*GetSessionSubsystem() const
Gets the session subsystem on the instance.
public inline FORCEINLINE URH_SessionBrowserCache*GetSessionSearchCache() const
Gets the session search cache on the instance.
public inline FORCEINLINE URH_MatchmakingBrowserCache*GetMatchmakingCache() const
Gets the matchmaking cache on the instance.
public inline FORCEINLINE URH_GameInstanceServerBootstrapper*GetServerBootstrapper() const
Gets the server bootstrapper on the instance.
public inline FORCEINLINE URH_GameInstanceClientBootstrapper*GetClientBootstrapper() const
Gets the client boostrapper on the instance.
public inline FORCEINLINE URH_PlayerInfoSubsystem*GetPlayerInfoSubsystem() const
Gets the player info subsystem on the instance.
public inline FORCEINLINE URH_CatalogSubsystem*GetCatalogSubsystem() const
Gets the catalog subsystem on the instance.
public inline FORCEINLINE URH_ConfigSubsystem*GetConfigSubsystem() const
Gets the config subsystem on the instance.
public inline FORCEINLINE URH_SettingsSubsystem*GetSettingsSubsystem() const
Gets the settings subsystem on the instance.
public inline FORCEINLINE URH_MatchSubsystem*GetMatchSubsystem() const
Gets the match subsystem on the instance.
public inline FORCEINLINE URH_RemoteFileSubsystem*GetRemoteFileSubsystem() const
Gets the remote file subsystem on the instance.
public inline virtual bool IsServerBootstrappingEnabled()
Gets if server boostrapping is enabled.
public inline virtual bool IsClientBootstrappingEnabled()
Gets if client boostrapping is enabled.
public virtual void CustomEndpoint(const FRH_CustomEndpointRequestWrapper & Request,const RallyHereAPI::FDelegate_CustomEndpointSend & Delegate)
Custom Endpoint wrapper (for custom endpoints that require authentication)
Parameters
-
[FRH_CustomEndpointRequestWrapper](Common.md#structFRH__CustomEndpointRequestWrapper)Wrapper struct containing call information -
DelegateThe delegate to call when the call is complete (contains raw response)
public virtual void CustomEndpoint(const FRH_CustomEndpointRequestWrapper & Request,const FRH_CustomEndpointDelegateBlock & Delegate)
Custom Endpoint wrapper (for custom endpoints that require authentication)
Parameters
-
[FRH_CustomEndpointRequestWrapper](Common.md#structFRH__CustomEndpointRequestWrapper)Wrapper struct containing call information -
DelegateThe delegate to call when the call is complete
public inline FString GetLastKnownIPAddress() const
Gets a last-known IP address for use with reporting.
Returns
The last-known IP address, if known, empty otherwise
public inline FSimpleMulticastDelegate & GetOnLastKnownIpAddressUpdated()
Gets a delegate triggered if the last-known IP address is updated.
Returns
The delegate
public virtual void QueryIpAddressIfNeeded(bool bForce,FSimpleDelegate Delegate)
Attempts to update the IP address.
Parameters
-
bForceIf true, forces the query to occur even if one is already in progress or has already completed -
DelegateThe delegate to call when the call is complete
protected FAuthContextPtr AuthContext
Auth context used by the Game Instance Subsystem.
protected TSharedPtr< class IAnalyticsProvider > AnalyticsProvider
Analytics provider used by the Game Instance Subsystem.
protected TArray< URH_GameInstanceSubsystemPlugin* >SubsystemPlugins
Array of plugins for the Game Instance Subsystem.
protected URH_GameInstanceSessionSubsystem*SessionSubsystem
The Session Subsystem.
protected URH_SessionBrowserCache*SessionSearchCache
The Cache for seasion seaches.
protected URH_MatchmakingBrowserCache*MatchmakingCache
The Cache to matchmaking.
protected URH_GameInstanceServerBootstrapper*ServerBootstrapper
The Game Instance Server Boostrapper.
protected URH_GameInstanceClientBootstrapper*ClientBootstrapper
The Game Instance Client Boostrapper.
protected URH_PlayerInfoSubsystem*PlayerInfoSubsystem
The Player Info Subsystem.
protected URH_CatalogSubsystem*CatalogSubsystem
The Catalog Subsystem.
protected URH_ConfigSubsystem*ConfigSubsystem
The Config Subsystem.
protected URH_SettingsSubsystem*SettingsSubsystem
The Settings Subsystem.
protected URH_MatchSubsystem*MatchSubsystem
The Match Subsystem.
protected URH_RemoteFileSubsystem*RemoteFileSubsystem
The File Subsystem.
protected FString LastKnownIPAddress
protected IpQueryState LastKnownIPAddressQueryState
protected FSimpleMulticastDelegate OnLastKnownIpAddressUpdated
protected TArray< FSimpleDelegate > LastKnownIpAddressUpdateDelegates
protected bool bEnabled
If the Game Instance Subsystem is enabled.
protected bool bEnableSessionBrowser
If the Session Browser is enabled.
protected bool bEnableMatchmakingBrowser
If the Matchmaking Browser is enabled.
protected bool bEnableGameSessions
If the Game Sessions are enabled.
protected bool bEnableServerBootstrapper
If the Game Instance Server Bootstrapper is enabled.
protected bool bEnableClientBootstrapper
If the Game Instance Client Bootstrapper is enabled.
protected template<>
inline UClassToUse * AddSubsystemPlugin(const FSoftClassPath & SubsystemClassPath)
Adds a plugin to the Game Instance Subsystem.
Parameters
SubsystemClassPathThe class path of the plugin to add.
Returns
The plugin that was added.
protected inline virtual void AddSubsystemPlugin(URH_GameInstanceSubsystemPlugin * InPlugin)
Adds a plugin to the Game Instance Subsystem.
Parameters
SubsystemClassPathThe class path of the plugin to add.
Returns
The plugin that was added.
protected virtual void AppSuspendCallbackInGameThread()
Handle application going into suspension (these involve the application losing focus).
protected virtual void AppResumeCallbackInGameThread()
Handle application resuming from suspension (these involve the application losing focus).
protected virtual void AppDeactivatedCallbackInGameThread()
Handle application deactivating (these involve the game shutting down and pausing (such as when a console is put to sleep)).
protected virtual void AppReactivatedCallbackInGameThread()
Handle application reactivating (these involve the game shutting down and pausing (such as when a console is put to sleep)).
struct FRH_BootstrappingResult
An result object that contains the accumulated results for the bootstrapping flow.
Summary
| Members | Descriptions |
|---|---|
public FRH_GameHostAllocationInfo AllocationInfo | Allocation info from the provider. |
public TOptional< FString > ETag | Etag for the session. |
public TOptional< FRH_APISessionWithETag>Session | Session data. |
public TOptional< FRHAPI_SessionTemplate>Template | Session template. |
public inline FRH_BootstrappingResult() | Default constructor. |
public inline FRH_BootstrappingResult(const FRH_GameHostAllocationInfo & InAllocationInfo) | Constructor with Host Allocation Info. |
public inline FORCEINLINE bool IsValid() const | Whether or not this result is valid (it has the required IDs to be finalized) |
public inline FORCEINLINE bool IsComplete() const | Whether or not this result is complete (it has valid and matching session information) |
Members
public FRH_GameHostAllocationInfo AllocationInfo
Allocation info from the provider.
public TOptional< FString > ETag
Etag for the session.
public TOptional< FRH_APISessionWithETag>Session
Session data.
public TOptional< FRHAPI_SessionTemplate>Template
Session template.
public inline FRH_BootstrappingResult()
Default constructor.
public inline FRH_BootstrappingResult(const FRH_GameHostAllocationInfo & InAllocationInfo)
Constructor with Host Allocation Info.
public inline FORCEINLINE bool IsValid() const
Whether or not this result is valid (it has the required IDs to be finalized)
public inline FORCEINLINE bool IsComplete() const
Whether or not this result is complete (it has valid and matching session information)
struct FRH_ActiveSessionStatePlayerContext
Summary
| Members | Descriptions |
|---|---|
public FGuid RHPlayerId | The player id for the context. |
public TWeakObjectPtr< AController > Controller | The controller for the context. |
public FDateTime JoinedTime | The time the player joined the server. |
public FDateTime LeaveTime | The time the player left the server. |
public float DurationSeconds | The total time the player has been connected. |
public inline FRH_ActiveSessionStatePlayerContext() |
Members
public FGuid RHPlayerId
The player id for the context.
public TWeakObjectPtr< AController > Controller
The controller for the context.
public FDateTime JoinedTime
The time the player joined the server.
public FDateTime LeaveTime
The time the player left the server.
public float DurationSeconds
The total time the player has been connected.