Skip to main content

Notifications

Summary​

MembersDescriptions
enum FRH_NotificationPollingTypesEnum to define how to poll for notifications.
class URH_PlayerNotificationsNotification Subsystem used for polling notifications of updates.

Members​

enum FRH_NotificationPollingTypes ​

ValuesDescriptions
LongPollLong Polling sends a web request to the server and the server responds when there is content to push.

Enum to define how to poll for notifications.

class URH_PlayerNotifications ​

class URH_PlayerNotifications
: public UObject

Notification Subsystem used for polling notifications of updates.

Summary​

MembersDescriptions
public FRH_OnNotificationStreamedDynamicDelegate OnNotificationStreamedDynamicDelegate to listen to for when a notification is streamed.
public FRH_OnNotificationStreamedDelegate OnNotificationStreamedDelegate to listen to for when a notification is streamed.
public TMap< FString, FRH_OnNotificationStreamedDelegate > OnNotificationStreamedByAPISpecialty version available only to C++, as cannot bind a TMap to a delegate in a UPROPERTY.
public virtual void Initialize()Initialize the subsystem.
public inline URH_PlayerInfo*GetPlayerInfo() constGets the player info set on the subsystem.
public FGuid GetRHPlayerUuid() constGets the associated player infos Unique Player Id.
public FAuthContextPtr GetAuthContext() constGets the Auth Context that has authority to operate on this players inventory.
public inline void SetPlayerInfo(URH_PlayerInfo * InPlayerInfo)Sets the Player Info owner of the subsystem.
public void StartStreamingLatestNotifications(const FString & Cursor)Starts streaming notifications from the server.
public void StopStreamingLatestNotifications(bool bClearCache)Stops streaming notifications from the server.
public inline bool IsStreaming() constGets if notifications are currenly being streamed.
public inline void SetStreamingHistorySize(int32 Size)Sets the amount of notifications to cache.
public inline int32 GetStreamingHistorySize() constGets the max size of the history cache.
public inline const TArray< FRHAPI_Notification> &GetStreamingHistory() constGets the notification history cache.
public inline void ClearStreamingHistory()Clears the notification history cache.
public inline const FString & GetStreamingCursor() constGets the current cursor for streaming notifications.
public inline const FGuid & GetStreamingPlayerUuid() constGets the unique player id the notifications are being streamed for.
public bool CreateNotification(const FGuid & PlayerUuid,const FString & Message,const FString & RhUrl,const TMap< FString, FString > & CustomData,const FRH_OnSingularNotificationIDDelegateBlock & Delegate)Creates a notification, mostly used for debugging as notifications generally originate from the core.
protected FRH_NotificationPollingTypes PollingTypeThe polling type to use, defaults to Long Poll.
protected TSharedPtr< class FRH_NotificationStreamingLongPollHelper > LongPollHelperHelper for making long polling requests.
protected FGuid StreamingPlayerUuidPlayer Uuid for that the notifications are being polled for.
protected FString StreamingCursorCursor location of the last poll response.
protected bool bIsStreamingIf ture, then polling is actively being done by the system.
protected TArray< FRHAPI_Notification>StreamingHistoryCache of the polled notifications.
protected int32 StreamingHistorySizeThe number of cached notifications to store before purging old ones.
protected URH_PlayerInfo*PlayerInfoThe player info associated with the notification polling.
protected float NextLongPollDelayThe delay to use before the next poll starts.
protected float MaxLongPollDelayThe max delay to use before the next poll starts.
protected FTimerHandle LongPollDeferralHandleThe timer handler for long poll deferrals.
protected virtual void RestartLongPollLoop(bool bPreviousPollSuccess)Restarts the long poll loop (potentially with deferal) to long poll for notifications.
protected virtual void StartLongPoll()Starts a long poll for Notifications.
protected virtual void OnNotificationsStreamed(bool bSuccess,const FString & CursorAfter,float RequestDuration,const FRHAPI_Notifications & Resp)Handles the response to a Nofitication poll.
protected virtual void OnNotificationCreated(const RallyHereAPI::FResponse_PlayerCreateNotification & Resp,const FRH_OnSingularNotificationIDDelegateBlock Delegate)Handles the response to a Nofitication Creation call.
protected inline void TrimStreamingHistory()Keeps the notification history size within the configured size for the cache.

Members​

public FRH_OnNotificationStreamedDynamicDelegate OnNotificationStreamedDynamic ​

Delegate to listen to for when a notification is streamed.

public FRH_OnNotificationStreamedDelegate OnNotificationStreamed ​

Delegate to listen to for when a notification is streamed.

