PICO Unreal Platform SDK
FOnlineAchievementsPico Class Reference

#include <OnlineAchievementsInterfacePico.h>

Public Member Functions

 FOnlineAchievementsPico (FOnlineSubsystemPico &InSubsystem)
 
virtual ~FOnlineAchievementsPico ()
 
virtual void WriteAchievements (const FUniqueNetId &PlayerId, FOnlineAchievementsWriteRef &WriteObject, const FOnAchievementsWrittenDelegate &Delegate=FOnAchievementsWrittenDelegate()) override
 Refresh achievement progress data to the server, or unlock an achievement. If the achievement type is Simple, it will unlock an achievement. If the achievement type is Count, it will add the count of the achievement. If the achievement type is Bitfield, it will add the fields of the achievement. More...
 
virtual void QueryAchievements (const FUniqueNetId &PlayerId, const FOnQueryAchievementsCompleteDelegate &Delegate=FOnQueryAchievementsCompleteDelegate()) override
 Read achievement ids and progress from the server. You must use QueryAchievementDescriptions first to get more information about the achievements。 More...
 
virtual void QueryAchievementDescriptions (const FUniqueNetId &PlayerId, const FOnQueryAchievementsCompleteDelegate &Delegate=FOnQueryAchievementsCompleteDelegate()) override
 Read achievement descriptions from the server for displaying achievements in game。 More...
 
virtual EOnlineCachedResult::Type GetCachedAchievement (const FUniqueNetId &PlayerId, const FString &AchievementId, FOnlineAchievement &OutAchievement) override
 Get cached achievement data. More...
 
virtual EOnlineCachedResult::Type GetCachedAchievements (const FUniqueNetId &PlayerId, TArray< FOnlineAchievement > &OutAchievements) override
 Get cached achievements data. More...
 
virtual EOnlineCachedResult::Type GetCachedAchievementDescription (const FString &AchievementId, FOnlineAchievementDesc &OutAchievementDesc) override
 The lookup achievement data was found in the cache. More...
 

Private Attributes

FOnlineSubsystemPico & PicoSubsystem
 
TMap< FUniqueNetIdPico, TArray< FOnlineAchievement > > PlayerAchievements
 
TMap< FString, FOnlineAchievementDescPicoAchievementDescriptions
 
const int MAX_REQUEST_SIZE = 50
 

Detailed Description

IOnlineAchievements - Interface class for achievements

Constructor & Destructor Documentation

◆ FOnlineAchievementsPico()

FOnlineAchievementsPico ( FOnlineSubsystemPico &  InSubsystem)

Constructor

Parameters
InSubsystem- A reference to the owning subsystem

◆ ~FOnlineAchievementsPico()

virtual ~FOnlineAchievementsPico ( )
virtual

Default destructor

Member Function Documentation

◆ GetCachedAchievement()

virtual EOnlineCachedResult::Type GetCachedAchievement ( const FUniqueNetId &  PlayerId,
const FString &  AchievementId,
FOnlineAchievement &  OutAchievement 
)
overridevirtual

Get cached achievement data.

Parameters
PlayerIdThe uid of the player we are searching achievements for.
AchievementIdThe name of the achievement.
OutAchievementThe progress data of the achievement.
Returns
Bool:
  • Success: There is an achievement you want to query in the cache
  • NotFound: The achievement you want cannot be found in the cache

◆ GetCachedAchievementDescription()

virtual EOnlineCachedResult::Type GetCachedAchievementDescription ( const FString &  AchievementId,
FOnlineAchievementDesc &  OutAchievementDesc 
)
overridevirtual

The lookup achievement data was found in the cache.

Parameters
AchievementIdThe name of the achievement to look for.
OutAchievementDescThe achievement description data.
Returns
EOnlineCachedResult::Type:
  • Success: There is an achievement you want to query in the cache
  • NotFound: The achievement you want cannot be found in the cache

◆ GetCachedAchievements()

virtual EOnlineCachedResult::Type GetCachedAchievements ( const FUniqueNetId &  PlayerId,
TArray< FOnlineAchievement > &  OutAchievements 
)
overridevirtual

Get cached achievements data.

Parameters
PlayerIdThe uid of the player we are searching achievements for.
OutAchievementsThe progress data of the achievements.
Returns
EOnlineCachedResult::Type:
  • Success: Find success.
  • NotFound: Find failed.

◆ QueryAchievementDescriptions()

virtual void QueryAchievementDescriptions ( const FUniqueNetId &  PlayerId,
const FOnQueryAchievementsCompleteDelegate &  Delegate = FOnQueryAchievementsCompleteDelegate() 
)
overridevirtual

Read achievement descriptions from the server for displaying achievements in game。

Parameters
PlayerIdThe id of the player we are reading achievements for.
DelegateThe delegate to trigger when the query is complete.

◆ QueryAchievements()

virtual void QueryAchievements ( const FUniqueNetId &  PlayerId,
const FOnQueryAchievementsCompleteDelegate &  Delegate = FOnQueryAchievementsCompleteDelegate() 
)
overridevirtual

Read achievement ids and progress from the server. You must use QueryAchievementDescriptions first to get more information about the achievements。

Parameters
PlayerIdThe id of the player we are reading achievements for.
DelegateThe delegate to trigger when the query is complete.

◆ WriteAchievements()

virtual void WriteAchievements ( const FUniqueNetId &  PlayerId,
FOnlineAchievementsWriteRef &  WriteObject,
const FOnAchievementsWrittenDelegate &  Delegate = FOnAchievementsWrittenDelegate() 
)
overridevirtual

Refresh achievement progress data to the server, or unlock an achievement. If the achievement type is Simple, it will unlock an achievement. If the achievement type is Count, it will add the count of the achievement. If the achievement type is Bitfield, it will add the fields of the achievement.

Parameters
PlayerIdThe uid of the player we are writing achievements for.
WriteObjectThe stats holder containing the achievements we are writing. You can save data in its param: Properties.
DelegateThe delegate to call when the write has completed or failed.

Member Data Documentation

◆ AchievementDescriptions

TMap<FString, FOnlineAchievementDescPico> AchievementDescriptions
private

Cached achievements (not player-specific)

◆ MAX_REQUEST_SIZE

const int MAX_REQUEST_SIZE = 50
private

The maximum number of items that can be obtained in a single request

◆ PicoSubsystem

FOnlineSubsystemPico& PicoSubsystem
private

Reference to the owning subsystem

◆ PlayerAchievements

TMap<FUniqueNetIdPico, TArray<FOnlineAchievement> > PlayerAchievements
private

Mapping of players to their achievements