Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
订阅 XBOX Live 游戏 Presence 更改,并在用户启动、停止或挂起特定游戏时连接处理程序的 XSAPI 示例。
uint64_t xuid{ 123 }; HRESULT hr = XblPresenceSubscribeToTitlePresenceChange( xboxLiveContext, xuid, titleId, &state.titlePresenceChangeSubscription );
HRESULT hr = XblPresenceUnsubscribeFromTitlePresenceChange( xboxLiveContext, state.titlePresenceChangeSubscription ); state.titlePresenceChangeSubscription = nullptr;
state.titlePresenceChangedHandlerToken = XblPresenceAddTitlePresenceChangedHandler( xboxLiveContext, [](void* context, uint64_t xuid, uint32_t titleId, XblPresenceTitleState titleState) { UNREFERENCED_PARAMETER(context); LogToFile("Title presence change notification received:"); LogToFile("Xuid = %u, titleId = %u, titleState = %u", xuid, titleId, titleState); }, nullptr );
HRESULT hr = XblPresenceRemoveTitlePresenceChangedHandler( xboxLiveContext, state.titlePresenceChangedHandlerToken ); state.titlePresenceChangedHandlerToken = 0;
相关主题
此页面对您有帮助吗?