public TMap< FString, FRH_OnNotificationStreamedDelegate > OnNotificationStreamedByAPI ​

Specialty version available only to C++, as cannot bind a TMap to a delegate in a UPROPERTY.

public virtual void Initialize() ​

Initialize the subsystem.

public inline URH_PlayerInfo*GetPlayerInfo() const ​

Gets the player info set on the subsystem.

Returns​

The set player info.

public FGuid GetRHPlayerUuid() const ​

Gets the associated player infos Unique Player Id.

Returns​

The set player infos Unique Player Id.

public FAuthContextPtr GetAuthContext() const ​

Gets the Auth Context that has authority to operate on this players inventory.

Returns​

The local or instance Auth Context.

public inline void SetPlayerInfo(URH_PlayerInfo * InPlayerInfo) ​

Sets the Player Info owner of the subsystem.

public void StartStreamingLatestNotifications(const FString & Cursor) ​

Starts streaming notifications from the server.

Parameters​

  • Cursor The cursor to start streaming from.

public void StopStreamingLatestNotifications(bool bClearCache) ​

Stops streaming notifications from the server.

Parameters​

  • bClearCache if true, clears the notification streaming history.

public inline bool IsStreaming() const ​

Gets if notifications are currenly being streamed.

public inline void SetStreamingHistorySize(int32 Size) ​

Sets the amount of notifications to cache.

Parameters​

  • Size The number of notifications to store in the streaming history.

public inline int32 GetStreamingHistorySize() const ​

Gets the max size of the history cache.

public inline const TArray< FRHAPI_Notification> &GetStreamingHistory() const ​

Gets the notification history cache.

public inline void ClearStreamingHistory() ​

Clears the notification history cache.

public inline const FString & GetStreamingCursor() const ​

Gets the current cursor for streaming notifications.

public inline const FGuid & GetStreamingPlayerUuid() const ​

Gets the unique player id the notifications are being streamed for.

public bool CreateNotification(const FGuid & PlayerUuid,const FString & Message,const FString & RhUrl,const TMap< FString, FString > & CustomData,const FRH_OnSingularNotificationIDDelegateBlock & Delegate) ​

Creates a notification, mostly used for debugging as notifications generally originate from the core.

Parameters​

  • PlayerUuid The player Id to create the notification for.

  • Message A text message on the notification.

  • RhUrl Path to get additional data about the notification.

  • CustomData Custom data added to the notification.

  • Delegate Callback when the notification is created or fails to create.

Returns​

True, if the notification was created.

protected FRH_NotificationPollingTypes PollingType ​

The polling type to use, defaults to Long Poll.

protected TSharedPtr< class FRH_NotificationStreamingLongPollHelper > LongPollHelper ​

Helper for making long polling requests.

protected FGuid StreamingPlayerUuid ​

Player Uuid for that the notifications are being polled for.

protected FString StreamingCursor ​

Cursor location of the last poll response.

protected bool bIsStreaming ​

If ture, then polling is actively being done by the system.

protected TArray< FRHAPI_Notification>StreamingHistory ​

Cache of the polled notifications.

protected int32 StreamingHistorySize ​

The number of cached notifications to store before purging old ones.

protected URH_PlayerInfo*PlayerInfo ​

The player info associated with the notification polling.

protected float NextLongPollDelay ​

The delay to use before the next poll starts.

protected float MaxLongPollDelay ​

The max delay to use before the next poll starts.

protected FTimerHandle LongPollDeferralHandle ​

The timer handler for long poll deferrals.

protected virtual void RestartLongPollLoop(bool bPreviousPollSuccess) ​

Restarts the long poll loop (potentially with deferal) to long poll for notifications.

protected virtual void StartLongPoll() ​

Starts a long poll for Notifications.

protected virtual void OnNotificationsStreamed(bool bSuccess,const FString & CursorAfter,float RequestDuration,const FRHAPI_Notifications & Resp) ​

Handles the response to a Nofitication poll.

Parameters​

  • bSuccess True if the poll was successful.

  • CursorAfter The cursor position for future notification polling.

  • RequestDuration The duration until the poll was responded to.

  • Resp Response given for the poll.

protected virtual void OnNotificationCreated(const RallyHereAPI::FResponse_PlayerCreateNotification & Resp,const FRH_OnSingularNotificationIDDelegateBlock Delegate) ​

Handles the response to a Nofitication Creation call.

Parameters​

  • Resp Response given for the call.

  • Delegate Delegate passed in for original call to respond to when call completes.

protected inline void TrimStreamingHistory() ​

Keeps the notification history size within the configured size for the cache.