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 社交關係變更事件,以及在使用者好友清單更新時新增或移除處理常式的 XSAPI 程式碼。
HRESULT hr = XblSocialSubscribeToSocialRelationshipChange( xboxLiveContext, xboxUserId, &state.socialSubscriptionHandle );
HRESULT hr = XblSocialUnsubscribeFromSocialRelationshipChange( xboxLiveContext, state.socialSubscriptionHandle ); state.socialSubscriptionHandle = nullptr;
state.socialRelationshipChangedHandlerToken = XblSocialAddSocialRelationshipChangedHandler( xboxLiveContext, [](const XblSocialRelationshipChangeEventArgs* args, void* context) { UNREFERENCED_PARAMETER(context); LogToFile("Social relationship changed:"); std::stringstream ss; for (size_t i = 0; i < args->xboxUserIdsCount; ++i) { if (i > 0) { ss << ", "; } ss << args->xboxUserIds[i]; } LogToFile("socialNotification = %u, affectedXuids = %s", args->socialNotification, ss.str().data()); }, nullptr );
HRESULT hr = XblSocialRemoveSocialRelationshipChangedHandler(xboxLiveContext, state.socialRelationshipChangedHandlerToken); state.socialRelationshipChangedHandlerToken = 0;
這個頁面有幫助嗎?