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, TimeoutTimeout)、指定的 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。將逾時值指定為任意毫秒數。