Skip to main content

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
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:

ParamTypeDescription
schedule_idconst std::string&Schedules to query
result_callbackPgosDataCallback<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:

ParamTypeDescription
player_goal_idconst std::string&Schedules id
orderconst uint32_tOrder of the first goal to query. Both 0 and 1 will be considered as starting the query from the first tier
countconst uint32_tCount of tiers need to query. The maximum value is 50
result_callbackPgosDataCallback<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:

ParamTypeDescription
player_goal_idconst std::string&Player goal id.
tier_idconst std::string&Tier id of the player goal.
result_callbackPgosDataCallback<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:

ParamTypeDescription
player_goal_idconst std::string&Player goal id.
result_callbackPgosDataCallback<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:

ParamTypeDescription
schedule_idconst std::string&Schedules id
result_callbackPgosDataCallback<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:

ParamTypeDescription
eventconst SimpleGoalAchievedEvt&Event content

SetOnHyperGoalAchieved

/**
* OnSetOnHyperGoalAchieved:
*
*
* @param event Event content
*/
void SetOnHyperGoalAchieved(
const HyperGoalAchievedEvt& event);

Parameters:

ParamTypeDescription
eventconst HyperGoalAchievedEvt&Event content