gpg::StatsManager

#include <stats_manager.h>

获取和设置各种统计相关数据。

摘要

公共类型

FetchForPlayerCallback typedef
std::function< void(const FetchForPlayerResponse &)>
定义一个接收 FetchForPlayerResponse 的回调类型。

公共函数

FetchForPlayer(FetchForPlayerCallback callback)
void
异步加载当前登录玩家的所有统计数据。
FetchForPlayer(DataSource data_source, FetchForPlayerCallback callback)
void
异步加载当前登录玩家的所有统计数据。
FetchForPlayerBlocking()
同步加载当前登录玩家的所有统计数据,直接返回 FetchForPlayerResponse
FetchForPlayerBlocking(DataSource data_source)
同步加载当前登录玩家的所有统计数据,直接返回 FetchForPlayerResponse
FetchForPlayerBlocking(Timeout timeout)
同步加载当前登录玩家的所有统计数据,直接返回 FetchForPlayerResponse
FetchForPlayerBlocking(DataSource data_source, Timeout timeout)
同步加载当前登录玩家的所有统计数据,直接返回 FetchForPlayerResponse

结构体

gpg::StatsManager::FetchForPlayerResponse

包含所有 PlayerStats 数据以及响应状态。

公共类型

FetchForPlayerCallback

std::function< void(const FetchForPlayerResponse &)> FetchForPlayerCallback

定义一个接收 FetchForPlayerResponse 的回调类型。

此回调类型提供给下面的 FetchForPlayer(*) 函数。

公共函数

FetchForPlayer

void FetchForPlayer(
  FetchForPlayerCallback callback
)

异步加载当前登录玩家的所有统计数据。

在操作完成时调用提供的 FetchForPlayerCallback。如果不指定 data_source,则此函数调用等同于调用 FetchForPlayer(DataSource data_source, FetchForPlayerCallback callback) 并将 data_source 指定为 CACHE_OR_NETWORK。

FetchForPlayer

void FetchForPlayer(
  DataSource data_source,
  FetchForPlayerCallback callback
)

异步加载当前登录玩家的所有统计数据。

在操作完成时调用提供的 FetchForPlayerCallback。将 data_source 指定为 CACHE_OR_NETWORK 或 NETWORK_ONLY。

FetchForPlayerBlocking

FetchForPlayerResponse FetchForPlayerBlocking()

同步加载当前登录玩家的所有统计数据,直接返回 FetchForPlayerResponse

不指定 data_source 或 timeout 会使此函数调用等同于调用 FetchForPlayerResponse FetchForPlayerBlocking(DataSource data_source, Timeout timeout),其中 data_source 指定为 CACHE_OR_NETWORK,timeout 指定为 10 年。

FetchForPlayerBlocking

FetchForPlayerResponse FetchForPlayerBlocking(
  DataSource data_source
)

同步加载当前登录玩家的所有统计数据,直接返回 FetchForPlayerResponse

将 data_source 指定为 CACHE_OR_NETWORK 或 NETWORK_ONLY。不指定 timeout 会使此函数调用等同于调用 FetchForPlayerResponse FetchForPlayerBlocking(DataSource data_source, Timeout timeout),其中 data_source 为您指定的值,timeout 指定为 10 年。

FetchForPlayerBlocking

FetchForPlayerResponse FetchForPlayerBlocking(
  Timeout timeout
)

同步加载当前登录玩家的所有统计数据,直接返回 FetchForPlayerResponse

将 timeout 指定为任意毫秒数。不指定 data_source 会使此函数调用等同于调用 FetchForPlayerResponse FetchForPlayerBlocking(DataSource data_source, Timeout timeout),其中 data_source 指定为 CACHE_OR_NETWORK,timeout 包含您指定的值。

FetchForPlayerBlocking

FetchForPlayerResponse FetchForPlayerBlocking(
  DataSource data_source,
  Timeout timeout
)

同步加载当前登录玩家的所有统计数据,直接返回 FetchForPlayerResponse

将 data_source 指定为 CACHE_OR_NETWORK 或 NETWORK_ONLY。将 timeout 指定为任意毫秒数。