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;
此页面对您有帮助吗?