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
| API | Description |
|---|---|
| GetGoalsSchedule | Query information of goals schedule and player goals in it |
| BatchGetGoalTiers | Batch query the tiers of a player goal |
| ClaimTierRewards | Cliam rewards for a player goal tier |
| ClaimGoalRewards | Cliam rewards for a player goal |
| ClaimScheduleRewards | Cliam rewards for all player goals in a schedule |
Event List
| Event | Description |
|---|---|
| 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:
| Param | Type | Description |
|---|---|---|
| ScheduleId | const FString& | Schedules to query |
| ResultCallback | TFunction<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:
| Param | Type | Description |
|---|---|---|
| PlayerGoalId | const FString& | Schedules id |
| Order | const int32 | Order of the first goal to query. Both 0 and 1 will be considered as starting the query from the first tier |
| Count | const int32 | Count of tiers need to query. The maximum value is 50 |
| ResultCallback | TFunction<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:
| Param | Type | Description |
|---|---|---|
| PlayerGoalId | const FString& | Player goal id. |
| TierId | const FString& | Tier id of the player goal. |
| ResultCallback | TFunction<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:
| Param | Type | Description |
|---|---|---|
| PlayerGoalId | const FString& | Player goal id. |
| ResultCallback | TFunction<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:
| Param | Type | Description |
|---|---|---|
| ScheduleId | const FString& | Schedules id |
| ResultCallback | TFunction<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: