跳到主要内容

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

/// <summary>Query information of goals schedule and player goals in it</summary>
/// <param name="schedule_id">Schedules to query</param>
public void GetGoalsSchedule(string schedule_id, GoalDelegate0 callback);

Parameters:

ParamTypeDescription
schedule_idstringSchedules to query
callbackGoalDelegate0

Return: void

BatchGetGoalTiers

Batch query the tiers of a player goal

/// <summary>Batch query the tiers of a player goal</summary>
/// <param name="player_goal_id">Schedules id</param>
/// <param name="order">Order of the first goal to query. Both 0 and 1 will be considered as starting the query from the first tier</param>
/// <param name="count">Count of tiers need to query. The maximum value is 50</param>
public void BatchGetGoalTiers(string player_goal_id, UInt32 order, UInt32 count, GoalDelegate1 callback);

Parameters:

ParamTypeDescription
player_goal_idstringSchedules id
orderUInt32Order of the first goal to query. Both 0 and 1 will be considered as starting the query from the first tier
countUInt32Count of tiers need to query. The maximum value is 50
callbackGoalDelegate1

Return: void

ClaimTierRewards

Cliam rewards for a player goal tier

/// <summary>Cliam rewards for a player goal tier</summary>
/// <param name="player_goal_id">Player goal id.</param>
/// <param name="tier_id">Tier id of the player goal.</param>
public void ClaimTierRewards(string player_goal_id, string tier_id, GoalDelegate2 callback);

Parameters:

ParamTypeDescription
player_goal_idstringPlayer goal id.
tier_idstringTier id of the player goal.
callbackGoalDelegate2

Return: void

ClaimGoalRewards

Cliam rewards for a player goal

/// <summary>Cliam rewards for a player goal</summary>
/// <param name="player_goal_id">Player goal id.</param>
public void ClaimGoalRewards(string player_goal_id, GoalDelegate2 callback);

Parameters:

ParamTypeDescription
player_goal_idstringPlayer goal id.
callbackGoalDelegate2

Return: void

ClaimScheduleRewards

Cliam rewards for all player goals in a schedule

/// <summary>Cliam rewards for all player goals in a schedule</summary>
/// <param name="schedule_id">Schedules id</param>
public void ClaimScheduleRewards(string schedule_id, GoalDelegate2 callback);

Parameters:

ParamTypeDescription
schedule_idstringSchedules id
callbackGoalDelegate2

Return: void

Event Details

OnSimpleGoalAchieved

/// <summary>
/// </summary>
public event GoalDelegate3 OnSimpleGoalAchieved;

Type Reference:

OnHyperGoalAchieved

/// <summary>
/// </summary>
public event GoalDelegate4 OnHyperGoalAchieved;

Type Reference:

All Delegates

public delegate void GoalDelegate0(PgosResult a0, GoalsSchedule a1);
public delegate void GoalDelegate1(PgosResult a0, GetGoalTiersResult a1);
public delegate void GoalDelegate2(PgosResult a0, ClaimGoalsRewardResult a1);
public delegate void GoalDelegate3(SimpleGoalAchievedEvt a0);
public delegate void GoalDelegate4(HyperGoalAchievedEvt a0);

Type Reference: