gpg::QuestManager

#include <quest_manager.h>

Gets and sets various quest-related data.

Summary

Deprecated. The Google Play Games quests service will be deprecated as of March 2018. Do not use the Google Play Games quests service in new apps. See the deprecation announcement blog post for more details.

Public types

AcceptCallback typedef
std::function< void(const AcceptResponse &)>
Defines a callback that can be used to receive an AcceptResponse.
ClaimMilestoneCallback typedef
std::function< void(const ClaimMilestoneResponse &)>
Defines a callback which can be used to receive a ClaimMilestoneResponse.
FetchCallback typedef
std::function< void(const FetchResponse &)>
Defines a callback type that receives a FetchResponse.
FetchListCallback typedef
std::function< void(const FetchListResponse &)>
Defines a callback type that receives a FetchListResponse.
QuestUICallback typedef
std::function< void(const QuestUIResponse &)>
Defines a callback type that receives a QuestUIResponse.

Public functions

Accept(const Quest & quest, AcceptCallback callback)
void
Asynchronously accept a quest.
AcceptBlocking(const Quest & quest)
Synchronously accept a quest.
AcceptBlocking(Timeout timeout, const Quest & quest)
Synchronously accept a quest.
ClaimMilestone(const QuestMilestone & milestone, ClaimMilestoneCallback callback)
void
Asynchronously claims the milestone.
ClaimMilestoneBlocking(const QuestMilestone & milestone)
Synchronously claim the milestone.
ClaimMilestoneBlocking(Timeout timeout, const QuestMilestone & milestone)
Synchronously claim the milestone.
Fetch(const std::string & quest_id, FetchCallback callback)
void
Asynchronously loads data for a specific quest for the currently signed-in player.
Fetch(DataSource data_source, const std::string & quest_id, FetchCallback callback)
void
Asynchronously loads quest data for the currently signed-in player.
FetchBlocking(const std::string & quest_id)
Synchronously loads quest data for the currently signed-in player, directly returning the FetchResponse.
FetchBlocking(DataSource data_source, const std::string & quest_id)
Synchronously loads all quest data for the currently signed-in player, directly returning the FetchResponse.
FetchBlocking(Timeout timeout, const std::string & quest_id)
Synchronously loads quest data for the currently signed-in player, directly returning the FetchResponse.
FetchBlocking(DataSource data_source, Timeout timeout, const std::string & quest_id)
Synchronously loads quest data for the currently signed-in player, directly returning the FetchResponse.
FetchList(int32_t fetch_flags, FetchListCallback callback)
void
Asynchronously loads data for all quests matching the fetch_flags bit-flags, which is made by ORing together QuestFetchFlags.
FetchList(FetchListCallback callback, int32_t fetch_flags)
void
DEPRECATED since v1.2 Use this version: void FetchList(int32_t fetch_flags, FetchListCallback callback);.
FetchList(DataSource data_source, int32_t fetch_flags, FetchListCallback callback)
void
Asynchronously loads data for all quests matching the fetch_flags bit-flags, which is made by ORing together QuestFetchFlags.
FetchList(FetchListCallback callback)
void
Asynchronously loads data for all quests, regardless of state, for the currently signed-in player.
FetchList(DataSource data_source, FetchListCallback callback)
void
Asynchronously loads data for all quests, regardless of state, for the currently signed-in player.
FetchListBlocking(int32_t fetch_flags)
Synchronously loads data for all quests matching the fetch_flags bit-flags, which is made by ORing together QuestFetchFlags.
FetchListBlocking(DataSource data_source, int32_t fetch_flags)
Synchronously loads data for all quests matching the fetch_flags bit-flags, which is made by ORing together QuestFetchFlags.
FetchListBlocking(Timeout timeout, int32_t fetch_flags)
Synchronously loads data for all quests matching the fetch_flags bit-flags, which is made by ORing together QuestFetchFlags.
FetchListBlocking(DataSource data_source, Timeout timeout, int32_t fetch_flags)
Synchronously loads data for all quests matching the fetch_flags bit-flags, which is made by ORing together QuestFetchFlags.
FetchListBlocking()
Synchronously loads data for all quests, regardless of state, for the currently signed-in player, directly returning the FetchListResponse.
FetchListBlocking(DataSource data_source)
Synchronously loads data for all quests, regardless of state, for the currently signed-in player, directly returning the FetchListResponse.
FetchListBlocking(Timeout timeout)
Synchronously loads data for all quests, regardless of state, for the currently signed-in player, directly returning the FetchListResponse.
FetchListBlocking(DataSource data_source, Timeout timeout)
Synchronously loads data for all quests, regardless of state, for the currently signed-in player, directly returning the FetchListResponse.
ShowAllUI(QuestUICallback callback)
void
Presents to the user a UI that displays information about all quests.
ShowAllUIBlocking()
Presents to the user a UI that displays information about all quests.
ShowAllUIBlocking(Timeout timeout)
Presents to the user a UI that displays information about all quests.
ShowUI(const Quest & quest, QuestUICallback callback)
void
Presents to the user a UI that displays information about a specific quest.
ShowUIBlocking(const Quest & quest)
Presents to the user a UI that displays information about a specific quest.
ShowUIBlocking(Timeout timeout, const Quest & quest)
Presents to the user a UI that displays information about a specific quest.

Structs

gpg::QuestManager::AcceptResponse

Contains a response status and a quest.

gpg::QuestManager::ClaimMilestoneResponse

Contains a response status, a quest, and a milestone.

gpg::QuestManager::FetchListResponse

Contains a list of quests and a response status.

gpg::QuestManager::FetchResponse

Holds data for a quest, along with a response status.

gpg::QuestManager::QuestUIResponse

Data and UIStatus for the ShowAllUI and ShowUI operations.

Public types

AcceptCallback

std::function< void(const AcceptResponse &)> AcceptCallback

Defines a callback that can be used to receive an AcceptResponse.

Used by the Accept* functions.

ClaimMilestoneCallback

std::function< void(const ClaimMilestoneResponse &)> ClaimMilestoneCallback

Defines a callback which can be used to receive a ClaimMilestoneResponse.

Used by the ClaimMilestone* functions.

FetchCallback

std::function< void(const FetchResponse &)> FetchCallback

Defines a callback type that receives a FetchResponse.

This callback type is provided to the Fetch* functions below.

FetchListCallback

std::function< void(const FetchListResponse &)> FetchListCallback

Defines a callback type that receives a FetchListResponse.

This callback type is provided to the FetchList* functions below.

QuestUICallback

std::function< void(const QuestUIResponse &)> QuestUICallback

Defines a callback type that receives a QuestUIResponse.

This callback type is provided to the ShowAllUI* and ShowUI* functions below.

Public functions

Accept

void Accept(
  const Quest & quest,
  AcceptCallback callback
)

Asynchronously accept a quest.

The quest must have a state QuestState::OPEN. Incrementing the associated events will start tracking progress toward the milestone goal.

AcceptBlocking

AcceptResponse AcceptBlocking(
  const Quest & quest
)

Synchronously accept a quest.

The quest must have a state QuestState::OPEN. Incrementing the associated events will start tracking progress toward the milestone goal. Not specifying timeout makes this function call equivalent to calling AcceptResponse AcceptBlocking(Timeout timeout, const std::string& quest_id), with timeout specified as 10 years.

AcceptBlocking

AcceptResponse AcceptBlocking(
  Timeout timeout,
  const Quest & quest
)

Synchronously accept a quest.

The quest must have a state QuestState::OPEN. Incrementing the associated events will start tracking progress toward the milestone goal. Specify timeout as an arbitrary number of milliseconds.

ClaimMilestone

void ClaimMilestone(
  const QuestMilestone & milestone,
  ClaimMilestoneCallback callback
)

Asynchronously claims the milestone.

Doing so calls the server, marking the milestone as completed. If the milestone is currently unclaimable, or if it has been claimed already on this or another device, you will get an error. If this call returns QuestClaimMilestoneStatus::VALID, you (as a developer) must still reward the player. Use the milestone CompletionRewardData to do so.

ClaimMilestoneBlocking

ClaimMilestoneResponse ClaimMilestoneBlocking(
  const QuestMilestone & milestone
)

Synchronously claim the milestone.

Doing so calls the server, marking the milestone as completed. If the milestone is currently unclaimable, or if it has been claimed already on this or another device, you will get an error. If the response contains QuestClaimMilestoneStatus::VALID, you (as a developer) must still reward the player. Use the milestone CompletionRewardData to do so. Not specifying timeout makes this function call equivalent to calling ClaimMilestoneResponseClaimMilestoneBlocking(Timeout timeout, const QuestMilestone& milestone) with timeout specified as 10 years.

ClaimMilestoneBlocking

ClaimMilestoneResponse ClaimMilestoneBlocking(
  Timeout timeout,
  const QuestMilestone & milestone
)

Synchronously claim the milestone.

Doing so will call the server, marking the milestone as completed. If the milestone is currently unclaimable, or if it has been claimed already on this or another device, you will get an error. If the response contains QuestClaimMilestoneStatus::VALID, you (as a developer) must still reward the player. Use the milestone CompletionRewardData to do so. Specify timeout as an arbitrary number of milliseconds.

Fetch

void Fetch(
  const std::string & quest_id,
  FetchCallback callback
)

Asynchronously loads data for a specific quest for the currently signed-in player.

Calls the provided FetchCallback upon operation completion. Not specifying data_source makes this function call equivalent to calling Fetch(DataSource data_source, const std::string& quest_id, FetchCallback callback), with data_source specified as CACHE_OR_NETWORK.

Fetch

void Fetch(
  DataSource data_source,
  const std::string & quest_id,
  FetchCallback callback
)

Asynchronously loads quest data for the currently signed-in player.

Calls the provided FetchCallback upon operation completion. Specify data_source as CACHE_OR_NETWORK or NETWORK_ONLY.

FetchBlocking

FetchResponse FetchBlocking(
  const std::string & quest_id
)

Synchronously loads quest data for the currently signed-in player, directly returning the FetchResponse.

Specifying neither data_source nor timeout makes this function call equivalent to calling FetchResponse FetchBlocking(DataSource data_source, Timeout timeout, const std::string& quest_id), with data_source specified as CACHE_OR_NETWORK and timeout specified as 10 years.

FetchBlocking

FetchResponse FetchBlocking(
  DataSource data_source,
  const std::string & quest_id
)

Synchronously loads all quest data for the currently signed-in player, directly returning the FetchResponse.

Specify data_source as CACHE_OR_NETWORK or NETWORK_ONLY. Not specifying timeout makes this function call equivalent to calling FetchResponse FetchBlocking(DataSource data_source, Timeout timeout, const std::string& quest_id), with timeout specified as 10 years.

FetchBlocking

FetchResponse FetchBlocking(
  Timeout timeout,
  const std::string & quest_id
)

Synchronously loads quest data for the currently signed-in player, directly returning the FetchResponse.

Specify timeout as an arbitrary number of milliseconds. Not specifying data_source makes this function call equivalent to calling FetchResponse FetchBlocking(DataSource data_source, Timeout timeout, const std::string& quest_id), with data_source specified as CACHE_OR_NETWORK.

FetchBlocking

FetchResponse FetchBlocking(
  DataSource data_source,
  Timeout timeout,
  const std::string & quest_id
)

Synchronously loads quest data for the currently signed-in player, directly returning the FetchResponse.

Specify data_source as CACHE_OR_NETWORK or NETWORK_ONLY. Specify timeout as an arbitrary number of milliseconds.

FetchList

void FetchList(
  int32_t fetch_flags,
  FetchListCallback callback
)

Asynchronously loads data for all quests matching the fetch_flags bit-flags, which is made by ORing together QuestFetchFlags.

Not specifying data_source makes this function call equivalent to calling FetchList(DataSource data_source, int32_t fetch_flags,FetchListCallback callback), with data_source specified as CACHE_OR_NETWORK.

FetchList

void FetchList(
  FetchListCallback callback,
  int32_t fetch_flags
)

DEPRECATED since v1.2 Use this version: void FetchList(int32_t fetch_flags, FetchListCallback callback);.

FetchList

void FetchList(
  DataSource data_source,
  int32_t fetch_flags,
  FetchListCallback callback
)

Asynchronously loads data for all quests matching the fetch_flags bit-flags, which is made by ORing together QuestFetchFlags.

Specify data_source as CACHE_OR_NETWORK or NETWORK_ONLY.

FetchList

void FetchList(
  FetchListCallback callback
)

Asynchronously loads data for all quests, regardless of state, for the currently signed-in player.

Not specifying data_source makes this function call equivalent to calling FetchList(DataSource data_source, FetchListCallback callback), with data_source specified as CACHE_OR_NETWORK.

FetchList

void FetchList(
  DataSource data_source,
  FetchListCallback callback
)

Asynchronously loads data for all quests, regardless of state, for the currently signed-in player.

Specify data_source as CACHE_OR_NETWORK or NETWORK_ONLY.

FetchListBlocking

FetchListResponse FetchListBlocking(
  int32_t fetch_flags
)

Synchronously loads data for all quests matching the fetch_flags bit-flags, which is made by ORing together QuestFetchFlags.

It directly returns the FetchListResponse. Specifying neither data_source nor timeout makes this function call equivalent to calling FetchListResponse FetchListBlocking(DataSource data_source, Timeout timeout, int32_t fetch_flags), with data_source specified as CACHE_OR_NETWORK, and timeout specified as 10 years.

FetchListBlocking

FetchListResponse FetchListBlocking(
  DataSource data_source,
  int32_t fetch_flags
)

