Loading...
Searching...
No Matches
FOnlinePresenceAccelByte Class Reference

#include <OnlinePresenceInterfaceAccelByte.h>

Inheritance diagram for FOnlinePresenceAccelByte:

Public Member Functions

 FOnlinePresenceAccelByte (FOnlineSubsystemAccelByte *InSubsystem)
 DEFINE_ONLINE_DELEGATE_TWO_PARAM (OnBulkQueryPresenceComplete, const bool, const FUserIDPresenceMap &)
virtual void SetPresence (const FUniqueNetId &User, const FOnlineUserPresenceStatus &Status, const FOnPresenceTaskCompleteDelegate &Delegate=FOnPresenceTaskCompleteDelegate()) override
virtual void QueryPresence (const FUniqueNetId &User, const FOnPresenceTaskCompleteDelegate &Delegate=FOnPresenceTaskCompleteDelegate()) override
virtual EOnlineCachedResult::Type GetCachedPresence (const FUniqueNetId &User, TSharedPtr< FOnlineUserPresence > &OutPresence) override
virtual EOnlineCachedResult::Type GetCachedPresenceForApp (const FUniqueNetId &LocalUserId, const FUniqueNetId &User, const FString &AppId, TSharedPtr< FOnlineUserPresence > &OutPresence) override
virtual void PlatformQueryPresence (const FUniqueNetId &User, const FOnPresenceTaskCompleteDelegate &Delegate=FOnPresenceTaskCompleteDelegate())
virtual EOnlineCachedResult::Type GetPlatformCachedPresence (const FUniqueNetId &User, TSharedPtr< FOnlineUserPresence > &OutPresence)
virtual void BulkQueryPresence (const FUniqueNetId &LocalUserId, const TArray< FUniqueNetIdRef > &UserIds)
TSharedRef< FOnlineUserPresenceAccelByteFindOrCreatePresence (const TSharedRef< const FUniqueNetIdAccelByteUser > &UserId)
TMap< FString, TSharedRef< FOnlineUserPresenceAccelByte > > GetCachedPresence () const
void UpdatePresenceCache (const TMap< FString, TSharedRef< FOnlineUserPresenceAccelByte > > &UpdatedPresence)
void UpdatePresenceCache (const FString &UserID, const TSharedRef< FOnlineUserPresenceAccelByte > &Presence)

Static Public Member Functions

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

Public Attributes

PACKAGE_SCOPE : virtual void RegisterRealTimeLobbyDelegates(int32 LocalUserNum)

Protected Member Functions

 FOnlinePresenceAccelByte ()
IOnlinePresencePtr GetPlatformOnlinePresenceInterface () const
void OnFriendStatusChangedNotificationReceived (const FAccelByteModelsUsersPresenceNotice &Notification, int32 LocalUserNum)

Protected Attributes

FOnlineSubsystemAccelByteWPtr AccelByteSubsystem = nullptr

Detailed Description

Implementation of the IOnlinePresence interface using AccelByte services.

Constructor & Destructor Documentation

◆ FOnlinePresenceAccelByte() [1/2]

FOnlinePresenceAccelByte::FOnlinePresenceAccelByte ( FOnlineSubsystemAccelByte * InSubsystem)

Constructor that is invoked by the Subsystem instance to create a presence interface instance

◆ FOnlinePresenceAccelByte() [2/2]

FOnlinePresenceAccelByte::FOnlinePresenceAccelByte ( )
inlineprotected

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

Member Function Documentation

◆ BulkQueryPresence()

void FOnlinePresenceAccelByte::BulkQueryPresence ( const FUniqueNetId & LocalUserId,
const TArray< FUniqueNetIdRef > & UserIds )
virtual

Bulk query user presences.

Parameters
LocalUserIdLocalUserId of user making the call.
UserIdsUserIds to query the presence.

◆ FindOrCreatePresence()

TSharedRef< FOnlineUserPresenceAccelByte > FOnlinePresenceAccelByte::FindOrCreatePresence ( const TSharedRef< const FUniqueNetIdAccelByteUser > & UserId)

Used to update cached Presence

◆ GetCachedPresence()

TMap< FString, TSharedRef< FOnlineUserPresenceAccelByte > > FOnlinePresenceAccelByte::GetCachedPresence ( ) const

Getter function for cached user presence mapped by userId

◆ GetFromSubsystem()

bool FOnlinePresenceAccelByte::GetFromSubsystem ( const IOnlineSubsystem * Subsystem,
TSharedPtr< FOnlinePresenceAccelByte, 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 FOnlinePresenceAccelByte::GetFromWorld ( const UWorld * World,
TSharedPtr< FOnlinePresenceAccelByte, 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

◆ OnFriendStatusChangedNotificationReceived()

void FOnlinePresenceAccelByte::OnFriendStatusChangedNotificationReceived ( const FAccelByteModelsUsersPresenceNotice & Notification,
int32 LocalUserNum )
protected

Delegate handler for when a friend change their presence status

◆ UpdatePresenceCache() [1/2]

void FOnlinePresenceAccelByte::UpdatePresenceCache ( const FString & UserID,
const TSharedRef< FOnlineUserPresenceAccelByte > & Presence )

Add or Update cached presence

◆ UpdatePresenceCache() [2/2]

void FOnlinePresenceAccelByte::UpdatePresenceCache ( const TMap< FString, TSharedRef< FOnlineUserPresenceAccelByte > > & UpdatedPresence)

Add or Update cached presence

Member Data Documentation

◆ AccelByteSubsystem

FOnlineSubsystemAccelByteWPtr FOnlinePresenceAccelByte::AccelByteSubsystem = nullptr
protected

Instance of the subsystem that created this interface