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

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

#include <AccelByteGameTelemetryApi.h>

Inheritance diagram for AccelByte::Api::GameTelemetry:

Public Member Functions

 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)

Protected Member Functions

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)

Additional Inherited Members

Protected Attributes inherited from AccelByte::FApiBase
TSharedRef< Credentials const, ESPMode::ThreadSafe > CredentialsRef
Settings const & SettingsRef
FHttpRetrySchedulerBaseHttpRef
FHttpClient HttpClient
FAccelBytePlatformPtr AccelBytePlatformPtr

Detailed Description

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

Member Function Documentation

◆ Send()

void AccelByte::Api::GameTelemetry::Send ( FAccelByteModelsTelemetryBody TelemetryBody,
FVoidHandler const & OnSuccess,
FErrorHandler const & OnError )

Send/enqueue a single authorized telemetry data. Server should be logged in. See DedicatedServer::LoginWithClientCredentials().

Parameters
TelemetryBodyTelemetry request with arbitrary payload.
OnSuccessThis will be called when the operation succeeded.
OnErrorThis will be called when the operation failed.

◆ SetBatchFrequency()

void AccelByte::Api::GameTelemetry::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.

Parameters
IntervalThe interval between telemetry event

◆ SetCriticalEventList()

void AccelByte::Api::GameTelemetry::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.

Parameters
EventNamesFString Array of payload EventName.

◆ SetImmediateEventList()

void AccelByte::Api::GameTelemetry::SetImmediateEventList ( TArray< FString > const & EventNames)

Set list of event that need to be sent immediately without the needs to jobQueue it.

Parameters
EventNamesFString Array of payload EventName.

◆ ShouldCacheEnabled()

void AccelByte::Api::GameTelemetry::ShouldCacheEnabled ( bool bShouldCache)

Set a flag to cache events.

Parameters
bShouldCacheboolean flag to cache events