Updating xsapi to be able to build shared source for beam and xsapi namespaces (#35)

This commit is contained in:
James Edwards 2017-01-12 12:29:58 -08:00 коммит произвёл GitHub
Родитель 8c32c01dc4
Коммит e3ce794096
80 изменённых файлов: 1855 добавлений и 1714 удалений

Просмотреть файл

@ -88,6 +88,7 @@
%(AdditionalIncludeDirectories)
</AdditionalIncludeDirectories>
<CompileAsWinRT>true</CompileAsWinRT>
<ShowIncludes Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ShowIncludes>
</ClCompile>
<Link>
<AdditionalDependencies>Bcrypt.lib;Pathcch.lib;Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
@ -108,6 +109,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WholeProgramOptimization Condition="'$(Configuration)'=='Release'">false</WholeProgramOptimization>
<ShowIncludes Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ShowIncludes>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>

Просмотреть файл

@ -17,7 +17,13 @@ namespace xbox
{
namespace services
{
class xbox_live_context;
#if BEAM_API
namespace beam {
#endif
class xbox_live_context;
#if BEAM_API
}
#endif
}
}

Просмотреть файл

@ -10,7 +10,10 @@
#pragma once
// forward declarations
namespace Microsoft { namespace Xbox { namespace Services { class Utils; } } }
NAMESPACE_MICROSOFT_XBOX_SERVICES_BEGIN
class Utils;
NAMESPACE_MICROSOFT_XBOX_SERVICES_END;
// preprocessor workaround
// to work with L##__FUNCTION__ and L##__FILE__ statements.

Просмотреть файл

@ -9,7 +9,8 @@
//*********************************************************
#pragma once
namespace xbox { namespace services {
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
class xbox_live_context_impl;
/// <summary>
/// Contains classes and enumerations that perform contextual search on Xbox Live.
@ -797,4 +798,6 @@ private:
};
}}}
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_END

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -9,8 +9,9 @@
//*********************************************************
#pragma once
#if UWP_API || XSAPI_U || XSAPI_CENTENNIAL
namespace xbox { namespace services {
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
/// <summary>
/// Contains classes that let you send an in-game event.
/// </summary>
@ -25,8 +26,8 @@ public:
events_service() {};
events_service(
_In_ std::shared_ptr<xbox::services::user_context> userContext,
_In_ std::shared_ptr<xbox::services::xbox_live_app_config> localConfig
_In_ std::shared_ptr<XBOX_LIVE_NAMESPACE::user_context> userContext,
_In_ std::shared_ptr<XBOX_LIVE_NAMESPACE::xbox_live_app_config> localConfig
);
/// <summary>
@ -69,8 +70,8 @@ public:
);
private:
std::shared_ptr<xbox::services::user_context> m_userContext;
std::shared_ptr<xbox::services::xbox_live_app_config> m_appConfig;
std::shared_ptr<XBOX_LIVE_NAMESPACE::user_context> m_userContext;
std::shared_ptr<XBOX_LIVE_NAMESPACE::xbox_live_app_config> m_appConfig;
string_t m_playSession;
#if UWP_API
@ -95,6 +96,7 @@ private:
#endif
};
}}}
} // namespace events
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_END
#endif

Просмотреть файл

@ -9,7 +9,7 @@
//*********************************************************
#pragma once
namespace xbox { namespace services {
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
/// <summary>
/// Enumerates the type of structured data contained in the http response body.
@ -238,7 +238,7 @@ public:
/// Attach the Xbox Live token, sign the request, send the request to the service, and return the response.
/// </summary>
virtual pplx::task<std::shared_ptr<http_call_response>> get_response_with_auth(
_In_ const std::shared_ptr<xbox::services::user_context>& userContext,
_In_ const std::shared_ptr<XBOX_LIVE_NAMESPACE::user_context>& userContext,
_In_ http_call_response_body_type httpCallResponseBodyType = http_call_response_body_type::json_body,
_In_ bool allUsersAuthRequired = false
) = 0;
@ -248,7 +248,7 @@ public:
) = 0;
virtual pplx::task<std::shared_ptr<http_call_response>> _Internal_get_response_with_auth(
_In_ const std::shared_ptr<xbox::services::user_context>& userContext,
_In_ const std::shared_ptr<XBOX_LIVE_NAMESPACE::user_context>& userContext,
_In_ http_call_response_body_type httpCallResponseBodyType = http_call_response_body_type::json_body,
_In_ bool allUsersAuthRequired = false
) = 0;
@ -343,7 +343,7 @@ public:
virtual void set_add_default_headers(_In_ bool value) = 0;
/// <summary>
/// Returns a flag inidicating if default headers should be added or not.
/// Returns a flag indicating if default headers should be added or not.
/// </summary>
virtual bool add_default_headers() const = 0;
@ -357,6 +357,4 @@ _XSAPIIMP std::shared_ptr<http_call> create_xbox_live_http_call(
_In_ const web::uri& pathQueryFragment
);
} }
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_END

Просмотреть файл

@ -8,8 +8,9 @@
//
//*********************************************************
#pragma once
#include "pch.h"
namespace xbox { namespace services {
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
/// <summary>
/// Enumerates the type of data contained in the http request body.
@ -74,4 +75,4 @@ private:
http_request_message_type m_httpRequestMessageType;
};
}}
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_END

Просмотреть файл

