跳到主要内容

Client Goal API Reference

Goal service that allows you to set numerous goals for players and then package these goals into a variety of outer loop features, for example Achievement, Quests, Battle Pass, etc. Games can use the Client SDK to access goal service to retrieve the goals progress and claim rewards for a player.

API List

APIDescription
GetGoalsScheduleQuery information of goals schedule and player goals in it
BatchGetGoalTiersBatch query the tiers of a player goal
ClaimTierRewardsCliam rewards for a player goal tier
ClaimGoalRewardsCliam rewards for a player goal
ClaimScheduleRewardsCliam rewards for all player goals in a schedule

Event List

EventDescription
OnSimpleGoalAchieved
OnHyperGoalAchieved

API Details

GetGoalsSchedule

Query information of goals schedule and player goals in it

/**
* Query information of goals schedule and player goals in it
*
* @param ScheduleId Schedules to query
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void GetGoalsSchedule(
const FString& ScheduleId,
TFunction<void(const FPgosResult& Ret, const FPgosClientGoalsSchedule* Data)> ResultCallback) const;

Parameters:

ParamTypeDescription
ScheduleIdconst FString&Schedules to query
ResultCallbackTFunction<void(const FPgosResult& Ret, const FPgosClientGoalsSchedule* Data)>The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.

Return: void

BatchGetGoalTiers

Batch query the tiers of a player goal

/**
* Batch query the tiers of a player goal
*
* @param PlayerGoalId Schedules id
* @param Order Order of the first goal to query. Both 0 and 1 will be considered as starting the query from the first tier
* @param Count Count of tiers need to query. The maximum value is 50
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void BatchGetGoalTiers(
const FString& PlayerGoalId,
const int32 Order,
const int32 Count,
TFunction<void(const FPgosResult& Ret, const FPgosClientGetGoalTiersResult* Data)> ResultCallback) const;

Parameters:

ParamTypeDescription
PlayerGoalIdconst FString&Schedules id
Orderconst int32Order of the first goal to query. Both 0 and 1 will be considered as starting the query from the first tier
Countconst int32Count of tiers need to query. The maximum value is 50
ResultCallbackTFunction<void(const FPgosResult& Ret, const FPgosClientGetGoalTiersResult* Data)>The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.

Return: void

ClaimTierRewards

Cliam rewards for a player goal tier

/**
* Cliam rewards for a player goal tier
*
* @param PlayerGoalId Player goal id.
* @param TierId Tier id of the player goal.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void ClaimTierRewards(
const FString& PlayerGoalId,
const FString& TierId,
TFunction<void(const FPgosResult& Ret, const FPgosClientClaimGoalsRewardResult* Data)> ResultCallback) const;

Parameters:

ParamTypeDescription
PlayerGoalIdconst FString&Player goal id.
TierIdconst FString&Tier id of the player goal.
ResultCallbackTFunction<void(const FPgosResult& Ret, const FPgosClientClaimGoalsRewardResult* Data)>The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.

Return: void

ClaimGoalRewards

Cliam rewards for a player goal

/**
* Cliam rewards for a player goal
*
* @param PlayerGoalId Player goal id.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void ClaimGoalRewards(
const FString& PlayerGoalId,
TFunction<void(const FPgosResult& Ret, const FPgosClientClaimGoalsRewardResult* Data)> ResultCallback) const;

Parameters:

ParamTypeDescription
PlayerGoalIdconst FString&Player goal id.
ResultCallbackTFunction<void(const FPgosResult& Ret, const FPgosClientClaimGoalsRewardResult* Data)>The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.

Return: void

ClaimScheduleRewards

Cliam rewards for all player goals in a schedule

/**
* Cliam rewards for all player goals in a schedule
*
* @param ScheduleId Schedules id
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void ClaimScheduleRewards(
const FString& ScheduleId,
TFunction<void(const FPgosResult& Ret, const FPgosClientClaimGoalsRewardResult* Data)> ResultCallback) const;

Parameters:

ParamTypeDescription
ScheduleIdconst FString&Schedules id
ResultCallbackTFunction<void(const FPgosResult& Ret, const FPgosClientClaimGoalsRewardResult* Data)>The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.

Return: void

Event Details

OnSimpleGoalAchieved

/**
* OnSimpleGoalAchieved:
*
*
* @param Event Event content
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnSimpleGoalAchieved, const FPgosClientSimpleGoalAchievedEvt& /*Event*/);
FOnSimpleGoalAchieved& OnSimpleGoalAchieved() { return SimpleGoalAchievedDelegate; }

Type Reference:

OnHyperGoalAchieved

/**
* OnHyperGoalAchieved:
*
*
* @param Event Event content
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnHyperGoalAchieved, const FPgosClientHyperGoalAchievedEvt& /*Event*/);
FOnHyperGoalAchieved& OnHyperGoalAchieved() { return HyperGoalAchievedDelegate; }

Type Reference: