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 |
|---|---|
| SetOnSimpleGoalAchieved | |
| SetOnHyperGoalAchieved |
API Details
GetGoalsSchedule
Query information of goals schedule and player goals in it
/**
* Query information of goals schedule and player goals in it
*
* @param schedule_id Schedules to query
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetGoalsSchedule(
const pgos::pstring& schedule_id,
PgosDataCallback<GoalsSchedule> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| schedule_id | const std::string& | Schedules to query |
| result_callback | PgosDataCallback<GoalsSchedule> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
BatchGetGoalTiers
Batch query the tiers of a player goal
/**
* Batch query the tiers of a player goal
*
* @param player_goal_id 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 result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void BatchGetGoalTiers(
const pgos::pstring& player_goal_id,
const uint32_t order,
const uint32_t count,
PgosDataCallback<GetGoalTiersResult> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| player_goal_id | const std::string& | Schedules id |
| order | const uint32_t | Order of the first goal to query. Both 0 and 1 will be considered as starting the query from the first tier |
| count | const uint32_t | Count of tiers need to query. The maximum value is 50 |
| result_callback | PgosDataCallback<GetGoalTiersResult> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
ClaimTierRewards
Cliam rewards for a player goal tier
/**
* Cliam rewards for a player goal tier
*
* @param player_goal_id Player goal id.
* @param tier_id Tier id of the player goal.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void ClaimTierRewards(
const pgos::pstring& player_goal_id,
const pgos::pstring& tier_id,
PgosDataCallback<ClaimGoalsRewardResult> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| player_goal_id | const std::string& | Player goal id. |
| tier_id | const std::string& | Tier id of the player goal. |
| result_callback | PgosDataCallback<ClaimGoalsRewardResult> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
ClaimGoalRewards
Cliam rewards for a player goal
/**
* Cliam rewards for a player goal
*
* @param player_goal_id Player goal id.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void ClaimGoalRewards(
const pgos::pstring& player_goal_id,
PgosDataCallback<ClaimGoalsRewardResult> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| player_goal_id | const std::string& | Player goal id. |
| result_callback | PgosDataCallback<ClaimGoalsRewardResult> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
ClaimScheduleRewards
Cliam rewards for all player goals in a schedule
/**
* Cliam rewards for all player goals in a schedule
*
* @param schedule_id Schedules id
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void ClaimScheduleRewards(
const pgos::pstring& schedule_id,
PgosDataCallback<ClaimGoalsRewardResult> result_callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| schedule_id | const std::string& | Schedules id |
| result_callback | PgosDataCallback<ClaimGoalsRewardResult> | The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD. |
Return: void
Event Details
SetOnSimpleGoalAchieved
/**
* OnSetOnSimpleGoalAchieved:
*
*
* @param event Event content
*/
void SetOnSimpleGoalAchieved(
const SimpleGoalAchievedEvt& event);
Parameters:
| Param | Type | Description |
|---|---|---|
| event | const SimpleGoalAchievedEvt& | Event content |
SetOnHyperGoalAchieved
/**
* OnSetOnHyperGoalAchieved:
*
*
* @param event Event content
*/
void SetOnHyperGoalAchieved(
const HyperGoalAchievedEvt& event);
Parameters:
| Param | Type | Description |
|---|---|---|
| event | const HyperGoalAchievedEvt& | Event content |