回调

作为异步调用目标的构造函数。

摘要

包括作为访问器方法的参数提供的一次性回调的函数,以及在构建 GameServices 时配置的多用途回调。

所有回调均在一个专用回调线程上调用。此线程可能不同于任何平台的“主线程”或“界面线程”概念。用户回调应快速执行,因为回调线程停滞可能会导致用户可见的问题(例如,退出登录请求延迟完成)。

您不应在回调中调用屏蔽 GPG API(例如 Leaderboards().FetchAllBlocking()),因为此类调用会导致死锁。

类型定义符

CaptureCapabilitiesCallback typedef
std::function< void(GetCaptureCapabilitiesResponse const &)>
定义接收 GetCaptureCapabilitiesResponse 的回调类型。
CaptureStateCallback typedef
std::function< void(GetCaptureStateResponse const &)>
定义接收 GetCaptureStateResponse 的回调类型。
CommitCallback typedef
std::function< void(CommitResponse const &)>
定义接收 CommitResponse 的回调类型。
ConnectionRequestCallback typedef
std::function< void(int64_t client_id, ConnectionRequest const &request)>
定义一个回调类型,该回调类型会在远程端点尝试连接到应用自己的端点时接收 ConnectionRequest
FetchAllCallback typedef
std::function< void(FetchAllResponse const &)>
定义接收 FetchAllResponse 的回调类型。
FetchAllCallback typedef
std::function< void(FetchAllResponse const &)>
定义接收 FetchAllResponse 的回调类型。
FetchAllCallback typedef
std::function< void(FetchAllResponse const &)>
定义一个 FetchAllResponse 类型的回调。
FetchAllCallback typedef
std::function< void(FetchAllResponse const &)>
定义接收 FetchAllResponse 的回调类型。
FetchAllScoreSummariesCallback typedef
std::function< void(FetchAllScoreSummariesResponse const &)>
定义一个 FetchAllScoreSummariesResponse 类型的回调。
FetchCallback typedef
std::function< void(FetchResponse const &)>
定义接收 FetchResponse 的回调类型。
FetchCallback typedef
std::function< void(const FetchResponse &)>
定义接收 FetchResponse 的回调类型。
FetchCallback typedef
std::function< void(FetchResponse const &)>
定义接收 FetchResponse 的回调类型。
FetchCallback typedef
std::function< void(FetchResponse const &)>
定义接收 FetchResponse 的回调类型。
FetchForPlayerCallback typedef
std::function< void(FetchForPlayerResponse const &)>
定义接收 FetchForPlayerResponse 的回调类型。
FetchListCallback typedef
std::function< void(FetchListResponse const &)>
定义接收 FetchListResponse 的回调类型。
FetchScorePageCallback typedef
std::function< void(FetchScorePageResponse const &)>
定义一个 ScorePageResponse 类型的回调。
FetchScoreSummaryCallback typedef
std::function< void(FetchScoreSummaryResponse const &)>
定义一个 FetchScoreSummaryResponse 类型的回调。
FetchSelfCallback typedef
std::function< void(FetchSelfResponse const &)>
定义接收 FetchSelfResponse 的回调类型。
FetchServerAuthCodeCallback typedef
std::function< void(FetchServerAuthCodeResponse const &)>
定义接收 FetchServerAuthCodeResponse 的回调类型。
FlushCallback typedef
std::function< void(FlushStatus)>
定义一个回调类型,用于接收 Flush 操作的结果(状态)。
IsCaptureAvailableCallback typedef
std::function< void(IsCaptureAvailableResponse const &)>
定义接收 IsCaptureAvailableResponse 的回调类型。
OnAuthActionFinishedCallback typedef
std::function< void(AuthOperation, AuthStatus)>
可向 SDK 提供的身份验证操作完成回调的类型。
OnAuthActionStartedCallback typedef
std::function< void(AuthOperation)>
可向 SDK 提供的身份验证操作启动的回调函数的类型。
OnInitializationFinishedCallback typedef
std::function< void(InitializationStatus)>
应用在初始化 API 时或初始化失败时调用的回调。
OnLogCallback typedef
std::function< void(LogLevel, std::string const &)>
可以向 SDK 提供的日志记录回调的类型。
OnLogCallback typedef
std::function< void(LogLevel, std::string const &)>
可以向 SDK 提供的日志记录回调的类型。
OnMultiplayerInvitationEventCallback typedef
std::function< void(MultiplayerEvent, std::string, MultiplayerInvitation)>
可以向 SDK 提供的多人游戏邀请回调的类型。
OnTurnBasedMatchEventCallback typedef
std::function< void(MultiplayerEvent event, std::string, TurnBasedMatch)>
可以向 SDK 提供的基于回合的多人游戏事件回调函数的类型。
OpenCallback typedef
std::function< void(OpenResponse const &)>
定义接收 OpenResponse 的回调类型。
ReadCallback typedef
std::function< void(ReadResponse const &)>
定义接收 ReadResponse 的回调类型。
ShowAllUICallback typedef
std::function< void(UIStatus const &)>
定义接收 UIStatus 的回调类型。
ShowAllUICallback typedef
std::function< void(UIStatus const &)>
定义接收 UIStatus 的回调类型。
ShowUICallback typedef
std::function< void(UIStatus const &)>
定义接收 UIStatus 的回调类型。
StartAdvertisingCallback typedef
std::function< void(int64_t client_id, StartAdvertisingResult const &result)>
定义一个回调类型,该回调类型会在本地端点广告尝试完成时收到 StartAdvertisingResult;其成功字段用于指明广告是否已成功启动。

