Tipo: HRESULTRetornará S_OK se for bem-sucedido; caso contrário, retornará um código de erro. Para obter uma lista de códigos de erro, confira Códigos de erro.
Se uma API XUsers retornar um erro E_GAMEUSER_RESOLVE_USER_ISSUE_REQUIRED, o usuário deverá interagir com a interface do usuário (IU) do sistema para resolver o problema.
Chame XUserResolveIssueWithUiAsync para mostrar a IU do sistema apropriada.Para exibir uma interface do usuário do sistema para resolver problemas de token com uma URL Unicode, chame XUserResolveIssueWithUiUtf16Async.Para recuperar o resultado de uma chamada para XUserResolveIssueWithUiUtf16Async, chame XUserResolveIssueWithUiUtf16Result.O exemplo a seguir demonstra como exibir a IU do sistema para resolver problemas de token com uma URL.
HRESULT ResolveUserIssueComplete(XAsyncBlock* ab){ if (SUCCEEDED_LOG(XUserResolveIssueWithUiResult(ab))) { appLog.AddLog("Successfully Resolved User Issue\n"); } return S_OK;}HRESULT ResolveUserIssueUtf16Complete(XAsyncBlock* ab){ if (SUCCEEDED_LOG(XUserResolveIssueWithUiUtf16Result(ab))) { appLog.AddLog("Successfully Resolved User Issue\n"); } return S_OK;}HRESULT ResolveUserIssueWithUiAsync( XTaskQueueHandle queue, const char* narrowUrl = nullptr, const wchar_t* wideUrl = nullptr, bool useUtf16 = false){ auto resolveAsyncBlock = std::make_unique<XAsyncBlock>(); ZeroMemory(resolveAsyncBlock.get(), sizeof(*resolveAsyncBlock)); resolveAsyncBlock->queue = queue; resolveAsyncBlock->context = this; if (useUtf16) { resolveAsyncBlock->callback = [](XAsyncBlock* ab) { auto asyncBlock = std::unique_ptr<XAsyncBlock>(ab); LOG_IF_FAILED(static_cast<User*>(ab->context)->ResolveUserIssueUtf16Complete(ab)); }; if (SUCCEEDED_LOG(XUserResolveIssueWithUiUtf16Async( _handle.get(), wideUrl, resolveAsyncBlock.get()))) { // The call succeeded, so release the std::unique_ptr ownership of XAsyncBlock* since the callback will take over ownership. // If the call fails, the std::unique_ptr will keep ownership and delete the XAsyncBlock* resolveAsyncBlock.release(); } } else { resolveAsyncBlock->callback = [](XAsyncBlock* ab) { auto asyncBlock = std::unique_ptr<XAsyncBlock>(ab); LOG_IF_FAILED(static_cast<User*>(ab->context)->ResolveUserIssueComplete(ab)); }; if (SUCCEEDED_LOG(XUserResolveIssueWithUiAsync( _handle.get(), narrowUrl, resolveAsyncBlock.get()))) { // The call succeeded, so release the std::unique_ptr ownership of XAsyncBlock* since the callback will take over ownership. // If the call fails, the std::unique_ptr will keep ownership and delete the XAsyncBlock* resolveAsyncBlock.release(); } } return S_OK;}