@ -12,7 +12,7 @@
#include <stddef.h>
#include "xsapi/system.h"
namespace xbox { namespace services { namespace system {
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN
class xsapi_memory
{
@ -54,7 +54,8 @@ private:
void* m_pBuffer;
};
}}}
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_END
template<typename T>
class xsapi_stl_allocator
@ -79,8 +80,9 @@ public:
typedef T value_type;
pointer allocate(size_type n, const void * = 0)
{
pointer p = reinterpret_cast<pointer>(xbox::services::system::xsapi_memory::mem_alloc(n * sizeof(T)));
{
pointer p = reinterpret_cast<pointer>(XBOX_LIVE_NAMESPACE::system::xsapi_memory::mem_alloc(n * sizeof(T)));
if (p == NULL)
{
throw std::bad_alloc();
@ -90,12 +92,13 @@ public:
void deallocate(_In_opt_ void* p, size_type)
{
xbox::services::system::xsapi_memory::mem_free(p);
XBOX_LIVE_NAMESPACE::system::xsapi_memory::mem_free(p);
}
char* _Charalloc(size_type n)
{
char* p = reinterpret_cast<char*>(xbox::services::system::xsapi_memory::mem_alloc(n));
{
char* p = reinterpret_cast<char*>(XBOX_LIVE_NAMESPACE::system::xsapi_memory::mem_alloc(n));
if (p == NULL)
{
throw std::bad_alloc();

Просмотреть файл

@ -9,29 +9,30 @@
//*********************************************************
#pragma once
namespace xbox { namespace services {
class xbox_live_context_impl;
/// <summary>
/// Contains classes and enumerations that let you retrieve
/// information about a player's Xbox Live profile.
/// </summary>
namespace social {
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
/// <summary>
/// Represents a user's Xbox Live profile.
class xbox_live_context_impl;
/// <summary>
/// Contains classes and enumerations that let you retrieve
/// information about a player's Xbox Live profile.
/// </summary>
class xbox_user_profile
{
public:
/// <summary>Constructor for a user profile object.</summary>
/// <param name="appDisplayName">The user's display name to be used in application UI.</param>
/// <param name="appDisplayPictureResizeUri">Uri for the user's display picture to be used in application UI.</param>
/// <param name="gameDisplayName">The user's display name to be used in game UI.</param>
/// <param name="gameDisplayPictureResizeUri">Uri for the user's display picture to be used in games.</param>
/// <param name="gamerscore">The user's Gamerscore.</param>
/// <param name="gamertag">The user's Gamertag.</param>
/// <param name="xboxUserId">The user's Xbox user ID.</param>
_XSAPIIMP xbox_user_profile(
namespace social {
/// <summary>
/// Represents a user's Xbox Live profile.
/// </summary>
class xbox_user_profile
{
public:
/// <summary>Constructor for a user profile object.</summary>
/// <param name="appDisplayName">The user's display name to be used in application UI.</param>
/// <param name="appDisplayPictureResizeUri">Uri for the user's display picture to be used in application UI.</param>
/// <param name="gameDisplayName">The user's display name to be used in game UI.</param>
/// <param name="gameDisplayPictureResizeUri">Uri for the user's display picture to be used in games.</param>
/// <param name="gamerscore">The user's Gamerscore.</param>
/// <param name="gamertag">The user's Gamertag.</param>
/// <param name="xboxUserId">The user's Xbox user ID.</param>
_XSAPIIMP xbox_user_profile(
_In_ string_t appDisplayName,
_In_ web::uri appDisplayPictureResizeUri,
_In_ string_t gameDisplayName,
@ -41,151 +42,151 @@ public:
_In_ string_t xboxUserId
);
/// <summary>
/// Internal function
/// </summary>
_XSAPIIMP xbox_user_profile();
/// <summary>
/// Internal function
/// </summary>
_XSAPIIMP xbox_user_profile();
/// <summary>
/// The user's display name to be used in application UI. This value is privacy gated and could
/// be a user's real name or their Gamertag.
/// </summary>
_XSAPIIMP const string_t& app_display_name() const;
/// <summary>
/// Uri for the user's display picture to be used in application UI.
/// The Uri is a resizable Uri. It can be used to specify one of the following sizes and formats by appending &apos;&amp;format={format}&amp;w={width}&amp;h={height}:
/// Format: png
/// Width Height
/// 64 64
/// 208 208
/// 424 424
/// </summary>
_XSAPIIMP const web::uri& app_display_picture_resize_uri() const;
/// <summary>
/// The user's display name to be used in game UI. This value is privacy gated and could
/// be a user's real name or their Gamertag.
/// </summary>
_XSAPIIMP const string_t& game_display_name() const;
/// <summary>
/// Uri for the user's display picture to be used in games.
/// The Uri is a resizable Uri. It can be used to specify one of the following sizes and formats by appending &apos;&amp;format={format}&amp;w={width}&amp;h={height}:
/// Format: png
/// Width Height
/// 64 64
/// 208 208
/// 424 424
/// </summary>
_XSAPIIMP const web::uri& game_display_picture_resize_uri() const;
/// <summary>
/// The user's Gamerscore.
/// </summary>
_XSAPIIMP const string_t& gamerscore() const;
/// <summary>
/// The user's Gamertag.
/// </summary>
_XSAPIIMP const string_t& gamertag() const;
/// <summary>
/// The user's Xbox user ID.
/// </summary>
_XSAPIIMP const string_t& xbox_user_id() const;
/// <summary>
/// Internal function
/// </summary>
static xbox_live_result<xbox_user_profile> _Deserialize(_In_ const web::json::value& json);
private:
string_t m_appDisplayName;
web::uri m_appDisplayPictureResizeUri;
string_t m_gameDisplayName;
web::uri m_gameDisplayPictureResizeUri;
string_t m_gamerscore;
string_t m_gamertag;
string_t m_xboxUserId;
};
/// <summary>
/// The user's display name to be used in application UI. This value is privacy gated and could
/// be a user's real name or their Gamertag.
/// Services that manage user profile.
/// </summary>
_XSAPIIMP const string_t& app_display_name() const;
/// <summary>
/// Uri for the user's display picture to be used in application UI.
/// The Uri is a resizable Uri. It can be used to specify one of the following sizes and formats by appending &apos;&amp;format={format}&amp;w={width}&amp;h={height}:
/// Format: png
/// Width Height
/// 64 64
/// 208 208
/// 424 424
/// </summary>
_XSAPIIMP const web::uri& app_display_picture_resize_uri() const;
/// <summary>
/// The user's display name to be used in game UI. This value is privacy gated and could
/// be a user's real name or their Gamertag.
/// </summary>
_XSAPIIMP const string_t& game_display_name() const;
/// <summary>
/// Uri for the user's display picture to be used in games.
/// The Uri is a resizable Uri. It can be used to specify one of the following sizes and formats by appending &apos;&amp;format={format}&amp;w={width}&amp;h={height}:
/// Format: png
/// Width Height
/// 64 64
/// 208 208
/// 424 424
/// </summary>
_XSAPIIMP const web::uri& game_display_picture_resize_uri() const;
/// <summary>
/// The user's Gamerscore.
/// </summary>
_XSAPIIMP const string_t& gamerscore() const;
/// <summary>
/// The user's Gamertag.
/// </summary>
_XSAPIIMP const string_t& gamertag() const;
/// <summary>
/// The user's Xbox user ID.
/// </summary>
_XSAPIIMP const string_t& xbox_user_id() const;
/// <summary>
/// Internal function
/// </summary>
static xbox_live_result<xbox_user_profile> _Deserialize(_In_ const web::json::value& json);
private:
string_t m_appDisplayName;
web::uri m_appDisplayPictureResizeUri;
string_t m_gameDisplayName;
web::uri m_gameDisplayPictureResizeUri;
string_t m_gamerscore;
string_t m_gamertag;
string_t m_xboxUserId;
};
/// <summary>
/// Services that manage user profile.
/// </summary>
class profile_service
{
public:
/// <summary>
/// Gets a user profile for a specific Xbox user.
/// </summary>
/// <param name="xboxUserId">The Xbox User ID of the user to get the profile for.</param>
/// <returns>
/// Returns a concurrency::task&lt;T&gt; object that represents the state of the asynchronous operation.
/// The result of the asynchronous operation is an xbox_user_profile object.
/// </returns>
/// <remarks>Calls V2 GET /users/batch/profile/settings</remarks>
_XSAPIIMP pplx::task<xbox::services::xbox_live_result<xbox_user_profile>> get_user_profile(
class profile_service
{
public:
/// <summary>
/// Gets a user profile for a specific Xbox user.
/// </summary>
/// <param name="xboxUserId">The Xbox User ID of the user to get the profile for.</param>
/// <returns>
/// Returns a concurrency::task&lt;T&gt; object that represents the state of the asynchronous operation.
/// The result of the asynchronous operation is an xbox_user_profile object.
/// </returns>
/// <remarks>Calls V2 GET /users/batch/profile/settings</remarks>
_XSAPIIMP pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<xbox_user_profile>> get_user_profile(
_In_ string_t xboxUserId
);
/// <summary>
/// Gets one or more user profiles for a collection of specified Xbox users.
/// </summary>
/// <param name="xboxUserIds">The collection of Xbox User IDs of the users to get profiles for</param>
/// <returns>
/// Returns a concurrency::task&lt;T&gt; object that represents the state of the asynchronous operation.
/// The result of the asynchronous operation is a collection of xbox_user_profile objects.
/// </returns>
/// <remarks>Calls V2 GET /users/batch/profile/settings</remarks>
_XSAPIIMP pplx::task<xbox::services::xbox_live_result<std::vector<xbox_user_profile>>> get_user_profiles(
/// <summary>
/// Gets one or more user profiles for a collection of specified Xbox users.
/// </summary>
/// <param name="xboxUserIds">The collection of Xbox User IDs of the users to get profiles for</param>
/// <returns>
/// Returns a concurrency::task&lt;T&gt; object that represents the state of the asynchronous operation.
/// The result of the asynchronous operation is a collection of xbox_user_profile objects.
/// </returns>
/// <remarks>Calls V2 GET /users/batch/profile/settings</remarks>
_XSAPIIMP pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<std::vector<xbox_user_profile>>> get_user_profiles(
_In_ const std::vector<string_t>& xboxUserIds
);
/// <summary>
/// Gets user profiles for users in a specified social group.
/// </summary>
/// <param name="socialGroup">The name of the social group of users to search.
/// See xbox::services::social::social_group_constants for the latest options.</param>
/// <returns>
/// Returns a concurrency::task&lt;T&gt; object that represents the state of the asynchronous operation.
/// The result of the asynchronous operation is a collection of xbox_user_profile objects.
/// </returns>
/// <remarks>Calls V2 GET /users/{userId}/profile/settings/people/{socialGroup}</remarks>
_XSAPIIMP pplx::task<xbox::services::xbox_live_result< std::vector< xbox_user_profile>>> get_user_profiles_for_social_group(
/// <summary>
/// Gets user profiles for users in a specified social group.
/// </summary>
/// <param name="socialGroup">The name of the social group of users to search.
/// See XBOX_LIVE_NAMESPACE::social::social_group_constants for the latest options.</param>
/// <returns>
/// Returns a concurrency::task&lt;T&gt; object that represents the state of the asynchronous operation.
/// The result of the asynchronous operation is a collection of xbox_user_profile objects.
/// </returns>
/// <remarks>Calls V2 GET /users/{userId}/profile/settings/people/{socialGroup}</remarks>
_XSAPIIMP pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result< std::vector< xbox_user_profile>>> get_user_profiles_for_social_group(
_In_ const string_t& socialGroup
);
private:
profile_service() {};
private:
profile_service() {};
profile_service(
_In_ std::shared_ptr<xbox::services::user_context> userContext,
_In_ std::shared_ptr<xbox::services::xbox_live_context_settings> xboxLiveContextSettings,
_In_ std::shared_ptr<xbox::services::xbox_live_app_config> appConfig
profile_service(
_In_ std::shared_ptr<XBOX_LIVE_NAMESPACE::user_context> userContext,
_In_ std::shared_ptr<XBOX_LIVE_NAMESPACE::xbox_live_context_settings> xboxLiveContextSettings,
_In_ std::shared_ptr<XBOX_LIVE_NAMESPACE::xbox_live_app_config> appConfig
);
static const string_t settings_query();
static const string_t settings_query();
static const string_t pathandquery_user_profiles_for_social_group(
static const string_t pathandquery_user_profiles_for_social_group(
_In_ const string_t& socialGroup
);
static web::json::value serialize_settings_json();
static web::json::value serialize_settings_json();
static const string_t SETTINGS_ARRAY[];
static const string_t SETTINGS_ARRAY[];
static const web::json::value SETTINGS_SERIALIZED;
static const web::json::value SETTINGS_SERIALIZED;
static const string_t SETTINGS_QUERY;
static const string_t SETTINGS_QUERY;
static std::mutex m_settingsLock;
std::shared_ptr<xbox::services::user_context> m_userContext;
std::shared_ptr<xbox::services::xbox_live_context_settings> m_xboxLiveContextSettings;
std::shared_ptr<xbox::services::xbox_live_app_config> m_appConfig;
static std::mutex m_settingsLock;
std::shared_ptr<XBOX_LIVE_NAMESPACE::user_context> m_userContext;
std::shared_ptr<XBOX_LIVE_NAMESPACE::xbox_live_context_settings> m_xboxLiveContextSettings;
std::shared_ptr<XBOX_LIVE_NAMESPACE::xbox_live_app_config> m_appConfig;
friend xbox_live_context_impl;
};
friend xbox_live_context_impl;
};
}
}}}
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_END

Просмотреть файл

@ -9,8 +9,9 @@
//*********************************************************
#pragma once
namespace xbox { namespace services {
class xbox_live_context_impl;
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
class xbox_live_context_impl;
class service_call_logging_config
{
@ -52,4 +53,4 @@ private:
friend xbox_live_context_impl;
};
}}
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_END

Просмотреть файл

@ -12,12 +12,16 @@
#pragma warning(disable: 4266)
#pragma warning(disable: 4062)
#include <cpprest/http_msg.h>
#include "xsapi/types.h"
#include "xsapi/errors.h"
#include "xsapi/xbox_live_context_settings.h"
#include "xsapi/system.h"
#include "xsapi/profile.h"
#include "xsapi/events.h"
#include "xsapi/http_call.h"
#include "xsapi/service_call_logging_config.h"
#if !BEAM_API
#include <cpprest/http_msg.h>
#include "xsapi/social.h"
#include "xsapi/achievements.h"
#include "xsapi/leaderboard.h"
@ -31,14 +35,12 @@
#include "xsapi/contextual_search_service.h"
#include "xsapi/privacy.h"
#include "xsapi/marketplace.h"
#include "xsapi/events.h"
#include "xsapi/title_callable_ui.h"
#include "xsapi/xbox_live_context.h"
#include "xsapi/http_call.h"
#include "xsapi/social_manager.h"
#include "xsapi/multiplayer_manager.h"
#include "xsapi/service_call_logging_config.h"
#include "xsapi/entertainment_profile.h"
#endif
#include "xsapi/xbox_live_context.h"
#ifdef U
#undef U // clean up cpprest's global define in case it's used by app

Просмотреть файл

@ -9,6 +9,7 @@
//*********************************************************
#pragma once
#include "pch.h"
#include "types.h"
#include "errors.h"
#include "xbox_live_context_settings.h"
@ -22,7 +23,8 @@
#include "pplx/pplxtasks.h"
#endif
namespace xbox { namespace services {
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
class http_call_impl;
class xbox_live_context_impl;
@ -33,13 +35,15 @@ namespace xbox { namespace services {
class events_service;
}
#if !BEAM_API
namespace multiplayer { namespace manager {
class multiplayer_client_manager;
class multiplayer_local_user;
}}
} }
#endif
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_END
namespace xbox { namespace services {
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
/// <summary>
/// Configuration information for Xbox Live service objects.
/// </summary>
@ -111,7 +115,7 @@ public:
);
/// <summary>
/// Registers to recieve logging messages for levels that are enabled. Event handlers will receive the level, category, and content of the message.
/// Registers to receive logging messages for levels that are enabled. Event handlers will receive the level, category, and content of the message.
/// </summary>
/// <param name="handler">The event handler function to call.</param>
/// <returns>
@ -120,7 +124,7 @@ public:
_XSAPIIMP function_context add_logging_handler(_In_ std::function<void(xbox_services_diagnostics_trace_level, const std::string&, const std::string&)> handler);
/// <summary>
/// Unregisters from recieving logging messages.
/// Unregisters from receiving logging messages.
/// </summary>
/// <param name="context">The function_context object that was returned when the event handler was registered. </param>
_XSAPIIMP void remove_logging_handler(_In_ function_context context);
@ -293,16 +297,16 @@ class xbox_live_server
public:
_XSAPIIMP xbox_live_server();
_XSAPIIMP pplx::task<xbox::services::xbox_live_result<void>> signin(_In_ cert_context cert);
_XSAPIIMP pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<void>> signin(_In_ cert_context cert);
_XSAPIIMP pplx::task<xbox::services::xbox_live_result<token_and_signature_result>>
_XSAPIIMP pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_and_signature_result>>
get_token_and_signature(
_In_ const string_t& httpMethod,
_In_ const string_t& url,
_In_ const string_t& headers
);
_XSAPIIMP pplx::task<xbox::services::xbox_live_result<token_and_signature_result>>
_XSAPIIMP pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_and_signature_result>>
get_token_and_signature(
_In_ const string_t& httpMethod,
_In_ const string_t& url,
@ -310,7 +314,7 @@ public:
_In_ const string_t& requestBodyString
);
_XSAPIIMP pplx::task<xbox::services::xbox_live_result<token_and_signature_result>>
_XSAPIIMP pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_and_signature_result>>
get_token_and_signature_array(
_In_ const string_t& httpMethod,
_In_ const string_t& url,
@ -323,7 +327,7 @@ public:
private:
std::shared_ptr<xbox_live_server_impl> m_server_impl;
friend xbox::services::user_context;
friend XBOX_LIVE_NAMESPACE::user_context;
};
#endif //#if XSAPI_SERVER
@ -562,7 +566,7 @@ public:
/// An interface for tracking the progress of the asynchronous call. The result is an object
/// indicating the token and the digital signature of the entire request, including the token.
/// </returns>
_XSAPIIMP pplx::task<xbox::services::xbox_live_result<token_and_signature_result> >
_XSAPIIMP pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_and_signature_result> >
get_token_and_signature(
_In_ const string_t& httpMethod,
_In_ const string_t& url,
@ -581,7 +585,7 @@ public:
/// An interface for tracking the progress of the asynchronous call. The result is an object
/// indicating the token and the digital signature of the entire request, including the token.
/// </returns>
_XSAPIIMP pplx::task<xbox::services::xbox_live_result<token_and_signature_result> >
_XSAPIIMP pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_and_signature_result> >
get_token_and_signature(
_In_ const string_t& httpMethod,
_In_ const string_t& url,
@ -601,7 +605,7 @@ public:
/// An interface for tracking the progress of the asynchronous call. The result is an object
/// indicating the token and the digital signature of the entire request, including the token.
/// </returns>
_XSAPIIMP pplx::task<xbox::services::xbox_live_result<token_and_signature_result> >
_XSAPIIMP pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_and_signature_result> >
get_token_and_signature_array(
_In_ const string_t& httpMethod,
_In_ const string_t& url,
@ -762,14 +766,15 @@ public:
/// Internal function
/// </summary>
string_service(
_In_ std::shared_ptr<xbox::services::user_context> userContext,
_In_ std::shared_ptr<xbox::services::xbox_live_context_settings> xboxLiveContextSettings,
_In_ std::shared_ptr<xbox::services::xbox_live_app_config> appConfig
_In_ std::shared_ptr<XBOX_LIVE_NAMESPACE::user_context> userContext,
_In_ std::shared_ptr<XBOX_LIVE_NAMESPACE::xbox_live_context_settings> xboxLiveContextSettings,
_In_ std::shared_ptr<XBOX_LIVE_NAMESPACE::xbox_live_app_config> appConfig
);
private:
std::shared_ptr<xbox::services::user_context> m_userContext;
std::shared_ptr<xbox::services::xbox_live_context_settings> m_xboxLiveContextSettings;
std::shared_ptr<xbox::services::xbox_live_app_config> m_appConfig;
std::shared_ptr<XBOX_LIVE_NAMESPACE::user_context> m_userContext;
std::shared_ptr<XBOX_LIVE_NAMESPACE::xbox_live_context_settings> m_xboxLiveContextSettings;
std::shared_ptr<XBOX_LIVE_NAMESPACE::xbox_live_app_config> m_appConfig;
};
}}}
} // namespace system
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_END

Просмотреть файл

@ -25,7 +25,7 @@
#endif
#ifndef UWP_API
#define UWP_API (WINAPI_FAMILY == WINAPI_FAMILY_APP && _WIN32_WINNT >= _WIN32_WINNT_WIN10 )
#define UWP_API (WINAPI_FAMILY == WINAPI_FAMILY_APP && _WIN32_WINNT >= _WIN32_WINNT_WIN10)
#endif
#endif //#ifdef _WIN32
@ -105,11 +105,21 @@ typedef std::chrono::steady_clock chrono_clock_t;
#endif
// Forward declarations
namespace xbox { namespace services {
class user_context;
class xbox_live_context_settings;
class local_config;
}}
// Forward declarations
namespace xbox {
namespace services {
#if BEAM_API
namespace beam {
#endif
class user_context;
class xbox_live_context_settings;
class local_config;
#if BEAM_API
}
#endif
}
}
#if !TV_API
// SSL client certificate context

Просмотреть файл

@ -14,7 +14,7 @@
#import <UIKit/UIKit.h>
#endif
namespace xbox { namespace services {
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
namespace system {
class user_impl_idp;
@ -317,5 +317,4 @@ private:
#endif
};
}}
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_END

Просмотреть файл

@ -19,13 +19,15 @@
#endif
#if !BEAM_API
#include "xsapi/contextual_search_service.h"
#if TV_API || UNIT_TEST_SERVICES
#include "xsapi/entertainment_profile.h"
#endif
#include "xsapi/multiplayer.h"
#endif
namespace xbox { namespace services {
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
class xbox_live_context_server_impl;
#if XSAPI_SERVER
@ -60,7 +62,7 @@ public:
private:
std::shared_ptr<xbox::services::xbox_live_context_server_impl> m_xboxLiveContextImpl;
std::shared_ptr<XBOX_LIVE_NAMESPACE::xbox_live_context_server_impl> m_xboxLiveContextImpl;
};
#endif
@ -103,18 +105,32 @@ public:
_XSAPIIMP std::shared_ptr<system::xbox_live_user> user();
#else
#if BEAM_API
/// <summary>
/// Creates an xbox_live_context from a Microsoft::Xbox::Services::System::XboxLiveUser^
/// Creates an xbox_live_context from a Microsoft::Xbox::Services::Beam::System::XboxLiveUser^
/// </summary>
_XSAPIIMP xbox_live_context(
_In_ Microsoft::Xbox::Services::System::XboxLiveUser^ user
_In_ Microsoft::Xbox::Services::Beam::System::XboxLiveUser^ user
);
/// <summary>
/// Returns the associated system XboxLiveUser.
/// </summary>
_XSAPIIMP Microsoft::Xbox::Services::Beam::System::XboxLiveUser^ user();
#else
/// <summary>
/// Creates an xbox_live_context from a Microsoft::Xbox::Services::System::XboxLiveUser^
/// </summary>
_XSAPIIMP xbox_live_context(
_In_ Microsoft::Xbox::Services::System::XboxLiveUser^ user
);
/// <summary>
/// Returns the associated system XboxLiveUser.
/// </summary>
_XSAPIIMP Microsoft::Xbox::Services::System::XboxLiveUser^ user();
#endif
#endif
#endif
@ -123,6 +139,7 @@ public:
/// </summary>
_XSAPIIMP const string_t& xbox_live_user_id();
#if !BEAM_API
/// <summary>
/// A service for managing user profiles.
/// </summary>
@ -163,16 +180,6 @@ public:
/// </summary>
_XSAPIIMP matchmaking::matchmaking_service& matchmaking_service();
/// <summary>
/// Returns an object containing settings that apply to all REST calls made such as retry and diagnostic settings.
/// </summary>
_XSAPIIMP std::shared_ptr<xbox_live_context_settings> settings();
/// <summary>
/// Returns an object containing Xbox Live app config such as title ID
/// </summary>
_XSAPIIMP std::shared_ptr<xbox_live_app_config> application_config();
/// <summary>
/// A service for managing real-time activity.
/// </summary>
@ -207,6 +214,17 @@ public:
/// A service for contextual search.
/// </summary>
_XSAPIIMP contextual_search::contextual_search_service& contextual_search_service();
#endif
/// <summary>
/// Returns an object containing settings that apply to all REST calls made such as retry and diagnostic settings.
/// </summary>
_XSAPIIMP std::shared_ptr<xbox_live_context_settings> settings();
/// <summary>
/// Returns an object containing Xbox Live app config such as title ID
/// </summary>
_XSAPIIMP std::shared_ptr<xbox_live_app_config> application_config();
#if UWP_API || XSAPI_U || XSAPI_CENTENNIAL
/// <summary>
@ -251,8 +269,7 @@ public:
private:
std::shared_ptr<xbox::services::xbox_live_context_impl> m_xboxLiveContextImpl;
std::shared_ptr<XBOX_LIVE_NAMESPACE::xbox_live_context_impl> m_xboxLiveContextImpl;
};
}}
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_END

Просмотреть файл

@ -8,13 +8,14 @@
//
//*********************************************************
#pragma once
#include "pch.h"
#include <chrono>
#include <functional>
#include <mutex>
#include <unordered_map>
#include "xsapi/xbox_service_call_routed_event_args.h"
namespace xbox { namespace services {
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
#define DEFAULT_HTTP_TIMEOUT_SECONDS (30)
#if UNIT_TEST_SERVICES
@ -106,7 +107,7 @@ public:
/// <returns>
/// A function_context object that can be used to unregister the event handler.
/// </returns>
_XSAPIIMP function_context add_service_call_routed_handler(_In_ std::function<void(const xbox::services::xbox_service_call_routed_event_args&)> handler);
_XSAPIIMP function_context add_service_call_routed_handler(_In_ std::function<void(const XBOX_LIVE_NAMESPACE::xbox_service_call_routed_event_args&)> handler);
/// <summary>
/// Unregisters from all service call notifications.
@ -303,7 +304,7 @@ public:
static cert_context _s_certContext;
#endif
void _Raise_service_call_routed_event(_In_ const xbox::services::xbox_service_call_routed_event_args& result);
void _Raise_service_call_routed_event(_In_ const XBOX_LIVE_NAMESPACE::xbox_service_call_routed_event_args& result);
bool _Is_disable_asserts_for_xbox_live_throttling_in_dev_sandboxes();
bool _Is_disable_asserts_for_max_number_of_websockets_activated();
@ -316,7 +317,7 @@ private:
std::chrono::seconds m_httpTimeoutWindow;
std::mutex m_writeLock;
std::unordered_map<function_context, std::function<void(xbox::services::xbox_service_call_routed_event_args)>> m_serviceCallRoutedHandlers;
std::unordered_map<function_context, std::function<void(XBOX_LIVE_NAMESPACE::xbox_service_call_routed_event_args)>> m_serviceCallRoutedHandlers;
function_context m_serviceCallRoutedHandlersCounter;
std::chrono::seconds m_websocketTimeoutWindow;
@ -326,4 +327,4 @@ private:
};
}}
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_END

Просмотреть файл

@ -8,9 +8,10 @@
//
//*********************************************************
#pragma once
#include "pch.h"
#include "xsapi/http_call_request_message.h"
namespace xbox { namespace services {
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
/// <summary>
/// Contains information about a service call.
@ -138,4 +139,4 @@ private:
};
}}
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_END

Просмотреть файл

@ -13,10 +13,9 @@
#include "user_context.h"
#include "xbox_system_factory.h"
#include "xbox_live_context_impl.h"
#if !TV_API && !UNIT_TEST_SERVICES && !XSAPI_SERVER && !XSAPI_U
#if !TV_API && !UNIT_TEST_SERVICES && !XSAPI_SERVER && !XSAPI_U && !BEAM_API
#include "Misc/notification_service.h"
#endif
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
#if TV_API | XBOX_UWP
@ -35,6 +34,23 @@ xbox_live_context::user()
return m_xboxLiveContextImpl->user();
}
#elif BEAM_API
xbox_live_context::xbox_live_context(
_In_ std::shared_ptr<beam::system::xbox_live_user> user
)
{
user->_User_impl()->set_user_pointer(user);
m_xboxLiveContextImpl = std::make_shared<xbox_live_context_impl>(user);
m_xboxLiveContextImpl->init();
}
std::shared_ptr<beam::system::xbox_live_user>
xbox_live_context::user()
{
return m_xboxLiveContextImpl->user();
}
#elif XSAPI_CPP
xbox_live_context::xbox_live_context(
@ -68,6 +84,7 @@ xbox_live_context::user()
}
#endif
#if !BEAM_API
const string_t& xbox_live_context::xbox_live_user_id()
{
return m_xboxLiveContextImpl->xbox_live_user_id();
@ -154,14 +171,15 @@ xbox_live_context::privacy_service()
system::string_service&
xbox_live_context::string_service()
{
return m_xboxLiveContextImpl->string_service();
return m_xboxLiveContextImpl->string_service();
}
contextual_search::contextual_search_service&
xbox_live_context::contextual_search_service()
{
return m_xboxLiveContextImpl->contextual_search_service();
return m_xboxLiveContextImpl->contextual_search_service();
}
#endif
#if UWP_API || XSAPI_U
events::events_service&

Просмотреть файл

@ -33,6 +33,8 @@
#define _NOEXCEPT noexcept
#endif
// STL includes
#include <string>
#include <map>

Просмотреть файл

@ -14,11 +14,13 @@
#include "xbox_system_factory.h"
#include "xsapi/system.h"
#include "xbox_live_context_impl.h"
#if !BEAM_API
#if !TV_API && !UNIT_TEST_SERVICES && !XSAPI_SERVER
#include "notification_service.h"
#endif
#include "presence_internal.h"
#include "real_time_activity_internal.h"
#endif
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
@ -30,7 +32,7 @@ xbox_live_context_impl::xbox_live_context_impl(
m_signInContext(0),
m_signOutContext(0)
{
m_userContext = std::make_shared<xbox::services::user_context>(user);
m_userContext = std::make_shared<XBOX_LIVE_NAMESPACE::user_context>(user);
}
Windows::Xbox::System::User^
@ -48,7 +50,7 @@ xbox_live_context_impl::xbox_live_context_impl(
m_signOutContext(0)
{
user->_User_impl()->set_user_pointer(user);
m_userContext = std::make_shared<xbox::services::user_context>(user);
m_userContext = std::make_shared<XBOX_LIVE_NAMESPACE::user_context>(user);
}
#if XSAPI_CPP
@ -65,7 +67,7 @@ xbox_live_context_impl::xbox_live_context_impl(
m_signInContext(0),
m_signOutContext(0)
{
m_userContext = std::make_shared<xbox::services::user_context>(user);
m_userContext = std::make_shared<XBOX_LIVE_NAMESPACE::user_context>(user);
}
Microsoft::Xbox::Services::System::XboxLiveUser^
@ -101,7 +103,9 @@ xbox_live_context_impl::~xbox_live_context_impl()
#endif
}
#if !BEAM_API
real_time_activity::real_time_activity_service_factory::get_singleton_instance()->remove_user_from_rta_map(m_userContext);
#endif
}
@ -110,8 +114,10 @@ void xbox_live_context_impl::init()
xbox_live_result<void> servicesConfigFileReadResult;
m_appConfig = xbox_live_app_config::get_app_config_singleton();
m_xboxLiveContextSettings = std::make_shared<xbox::services::xbox_live_context_settings>();
m_xboxLiveContextSettings = std::make_shared<XBOX_LIVE_NAMESPACE::xbox_live_context_settings>();
#if !BEAM_API
init_real_time_activity_service_instance();
#endif
#if TV_API || UWP_API
auto dispatcher = xbox_live_context_settings::_s_dispatcher;
@ -139,30 +145,32 @@ void xbox_live_context_impl::init()
dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal,
ref new Windows::UI::Core::DispatchedHandler([]()
{
xbox::services::service_call_logging_config::get_singleton_instance()->_Register_for_protocol_activation();
XBOX_LIVE_NAMESPACE::service_call_logging_config::get_singleton_instance()->_Register_for_protocol_activation();
}));
}
}
xbox::services::service_call_logging_config::get_singleton_instance()->_ReadLocalConfig();
XBOX_LIVE_NAMESPACE::service_call_logging_config::get_singleton_instance()->_ReadLocalConfig();
#endif
std::weak_ptr<xbox_live_context_impl> thisWeakPtr = shared_from_this();
m_profileService = xbox::services::social::profile_service(m_userContext, m_xboxLiveContextSettings, m_appConfig);
m_reputationService = xbox::services::social::reputation_service(m_userContext, m_xboxLiveContextSettings, m_appConfig);
m_leaderboardService = xbox::services::leaderboard::leaderboard_service(m_userContext, m_xboxLiveContextSettings, m_appConfig);
m_achievementService = xbox::services::achievements::achievement_service(m_userContext, m_xboxLiveContextSettings, m_appConfig, thisWeakPtr);
m_matchmakingService = xbox::services::matchmaking::matchmaking_service(m_userContext, m_xboxLiveContextSettings, m_appConfig);
m_gameServerPlatformService = xbox::services::game_server_platform::game_server_platform_service(m_userContext, m_xboxLiveContextSettings, m_appConfig);
m_titleStorageService = xbox::services::title_storage::title_storage_service(m_userContext, m_xboxLiveContextSettings, m_appConfig);
m_privacyService = xbox::services::privacy::privacy_service(m_userContext, m_xboxLiveContextSettings, m_appConfig);
m_presenceService = xbox::services::presence::presence_service(m_userContext, m_xboxLiveContextSettings, m_appConfig, m_realTimeActivityService);
m_userStatisticsService = xbox::services::user_statistics::user_statistics_service(m_userContext, m_xboxLiveContextSettings, m_appConfig, m_realTimeActivityService);
m_multiplayerService = xbox::services::multiplayer::multiplayer_service(m_userContext, m_xboxLiveContextSettings, m_appConfig, m_realTimeActivityService);
m_socialService = xbox::services::social::social_service(m_userContext, m_xboxLiveContextSettings, m_appConfig, m_realTimeActivityService);
m_stringService = xbox::services::system::string_service(m_userContext, m_xboxLiveContextSettings, m_appConfig);
m_contextualSearchService = xbox::services::contextual_search::contextual_search_service(m_userContext, m_xboxLiveContextSettings, m_appConfig);
#if !BEAM_API
m_profileService = XBOX_LIVE_NAMESPACE::social::profile_service(m_userContext, m_xboxLiveContextSettings, m_appConfig);
m_reputationService = XBOX_LIVE_NAMESPACE::social::reputation_service(m_userContext, m_xboxLiveContextSettings, m_appConfig);
m_leaderboardService = XBOX_LIVE_NAMESPACE::leaderboard::leaderboard_service(m_userContext, m_xboxLiveContextSettings, m_appConfig);
m_achievementService = XBOX_LIVE_NAMESPACE::achievements::achievement_service(m_userContext, m_xboxLiveContextSettings, m_appConfig, thisWeakPtr);
m_matchmakingService = XBOX_LIVE_NAMESPACE::matchmaking::matchmaking_service(m_userContext, m_xboxLiveContextSettings, m_appConfig);
m_gameServerPlatformService = XBOX_LIVE_NAMESPACE::game_server_platform::game_server_platform_service(m_userContext, m_xboxLiveContextSettings, m_appConfig);
m_titleStorageService = XBOX_LIVE_NAMESPACE::title_storage::title_storage_service(m_userContext, m_xboxLiveContextSettings, m_appConfig);
m_privacyService = XBOX_LIVE_NAMESPACE::privacy::privacy_service(m_userContext, m_xboxLiveContextSettings, m_appConfig);
m_presenceService = XBOX_LIVE_NAMESPACE::presence::presence_service(m_userContext, m_xboxLiveContextSettings, m_appConfig, m_realTimeActivityService);
m_userStatisticsService = XBOX_LIVE_NAMESPACE::user_statistics::user_statistics_service(m_userContext, m_xboxLiveContextSettings, m_appConfig, m_realTimeActivityService);
m_multiplayerService = XBOX_LIVE_NAMESPACE::multiplayer::multiplayer_service(m_userContext, m_xboxLiveContextSettings, m_appConfig, m_realTimeActivityService);
m_socialService = XBOX_LIVE_NAMESPACE::social::social_service(m_userContext, m_xboxLiveContextSettings, m_appConfig, m_realTimeActivityService);
m_contextualSearchService = XBOX_LIVE_NAMESPACE::contextual_search::contextual_search_service(m_userContext, m_xboxLiveContextSettings, m_appConfig);
#endif
m_stringService = XBOX_LIVE_NAMESPACE::system::string_service(m_userContext, m_xboxLiveContextSettings, m_appConfig);
#if !XSAPI_SERVER
@ -179,6 +187,7 @@ void xbox_live_context_impl::init()
#if !XBOX_UWP
#if !BEAM_API
// Only start the presence writer on UAP
presence::presence_writer::get_presence_writer_singleton()->start_writer(m_presenceService._Impl());
@ -237,6 +246,7 @@ void xbox_live_context_impl::init()
});
#endif
}
#endif //!BEAM_API
#endif
#endif
#endif
@ -252,6 +262,7 @@ const string_t& xbox_live_context_impl::xbox_live_user_id()
return m_userContext->xbox_user_id();
}
#if !BEAM_API
social::profile_service&
xbox_live_context_impl::profile_service()
{
@ -305,7 +316,7 @@ xbox_live_context_impl::init_real_time_activity_service_instance()
{
if (m_userContext->caller_context_type() == caller_context_type::title)
{
m_realTimeActivityService = std::shared_ptr<xbox::services::real_time_activity::real_time_activity_service>(new xbox::services::real_time_activity::real_time_activity_service(m_userContext, m_xboxLiveContextSettings, m_appConfig));
m_realTimeActivityService = std::shared_ptr<XBOX_LIVE_NAMESPACE::real_time_activity::real_time_activity_service>(new XBOX_LIVE_NAMESPACE::real_time_activity::real_time_activity_service(m_userContext, m_xboxLiveContextSettings, m_appConfig));
}
else
{
@ -343,17 +354,18 @@ xbox_live_context_impl::privacy_service()
return m_privacyService;
}
system::string_service&
xbox_live_context_impl::string_service()
{
return m_stringService;
}
contextual_search::contextual_search_service&
xbox_live_context_impl::contextual_search_service()
{
return m_contextualSearchService;
}
#endif
system::string_service&
xbox_live_context_impl::string_service()
{
return m_stringService;
}
#if UWP_API || XSAPI_U
events::events_service&

Просмотреть файл

@ -19,7 +19,7 @@
#endif
namespace xbox { namespace services {
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
class xbox_live_context_impl : public std::enable_shared_from_this < xbox_live_context_impl >
{
@ -69,6 +69,7 @@ public:
/// </summary>
const string_t& xbox_live_user_id();
#if !BEAM_API
/// <summary>
/// A service for managing user profiles.
/// </summary>
@ -109,16 +110,6 @@ public:
/// </summary>
matchmaking::matchmaking_service& matchmaking_service();
/// <summary>
/// Returns an object containing settings that apply to all REST calls made such as retry and diagnostic settings.
/// </summary>
std::shared_ptr<xbox_live_context_settings> settings();
/// <summary>
/// Returns an object containing Xbox Live app config such as title ID
/// </summary>
std::shared_ptr<xbox_live_app_config> application_config();
/// <summary>
/// A service for managing real-time activity.
/// </summary>
@ -144,15 +135,26 @@ public:
/// </summary>
privacy::privacy_service& privacy_service();
/// <summary>
/// A service used to check for offensive strings.
/// </summary>
system::string_service& string_service();
/// <summary>
/// A service for contextual search.
/// </summary>
contextual_search::contextual_search_service& contextual_search_service();
#endif
/// <summary>
/// Returns an object containing Xbox Live app config such as title ID
/// </summary>
std::shared_ptr<xbox_live_app_config> application_config();
/// <summary>
/// Returns an object containing settings that apply to all REST calls made such as retry and diagnostic settings.
/// </summary>
std::shared_ptr<xbox_live_context_settings> settings();
/// <summary>
/// A service used to check for offensive strings.
/// </summary>
system::string_service& string_service();
#if UWP_API || XSAPI_U
/// <summary>
@ -179,13 +181,16 @@ public:
#endif
void init();
#if !BEAM_API
void init_real_time_activity_service_instance();
#endif
private:
std::shared_ptr<xbox::services::user_context> m_userContext;
std::shared_ptr<xbox::services::xbox_live_context_settings> m_xboxLiveContextSettings;
std::shared_ptr<XBOX_LIVE_NAMESPACE::user_context> m_userContext;
std::shared_ptr<XBOX_LIVE_NAMESPACE::xbox_live_context_settings> m_xboxLiveContextSettings;
std::shared_ptr<xbox_live_app_config> m_appConfig;
#if !BEAM_API
social::profile_service m_profileService;
social::social_service m_socialService;
social::reputation_service m_reputationService;
@ -199,8 +204,9 @@ private:
game_server_platform::game_server_platform_service m_gameServerPlatformService;
title_storage::title_storage_service m_titleStorageService;
privacy::privacy_service m_privacyService;
system::string_service m_stringService;
contextual_search::contextual_search_service m_contextualSearchService;
#endif
system::string_service m_stringService;
#if UWP_API || XSAPI_U
events::events_service m_eventsService;
@ -217,6 +223,4 @@ private:
friend class xbox_live_context;
};
}}
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_END

Просмотреть файл

@ -172,7 +172,5 @@ private:
Windows::Foundation::Collections::IVectorView<CatalogItemAvailability^>^ m_availabilities;
};
} // namespace Marketplace
} // namespace Services
} // namespace Xbox
} // namespace Microsoft
NAMESPACE_MICROSOFT_XBOX_SERVICES_MARKETPLACE_END