类型定义符

CaptureCapabilitiesCallback

std::function< void(GetCaptureCapabilitiesResponse const &)> CaptureCapabilitiesCallback

定义接收 GetCaptureCapabilitiesResponse 的回调类型。

此回调类型会提供给以下 GetCaptureCapabilities(*) 函数。

CaptureStateCallback

std::function< void(GetCaptureStateResponse const &)> CaptureStateCallback

定义接收 GetCaptureStateResponse 的回调类型。

此回调类型会提供给以下 GetCaptureState(*) 函数。

CommitCallback

std::function< void(CommitResponse const &)> CommitCallback

定义接收 CommitResponse 的回调类型。

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

ConnectionRequestCallback

std::function< void(int64_t client_id, ConnectionRequest const &request)> ConnectionRequestCallback

定义一个回调类型,该回调类型会在远程端点尝试连接到应用自己的端点时接收 ConnectionRequest

client_id 是接收此请求的 NearbyConnections 实例的 ID。request 包含连接请求的详细信息。

FetchAllCallback

std::function< void(FetchAllResponse const &)> FetchAllCallback

定义接收 FetchAllResponse 的回调类型。

此回调类型会提供给以下 FetchAll(*) 函数。

FetchAllCallback

std::function< void(FetchAllResponse const &)> FetchAllCallback

定义接收 FetchAllResponse 的回调类型。

此回调类型会提供给以下 FetchAll(*) 函数。

FetchAllCallback

std::function< void(FetchAllResponse const &)> FetchAllCallback

定义一个 FetchAllResponse 类型的回调。

FetchAllCallback

std::function< void(FetchAllResponse const &)> FetchAllCallback

定义接收 FetchAllResponse 的回调类型。

此回调类型会提供给以下 FetchAll(*) 函数。

FetchAllScoreSummariesCallback

std::function< void(FetchAllScoreSummariesResponse const &)> FetchAllScoreSummariesCallback

定义一个 FetchAllScoreSummariesResponse 类型的回调。

FetchCallback

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

定义接收 FetchResponse 的回调类型。

此回调类型会提供给以下 Fetch(*) 函数。

FetchCallback

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

定义接收 FetchResponse 的回调类型。

此回调类型会提供给以下 Fetch(*) 函数。

FetchCallback

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

定义接收 FetchResponse 的回调类型。

此回调类型会提供给以下 Fetch(*) 函数。

FetchCallback

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

定义接收 FetchResponse 的回调类型。

此回调类型会提供给以下 Fetch(*) 函数。

FetchForPlayerCallback

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

定义接收 FetchForPlayerResponse 的回调类型。

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

FetchListCallback

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

定义接收 FetchListResponse 的回调类型。

