Loading...
Searching...
No Matches
FOnlineWalletAccelByte Class Reference

#include <OnlineWalletInterfaceAccelByte.h>

Inheritance diagram for FOnlineWalletAccelByte:

Public Member Functions

 DEFINE_ONLINE_PLAYER_DELEGATE_THREE_PARAM (MAX_LOCAL_PLAYERS, OnGetCurrencyListCompleted, bool, const TArray< FAccelByteModelsCurrencyList > &, const FString &)
 DEFINE_ONLINE_PLAYER_DELEGATE_THREE_PARAM (MAX_LOCAL_PLAYERS, OnGetWalletInfoCompleted, bool, const FAccelByteModelsWalletInfo &, const FString &)
 DEFINE_ONLINE_PLAYER_DELEGATE_THREE_PARAM (MAX_LOCAL_PLAYERS, OnGetWalletTransactionsCompleted, bool, const TArray< FAccelByteModelsWalletTransactionInfo > &, const FString &)
 DEFINE_ONLINE_PLAYER_DELEGATE_TWO_PARAM (MAX_LOCAL_PLAYERS, OnWalletBalanceChangedNotification, const FUniqueNetId &, const FAccelByteModelsWalletBalanceChangedNotification &)
 DEFINE_ONLINE_PLAYER_DELEGATE_TWO_PARAM (MAX_LOCAL_PLAYERS, OnWalletStatusChangedNotification, const FUniqueNetId &, const FAccelByteModelsWalletStatusChangedNotification &)
bool GetCurrencyList (int32 LocalUserNum, bool bAlwaysRequestToService=false)
bool GetCurrencyFromCache (const FString &CurrencyCode, FAccelByteModelsCurrencyList &OutCurrency)
bool GetAllCurrencyFromCache (TArray< FAccelByteModelsCurrencyList > &OutCurrencyList)
void AddCurrencyToList (const FString &CurrencyCode, const TSharedRef< FAccelByteModelsCurrencyList > &InCurrencyList)
bool GetWalletInfoByCurrencyCode (int32 LocalUserNum, const FString &CurrencyCode, bool bAlwaysRequestToService=false)
bool GetWalletInfoByCurrencyCodeV2 (int32 LocalUserNum, const FString &CurrencyCode, bool bAlwaysRequestToService=false)
bool GetWalletInfoFromCache (int32 LocalUserNum, const FString &CurrencyCode, FAccelByteModelsWalletInfo &OutWalletInfo)
void AddWalletInfoToList (int32 LocalUserNum, const FString &CurrencyCode, const TSharedRef< FAccelByteModelsWalletInfo > &InWalletInfo)
bool ListWalletTransactionsByCurrencyCode (int32 LocalUserNum, const FString &CurrencyCode, int32 Offset=0, int32 Limit=20)

Static Public Member Functions

static bool GetFromWorld (const UWorld *World, TSharedPtr< FOnlineWalletAccelByte, ESPMode::ThreadSafe > &OutInterfaceInstance)
static bool GetFromSubsystem (const IOnlineSubsystem *Subsystem, TSharedPtr< FOnlineWalletAccelByte, ESPMode::ThreadSafe > &OutInterfaceInstance)

Protected Member Functions

 FOnlineWalletAccelByte ()
void OnWalletBalanceChangedNotificationReceived (const FAccelByteModelsWalletBalanceChangedNotification &Response, int32 InLocalUserNum)
void OnWalletStatusChangedNotificationReceived (const FAccelByteModelsWalletStatusChangedNotification &Response, int32 InLocalUserNum)

Protected Attributes

FOnlineSubsystemAccelByteWPtr AccelByteSubsystem = nullptr
TMap< int32, FDelegateHandle > OnWalletBalanceChangedNotificationReceivedDelegateHandleMap
TMap< int32, FDelegateHandle > OnWalletStatusChangedNotificationReceivedDelegateHandleMap

Detailed Description

Implementation of Wallet service from AccelByte services

Constructor & Destructor Documentation

◆ FOnlineWalletAccelByte()

FOnlineWalletAccelByte::FOnlineWalletAccelByte ( )
inlineprotected

Hidden default constructor, the constructor that takes in a subsystem instance should be used instead.

Member Function Documentation

◆ GetFromSubsystem()

bool FOnlineWalletAccelByte::GetFromSubsystem ( const IOnlineSubsystem * Subsystem,
TSharedPtr< FOnlineWalletAccelByte, ESPMode::ThreadSafe > & OutInterfaceInstance )
static

Convenience method to get an instance of this interface from the subsystem passed in.

Parameters
SubsystemSubsystem instance that we wish to get this interface from
OutInterfaceInstanceInstance of the interface that we got from the subsystem, or nullptr if not found
Returns
boolean that is true if we could get an instance of the interface, false otherwise

◆ GetFromWorld()

bool FOnlineWalletAccelByte::GetFromWorld ( const UWorld * World,
TSharedPtr< FOnlineWalletAccelByte, ESPMode::ThreadSafe > & OutInterfaceInstance )
static

Convenience method to get an instance of this interface from the subsystem associated with the world passed in.

Parameters
WorldWorld instance that we wish to get the interface from
OutInterfaceInstanceInstance of the interface that we got from the subsystem, or nullptr if not found
Returns
boolean that is true if we could get an instance of the interface, false otherwise

Member Data Documentation

◆ AccelByteSubsystem

FOnlineSubsystemAccelByteWPtr FOnlineWalletAccelByte::AccelByteSubsystem = nullptr
protected

Instance of the subsystem that created this interface