Просмотреть файл

@ -10,7 +10,8 @@
#pragma once
#include "system_internal.h"
namespace xbox { namespace services { namespace presence {
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
namespace presence {
/// <summary>
/// Represents media supporting Rich Presence features.
@ -303,4 +304,5 @@ private:
};
#endif
}}}
} // namespace presence
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_END

Просмотреть файл

@ -15,7 +15,7 @@
#include "xbox_system_factory.h"
using namespace pplx;
using namespace xbox::services::system;
using namespace XBOX_LIVE_NAMESPACE::system;
NAMESPACE_MICROSOFT_XBOX_SERVICES_PRESENCE_CPP_BEGIN
@ -633,6 +633,4 @@ presence_service_impl::get_presence_for_social_group_subpath(
return subpath.str();
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_PRESENCE_CPP_END

Просмотреть файл

@ -11,8 +11,7 @@
#include "custom_output.h"
#include "xsapi/system.h"
using namespace xbox::services::system;
using namespace XBOX_LIVE_NAMESPACE::system;
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
void custom_output::add_log(_In_ const log_entry& entry)

Просмотреть файл

@ -10,7 +10,6 @@
#include "pch.h"
#include "log.h"
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
std::shared_ptr<logger> logger::s_logger = nullptr;

Просмотреть файл

@ -9,36 +9,38 @@
//*********************************************************
#pragma once
#define DEFAULT_LOGGER xbox::services::logger::get_logger()
#define DEFAULT_LOGGER XBOX_LIVE_NAMESPACE::logger::get_logger()
#define IF_LOGGER_ENABLED(logger) if(logger != nullptr)
#define LOG(logger, level, category, msg) IF_LOGGER_ENABLED(logger) logger->add_log(xbox::services::log_entry(level, category, msg))
#define LOGS(logger, level, category) IF_LOGGER_ENABLED(logger) *logger += xbox::services::log_entry(level, category)
#define LOG(logger, level, category, msg) IF_LOGGER_ENABLED(logger) logger->add_log(XBOX_LIVE_NAMESPACE::log_entry(level, category, msg))
#define LOGS(logger, level, category) IF_LOGGER_ENABLED(logger) *logger += XBOX_LIVE_NAMESPACE::log_entry(level, category)
// default logging macro
const char defaultCategory[] = "";
#define IF_LOG_ERROR() IF_LOG_LEVEL_ENABLED(DEFAULT_LOGGER, xbox::services::log_level::error)
#define LOG_ERROR(msg) LOG(DEFAULT_LOGGER, xbox::services::log_level::error, defaultCategory, msg)
#define IF_LOG_ERROR() IF_LOG_LEVEL_ENABLED(DEFAULT_LOGGER, XBOX_LIVE_NAMESPACE::log_level::error)
#define LOG_ERROR(msg) LOG(DEFAULT_LOGGER, XBOX_LIVE_NAMESPACE::log_level::error, defaultCategory, msg)
#define LOG_ERROR_IF(boolean_expression, msg) if(boolean_expression) LOG_ERROR(msg)
#define LOGS_ERROR LOGS(DEFAULT_LOGGER, xbox::services::log_level::error, defaultCategory)
#define LOGS_ERROR LOGS(DEFAULT_LOGGER, XBOX_LIVE_NAMESPACE::log_level::error, defaultCategory)
#define LOGS_ERROR_IF(boolean_expression) if(boolean_expression) LOGS_ERROR
#define IF_LOG_WARN() IF_LOG_LEVEL_ENABLED(DEFAULT_LOGGER, xbox::services::log_level::warn)
#define LOG_WARN(msg) LOG(DEFAULT_LOGGER, xbox::services::log_level::warn, defaultCategory, msg)
#define IF_LOG_WARN() IF_LOG_LEVEL_ENABLED(DEFAULT_LOGGER, XBOX_LIVE_NAMESPACE::log_level::warn)
#define LOG_WARN(msg) LOG(DEFAULT_LOGGER, XBOX_LIVE_NAMESPACE::log_level::warn, defaultCategory, msg)
#define LOG_WARN_IF(boolean_expression, msg) if(boolean_expression) LOG_WARN(msg)
#define LOGS_WARN LOGS(DEFAULT_LOGGER, xbox::services::log_level::warn, defaultCategory)
#define LOGS_WARN LOGS(DEFAULT_LOGGER, XBOX_LIVE_NAMESPACE::log_level::warn, defaultCategory)
#define LOGS_WARN_IF(boolean_expression) if(boolean_expression) LOGS_WARN
#define IF_LOG_INFO() IF_LOG_LEVEL_ENABLED(DEFAULT_LOGGER, xbox::services::log_level::info)
#define LOG_INFO(msg) LOG(DEFAULT_LOGGER, xbox::services::log_level::info, defaultCategory, msg)
#define IF_LOG_INFO() IF_LOG_LEVEL_ENABLED(DEFAULT_LOGGER, XBOX_LIVE_NAMESPACE::log_level::info)
#define LOG_INFO(msg) LOG(DEFAULT_LOGGER, XBOX_LIVE_NAMESPACE::log_level::info, defaultCategory, msg)
#define LOG_INFO_IF(boolean_expression, msg) if(boolean_expression) LOG_INFO(msg)
#define LOGS_INFO LOGS(DEFAULT_LOGGER, xbox::services::log_level::info, defaultCategory)
#define LOGS_INFO LOGS(DEFAULT_LOGGER, XBOX_LIVE_NAMESPACE::log_level::info, defaultCategory)
#define LOGS_INFO_IF(boolean_expression) if(boolean_expression) LOGS_INFO
#define IF_LOG_DEBUG() IF_LOG_LEVEL_ENABLED(DEFAULT_LOGGER, xbox::services::log_level::debug)
#define LOG_DEBUG(msg) LOG(DEFAULT_LOGGER, xbox::services::log_level::debug, defaultCategory, msg)
#define IF_LOG_DEBUG() IF_LOG_LEVEL_ENABLED(DEFAULT_LOGGER, XBOX_LIVE_NAMESPACE::log_level::debug)
#define LOG_DEBUG(msg) LOG(DEFAULT_LOGGER, XBOX_LIVE_NAMESPACE::log_level::debug, defaultCategory, msg)
#define LOG_DEBUG_IF(boolean_expression, msg) if(boolean_expression) LOG_DEBUG(msg)
#define LOGS_DEBUG LOGS(DEFAULT_LOGGER, xbox::services::log_level::debug, defaultCategory)
#define LOGS_DEBUG LOGS(DEFAULT_LOGGER, XBOX_LIVE_NAMESPACE::log_level::debug, defaultCategory)
#define LOGS_DEBUG_IF(boolean_expression) if(boolean_expression) LOGS_DEBUG
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN

Просмотреть файл

@ -31,8 +31,9 @@
using namespace web; // Common features like URIs.
using namespace web::http; // Common HTTP functionality
using namespace web::http::client; // HTTP client features
using namespace xbox::services;
using namespace xbox::services::system;
using namespace XBOX_LIVE_NAMESPACE;
using namespace XBOX_LIVE_NAMESPACE::system;
const int MIN_DELAY_FOR_HTTP_INTERNAL_ERROR_IN_SEC = 10;
const double MAX_DELAY_TIME_IN_SEC = 60.0;
@ -101,7 +102,7 @@ http_call_impl::get_response(
bodyData.assign(body.begin(), body.end());
}
string_t signature = xbox::services::system::request_signer::sign_request(
string_t signature = XBOX_LIVE_NAMESPACE::system::request_signer::sign_request(
*proofKey,
signaturePolicy,
utility::datetime::utc_now().to_interval(),
@ -185,7 +186,7 @@ http_call_impl::get_response_with_auth(
{
return pplx::task_from_result<std::shared_ptr<http_call_response>>(nullptr);
}
std::shared_ptr<xbox::services::user_context> userContextPtr = std::make_shared<xbox::services::user_context>(user);
std::shared_ptr<XBOX_LIVE_NAMESPACE::user_context> userContextPtr = std::make_shared<XBOX_LIVE_NAMESPACE::user_context>(user);
return _Internal_get_response_with_auth(
userContextPtr,
@ -709,7 +710,7 @@ http_call_impl::handle_json_body_response(
if (httpCallResponse->http_status() == static_cast<int>(xbox_live_error_code::http_status_429_too_many_requests))
{
std::shared_ptr<xbox_live_app_config> appConfig = xbox::services::xbox_live_app_config::get_app_config_singleton();
std::shared_ptr<xbox_live_app_config> appConfig = XBOX_LIVE_NAMESPACE::xbox_live_app_config::get_app_config_singleton();
if (utils::str_icmp(appConfig->sandbox(), _T("RETAIL")) != 0)
{
bool disableAsserts = httpCallResponse->_Context_settings()->_Is_disable_asserts_for_xbox_live_throttling_in_dev_sandboxes();

Просмотреть файл

@ -193,8 +193,8 @@ public:
/// Sign the request and get the response. Used for auth services.
/// </summary>
virtual pplx::task<std::shared_ptr<http_call_response>> get_response(
_In_ std::shared_ptr<xbox::services::system::ecdsa> proofKey,
_In_ const xbox::services::system::signature_policy& signaturePolicy,
_In_ std::shared_ptr<XBOX_LIVE_NAMESPACE::system::ecdsa> proofKey,
_In_ const XBOX_LIVE_NAMESPACE::system::signature_policy& signaturePolicy,
_In_ http_call_response_body_type httpCallResponseBodyType
) = 0;
#endif
@ -219,7 +219,7 @@ public:
);
private:
xbox::services::system::xbox_live_mutex m_lock;
XBOX_LIVE_NAMESPACE::system::xbox_live_mutex m_lock;
std::unordered_map<uint32_t, http_retry_after_api_state> m_apiStateMap;
};
@ -238,8 +238,8 @@ public:
#if XSAPI_SERVER || UNIT_TEST_SYSTEM || XSAPI_U
pplx::task<std::shared_ptr<http_call_response>> get_response(
_In_ std::shared_ptr<xbox::services::system::ecdsa> proofKey,
_In_ const xbox::services::system::signature_policy& signaturePolicy,
_In_ std::shared_ptr<XBOX_LIVE_NAMESPACE::system::ecdsa> proofKey,
_In_ const XBOX_LIVE_NAMESPACE::system::signature_policy& signaturePolicy,
_In_ http_call_response_body_type httpCallResponseBodyType
) override;
#endif
@ -254,7 +254,7 @@ public:
) override;
pplx::task<std::shared_ptr<http_call_response>> get_response_with_auth(
_In_ const std::shared_ptr<xbox::services::user_context>& userContext,
_In_ const std::shared_ptr<XBOX_LIVE_NAMESPACE::user_context>& userContext,
_In_ http_call_response_body_type httpCallResponseBodyType,
_In_ bool allUsersAuthRequired = false
) override;
@ -340,7 +340,7 @@ private:
_In_ const web::http::http_response& response
);
static xbox::services::xbox_live_error_code get_xbox_live_error_code_from_http_status(
static XBOX_LIVE_NAMESPACE::xbox_live_error_code get_xbox_live_error_code_from_http_status(
_In_ const web::http::status_code& statusCode
);

Просмотреть файл

@ -217,7 +217,7 @@ void http_call_response::_Route_service_call() const
bool callFailed = FAILED(utils::convert_http_status_to_hresult(m_httpStatus));
bool logCall =
(xbox::services::service_call_logger::get_singleton_instance()->is_enabled()) ||
(XBOX_LIVE_NAMESPACE::service_call_logger::get_singleton_instance()->is_enabled()) ||
(system::xbox_live_services_settings::get_singleton_instance()->_Is_at_diagnostics_trace_level(xbox_services_diagnostics_trace_level::info)) ||
(callFailed && system::xbox_live_services_settings::get_singleton_instance()->_Is_at_diagnostics_trace_level(xbox_services_diagnostics_trace_level::error));
@ -232,7 +232,7 @@ void http_call_response::_Route_service_call() const
headers.remove(AUTH_HEADER);
headers.remove(SIG_HEADER);
xbox::services::xbox_service_call_routed_event_args args(
XBOX_LIVE_NAMESPACE::xbox_service_call_routed_event_args args(
m_xboxUserId,
m_request.method(),
m_fullUrl,

Просмотреть файл

@ -15,7 +15,8 @@
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
template<typename T>
xbox::services::xbox_live_result<T>
XBOX_LIVE_NAMESPACE::xbox_live_result<T>
get_xbl_result_from_response(_In_ std::shared_ptr<http_call_response> response, _In_ std::function<T(_In_ const web::json::value&)> deserializeFn)
{
if (response->response_body_json().size() != 0)

Просмотреть файл

@ -16,7 +16,7 @@ using namespace web::http; // Common HTTP functionality
using namespace web::http::client; // HTTP client features
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
xbox_http_client_impl::xbox_http_client_impl(
_In_ web::http::uri base_uri,
_In_ web::http::client::http_client_config client_config

Просмотреть файл

@ -13,15 +13,17 @@
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN
void* xsapi_memory::mem_alloc(
_In_ size_t dwSize
)
{
std::function<_Ret_maybenull_ _Post_writable_byte_size_(dwSize) void*(_In_ size_t dwSize)> pMemAlloc;
auto xboxLiveServiceSettings = xbox::services::system::xbox_live_services_settings::get_singleton_instance();
auto xboxLiveServiceSettings = XBOX_LIVE_NAMESPACE::system::xbox_live_services_settings::get_singleton_instance();
if (xboxLiveServiceSettings != nullptr)
{
pMemAlloc = xbox::services::system::xbox_live_services_settings::get_singleton_instance()->m_pMemAllocHook;
pMemAlloc = XBOX_LIVE_NAMESPACE::system::xbox_live_services_settings::get_singleton_instance()->m_pMemAllocHook;
}
if (pMemAlloc == nullptr)
{
@ -46,7 +48,7 @@ void xsapi_memory::mem_free(
)
{
std::function<void(_In_ void* pAddress)> pMemFree = nullptr;
auto xboxLiveServiceSettings = xbox::services::system::xbox_live_services_settings::get_singleton_instance();
auto xboxLiveServiceSettings = XBOX_LIVE_NAMESPACE::system::xbox_live_services_settings::get_singleton_instance();
if (xboxLiveServiceSettings != nullptr)
{
pMemFree = xboxLiveServiceSettings->m_pMemFreeHook;

Просмотреть файл

@ -14,7 +14,7 @@
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
static xbox::services::system::xbox_live_mutex g_serviceLoggerSingletonLock;
static XBOX_LIVE_NAMESPACE::system::xbox_live_mutex g_serviceLoggerSingletonLock;
static std::shared_ptr<service_call_logger> g_serviceLoggerSingleton;
std::shared_ptr<service_call_logger> service_call_logger::get_singleton_instance()

Просмотреть файл

@ -57,7 +57,8 @@ private:
bool m_isEnabled;
bool m_firstWrite;
xbox::services::system::xbox_live_mutex m_writeLock;
XBOX_LIVE_NAMESPACE::system::xbox_live_mutex m_writeLock;
};
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_END

Просмотреть файл

@ -23,7 +23,7 @@ using namespace Windows::Foundation;
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
static xbox::services::system::xbox_live_mutex g_serviceLoggerProtocolSingletonLock;
static XBOX_LIVE_NAMESPACE::system::xbox_live_mutex g_serviceLoggerProtocolSingletonLock;
static std::shared_ptr<service_call_logger_protocol> g_serviceLoggerProtocolSingleton;
std::shared_ptr<service_call_logger_protocol> service_call_logger_protocol::get_singleton_instance()

Просмотреть файл

@ -10,7 +10,6 @@
#pragma once
#include "system_internal.h"
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
class service_call_logger_protocol : public std::enable_shared_from_this<service_call_logger_protocol>

Просмотреть файл

@ -16,10 +16,9 @@
#include "service_call_logger_protocol.h"
#endif
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
static xbox::services::system::xbox_live_mutex g_serviceLoggingConfigSingletonLock;
static XBOX_LIVE_NAMESPACE::system::xbox_live_mutex g_serviceLoggingConfigSingletonLock;
static std::shared_ptr<service_call_logging_config> g_serviceLoggingConfigSingleton;
std::shared_ptr<service_call_logging_config> service_call_logging_config::get_singleton_instance()

Просмотреть файл

@ -8,6 +8,7 @@
//
//*********************************************************
#pragma once
#include "pch.h"
#include "build_version.h"
#ifndef UNIT_TEST_SERVICES
@ -42,10 +43,21 @@
#define THROW_CPP_INVALID_JSON_STRING_IF_STRING_EMPTY(x) { auto y = x; if ( y.empty() ) { throw web::json::json_exception(); } }
#define THROW_CPP_RUNTIME_IF(x,y) if ( x ) { throw std::runtime_error(y); }
#if BEAM_API
#define XBOX_LIVE_NAMESPACE xbox::services::beam
#define NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN namespace xbox { namespace services { namespace beam {
#define NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_END }}}
#define NAMESPACE_MICROSOFT_XBOX_SERVICES_BEGIN namespace Microsoft { namespace Xbox { namespace Services { namespace Beam {
#define NAMESPACE_MICROSOFT_XBOX_SERVICES_END }}}}
#else
#define XBOX_LIVE_NAMESPACE xbox::services
#define NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN namespace xbox { namespace services {
#define NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_END }}
#define NAMESPACE_MICROSOFT_XBOX_SERVICES_BEGIN namespace Microsoft { namespace Xbox { namespace Services {
#define NAMESPACE_MICROSOFT_XBOX_SERVICES_END }}}
#endif
#define NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN namespace system {
#define NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_END NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_END }

Просмотреть файл

@ -16,10 +16,16 @@
using namespace Platform;
using namespace Windows::Foundation::Collections;
#if !XSAPI_CPP
#if BEAM_API
using namespace Microsoft::Xbox::Services::Beam::System;
#else
using namespace Microsoft::Xbox::Services::System;
#endif
#endif
using namespace xbox::services::system;
#endif
using namespace XBOX_LIVE_NAMESPACE::system;
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN

Просмотреть файл

@ -31,7 +31,7 @@ typedef Microsoft::Xbox::Services::System::XboxLiveUser^ XboxLiveUser_t;
#if TV_API | XBOX_UWP
typedef Windows::Xbox::System::User^ xbox_live_user_t;
#else
typedef std::shared_ptr<xbox::services::system::xbox_live_user> xbox_live_user_t;
typedef std::shared_ptr<XBOX_LIVE_NAMESPACE::system::xbox_live_user> xbox_live_user_t;
#endif
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
@ -69,9 +69,9 @@ public:
const string_t& caller_context() const;
caller_context_type caller_context_type() const;
void set_caller_context_type(xbox::services::caller_context_type context);
void set_caller_context_type(XBOX_LIVE_NAMESPACE::caller_context_type context);
pplx::task<xbox::services::xbox_live_result<user_context_auth_result>> get_auth_result(
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<user_context_auth_result>> get_auth_result(
_In_ const string_t& httpMethod,
_In_ const string_t& url,
_In_ const string_t& headers,
@ -79,7 +79,7 @@ public:
_In_ bool allUsersAuthRequired = false
);
pplx::task<xbox::services::xbox_live_result<user_context_auth_result>> get_auth_result(
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<user_context_auth_result>> get_auth_result(
_In_ const string_t& httpMethod,
_In_ const string_t& url,
_In_ const string_t& headers,
@ -87,7 +87,7 @@ public:
_In_ bool allUsersAuthRequired = false
);
pplx::task<xbox::services::xbox_live_result<void>> refresh_token();
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<void>> refresh_token();
// inline helper functions
static string_t get_user_id(xbox_live_user_t user)
@ -106,12 +106,12 @@ public:
return user;
}
#else
static std::shared_ptr<xbox::services::system::xbox_live_user> user_convert(Microsoft::Xbox::Services::System::XboxLiveUser^ user)
static std::shared_ptr<XBOX_LIVE_NAMESPACE::system::xbox_live_user> user_convert(Microsoft::Xbox::Services::System::XboxLiveUser^ user)
{
return std::make_shared<xbox::services::system::xbox_live_user>(user->GetUserImpl());
return std::make_shared<XBOX_LIVE_NAMESPACE::system::xbox_live_user>(user->GetUserImpl());
}
static Microsoft::Xbox::Services::System::XboxLiveUser^ user_convert(std::shared_ptr<xbox::services::system::xbox_live_user> user)
static Microsoft::Xbox::Services::System::XboxLiveUser^ user_convert(std::shared_ptr<XBOX_LIVE_NAMESPACE::system::xbox_live_user> user)
{
return ref new Microsoft::Xbox::Services::System::XboxLiveUser(user->_User_impl());
}
@ -120,11 +120,11 @@ public:
#if XSAPI_SERVER
public:
user_context(_In_ std::shared_ptr<xbox::services::system::xbox_live_server> server);
std::shared_ptr<xbox::services::system::xbox_live_server> server() const;
user_context(_In_ std::shared_ptr<XBOX_LIVE_NAMESPACE::system::xbox_live_server> server);
std::shared_ptr<XBOX_LIVE_NAMESPACE::system::xbox_live_server> server() const;
private:
std::shared_ptr<xbox::services::system::xbox_live_server> m_server;
std::shared_ptr<XBOX_LIVE_NAMESPACE::system::xbox_live_server> m_server;
#endif
#if TV_API | XBOX_UWP
@ -138,14 +138,14 @@ private:
#elif XSAPI_CPP
// C++ Microsoft.* user object
public:
user_context(_In_ std::shared_ptr< xbox::services::system::xbox_live_user > user);
std::shared_ptr< xbox::services::system::xbox_live_user > user();
user_context(_In_ std::shared_ptr< XBOX_LIVE_NAMESPACE::system::xbox_live_user > user);
std::shared_ptr< XBOX_LIVE_NAMESPACE::system::xbox_live_user > user();
private:
std::shared_ptr< xbox::services::system::xbox_live_user > m_user;
std::shared_ptr< XBOX_LIVE_NAMESPACE::system::xbox_live_user > m_user;
#else
// WinRT Microsoft.* user object
public:
user_context(_In_ std::shared_ptr< xbox::services::system::xbox_live_user > user);
user_context(_In_ std::shared_ptr< XBOX_LIVE_NAMESPACE::system::xbox_live_user > user);
user_context(_In_ Microsoft::Xbox::Services::System::XboxLiveUser^ user);
@ -157,7 +157,7 @@ private:
private:
string_t m_xboxUserId;
string_t m_callerContext;
xbox::services::caller_context_type m_callerContextType;
XBOX_LIVE_NAMESPACE::caller_context_type m_callerContextType;
};
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_END

Просмотреть файл

@ -24,9 +24,13 @@
#include <objbase.h>
#endif
#include "http_call_response.h"
#if !BEAM_API
#include "xsapi/presence.h"
#endif
#include "xsapi/system.h"
#if !BEAM_API
#include "presence_internal.h"
#endif
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
@ -42,8 +46,8 @@ static std::mutex g_xsapiSingletonLock;
static std::shared_ptr<xsapi_singleton> g_xsapiSingleton;
xsapi_singleton::xsapi_singleton()
#if !TV_API && !XSAPI_SERVER
: s_presenceWriterSingleton(std::shared_ptr<xbox::services::presence::presence_writer>(new xbox::services::presence::presence_writer()))
#if !TV_API && !XSAPI_SERVER && !BEAM_API
: s_presenceWriterSingleton(std::shared_ptr<XBOX_LIVE_NAMESPACE::presence::presence_writer>(new XBOX_LIVE_NAMESPACE::presence::presence_writer()))
#endif
{
}
@ -855,7 +859,7 @@ utils::convert_xbox_live_error_code_to_hresult(
long utils::convert_http_status_to_hresult(_In_ uint32_t httpStatusCode)
{
xbox::services::xbox_live_error_code errCode = static_cast<xbox::services::xbox_live_error_code>(httpStatusCode);
XBOX_LIVE_NAMESPACE::xbox_live_error_code errCode = static_cast<XBOX_LIVE_NAMESPACE::xbox_live_error_code>(httpStatusCode);
long hr = HTTP_E_STATUS_UNEXPECTED;
// 2xx are http success codes
@ -1092,11 +1096,11 @@ string_t utils::convert_hresult_to_error_name(_In_ long hr)
}
#endif
xbox::services::xbox_live_error_code
XBOX_LIVE_NAMESPACE::xbox_live_error_code
utils::convert_exception_to_xbox_live_error_code()
{
// Default value, if there is no exception appears, return no_error
xbox::services::xbox_live_error_code errCode = xbox_live_error_code::no_error;
XBOX_LIVE_NAMESPACE::xbox_live_error_code errCode = xbox_live_error_code::no_error;
try
{
@ -1490,10 +1494,10 @@ string_t utils::datetime_to_string(
uint32_t
utils::try_get_master_title_id()
{
auto titleId = xbox::services::xbox_live_app_config::get_app_config_singleton()->_Override_title_id_for_multiplayer();
auto titleId = XBOX_LIVE_NAMESPACE::xbox_live_app_config::get_app_config_singleton()->_Override_title_id_for_multiplayer();
if (titleId == 0)
{
titleId = xbox::services::xbox_live_app_config::get_app_config_singleton()->title_id();
titleId = XBOX_LIVE_NAMESPACE::xbox_live_app_config::get_app_config_singleton()->title_id();
}
return titleId;
}
@ -1501,10 +1505,10 @@ utils::try_get_master_title_id()
string_t
utils::try_get_override_scid()
{
auto scid = xbox::services::xbox_live_app_config::get_app_config_singleton()->_Override_scid_for_multiplayer();
auto scid = XBOX_LIVE_NAMESPACE::xbox_live_app_config::get_app_config_singleton()->_Override_scid_for_multiplayer();
if (scid.empty())
{
scid = xbox::services::xbox_live_app_config::get_app_config_singleton()->scid();
scid = XBOX_LIVE_NAMESPACE::xbox_live_app_config::get_app_config_singleton()->scid();
}
return scid;
}

Просмотреть файл

@ -20,13 +20,10 @@
#include "xsapi/mem.h"
// Forward
namespace xbox {
namespace services {
namespace system {
class xbox_live_services_settings;
}
}
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN
class xbox_live_services_settings;
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_END
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN
@ -56,11 +53,11 @@ struct xsapi_singleton
std::unordered_map<string_t, uint32_t> s_rtaActiveManagersByUser;
std::mutex s_singletonLock;
std::shared_ptr<xbox::services::system::xbox_live_services_settings> s_xboxServiceSettingsSingleton;
std::shared_ptr<xbox::services::local_config> s_localConfigSingleton;
std::shared_ptr<XBOX_LIVE_NAMESPACE::system::xbox_live_services_settings> s_xboxServiceSettingsSingleton;
std::shared_ptr<XBOX_LIVE_NAMESPACE::local_config> s_localConfigSingleton;
#if !TV_API && !XSAPI_SERVER
std::shared_ptr<xbox::services::presence::presence_writer> s_presenceWriterSingleton;
#if !TV_API && !XSAPI_SERVER && !BEAM_API
std::shared_ptr<XBOX_LIVE_NAMESPACE::presence::presence_writer> s_presenceWriterSingleton;
#endif
};
@ -484,7 +481,7 @@ public:
_In_ string_t::value_type seperator
);
static xbox::services::xbox_live_error_code convert_exception_to_xbox_live_error_code();
static XBOX_LIVE_NAMESPACE::xbox_live_error_code convert_exception_to_xbox_live_error_code();
#ifdef _WIN32
static void convert_unix_time_to_filetime(
@ -528,10 +525,10 @@ public:
static void set_locales(_In_ const string_t& locale);
template<typename T>
static xbox::services::xbox_live_result<T> generate_xbox_live_result(
_Inout_ xbox::services::xbox_live_result<T> deserializationResult,
_In_ const std::shared_ptr<xbox::services::http_call_response>& response
)
static XBOX_LIVE_NAMESPACE::xbox_live_result<T> generate_xbox_live_result(
_Inout_ XBOX_LIVE_NAMESPACE::xbox_live_result<T> deserializationResult,
_In_ const std::shared_ptr<XBOX_LIVE_NAMESPACE::http_call_response>& response
)
{
if (deserializationResult.err())
{
@ -549,11 +546,11 @@ public:
}
template<typename T>
static pplx::task <xbox::services::xbox_live_result<T>> create_exception_free_task(
_In_ const pplx::task <xbox::services::xbox_live_result<T>>& t
static pplx::task <XBOX_LIVE_NAMESPACE::xbox_live_result<T>> create_exception_free_task(
_In_ const pplx::task <XBOX_LIVE_NAMESPACE::xbox_live_result<T>>& t
)
{
return t.then([](pplx::task <xbox::services::xbox_live_result<T>> result)
return t.then([](pplx::task <XBOX_LIVE_NAMESPACE::xbox_live_result<T>> result)
{
try
{
@ -561,7 +558,7 @@ public:
}
catch (const std::exception& e)
{
xbox_live_error_code err = xbox::services::utils::convert_exception_to_xbox_live_error_code();
xbox_live_error_code err = XBOX_LIVE_NAMESPACE::utils::convert_exception_to_xbox_live_error_code();
return xbox_live_result<T>(err, e.what());
}
#ifdef __cplusplus_winrt

Просмотреть файл

@ -34,7 +34,7 @@ xbox_web_socket_client::connect(
string_t callerContext = userContext->caller_context();
return userContext->get_auth_result(_T("GET"), uri.to_string(), string_t(), string_t())
.then([uri, subProtocol, callerContext, thisWeakPtr](xbox::services::xbox_live_result<user_context_auth_result> xblResult)
.then([uri, subProtocol, callerContext, thisWeakPtr](XBOX_LIVE_NAMESPACE::xbox_live_result<user_context_auth_result> xblResult)
{
std::shared_ptr<xbox_web_socket_client> pThis(thisWeakPtr.lock());
if (pThis == nullptr)

Просмотреть файл

@ -16,7 +16,7 @@
#include "utils.h"
using namespace web::websockets::client;
using namespace xbox::services::system;
using namespace XBOX_LIVE_NAMESPACE::system;
NAMESPACE_MICROSOFT_XBOX_SERVICES_CPP_BEGIN

Просмотреть файл

@ -101,14 +101,14 @@ xbox_live_app_config::xbox_live_app_config() :
xbox_live_result<void> xbox_live_app_config::read()
{
xbox::services::system::xbox_system_factory::get_factory();
XBOX_LIVE_NAMESPACE::system::xbox_system_factory::get_factory();
#if TV_API
m_sandbox = Windows::Xbox::Services::XboxLiveConfiguration::SandboxId->Data();
m_scid = Windows::Xbox::Services::XboxLiveConfiguration::PrimaryServiceConfigId->Data();
m_titleId = std::stoi(Windows::Xbox::Services::XboxLiveConfiguration::TitleId->Data());
#else
std::shared_ptr<xbox::services::local_config> localConfig = xbox::services::system::xbox_system_factory::get_factory()->create_local_config();
std::shared_ptr<XBOX_LIVE_NAMESPACE::local_config> localConfig = XBOX_LIVE_NAMESPACE::system::xbox_system_factory::get_factory()->create_local_config();
m_titleId = localConfig->title_id();
m_scid = localConfig->scid();
m_environment = localConfig->environment();
@ -121,7 +121,7 @@ xbox_live_result<void> xbox_live_app_config::read()
if(m_titleId == 0)
{
return xbox_live_result<void>(
std::make_error_code(xbox::services::xbox_live_error_code::invalid_config),
std::make_error_code(XBOX_LIVE_NAMESPACE::xbox_live_error_code::invalid_config),
"ERROR: Could not read \"titleId\" in xboxservices.config. Must be a JSON number"
);
}
@ -129,7 +129,7 @@ xbox_live_result<void> xbox_live_app_config::read()
if(m_scid.empty())
{
return xbox_live_result<void>(
std::make_error_code(xbox::services::xbox_live_error_code::invalid_config),
std::make_error_code(XBOX_LIVE_NAMESPACE::xbox_live_error_code::invalid_config),
"ERROR: Could not read \"PrimaryServiceConfigId\" in xboxservices.config. Must be a JSON string"
);
}

Просмотреть файл

@ -56,7 +56,7 @@ xbox_live_context_settings::_Set_dispatcher(
Windows::UI::Core::CoreDispatcherPriority::Normal,
ref new Windows::UI::Core::DispatchedHandler([]()
{
xbox::services::utils::generate_locales();
XBOX_LIVE_NAMESPACE::utils::generate_locales();
}));
}
}
@ -92,7 +92,7 @@ xbox_live_context_settings::xbox_live_context_settings() :
{
}
function_context xbox_live_context_settings::add_service_call_routed_handler(_In_ std::function<void(const xbox::services::xbox_service_call_routed_event_args&)> handler)
function_context xbox_live_context_settings::add_service_call_routed_handler(_In_ std::function<void(const XBOX_LIVE_NAMESPACE::xbox_service_call_routed_event_args&)> handler)
{
std::lock_guard<std::mutex> lock(m_writeLock);
@ -127,7 +127,7 @@ void xbox_live_context_settings::set_diagnostics_trace_level(_In_ xbox_services_
system::xbox_live_services_settings::get_singleton_instance()->set_diagnostics_trace_level(value);
}
void xbox_live_context_settings::_Raise_service_call_routed_event(_In_ const xbox::services::xbox_service_call_routed_event_args& result)
void xbox_live_context_settings::_Raise_service_call_routed_event(_In_ const XBOX_LIVE_NAMESPACE::xbox_service_call_routed_event_args& result)
{
std::lock_guard<std::mutex> lock(m_writeLock);

Просмотреть файл

@ -162,11 +162,12 @@ xbox_system_factory::create_web_socket_client()
return std::make_shared<xbox_web_socket_client>();
}
#if !BEAM_API
std::shared_ptr<multiplayer::multiplayer_subscription>
xbox_system_factory::create_multiplayer_subscription(
_In_ const std::function<void(const multiplayer::multiplayer_session_change_event_args&)>& multiplayerSessionChangeHandler,
_In_ const std::function<void()>& multiplayerSubscriptionLostHandler,
_In_ const std::function<void(const xbox::services::real_time_activity::real_time_activity_subscription_error_event_args&)>& subscriptionErrorHandler
_In_ const std::function<void(const XBOX_LIVE_NAMESPACE::real_time_activity::real_time_activity_subscription_error_event_args&)>& subscriptionErrorHandler
)
{
return std::make_shared<multiplayer::multiplayer_subscription>(
@ -175,6 +176,6 @@ xbox_system_factory::create_multiplayer_subscription(
subscriptionErrorHandler
);
}
#endif
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_END

Просмотреть файл

@ -33,7 +33,9 @@
#endif
#include "web_socket_client.h"
#if !BEAM_API
#include "multiplayer_internal.h"
#endif
#include "local_config.h"
#include "http_call_impl.h"
@ -42,6 +44,7 @@
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN
class xbox_system_factory
{
public:
@ -92,11 +95,13 @@ public:
virtual std::shared_ptr<xbox_web_socket_client> create_web_socket_client();
#if !BEAM_API
virtual std::shared_ptr<multiplayer::multiplayer_subscription> create_multiplayer_subscription(
_In_ const std::function<void(const multiplayer::multiplayer_session_change_event_args&)>& multiplayerSessionChangeHandler,
_In_ const std::function<void()>& multiplayerSubscriptionLostHandler,
_In_ const std::function<void(const xbox::services::real_time_activity::real_time_activity_subscription_error_event_args&)>& subscriptionErrorHandler
_In_ const std::function<void(const XBOX_LIVE_NAMESPACE::real_time_activity::real_time_activity_subscription_error_event_args&)>& subscriptionErrorHandler
);
#endif
static std::shared_ptr<xbox_system_factory> get_factory();
static void set_factory(_In_ std::shared_ptr<xbox_system_factory> factory);

Просмотреть файл

@ -12,11 +12,9 @@
#include "auth_flow_result_jni.h"
#include <jni.h>
namespace xbox {
namespace services {
class java_interop;
}
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN
class java_interop;
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_END
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN

Просмотреть файл

@ -13,7 +13,7 @@
#include "request_signer.h"
#include "auth_manager.h"
using namespace xbox::services;
using namespace XBOX_LIVE_NAMESPACE;
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN

Просмотреть файл

@ -14,7 +14,10 @@
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN
#if !BEAM_API
class xtitle_service;
#endif
class auth_manager;
class auth_manager : public std::enable_shared_from_this<auth_manager>
@ -27,12 +30,12 @@ public:
static std::shared_ptr<auth_manager> get_auth_manager_instance();
void set_rps_ticket(const string_t& rpsTicket);
pplx::task<xbox::services::xbox_live_result<void>> initialize_default_nsal();
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<void>> initialize_default_nsal();
pplx::task<xbox_live_result<void>> initialize_title_nsal(
_In_ const string_t& titleId
);
pplx::task<xbox::services::xbox_live_result<token_and_signature_result>>
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_and_signature_result>>
internal_get_token_and_signature(
_In_ string_t httpMethod,
_In_ const string_t& url,
@ -52,7 +55,9 @@ private:
std::shared_ptr<auth_config> m_authConfig;
std::shared_ptr<xbox_live_context_settings> m_xboxLiveContextSettings;
#if !BEAM_API
std::shared_ptr<xtitle_service> m_xtitle_service;
#endif
nsal m_defaultNsal;
nsal m_titleNsal;
@ -62,4 +67,4 @@ private:
static std::shared_ptr<auth_manager> s_authManager;
};
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_END
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_END

Просмотреть файл

@ -16,6 +16,7 @@
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN
/// <summary>
/// This represents an IP address and it's routing prefix in CIDR notation.
/// It is used in the NSAL for specifying IP ranges.

Просмотреть файл

@ -15,7 +15,7 @@
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN
pplx::task<xbox::services::xbox_live_result<token_result>>
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>>
device_token_service_impl::get_d_token_from_service(
_In_ const string_t& rpsTicket,
_In_ std::shared_ptr<ecdsa> proofKey,

Просмотреть файл

@ -18,7 +18,7 @@ NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN
class device_token_service
{
public:
virtual pplx::task<xbox::services::xbox_live_result<token_result>>
virtual pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>>
get_d_token_from_service(
_In_ const string_t& rpsTicket,
_In_ std::shared_ptr<ecdsa> proofKey,
@ -30,7 +30,7 @@ public:
class device_token_service_impl : public device_token_service
{
public:
virtual pplx::task<xbox::services::xbox_live_result<token_result>>
virtual pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>>
get_d_token_from_service(
_In_ const string_t& rpsTicket,
_In_ std::shared_ptr<ecdsa> proofKey,

Просмотреть файл

@ -97,4 +97,4 @@ private:
#endif
};
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_END
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_END

Просмотреть файл

@ -164,3 +164,4 @@ private:
};
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_END

Просмотреть файл

@ -23,7 +23,7 @@ service_token_service_impl::get_s_token_from_service(
string_t titleId;
if (!authenticationConfiguration->use_win10_auth())
{
auto appConfig = xbox::services::xbox_live_app_config::get_app_config_singleton();
auto appConfig = XBOX_LIVE_NAMESPACE::xbox_live_app_config::get_app_config_singleton();
uint32_t titleIdNum = appConfig->title_id();
stringstream_t msg;
msg << std::hex << titleIdNum;

Просмотреть файл

@ -82,4 +82,4 @@ token_error::deserialize(
utils::extract_json_string(json, _T("Redirect")));
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_END
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_END

Просмотреть файл

@ -16,6 +16,7 @@
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN
class token_error
{
public:
@ -62,3 +63,4 @@ private:
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_END

Просмотреть файл

@ -49,7 +49,7 @@ token_manager::token_manager(
{
}
pplx::task<xbox::services::xbox_live_result<token_result>> token_manager::get_xtoken(
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>> token_manager::get_xtoken(
_In_ const string_t& relyingParty,
_In_ const string_t& subRelyingParty,
_In_ const string_t tokenType,
@ -67,7 +67,7 @@ pplx::task<xbox::services::xbox_live_result<token_result>> token_manager::get_xt
);
}
pplx::task<xbox::services::xbox_live_result<token_result>> token_manager::get_token_from_cache_or_service(
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>> token_manager::get_token_from_cache_or_service(
_In_ std::shared_ptr<token_state> state,
_In_ const string_t& relyingParty,
_In_ const string_t& subRelyingParty,
@ -99,7 +99,7 @@ pplx::task<xbox::services::xbox_live_result<token_result>> token_manager::get_to
{
// Only kick off to get a new token if not doing so already
tokenInfo->IsRefreshInProgress = true;
tokenInfo->RefreshEvent = pplx::task_completion_event<xbox::services::xbox_live_result<token_result>>();
tokenInfo->RefreshEvent = pplx::task_completion_event<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>>();
}
}
if (!isRefreshInProgress)
@ -134,7 +134,7 @@ pplx::task<xbox::services::xbox_live_result<token_result>> token_manager::get_to
}
else
{
xbox::services::xbox_live_result<token_result> xblResult(tokenResult);
XBOX_LIVE_NAMESPACE::xbox_live_result<token_result> xblResult(tokenResult);
return pplx::task_from_result(xblResult);
}
}
@ -211,7 +211,7 @@ token_manager::refresh_x_token(
string_t utoken, stoken, ttoken, dtoken;
std::vector<pplx::task<xbox::services::xbox_live_result<token_result>>> tokenTasks;
std::vector<pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>>> tokenTasks;
std::condition_variable preTokenCondition;
std::mutex tokenMutex;
uint32_t prereqTokensFetched = 0;
@ -262,7 +262,7 @@ token_manager::refresh_x_token(
break;
case token_identity_type::d_token:
{
pplx::task<xbox::services::xbox_live_result<token_result>> dTokenTask =
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>> dTokenTask =
get_token_from_cache_or_service(
state,
xTokenInfo->RelyingParty,
@ -292,7 +292,7 @@ token_manager::refresh_x_token(
break;
case token_identity_type::u_token:
{
pplx::task<xbox::services::xbox_live_result<token_result>> uTokenTask =
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>> uTokenTask =
get_token_from_cache_or_service(
state,
xTokenInfo->RelyingParty,
@ -318,7 +318,7 @@ token_manager::refresh_x_token(
break;
case token_identity_type::s_token:
{
pplx::task<xbox::services::xbox_live_result<token_result>> sTokenTask =
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>> sTokenTask =
get_token_from_cache_or_service(
state,
xTokenInfo->RelyingParty,
@ -385,7 +385,7 @@ token_manager::refresh_x_token(
});
}
pplx::task<xbox::services::xbox_live_result<token_result>>
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>>
token_manager::refresh_t_token(
_In_ std::shared_ptr<token_state> state,
_In_ std::shared_ptr<token_info> tokenInfo
@ -412,14 +412,14 @@ token_manager::refresh_t_token(
state->XboxLiveContextSettings,
dTokenInfo->Token.token()
)
.then([tokenInfo](xbox::services::xbox_live_result<token_result> xblResult)
.then([tokenInfo](XBOX_LIVE_NAMESPACE::xbox_live_result<token_result> xblResult)
{
tokenInfo->set_token_result(xblResult.payload());
return xblResult;
});
}
pplx::task<xbox::services::xbox_live_result<token_result>>
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>>
token_manager::refresh_d_token(
_In_ std::shared_ptr<token_state> state,
_In_ std::shared_ptr<token_info> tokenInfo
@ -437,14 +437,14 @@ token_manager::refresh_d_token(
state->AuthConfig,
state->XboxLiveContextSettings
)
.then([tokenInfo](xbox::services::xbox_live_result<token_result> xblResult)
.then([tokenInfo](XBOX_LIVE_NAMESPACE::xbox_live_result<token_result> xblResult)
{
tokenInfo->set_token_result(xblResult.payload());
return xblResult;
});
}
pplx::task<xbox::services::xbox_live_result<token_result>>
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>>
token_manager::refresh_u_token(
_In_ std::shared_ptr<token_state> state,
_In_ std::shared_ptr<token_info> tokenInfo
@ -461,7 +461,7 @@ token_manager::refresh_u_token(
state->ProofKey,
state->AuthConfig,
state->XboxLiveContextSettings)
.then([tokenInfo](xbox::services::xbox_live_result<token_result> xblResult)
.then([tokenInfo](XBOX_LIVE_NAMESPACE::xbox_live_result<token_result> xblResult)
{
tokenInfo->set_token_result(xblResult.payload());
return xblResult;
@ -469,7 +469,7 @@ token_manager::refresh_u_token(
}
#if XSAPI_SERVER
pplx::task<xbox::services::xbox_live_result<token_result>>
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>>
token_manager::refresh_s_token(
_In_ std::shared_ptr<token_state> state,
_In_ std::shared_ptr<token_info> tokenInfo
@ -479,7 +479,7 @@ token_manager::refresh_s_token(
state->ProofKey,
state->AuthConfig,
state->XboxLiveContextSettings)
.then([tokenInfo](xbox::services::xbox_live_result<token_result> xblResult)
.then([tokenInfo](XBOX_LIVE_NAMESPACE::xbox_live_result<token_result> xblResult)
{
tokenInfo->set_token_result(xblResult.payload());
return xblResult;

Просмотреть файл

@ -21,16 +21,18 @@
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN
class token_manager
{
public:
token_manager(
_In_ std::shared_ptr<ecdsa> proofKey,
_In_ std::shared_ptr<auth_config> authConfig,
_In_ std::shared_ptr<XBOX_LIVE_NAMESPACE::system::ecdsa> proofKey,
_In_ std::shared_ptr<XBOX_LIVE_NAMESPACE::system::auth_config> authConfig,
_In_ std::shared_ptr<xbox_live_context_settings> xboxLiveContextSettings
);
pplx::task<xbox::services::xbox_live_result<token_result>> get_xtoken(
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>> get_xtoken(
_In_ const string_t& relyingParty,
_In_ const string_t& subRelyingParty,
_In_ const string_t tokenType,
@ -72,21 +74,21 @@ private:
std::mutex Lock; // Lock for synchronizing access to non-const fields
token_result Token;
bool IsRefreshInProgress;
pplx::task_completion_event<xbox::services::xbox_live_result<token_result>> RefreshEvent;
pplx::task_completion_event<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>> RefreshEvent;
};
struct token_state
{
token_state(
_In_ std::shared_ptr<ecdsa> proofKey,
_In_ std::shared_ptr<auth_config> authConfig,
_In_ std::shared_ptr<XBOX_LIVE_NAMESPACE::system::auth_config> authConfig,
_In_ std::shared_ptr<xbox_live_context_settings> xboxLiveContextSettings);
std::map<string_t, std::shared_ptr<token_info>> Cache;
string_t RpsTicket;
std::mutex DataLock;
const std::shared_ptr<ecdsa> ProofKey;
const std::shared_ptr<auth_config> AuthConfig;
const std::shared_ptr<XBOX_LIVE_NAMESPACE::system::auth_config> AuthConfig;
const std::shared_ptr<xbox_live_context_settings> XboxLiveContextSettings;
};
@ -104,7 +106,7 @@ private:
_In_ const string_t& relyingParty,
_In_ const string_t& subRelyingParty,
_In_ const string_t& tokenType,
_In_ token_identity_type tokenIdentityType);
_In_ XBOX_LIVE_NAMESPACE::system::token_identity_type tokenIdentityType);
// Gets a token from state->Cache in a thread safe manner.
static std::shared_ptr<token_info> get_token_from_cache(
@ -112,16 +114,16 @@ private:
_In_ const string_t& relyingParty,
_In_ const string_t& subRelyingParty,
_In_ const string_t& tokenType,
_In_ token_identity_type tokenIdentityType,
_In_ XBOX_LIVE_NAMESPACE::system::token_identity_type tokenIdentityType,
_In_ bool forceRefresh = false);
static pplx::task<xbox::services::xbox_live_result<token_result>> get_token_from_cache_or_service(
static pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>> get_token_from_cache_or_service(
_In_ std::shared_ptr<token_state> state,
_In_ const string_t& relyingParty,
_In_ const string_t& subRelyingParty,
_In_ const string_t tokenType,
_In_ bool promptForCreds,
_In_ token_identity_type tokenIdentityType,
_In_ XBOX_LIVE_NAMESPACE::system::token_identity_type tokenIdentityType,
_In_ bool forceRefresh = false
);
@ -131,28 +133,28 @@ private:
// the token type and RP are the same) does not start multiple
// threads. If an existing thread exists, the call is given
// a task that finishes when that thread finishes.
static pplx::task<xbox::services::xbox_live_result<token_result>> refresh_x_token(
static pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>> refresh_x_token(
_In_ std::shared_ptr<token_state> state,
_In_ std::shared_ptr<token_info> tokenInfo,
_In_ bool promptForCreds
);
static pplx::task<xbox::services::xbox_live_result<token_result>> refresh_t_token(
static pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>> refresh_t_token(
_In_ std::shared_ptr<token_state> state,
_In_ std::shared_ptr<token_info> tokenInfo
);
static pplx::task<xbox::services::xbox_live_result<token_result>> refresh_u_token(
static pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>> refresh_u_token(
_In_ std::shared_ptr<token_state> state,
_In_ std::shared_ptr<token_info> tokenInfo
);
static pplx::task<xbox::services::xbox_live_result<token_result>> refresh_d_token(
static pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>> refresh_d_token(
_In_ std::shared_ptr<token_state> state,
_In_ std::shared_ptr<token_info> tokenInfo
);
static pplx::task<xbox::services::xbox_live_result<token_result>> refresh_s_token(
static pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>> refresh_s_token(
_In_ std::shared_ptr<token_state> state,
_In_ std::shared_ptr<token_info> tokenInfo
);

Просмотреть файл

@ -227,3 +227,4 @@ bool trie<T>::get_exact(_In_ string_t path, _Out_ T& result) const
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_END

Просмотреть файл

@ -13,7 +13,8 @@
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN
pplx::task<xbox::services::xbox_live_result<token_result>>
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>>
user_token_service_impl::get_u_token_from_service(
_In_ const string_t& rpsTicket,
_In_ std::shared_ptr<ecdsa> proofKey,

Просмотреть файл

@ -15,10 +15,11 @@
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN
class user_token_service
{
public:
virtual pplx::task<xbox::services::xbox_live_result<token_result>>
virtual pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>>
get_u_token_from_service(
_In_ const string_t& rpsTicket,
_In_ std::shared_ptr<ecdsa> proofKey,
@ -34,7 +35,7 @@ public:
/// Returns a user token obtained from XASU
/// </summary>
/// <param name="rpsTicket">A valid (non-expired) RPS ticket.</param>
virtual pplx::task<xbox::services::xbox_live_result<token_result>>
virtual pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>>
get_u_token_from_service(
_In_ const string_t& rpsTicket,
_In_ std::shared_ptr<ecdsa> proofKey,

Просмотреть файл

@ -11,10 +11,11 @@
#include "xsapi/system.h"
#include "xbox_live_server_impl.h"
using namespace xbox::services;
using namespace XBOX_LIVE_NAMESPACE;
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN
xbox_live_server::xbox_live_server()
{
m_server_impl = std::make_shared<xbox_live_server_impl>();

Просмотреть файл

@ -13,10 +13,11 @@
#include "request_signer.h"
#include <WinHttp.h>
using namespace xbox::services;
using namespace XBOX_LIVE_NAMESPACE;
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN
xbox_live_server_impl::xbox_live_server_impl()
:m_isSignedIn(false)
{
@ -84,7 +85,7 @@ xbox_live_server_impl::signin(
});
}
pplx::task<xbox::services::xbox_live_result<token_and_signature_result> >
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_and_signature_result> >
xbox_live_server_impl::get_token_and_signature(
_In_ string_t httpMethod,
_In_ string_t url,
@ -102,7 +103,7 @@ xbox_live_server_impl::get_token_and_signature(
);
}
pplx::task<xbox::services::xbox_live_result<token_and_signature_result> >
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_and_signature_result> >
xbox_live_server_impl::get_token_and_signature(
_In_ string_t httpMethod,
_In_ string_t url,
@ -123,7 +124,7 @@ xbox_live_server_impl::get_token_and_signature(
);
}
pplx::task<xbox::services::xbox_live_result<token_and_signature_result> >
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_and_signature_result> >
xbox_live_server_impl::get_token_and_signature_array(
_In_ string_t httpMethod,
_In_ string_t url,
@ -142,7 +143,7 @@ xbox_live_server_impl::get_token_and_signature_array(
);
}
pplx::task<xbox::services::xbox_live_result<token_and_signature_result> >
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_and_signature_result> >
xbox_live_server_impl::internal_get_token_and_signature(
_In_ string_t httpMethod,
_In_ const string_t& url,

Просмотреть файл

@ -14,24 +14,25 @@
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN
class xbox_live_server_impl : public std::enable_shared_from_this<xbox_live_server_impl>
{
public:
xbox_live_server_impl();
pplx::task<xbox::services::xbox_live_result<void>> signin(
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<void>> signin(
_In_ cert_context cert,
_In_ bool forceRefresh
);
pplx::task<xbox::services::xbox_live_result<token_and_signature_result>>
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_and_signature_result>>
get_token_and_signature(
_In_ string_t httpMethod,
_In_ string_t url,
_In_ string_t headers
);
pplx::task<xbox::services::xbox_live_result<token_and_signature_result>>
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_and_signature_result>>
get_token_and_signature(
_In_ string_t httpMethod,
_In_ string_t url,
@ -39,7 +40,7 @@ public:
_In_ string_t requestBodyString
);
pplx::task<xbox::services::xbox_live_result<token_and_signature_result>>
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_and_signature_result>>
get_token_and_signature_array(
_In_ string_t httpMethod,
_In_ string_t url,
@ -47,7 +48,7 @@ public:
_In_ const std::vector<unsigned char>& requestBodyArray
);
pplx::task<xbox::services::xbox_live_result<token_and_signature_result>>
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_and_signature_result>>
internal_get_token_and_signature(
_In_ string_t httpMethod,
_In_ const string_t& url,

Просмотреть файл

@ -14,7 +14,8 @@
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN
pplx::task<xbox::services::xbox_live_result<token_result>>
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>>
xsts_token_service_impl::get_x_token_from_service(
_In_ std::shared_ptr<ecdsa> proofKey,
_In_ string_t deviceToken,
@ -64,7 +65,7 @@ xsts_token_service_impl::get_x_token_from_service(
str << "Http status: ";
str << response->http_status();
xbox::services::xbox_live_result<token_result> result = get_xbl_result_from_response<token_result>(response, token_result::deserialize);
XBOX_LIVE_NAMESPACE::xbox_live_result<token_result> result = get_xbl_result_from_response<token_result>(response, token_result::deserialize);
result.payload().set_title_id(titleId);
result.payload().set_http_status_code(response->http_status());

Просмотреть файл

@ -18,17 +18,17 @@ NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN
class xsts_token_service
{
public:
virtual pplx::task<xbox::services::xbox_live_result<token_result> >
virtual pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result> >
get_x_token_from_service(
_In_ std::shared_ptr<xbox::services::system::ecdsa> proofKey,
_In_ std::shared_ptr<XBOX_LIVE_NAMESPACE::system::ecdsa> proofKey,
_In_ string_t deviceToken,
_In_ string_t titleToken,
_In_ string_t userToken,
_In_ string_t serviceToken,
_In_ string_t relyingParty,
_In_ string_t tokenType,
_In_ std::shared_ptr<xbox::services::system::auth_config> authenticationConfiguration,
_In_ std::shared_ptr<xbox::services::xbox_live_context_settings> xboxLiveContextSettings,
_In_ std::shared_ptr<XBOX_LIVE_NAMESPACE::system::auth_config> authenticationConfiguration,
_In_ std::shared_ptr<XBOX_LIVE_NAMESPACE::xbox_live_context_settings> xboxLiveContextSettings,
_In_ string_t titleId
) = 0;
};
@ -39,7 +39,7 @@ public:
/// <summary>
/// Returns a XToken obtained from XSTS
/// </summary>
virtual pplx::task<xbox::services::xbox_live_result<token_result>>
virtual pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_result>>
get_x_token_from_service(
_In_ std::shared_ptr<ecdsa> proofKey,
_In_ string_t deviceToken,

Просмотреть файл

@ -18,7 +18,7 @@
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN
pplx::task<xbox::services::xbox_live_result<nsal>>
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<nsal>>
xtitle_service_impl::get_default_nsal(
_In_ std::shared_ptr<xbox_live_context_settings> xboxLiveContextSettings,
_In_ std::shared_ptr<auth_config> authConfig
@ -48,11 +48,11 @@ string_t create_title_nsal_path(_In_ const string_t& titleId)
return ss.str();
}
pplx::task<xbox::services::xbox_live_result<nsal>>
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<nsal>>
xtitle_service_impl::get_title_nsal(
_In_ std::shared_ptr<auth_manager> authMan,
_In_ const string_t& titleId,
_In_ std::shared_ptr<xbox::services::xbox_live_context_settings> xboxLiveContextSettings,
_In_ std::shared_ptr<XBOX_LIVE_NAMESPACE::xbox_live_context_settings> xboxLiveContextSettings,
_In_ std::shared_ptr<auth_config> authConfig
)
{
@ -77,7 +77,7 @@ xtitle_service_impl::get_title_nsal(
false,
false
)
.then([httpCall, httpRequest](xbox::services::xbox_live_result<token_and_signature_result> xblResult) mutable -> pplx::task<std::shared_ptr<http_call_response>>
.then([httpCall, httpRequest](XBOX_LIVE_NAMESPACE::xbox_live_result<token_and_signature_result> xblResult) mutable -> pplx::task<std::shared_ptr<http_call_response>>
{
token_and_signature_result authResult = xblResult.payload(); // Auth failures will be handled later inside get_response()
if (!authResult.token().empty())

Просмотреть файл

@ -19,17 +19,17 @@ NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN
class xtitle_service
{
public:
virtual pplx::task<xbox::services::xbox_live_result<nsal>>
virtual pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<nsal>>
get_default_nsal(
_In_ std::shared_ptr<xbox::services::xbox_live_context_settings> xboxLiveContextSettings,
_In_ std::shared_ptr<XBOX_LIVE_NAMESPACE::xbox_live_context_settings> xboxLiveContextSettings,
_In_ std::shared_ptr<auth_config> authConfig
) = 0;
virtual pplx::task<xbox::services::xbox_live_result<nsal>>
virtual pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<nsal>>
get_title_nsal(
_In_ std::shared_ptr<auth_manager> authMan,
_In_ const string_t& titleId,
_In_ std::shared_ptr<xbox::services::xbox_live_context_settings> xboxLiveContextSettings,
_In_ std::shared_ptr<XBOX_LIVE_NAMESPACE::xbox_live_context_settings> xboxLiveContextSettings,
_In_ std::shared_ptr<auth_config> authConfig
) = 0;
};
@ -37,17 +37,17 @@ public:
class xtitle_service_impl : public xtitle_service
{
public:
virtual pplx::task<xbox::services::xbox_live_result<nsal>>
virtual pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<nsal>>
get_default_nsal(
_In_ std::shared_ptr<xbox::services::xbox_live_context_settings> xboxLiveContextSettings,
_In_ std::shared_ptr<XBOX_LIVE_NAMESPACE::xbox_live_context_settings> xboxLiveContextSettings,
_In_ std::shared_ptr<auth_config> authConfig
) override;
virtual pplx::task<xbox::services::xbox_live_result<nsal>>
virtual pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<nsal>>
get_title_nsal(
_In_ std::shared_ptr<auth_manager> authMan,
_In_ const string_t& titleId,
_In_ std::shared_ptr<xbox::services::xbox_live_context_settings> xboxLiveContextSettings,
_In_ std::shared_ptr<XBOX_LIVE_NAMESPACE::xbox_live_context_settings> xboxLiveContextSettings,
_In_ std::shared_ptr<auth_config> authConfig
) override;

Просмотреть файл

@ -8,7 +8,8 @@
//
//*********************************************************
#pragma once
namespace xbox { namespace services { namespace system {
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN
class xbox_live_mutex
{
@ -21,4 +22,5 @@ private:
std::mutex m_xboxLiveMutex;
};
}}}
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_END

Просмотреть файл

@ -195,5 +195,4 @@ xbox_live_user::remove_sign_out_completed_handler(_In_ function_context context)
return user_impl::remove_sign_out_completed_handler(context);
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_END

Просмотреть файл

@ -27,12 +27,12 @@ std::unordered_map<function_context, std::function<void(const sign_out_completed
std::unordered_map<function_context, std::function<void(const string_t&)>> user_impl::s_signInCompletedHandlers;
function_context user_impl::s_signOutCompletedHandlerIndexer = 0;
function_context user_impl::s_signInCompletedHandlerIndexer = 0;
xbox::services::system::xbox_live_mutex user_impl::s_trackingUsersLock;
XBOX_LIVE_NAMESPACE::system::xbox_live_mutex user_impl::s_trackingUsersLock;
std::shared_ptr<user_impl>
user_factory::create_user_impl(user_creation_context userCreationContext)
{
return xbox::services::system::xbox_system_factory::get_factory()->create_user_impl(userCreationContext);
return XBOX_LIVE_NAMESPACE::system::xbox_system_factory::get_factory()->create_user_impl(userCreationContext);
}
user_impl::user_impl(
@ -60,7 +60,7 @@ user_impl::user_impl(
#endif
}
pplx::task<xbox::services::xbox_live_result<token_and_signature_result>>
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_and_signature_result>>
user_impl::get_token_and_signature(
_In_ const string_t& httpMethod,
_In_ const string_t& url,
@ -78,7 +78,7 @@ user_impl::get_token_and_signature(
);
}
pplx::task<xbox::services::xbox_live_result<token_and_signature_result> >
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_and_signature_result> >
user_impl::get_token_and_signature(
_In_ const string_t& httpMethod,
_In_ const string_t& url,
@ -99,7 +99,7 @@ user_impl::get_token_and_signature(
);
}
pplx::task<xbox::services::xbox_live_result<token_and_signature_result> >
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_and_signature_result> >
user_impl::get_token_and_signature_array(
_In_ const string_t& httpMethod,
_In_ const string_t& url,

Просмотреть файл

@ -30,9 +30,9 @@ public:
#endif
#if XSAPI_U
virtual pplx::task<xbox::services::xbox_live_result<void>> signout() = 0;
virtual pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<void>> signout() = 0;
#endif
virtual pplx::task<xbox::services::xbox_live_result<sign_in_result>> switch_account() { return pplx::task_from_exception<xbox::services::xbox_live_result<sign_in_result>>(std::exception()); }
virtual pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<sign_in_result>> switch_account() { return pplx::task_from_exception<XBOX_LIVE_NAMESPACE::xbox_live_result<sign_in_result>>(std::exception()); }
virtual pplx::task<xbox_live_result<void>> sign_in_impl(
_In_ const string_t& userDelegationTicket,
@ -41,7 +41,7 @@ public:
{
UNREFERENCED_PARAMETER(userDelegationTicket);
UNREFERENCED_PARAMETER(forceRefresh);
return pplx::task_from_exception<xbox::services::xbox_live_result<void>>(std::exception());
return pplx::task_from_exception<XBOX_LIVE_NAMESPACE::xbox_live_result<void>>(std::exception());
}
// IUser
@ -57,14 +57,14 @@ public:
void _Set_xbox_user_id(const string_t& xboxUserId) { m_xboxUserId = xboxUserId; }
#endif
pplx::task<xbox::services::xbox_live_result<token_and_signature_result> >
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_and_signature_result> >
get_token_and_signature(
_In_ const string_t& httpMethod,
_In_ const string_t& url,
_In_ const string_t& headers
);
pplx::task<xbox::services::xbox_live_result<token_and_signature_result> >
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_and_signature_result> >
get_token_and_signature(
_In_ const string_t& httpMethod,
_In_ const string_t& url,
@ -72,7 +72,7 @@ public:
_In_ const string_t& requestBodyString
);
pplx::task<xbox::services::xbox_live_result<token_and_signature_result> >
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_and_signature_result> >
get_token_and_signature_array(
_In_ const string_t& httpMethod,
_In_ const string_t& url,
@ -85,7 +85,7 @@ public:
void set_title_telemetry_session_id(_In_ const string_t& sessionId);
const string_t& title_telemetry_session_id();
virtual pplx::task<xbox::services::xbox_live_result<token_and_signature_result> >
virtual pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_and_signature_result> >
internal_get_token_and_signature(
_In_ const string_t& httpMethod,
_In_ const string_t& url,
@ -131,30 +131,30 @@ protected:
static std::unordered_map<function_context, std::function<void(const sign_out_completed_event_args&)>> s_signOutCompletedHandlers;
static function_context s_signInCompletedHandlerIndexer;
static function_context s_signOutCompletedHandlerIndexer;
static xbox::services::system::xbox_live_mutex s_trackingUsersLock;
xbox::services::system::xbox_live_mutex m_lock;
static XBOX_LIVE_NAMESPACE::system::xbox_live_mutex s_trackingUsersLock;
XBOX_LIVE_NAMESPACE::system::xbox_live_mutex m_lock;
};
#if UWP_API
class user_impl_idp : public user_impl
{
public:
pplx::task<xbox::services::xbox_live_result<sign_in_result>> sign_in_impl(
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<sign_in_result>> sign_in_impl(
_In_ bool showUI,
_In_ bool forceRefresh
) override;
pplx::task<xbox::services::xbox_live_result<sign_in_result>> switch_account() override;
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<sign_in_result>> switch_account() override;
// Not supported for user_impl_idp
pplx::task<xbox::services::xbox_live_result<void>> sign_in_impl(
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<void>> sign_in_impl(
_In_ const string_t& userDelegationTicket,
_In_ bool forceRefresh
) override;
user_impl_idp(Windows::System::User^ systemUser);
pplx::task<xbox::services::xbox_live_result<token_and_signature_result>>
pplx::task<XBOX_LIVE_NAMESPACE::xbox_live_result<token_and_signature_result>>
internal_get_token_and_signature(
_In_ const string_t& httpMethod,
_In_ const string_t& url,
@ -181,7 +181,7 @@ private:
pplx::task<void> initialize_provider();
// sync version of get internal_get_token_and_signature
xbox::services::xbox_live_result<token_and_signature_result>
XBOX_LIVE_NAMESPACE::xbox_live_result<token_and_signature_result>
internal_get_token_and_signature_helper(
_In_ const string_t& httpMethod,
_In_ const string_t& url,

Просмотреть файл

@ -26,10 +26,15 @@ using namespace Platform;
using namespace Windows::Security::Authentication::Web::Core;
using namespace Windows::Security::Credentials;
using namespace Windows::System::Threading;
using namespace xbox::services;
using namespace XBOX_LIVE_NAMESPACE;
#if BEAM_API
using namespace Microsoft::Xbox::Services::Beam;
using namespace Microsoft::Xbox::Services::Beam::System;
#else
using namespace Microsoft::Xbox::Services;
using namespace Microsoft::Xbox::Services::System;
using namespace xbox::services::presence;
using namespace XBOX_LIVE_NAMESPACE::presence;
#endif
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN
@ -706,7 +711,6 @@ bool user_impl_idp::is_multi_user_application()
#endif
return isSupported == 1;
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_END
#endif

Просмотреть файл

@ -13,8 +13,7 @@
#include "user_impl.h"
using namespace pplx;
using namespace xbox::services;
using XBOX_LIVE_NAMESPACE;
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_BEGIN
pplx::task<xbox_live_result<sign_in_result>>

Просмотреть файл

@ -34,4 +34,4 @@ xbox_live_mutex::get()
return m_xboxLiveMutex;
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_END
NAMESPACE_MICROSOFT_XBOX_SERVICES_SYSTEM_CPP_END