此回调类型会提供给以下 Fetch(*) 函数。

FetchScorePageCallback

std::function< void(FetchScorePageResponse const &)> FetchScorePageCallback

定义一个 ScorePageResponse 类型的回调。

FetchScoreSummaryCallback

std::function< void(FetchScoreSummaryResponse const &)> FetchScoreSummaryCallback

定义一个 FetchScoreSummaryResponse 类型的回调。

FetchSelfCallback

std::function< void(FetchSelfResponse const &)> FetchSelfCallback

定义接收 FetchSelfResponse 的回调类型。

此回调类型会提供给以下 FetchSelf(*) 函数。

FetchServerAuthCodeCallback

std::function< void(FetchServerAuthCodeResponse const &)> FetchServerAuthCodeCallback

定义接收 FetchServerAuthCodeResponse 的回调类型。

此回调类型会提供给下面的 FetchServerAuthCode 函数。

FlushCallback

std::function< void(FlushStatus)> FlushCallback

定义一个回调类型,用于接收 Flush 操作的结果(状态)。

Flush() 中使用。

IsCaptureAvailableCallback

std::function< void(IsCaptureAvailableResponse const &)> IsCaptureAvailableCallback

定义接收 IsCaptureAvailableResponse 的回调类型。

此回调类型会提供给以下 IsCaptureAvailable(*) 函数。

OnAuthActionFinishedCallback

std::function< void(AuthOperation, AuthStatus)> OnAuthActionFinishedCallback

可向 SDK 提供的身份验证操作完成回调的类型。

OnAuthActionStartedCallback

std::function< void(AuthOperation)> OnAuthActionStartedCallback

可向 SDK 提供的身份验证操作启动的回调函数的类型。

OnInitializationFinishedCallback

std::function< void(InitializationStatus)> OnInitializationFinishedCallback

应用在初始化 API 时或初始化失败时调用的回调。

OnLogCallback

std::function< void(LogLevel, std::string const &)> OnLogCallback

可以向 SDK 提供的日志记录回调的类型。

OnLogCallback

std::function< void(LogLevel, std::string const &)> OnLogCallback

可以向 SDK 提供的日志记录回调的类型。

OnMultiplayerInvitationEventCallback

std::function< void(MultiplayerEvent, std::string, MultiplayerInvitation)> OnMultiplayerInvitationEventCallback

可以向 SDK 提供的多人游戏邀请回调的类型。

Valid() 只会针对 UPDATED 事件针对 MultiplayerInvitation 返回 true。

OnTurnBasedMatchEventCallback

std::function< void(MultiplayerEvent event, std::string, TurnBasedMatch)> OnTurnBasedMatchEventCallback

可以向 SDK 提供的基于回合的多人游戏事件回调函数的类型。

Valid() 仅针对 UPDATED 事件针对 TurnBasedMatch 参数返回 true。

OpenCallback

std::function< void(OpenResponse const &)> OpenCallback

定义接收 OpenResponse 的回调类型。

此回调类型会提供给以下 Open(*) 函数。

ReadCallback

std::function< void(ReadResponse const &)> ReadCallback

定义接收 ReadResponse 的回调类型。

此回调类型会提供给以下 Read(*) 函数。

ShowAllUICallback

std::function< void(UIStatus const &)> ShowAllUICallback

定义接收 UIStatus 的回调类型。

此回调类型会提供给下面的 ShowAllUI* 函数。

ShowAllUICallback

std::function< void(UIStatus const &)> ShowAllUICallback

定义接收 UIStatus 的回调类型。

此回调类型会提供给下面的 ShowAllUI* 函数。

ShowUICallback

std::function< void(UIStatus const &)> ShowUICallback

定义接收 UIStatus 的回调类型。

此回调类型会提供给下面的 ShowUI* 函数。

StartAdvertisingCallback

std::function< void(int64_t client_id, StartAdvertisingResult const &result)> StartAdvertisingCallback

定义一个回调类型,该回调类型会在本地端点广告尝试完成时收到 StartAdvertisingResult;其成功字段用于指明广告是否已成功启动。

client_id 是尝试开始通告的 NearbyConnections 实例的 ID。result 包含该通告的结果。