Loading...
Searching...
No Matches
AccelByte::Api::PredefinedEvent Class Reference

Send predefined telemetry data securely and the user should be logged in first. More...

#include <AccelBytePredefinedEventApi.h>

Inheritance diagram for AccelByte::Api::PredefinedEvent:

Public Member Functions

 PredefinedEvent (Credentials &InCredentialsRef, Settings const &InSettingsRef, FHttpRetrySchedulerBase &InHttpRef, TSharedPtr< AccelByte::FApiClient, ESPMode::ThreadSafe > const &InApiClient=nullptr)
 PredefinedEvent (Credentials &InCredentialsRef, Settings const &InSettingsRef, FHttpRetrySchedulerBase &InHttpRef, FAccelBytePlatformPtr const &InAccelBytePlatform)
template<typename T>
void SendPredefinedEventData (TSharedRef< T > const &Payload, FVoidHandler const &OnSuccess, FErrorHandler const &OnError, FDateTime const &ClientTimestamp=FDateTime::UtcNow())
 Send/enqueue a single authorized telemetry data of a predefined event. User should be logged in.
void SendPredefinedEventData (TSharedRef< FAccelByteModelsCachedPredefinedEventPayload > const &Payload, FVoidHandler const &OnSuccess, FErrorHandler const &OnError, FDateTime const &ClientTimestamp=FDateTime::UtcNow())
Public Member Functions inherited from AccelByte::Api::GameTelemetry
 GameTelemetry (Credentials &InCredentialsRef, Settings const &InSettingsRef, FHttpRetrySchedulerBase &InHttpRef, TSharedPtr< AccelByte::FApiClient, ESPMode::ThreadSafe > const &InApiClient=nullptr, bool bInCacheEvent=true, bool bInRetryOnFailed=false)
 GameTelemetry (Credentials &InCredentialsRef, Settings const &InSettingsRef, FHttpRetrySchedulerBase &InHttpRef, FAccelBytePlatformPtr const &InAccelBytePlatform, bool bInCacheEvent=true, bool bInRetryOnFailed=false)
void SetBatchFrequency (FTimespan Interval)
 Set the interval of sending telemetry event to the backend. By default it sends the queued events once a minute. Should not be less than 5 seconds.
void SetCriticalEventList (TArray< FString > const &EventNames)
 Set list of event that need to be backed up on disc before sending in order to be able to recover in case of failure.
void SetImmediateEventList (TArray< FString > const &EventNames)
 Set list of event that need to be sent immediately without the needs to jobQueue it.
void Send (FAccelByteModelsTelemetryBody TelemetryBody, FVoidHandler const &OnSuccess, FErrorHandler const &OnError)
 Send/enqueue a single authorized telemetry data. Server should be logged in. See DedicatedServer::LoginWithClientCredentials().
void Flush ()
 Flush pending telemetry events.
void Startup ()
 Startup module.
void Shutdown ()
 Shutdown module.
bool IsCacheUpdated ()
 Check the cache has been updated or not.
void ShouldCacheEnabled (bool bShouldCache)
 Set a flag to cache events.
bool IsCacheEnabled () const
 Check the flag value to cache events.
Public Member Functions inherited from AccelByte::FApiBase
 FApiBase (Credentials const &InCredentialsRef, Settings const &InSettingsRef, FHttpRetrySchedulerBase &InHttpRef, TSharedPtr< AccelByte::FApiClient, ESPMode::ThreadSafe > const &InApiClient)
 FApiBase (Credentials const &InCredentialsRef, Settings const &InSettingsRef, FHttpRetrySchedulerBase &InHttpRef, FAccelBytePlatformPtr const &InAccelBytePlatform)
void SetApiClient (TSharedPtr< AccelByte::FApiClient, ESPMode::ThreadSafe > const &InApiClient)

Additional Inherited Members

Protected Member Functions inherited from AccelByte::Api::BaseAnalytics
 BaseAnalytics (Credentials &InCredentialsRef, Settings const &InSettingsRef, FHttpRetrySchedulerBase &InHttpRef, TSharedPtr< AccelByte::FApiClient, ESPMode::ThreadSafe > const &InApiClient, FString const &InEventName, bool bInCacheEvent, bool bInRetryOnFailed=false)
 BaseAnalytics (Credentials &InCredentialsRef, Settings const &InSettingsRef, FHttpRetrySchedulerBase &InHttpRef, FAccelBytePlatformPtr const &InAccelBytePlatform, FString const &InEventName, bool bInCacheEvent, bool bInRetryOnFailed=false)
void SendEventData (const TSharedPtr< FJsonObject > &Payload, FVoidHandler const &OnSuccess, FErrorHandler const &OnError, FDateTime const &ClientTimestamp=FDateTime::UtcNow())
template<typename T>
void SendEventData (const TSharedRef< T > &Payload, FVoidHandler const &OnSuccess, FErrorHandler const &OnError, FDateTime const &ClientTimestamp=FDateTime::UtcNow())
 Send/enqueue a single authorized telemetry data of an event. User should be logged in.
void SendEventData (FAccelByteModelsTelemetryBody Payload, FVoidHandler const &OnSuccess, FErrorHandler const &OnError, FDateTime const &ClientTimestamp=FDateTime::UtcNow())
void Flush ()
 Flush pending telemetry events.
void SetCriticalEventList (TArray< FString > const &EventNames)
 Set list of event that need to be backed up on disc before sending in order to be able to recover in case of failure.
void SetImmediateEventList (TArray< FString > const &EventNames)
 Set list of event that need to be sent immediately without the needs to jobQueue it.
Protected Member Functions inherited from AccelByte::Api::GameTelemetry
bool EventsJsonToArray (FString &InJsonString, TArray< TelemetryBodyPtr > &OutArray)
virtual FString GetTelemetryKey ()
Protected Member Functions inherited from AccelByte::FApiBase
template<typename T>
bool ValidateAccelByteId (FString const &Id, EAccelByteIdHypensRule HypenRule, FString const &ErrorMessage, T const &OnError)
Protected Attributes inherited from AccelByte::Api::BaseAnalytics
const FString EventName
TSharedRef< Credentials const, ESPMode::ThreadSafe > CredentialsRef
Protected Attributes inherited from AccelByte::FApiBase
TSharedRef< Credentials const, ESPMode::ThreadSafe > CredentialsRef
Settings const & SettingsRef
FHttpRetrySchedulerBaseHttpRef
FHttpClient HttpClient
FAccelBytePlatformPtr AccelBytePlatformPtr

Detailed Description

Send predefined telemetry data securely and the user should be logged in first.

Member Function Documentation

◆ SendPredefinedEventData()

template<typename T>
void AccelByte::Api::PredefinedEvent::SendPredefinedEventData ( TSharedRef< T > const & Payload,
FVoidHandler const & OnSuccess,
FErrorHandler const & OnError,
FDateTime const & ClientTimestamp = FDateTime::UtcNow() )
inline

Send/enqueue a single authorized telemetry data of a predefined event. User should be logged in.

Parameters
PayloadThe data to be send, each event expected to have different payload body, see Models/AccelBytePredefinedEventModels.h
OnSuccessThis will be called when the operation succeeded.
OnErrorThis will be called when the operation failed.
ClientTimestampTimestamp when the event is triggered, the default will be FDateTime::UtcNow()