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 或超时,此函数调用等同于调用 FetchForPlayerResponse FetchForPlayerBlocking(DataSource data_source, Timeout timeout),将 data_source 指定为 CACHE_OR_NETWORK,将超时指定为 10 年。

FetchForPlayerBlocking

FetchForPlayerResponse FetchForPlayerBlocking(
  DataSource data_source
)

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

将 data_source 指定为 CACHE_OR_NETWORK 或 NETWORK_ONLY。如果不指定超时,此函数调用等同于调用 FetchForPlayerResponse FetchForPlayerBlocking(DataSource data_source, Timeout timeout),使用指定的 data_source 值并将超时指定为 10 年。

FetchForPlayerBlocking

FetchForPlayerResponse FetchForPlayerBlocking(
  Timeout timeout
)

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

将超时指定为任意毫秒数。如果不指定 data_source,则此函数调用等同于调用 FetchForPlayerResponse FetchForPlayerBlocking(DataSource data_source, Timeout timeout),将 data_source 指定为 CACHE_OR_NETWORK 并超时包含指定的值。

FetchForPlayerBlocking

FetchForPlayerResponse FetchForPlayerBlocking(
  DataSource data_source,
  Timeout timeout
)

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

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