Synchronously loads data for all quests matching the fetch_flags bit-flags, which is made by ORing together QuestFetchFlags.

It directly returns the FetchListResponse. Specify data_source as CACHE_OR_NETWORK or NETWORK_ONLY. Not specifying timeout makes this function call equivalent to calling FetchListResponse FetchListBlocking(DataSource data_source, Timeout timeout, int32_t fetch_flags), with timeout specified as 10 years.

FetchListBlocking

FetchListResponse FetchListBlocking(
  Timeout timeout,
  int32_t fetch_flags
)

Synchronously loads data for all quests matching the fetch_flags bit-flags, which is made by ORing together QuestFetchFlags.

It directly returns the FetchListResponse. Specify timeout as an arbitrary number of milliseconds. Not specifying data_source makes this function call equivalent to calling FetchListResponse FetchListBlocking(DataSource data_source, Timeout timeout, int32_t fetch_flags), with data_source specified as CACHE_OR_NETWORK, and timeout containing the value you specified.

FetchListBlocking

FetchListResponse FetchListBlocking(
  DataSource data_source,
  Timeout timeout,
  int32_t fetch_flags
)

Synchronously loads data for all quests matching the fetch_flags bit-flags, which is made by ORing together QuestFetchFlags.

It directly returns the FetchListResponse. Specify data_source as CACHE_OR_NETWORK or NETWORK_ONLY. Specify timeout as an arbitrary number of milliseconds.

FetchListBlocking

FetchListResponse FetchListBlocking()

Synchronously loads data for all quests, regardless of state, for the currently signed-in player, directly returning the FetchListResponse.

Specifying neither data_source nor timeout makes this function call equivalent to calling FetchListResponse FetchListBlocking(DataSource data_source, Timeout timeout), with data_source specified as CACHE_OR_NETWORK, and timeout specified as 10 years.

FetchListBlocking

FetchListResponse FetchListBlocking(
  DataSource data_source
)

Synchronously loads data for all quests, regardless of state, for the currently signed-in player, directly returning the FetchListResponse.

Specify data_source as CACHE_OR_NETWORK or NETWORK_ONLY. Not specifying timeout makes this function call equivalent to calling FetchListResponse FetchListBlocking(DataSource data_source, Timeout timeout), with timeout specified as 10 years.

FetchListBlocking

FetchListResponse FetchListBlocking(
  Timeout timeout
)

Synchronously loads data for all quests, regardless of state, for the currently signed-in player, directly returning the FetchListResponse.

Specify timeout as an arbitrary number of milliseconds. Not specifying data_source makes this function call equivalent to calling FetchListResponse FetchListBlocking(DataSource data_source, Timeout timeout), with data_source specified as CACHE_OR_NETWORK.

FetchListBlocking

FetchListResponse FetchListBlocking(
  DataSource data_source,
  Timeout timeout
)

Synchronously loads data for all quests, regardless of state, for the currently signed-in player, directly returning the FetchListResponse.

Specify data_source as CACHE_OR_NETWORK or NETWORK_ONLY. Specify timeout as an arbitrary number of milliseconds.

ShowAllUI

void ShowAllUI(
  QuestUICallback callback
)

Presents to the user a UI that displays information about all quests.

It asynchronously calls QuestUICallback.

ShowAllUIBlocking

QuestUIResponse ShowAllUIBlocking()

Presents to the user a UI that displays information about all quests.

It synchronously returns a QuestUIResponse. Not specifying timeout makes this function call equivalent to calling ShowAllUIBlocking(Timeout timeout) with timeout specified as 10 years.

ShowAllUIBlocking

QuestUIResponse ShowAllUIBlocking(
  Timeout timeout
)

Presents to the user a UI that displays information about all quests.

It synchronously returns a QuestUIResponse. Specify timeout as an arbitrary number of milliseconds.

ShowUI

void ShowUI(
  const Quest & quest,
  QuestUICallback callback
)

Presents to the user a UI that displays information about a specific quest.

It asynchronously calls QuestUICallback.

ShowUIBlocking

QuestUIResponse ShowUIBlocking(
  const Quest & quest
)

Presents to the user a UI that displays information about a specific quest.

It synchronously returns a QuestUIResponse. Not specifying timeout makes this function call equivalent to calling ShowUIBlocking(Timeout timeout, const Quest& quest) with timeout specified as 10 years.

ShowUIBlocking

QuestUIResponse ShowUIBlocking(
  Timeout timeout,
  const Quest & quest
)

Presents to the user a UI that displays information about a specific quest.

It synchronously returns a QuestUIResponse. Specify timeout as an arbitrary number of milliseconds.

Send feedback about...

Play Games Services for C++
Play Games Services for C++