Loading...
Searching...
No Matches
AccelByte::FAccelByteApiUtilities Class Reference
Inheritance diagram for AccelByte::FAccelByteApiUtilities:

Public Member Functions

 FAccelByteApiUtilities (TSharedRef< BaseCredentials, ESPMode::ThreadSafe > const &InCredentialsRef, TSharedRef< BaseSettings, ESPMode::ThreadSafe > const &InSettingsRef, TSharedRef< FHttpRetrySchedulerBase, ESPMode::ThreadSafe > const &InHttpRef, TWeakPtr< FAccelByteTimeManager, ESPMode::ThreadSafe > const &InTimeManager)
void GetPublicIP (THandler< FAccelByteModelsPubIp > const &OnSuccess, FErrorHandler const &OnError) const
 Get Public IP using api.ipify.org.
void DownloadFrom (FString const &Url, FHttpRequestProgressDelegate const &OnProgress, THandler< TArray< uint8 > > const &OnDownloaded, FErrorHandler const &OnError)
 Download acontent from specified URL with several callback functions including OnProgress, OnDownloaded, and OnError.
void UploadTo (FString const &Url, TArray< uint8 > const &DataUpload, FHttpRequestProgressDelegate const &OnProgress, FVoidHandler const &OnSuccess, FErrorHandler const &OnError, FString const &ContentType=TEXT("application/octet-stream"))
 Upload a content using specified URL with several callback functions including OnProgress, OnSuccess, and OnError.
EAccelByteCurrentServerManagementType GetCurrentServerManagementType () const
 To be called from game server to decide the type of the game server management.
const FString GenerateTOTP (const FString &SecretKey, int CodeLength=6, int TimeStep=30)
 Generate TOTP string.
bool ValidateTOTP (const FString &ServerSecretKey, const FString &TOTP, const FString &UserId)
 Validate a TOTP against a User.

Member Function Documentation

◆ DownloadFrom()

void AccelByte::FAccelByteApiUtilities::DownloadFrom ( FString const & Url,
FHttpRequestProgressDelegate const & OnProgress,
THandler< TArray< uint8 > > const & OnDownloaded,
FErrorHandler const & OnError )

Download acontent from specified URL with several callback functions including OnProgress, OnDownloaded, and OnError.

Parameters
UrlSpecified URL to download the content.
OnProgressCallback function for on progress delegate.
OnDownloadedCallback function for successful download delegate.
OnErrorCallback function for error delegate.

◆ GenerateTOTP()

const FString AccelByte::FAccelByteApiUtilities::GenerateTOTP ( const FString & SecretKey,
int CodeLength = 6,
int TimeStep = 30 )

Generate TOTP string.

Parameters
SecretKey
CodeLength
TimeStep
Returns
TOTP string, may be empty if failed to generate

◆ GetPublicIP()

void AccelByte::FAccelByteApiUtilities::GetPublicIP ( THandler< FAccelByteModelsPubIp > const & OnSuccess,
FErrorHandler const & OnError ) const

Get Public IP using api.ipify.org.

Parameters
OnSuccessCallback function for successful delegate.
OnErrorCallback function for error delegate.

◆ UploadTo()

void AccelByte::FAccelByteApiUtilities::UploadTo ( FString const & Url,
TArray< uint8 > const & DataUpload,
FHttpRequestProgressDelegate const & OnProgress,
FVoidHandler const & OnSuccess,
FErrorHandler const & OnError,
FString const & ContentType = TEXT("application/octet-stream") )

Upload a content using specified URL with several callback functions including OnProgress, OnSuccess, and OnError.

Parameters
UrlSpecified URL to upload the content.
DataUploadContent to upload.
OnProgressCallback function for on progress delegate.
OnSuccessCallback function for successful upload delegate.
OnErrorCallback function for error delegate.
ContentTypeSpecified content-type header which determine the type of uploaded content (default: application/octet-stream)

◆ ValidateTOTP()

bool AccelByte::FAccelByteApiUtilities::ValidateTOTP ( const FString & ServerSecretKey,
const FString & TOTP,
const FString & UserId )

Validate a TOTP against a User.

Parameters
ServerSecretKeySecret key of the server.
TOTPTOTP to validate.
UserIdUserId to validate.
Returns
returns true if TOTP is valid for the UserId provided.