Adding RTA subscriptions for Teams (#124)

This commit is contained in:
Aditya Toney 2017-03-31 12:32:04 -07:00 коммит произвёл GitHub
Родитель 040402df3b
Коммит fd5e47ef51
34 изменённых файлов: 1023 добавлений и 20 удалений

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

@ -245,6 +245,9 @@
<ClCompile Include="..\..\Source\Services\Tournaments\match_metadata.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\current_match_metadata.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\previous_match_metadata.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_event_args.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_subscription.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_service_impl.cpp" />
<ClCompile Include="..\..\Source\Shared\call_buffer_timer.cpp" />
<ClCompile Include="..\..\Source\Shared\initiator.cpp" />
<ClCompile Include="..\..\Source\Shared\local_config.cpp" />
@ -322,6 +325,7 @@
<ClInclude Include="..\..\Source\Services\Social\social_internal.h" />
<ClInclude Include="..\..\Source\Services\Stats\Manager\stats_manager_internal.h" />
<ClInclude Include="..\..\Source\Services\Stats\user_statistics_internal.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\tournament_service_internal.h" />
<ClInclude Include="..\..\Source\Shared\call_buffer_timer.h" />
<ClInclude Include="..\..\Source\Shared\http_call_impl.h" />
<ClInclude Include="..\..\Source\Shared\http_call_response.h" />

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

@ -669,6 +669,15 @@
<ClCompile Include="..\..\Source\Services\Tournaments\previous_match_metadata.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_service_impl.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_event_args.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_subscription.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Social\Manager\social_user_group_loaded_event_args.cpp">
<Filter>C++ Source\Social\Manager</Filter>
</ClCompile>
@ -899,6 +908,9 @@
<ClInclude Include="..\..\Source\Services\Social\social_internal.h">
<Filter>C++ Source\Social</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\tournament_service_internal.h">
<Filter>C++ Source\Tournaments</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Common\xbox_live_context_impl.h">
<Filter>C++ Source\Common</Filter>
</ClInclude>

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

@ -393,6 +393,9 @@
<ClCompile Include="..\..\Source\Services\Tournaments\match_metadata.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\current_match_metadata.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\previous_match_metadata.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_event_args.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_subscription.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_service_impl.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TournamentReference_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TournamentRequestResult_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TournamentRequest_WinRT.cpp" />
@ -406,6 +409,8 @@
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamRequestResult_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamInfo_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamSummary_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamChangeEventArgs_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamChangeSubscription_WinRT.cpp" />
<ClCompile Include="..\..\Source\Shared\call_buffer_timer.cpp" />
<ClCompile Include="..\..\Source\Shared\errors.cpp" />
<ClCompile Include="..\..\Source\Shared\http_call_impl.cpp" />
@ -705,6 +710,7 @@
<ClInclude Include="..\..\Source\Services\TitleStorage\WinRT\TitleStorageQuota_WinRT.h" />
<ClInclude Include="..\..\Source\Services\TitleStorage\WinRT\TitleStorageService_WinRT.h" />
<ClInclude Include="..\..\Source\Services\TitleStorage\WinRT\TitleStorageType_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\tournament_service_internal.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamState_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TournamentArbitrationState_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TournamentArbitrationStatus_WinRT.h" />
@ -730,6 +736,8 @@
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamRequestResult_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamInfo_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamSummary_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamChangeEventArgs_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamChangeSubscription_WinRT.h" />
<ClInclude Include="..\..\Source\Shared\call_buffer_timer.h" />
<ClInclude Include="..\..\Source\Shared\http_call_impl.h" />
<ClInclude Include="..\..\Source\Shared\http_call_response.h" />

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

@ -1185,6 +1185,15 @@
<ClCompile Include="..\..\Source\Services\Tournaments\previous_match_metadata.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_event_args.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_subscription.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_service_impl.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\Tournament_WinRT.cpp">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClCompile>
@ -1218,6 +1227,12 @@
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamSummary_WinRT.cpp">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamChangeEventArgs_WinRT.cpp">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamChangeSubscription_WinRT.cpp">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Social\Manager\social_user_group_loaded_event_args.cpp">
<Filter>C++ Source\Social\Manager</Filter>
</ClCompile>
@ -2150,6 +2165,9 @@
<ClInclude Include="..\..\Include\xsapi\tournaments.h">
<Filter>C++ Public Includes</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\tournament_service_internal.h">
<Filter>C++ Source\Tournaments</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\Tournament_WinRT.h">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClInclude>
@ -2201,6 +2219,12 @@
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamSummary_WinRT.h">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamChangeEventArgs_WinRT.h">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamChangeSubscription_WinRT.h">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Social\Manager\WinRT\SocialEventArgs_WinRT.h">
<Filter>C++ Source\Social\Manager\WinRT</Filter>
</ClInclude>

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

@ -310,11 +310,14 @@
<ClCompile Include="..\..\Source\Services\TitleStorage\title_storage_blob_result.cpp" />
<ClCompile Include="..\..\Source\Services\TitleStorage\title_storage_quota.cpp" />
<ClCompile Include="..\..\Source\Services\TitleStorage\title_storage_service.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_event_args.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_subscription.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\tournament.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_reference.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_request.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_request_result.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_service.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_service_impl.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_team_result.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\team_info.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\team_summary.cpp" />
@ -408,6 +411,7 @@
<ClInclude Include="..\..\Source\Services\Social\social_internal.h" />
<ClInclude Include="..\..\Source\Services\Stats\Manager\stats_manager_internal.h" />
<ClInclude Include="..\..\Source\Services\Stats\user_statistics_internal.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\tournament_service_internal.h" />
<ClInclude Include="..\..\Source\Shared\call_buffer_timer.h" />
<ClInclude Include="..\..\Source\Shared\initiator.h" />
<ClInclude Include="..\..\Source\Shared\Logger\custom_output.h" />

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

@ -762,6 +762,15 @@
<ClCompile Include="..\..\Source\Services\Misc\UWP\title_callable_ui.cpp">
<Filter>C++ Source\Misc</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_service_impl.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_event_args.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_subscription.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Shared\http_call_response.h">
@ -986,5 +995,8 @@
<ClInclude Include="..\..\Include\xsapi\title_callable_ui.h">
<Filter>C++ Public Includes</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\tournament_service_internal.h">
<Filter>C++ Source\Tournaments</Filter>
</ClInclude>
</ItemGroup>
</Project>

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

@ -457,6 +457,9 @@
<ClCompile Include="..\..\Source\Services\Tournaments\team_request.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\team_request_result.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\match_metadata.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_event_args.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_subscription.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_service_impl.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\current_match_metadata.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\previous_match_metadata.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TournamentReference_WinRT.cpp" />
@ -472,6 +475,8 @@
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamRequestResult_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamInfo_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamSummary_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamChangeEventArgs_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamChangeSubscription_WinRT.cpp" />
<ClCompile Include="..\..\Source\Shared\call_buffer_timer.cpp" />
<ClCompile Include="..\..\Source\Shared\errors.cpp" />
<ClCompile Include="..\..\Source\Shared\http_call_impl.cpp" />
@ -764,6 +769,7 @@
<ClInclude Include="..\..\Source\Services\TitleStorage\WinRT\TitleStorageQuota_WinRT.h" />
<ClInclude Include="..\..\Source\Services\TitleStorage\WinRT\TitleStorageService_WinRT.h" />
<ClInclude Include="..\..\Source\Services\TitleStorage\WinRT\TitleStorageType_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\tournament_service_internal.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamState_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TournamentArbitrationState_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TournamentArbitrationStatus_WinRT.h" />
@ -789,6 +795,8 @@
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamRequestResult_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamInfo_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamSummary_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamChangeEventArgs_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamChangeSubscription_WinRT.h" />
<ClInclude Include="..\..\Source\Shared\call_buffer_timer.h" />
<ClInclude Include="..\..\Source\Shared\http_call_impl.h" />
<ClInclude Include="..\..\Source\Shared\http_call_response.h" />

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

@ -1275,6 +1275,15 @@
<ClCompile Include="..\..\Source\Services\Tournaments\previous_match_metadata.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_event_args.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_subscription.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_service_impl.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\Tournament_WinRT.cpp">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClCompile>
@ -1308,6 +1317,12 @@
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamSummary_WinRT.cpp">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamChangeEventArgs_WinRT.cpp">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamChangeSubscription_WinRT.cpp">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\Source\Shared\WinRT\Macros_WinRT.h">
@ -2204,6 +2219,9 @@
<ClInclude Include="..\..\Include\xsapi\tournaments.h">
<Filter>C++ Public Includes</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\tournament_service_internal.h">
<Filter>C++ Source\Tournaments</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\Tournament_WinRT.h">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClInclude>
@ -2255,6 +2273,12 @@
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamSummary_WinRT.h">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamChangeEventArgs_WinRT.h">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamChangeSubscription_WinRT.h">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Shared\perf_tester.h">
<Filter>C++ Source\Shared</Filter>
</ClInclude>

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

@ -245,6 +245,9 @@
<ClCompile Include="..\..\Source\Services\Tournaments\match_metadata.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\current_match_metadata.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\previous_match_metadata.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_event_args.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_subscription.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_service_impl.cpp" />
<ClCompile Include="..\..\Source\Shared\call_buffer_timer.cpp" />
<ClCompile Include="..\..\Source\Shared\initiator.cpp" />
<ClCompile Include="..\..\Source\Shared\local_config.cpp" />
@ -322,6 +325,7 @@
<ClInclude Include="..\..\Source\Services\Social\social_internal.h" />
<ClInclude Include="..\..\Source\Services\Stats\Manager\stats_manager_internal.h" />
<ClInclude Include="..\..\Source\Services\Stats\user_statistics_internal.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\tournament_service_internal.h" />
<ClInclude Include="..\..\Source\Shared\call_buffer_timer.h" />
<ClInclude Include="..\..\Source\Shared\perf_tester.h" />
<ClInclude Include="..\..\Source\Shared\http_call_impl.h" />

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

@ -684,6 +684,15 @@
<ClCompile Include="..\..\Source\Services\Tournaments\previous_match_metadata.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_service_impl.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_event_args.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_subscription.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Social\Manager\social_user_group_loaded_event_args.cpp">
<Filter>C++ Source\Social\Manager</Filter>
</ClCompile>
@ -902,6 +911,9 @@
<ClInclude Include="..\..\Source\Services\Social\social_internal.h">
<Filter>C++ Source\Social</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\tournament_service_internal.h">
<Filter>C++ Source\Tournaments</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Common\xbox_live_context_impl.h">
<Filter>C++ Source\Common</Filter>
</ClInclude>

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

@ -313,6 +313,9 @@
<ClCompile Include="..\..\Source\Services\Tournaments\current_match_metadata.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\match_metadata.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\previous_match_metadata.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_event_args.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_subscription.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_service_impl.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\team_info.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\team_request.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\team_request_result.cpp" />
@ -407,6 +410,7 @@
<ClInclude Include="..\..\Source\Services\Social\social_internal.h" />
<ClInclude Include="..\..\Source\Services\Stats\Manager\stats_manager_internal.h" />
<ClInclude Include="..\..\Source\Services\Stats\user_statistics_internal.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\tournament_service_internal.h" />
<ClInclude Include="..\..\Source\Shared\call_buffer_timer.h" />
<ClInclude Include="..\..\Source\Shared\initiator.h" />
<ClInclude Include="..\..\Source\Shared\Logger\custom_output.h" />

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

@ -735,6 +735,15 @@
<ClCompile Include="..\..\Source\Services\Tournaments\previous_match_metadata.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_service_impl.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_event_args.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_subscription.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_info.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
@ -899,6 +908,9 @@
<ClInclude Include="..\..\Source\Services\Stats\user_statistics_internal.h">
<Filter>C++ Source\UserStats</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\tournament_service_internal.h">
<Filter>C++ Source\Tournaments</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Common\xbox_live_context_impl.h">
<Filter>C++ Source\Common</Filter>
</ClInclude>

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

@ -245,6 +245,9 @@
<ClCompile Include="..\..\Source\Services\Tournaments\match_metadata.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\current_match_metadata.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\previous_match_metadata.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_event_args.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_subscription.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_service_impl.cpp" />
<ClCompile Include="..\..\Source\Shared\call_buffer_timer.cpp" />
<ClCompile Include="..\..\Source\Shared\initiator.cpp" />
<ClCompile Include="..\..\Source\Shared\local_config.cpp" />
@ -322,6 +325,7 @@
<ClInclude Include="..\..\Source\Services\Social\social_internal.h" />
<ClInclude Include="..\..\Source\Services\Stats\Manager\stats_manager_internal.h" />
<ClInclude Include="..\..\Source\Services\Stats\user_statistics_internal.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\tournament_service_internal.h" />
<ClInclude Include="..\..\Source\Shared\call_buffer_timer.h" />
<ClInclude Include="..\..\Source\Shared\perf_tester.h" />
<ClInclude Include="..\..\Source\Shared\http_call_impl.h" />

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

@ -684,6 +684,15 @@
<ClCompile Include="..\..\Source\Services\Tournaments\previous_match_metadata.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_service_impl.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_event_args.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_change_subscription.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Social\Manager\social_user_group_loaded_event_args.cpp">
<Filter>C++ Source\Social\Manager</Filter>
</ClCompile>
@ -902,6 +911,9 @@
<ClInclude Include="..\..\Source\Services\Social\social_internal.h">
<Filter>C++ Source\Social</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\tournament_service_internal.h">
<Filter>C++ Source\Tournaments</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Common\xbox_live_context_impl.h">
<Filter>C++ Source\Common</Filter>
</ClInclude>

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

@ -281,6 +281,9 @@
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\TitleStorage\WinRT\TitleStorageQuota_WinRT.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\TitleStorage\WinRT\TitleStorageService_WinRT.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\TitleStorage\WinRT\TitleStorageType_WinRT.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\tournament_service_internal.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TeamChangeEventArgs_WinRT.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TeamChangeSubscription_WinRT.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TeamState_WinRT.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TournamentArbitrationState_WinRT.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TournamentArbitrationStatus_WinRT.h" />
@ -706,6 +709,11 @@
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\match_metadata.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\current_match_metadata.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\previous_match_metadata.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\team_change_event_args.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\team_change_subscription.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\tournament_service_impl.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TeamChangeEventArgs_WinRT.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TeamChangeSubscription_WinRT.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TournamentReference_WinRT.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TournamentRequestResult_WinRT.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TournamentRequest_WinRT.cpp" />

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

@ -1000,6 +1000,15 @@
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Shared\WinRT\XboxLiveWnsEventArgs_WinRT.h">
<Filter>XSAPI\Shared\WinRT</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TeamChangeEventArgs_WinRT.h">
<Filter>XSAPI\Services\Touraments\WinRT</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TeamChangeSubscription_WinRT.h">
<Filter>XSAPI\Services\Touraments\WinRT</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\tournament_service_internal.h">
<Filter>XSAPI\Services\Touraments</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="XSAPI">
@ -2393,5 +2402,20 @@
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TeamSummary_WinRT.cpp">
<Filter>XSAPI\Services\Touraments\WinRT</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TeamChangeEventArgs_WinRT.cpp">
<Filter>XSAPI\Services\Touraments\WinRT</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TeamChangeSubscription_WinRT.cpp">
<Filter>XSAPI\Services\Touraments\WinRT</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\tournament_service_impl.cpp">
<Filter>XSAPI\Services\Touraments</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\team_change_subscription.cpp">
<Filter>XSAPI\Services\Touraments</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\team_change_event_args.cpp">
<Filter>XSAPI\Services\Touraments</Filter>
</ClCompile>
</ItemGroup>
</Project>

2
External/cpprestsdk поставляемый

@ -1 +1 @@
Subproject commit cf809553e3bf1b4dffb56703d81dfcf84163c4b3
Subproject commit 65c533064178c63454293d5877395d9fce427329

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

@ -10,6 +10,8 @@ namespace xbox {
namespace tournaments {
class tournament_service_impl;
/// <summary>
/// Defines values used to indicate the state for a tournament.
/// </summary>
@ -538,7 +540,8 @@ public:
void _Init_next_page_info(
_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::services::xbox_live_app_config> appConfig,
_In_ std::shared_ptr<xbox::services::real_time_activity::real_time_activity_service> rtaService
);
/// <summary>
@ -550,6 +553,7 @@ 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::services::real_time_activity::real_time_activity_service> m_realTimeActivityService;
std::vector<team_info> m_items;
string_t m_nextLinkUrl;
@ -862,7 +866,8 @@ public:
void _Init_next_page_info(
_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::services::xbox_live_app_config> appConfig,
_In_ std::shared_ptr<xbox::services::real_time_activity::real_time_activity_service> rtaService
);
/// <summary>
@ -874,11 +879,96 @@ 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::services::real_time_activity::real_time_activity_service> m_realTimeActivityService;
std::vector<tournament> m_items;
string_t m_nextLinkUrl;
};
/// <summary>
/// Contains information about a change to a subscribed team.
/// </summary>
class team_change_event_args
{
public:
/// <summary>
/// The organizer ID used to create the subscription.
/// </summary>
_XSAPIIMP const string_t& organizer_id() const;
/// <summary>
/// The tournament ID used to create the subscription.
/// </summary>
_XSAPIIMP const string_t& tournament_id() const;
/// <summary>
/// The team ID used to create the subscription.
/// </summary>
_XSAPIIMP const string_t& team_id() const;
/// <summary>
/// Internal function
/// </summary>
team_change_event_args();
/// <summary>
/// Internal function
/// </summary>
team_change_event_args(
_In_ const string_t& organizerId,
_In_ const string_t& tournamentId,
_In_ const string_t& teamId
);
private:
string_t m_organizerId;
string_t m_tournamentId;
string_t m_teamId;
};
/// <summary>
/// Handles notification when the state of a team subscription changes.
/// </summary>
class team_change_subscription : public xbox::services::real_time_activity::real_time_activity_subscription
{
public:
/// <summary>
/// The organizer ID the subscription is for.
/// </summary>
_XSAPIIMP const string_t& organizer_id() const;
/// <summary>
/// The tournament ID the subscription is for.
/// </summary>
_XSAPIIMP const string_t& tournament_id() const;
/// <summary>
/// The team ID the subscription is for.
/// </summary>
_XSAPIIMP const string_t& team_id() const;
/// <summary>
/// Internal function
/// </summary>
team_change_subscription(
_In_ const string_t& organizerId,
_In_ const string_t& tournamentId,
_In_ const string_t& teamId,
_In_ std::function<void(const team_change_event_args&)> handler,
_In_ std::function<void(const xbox::services::real_time_activity::real_time_activity_subscription_error_event_args&)> subscriptionErrorHandler
);
protected:
void on_subscription_created(_In_ uint32_t id, _In_ const web::json::value& data) override;
void on_event_received(_In_ const web::json::value& data) override;
private:
std::function<void(const team_change_event_args&)> m_teamChangeHandler;
string_t m_organizerId;
string_t m_tournamentId;
string_t m_teamId;
};
/// <summary>
/// Represents an endpoint that you can use to access the Tournament service.
/// </summary>
@ -945,6 +1035,46 @@ public:
_In_ const string_t& teamId
);
/// <summary>
/// Subscribes to team update notifications via the TeamChanged event.
/// </summary>
/// <param name="organizerId">The ID of the tournament organizer. This is case sensitive.</param>
/// <param name="tournamentId">The ID of the tournament.</param>
/// <param name="teamId">The ID of the team.</param>
/// <returns>A team_change_subscription object that contains the state of the subscription.
/// You can register an event handler for team changes by calling add_team_changed_handler().
/// </returns>
_XSAPIIMP xbox_live_result<std::shared_ptr<team_change_subscription>> subscribe_to_team_change(
_In_ const string_t& organizerId,
_In_ const string_t& tournamentId,
_In_ const string_t& teamId
);
/// <summary>
/// Unsubscribes a previously created team change subscription.
/// </summary>
/// <param name="subscription">The subscription object to unsubscribe</param>
_XSAPIIMP xbox_live_result<void> unsubscribe_from_team_change(
_In_ std::shared_ptr<team_change_subscription> subscription
);
/// <summary>
/// Registers an event handler for team change notifications.
/// Event handlers receive a team_change_event_args object.
/// </summary>
/// <param name="handler">The callback function that recieves notifications.</param>
/// <returns>
/// A function_context object that can be used to unregister the event handler.
/// </returns>
_XSAPIIMP function_context add_team_changed_handler(_In_ std::function<void(team_change_event_args)> handler);
/// <summary>
/// Unregisters an event handler for team change notifications.
/// </summary>
/// <param name="context">The function_context object that was returned when the event handler was registered. </param>
/// <param name="handler">The callback function that recieves notifications.</param>
_XSAPIIMP void remove_team_changed_handler(_In_ function_context context);
/// <summary>
/// Internal function
/// </summary>
@ -975,9 +1105,15 @@ public:
tournament_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::services::xbox_live_app_config> appConfig,
_In_ std::shared_ptr<xbox::services::real_time_activity::real_time_activity_service> rtaService
);
/// <summary>
/// Internal function
/// </summary>
std::shared_ptr<xbox_live_context_settings> _Xbox_live_context_settings() { return m_xboxLiveContextSettings; }
private:
pplx::task<xbox::services::xbox_live_result<tournament_request_result>> get_tournaments_internal(
@ -1003,6 +1139,8 @@ 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<tournament_service_impl> m_tournamentServiceImpl;
std::shared_ptr<xbox::services::real_time_activity::real_time_activity_service> m_realTimeActivityService;
};
}}}

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

@ -161,7 +161,7 @@ m_xboxLiveContextSettings = std::make_shared<XBOX_LIVE_NAMESPACE::xbox_live_cont
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_tournamentService = XBOX_LIVE_NAMESPACE::tournaments::tournament_service(m_userContext, m_xboxLiveContextSettings, m_appConfig);
m_tournamentService = XBOX_LIVE_NAMESPACE::tournaments::tournament_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

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

@ -0,0 +1,16 @@
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pch.h"
#include "TeamChangeEventArgs_WinRT.h"
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_BEGIN
TeamChangeEventArgs::TeamChangeEventArgs(
_In_ xbox::services::tournaments::team_change_event_args cppObj
) :
m_cppObj(std::move(cppObj))
{
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_END

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

@ -0,0 +1,38 @@
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#pragma once
#include "xsapi/tournaments.h"
#include "Tournament_WinRT.h"
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_BEGIN
/// <summary>
/// Contains information about a change to a subscribed team.
/// </summary>
public ref class TeamChangeEventArgs sealed
{
public:
/// <summary>
/// The organizer ID used to create the subscription.
/// </summary>
DEFINE_PROP_GET_STR_OBJ(OrganizerId, organizer_id);
/// <summary>
/// The tournament ID used to create the subscription.
/// </summary>
DEFINE_PROP_GET_STR_OBJ(TournamentId, tournament_id);
/// <summary>
/// The team ID used to create the subscription.
/// </summary>
DEFINE_PROP_GET_STR_OBJ(TeamId, team_id);
internal:
TeamChangeEventArgs(_In_ xbox::services::tournaments::team_change_event_args cppObj);
private:
xbox::services::tournaments::team_change_event_args m_cppObj;
};
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_END

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

@ -0,0 +1,29 @@
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pch.h"
#include "TeamChangeSubscription_WinRT.h"
using namespace Microsoft::Xbox::Services::RealTimeActivity;
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_BEGIN
TeamChangeSubscription::TeamChangeSubscription(
_In_ std::shared_ptr<xbox::services::tournaments::team_change_subscription> cppObj
) :
m_cppObj(cppObj)
{
}
RealTimeActivitySubscriptionState
TeamChangeSubscription::State::get()
{
return static_cast<RealTimeActivitySubscriptionState>(m_cppObj->state());
}
std::shared_ptr<xbox::services::tournaments::team_change_subscription>
TeamChangeSubscription::GetCppObj() const
{
return m_cppObj;
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_END

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

@ -0,0 +1,49 @@
#pragma once
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#pragma once
#include "xsapi/tournaments.h"
#include "Tournament_WinRT.h"
#include "RealTimeActivitySubscriptionState_WinRT.h"
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_BEGIN
/// <summary>
/// Handles notification when the state of a team subscription changes.
/// </summary>
public ref class TeamChangeSubscription sealed
{
public:
/// <summary>
/// Indicates the state of the subscription.
/// </summary>
property Microsoft::Xbox::Services::RealTimeActivity::RealTimeActivitySubscriptionState State
{
Microsoft::Xbox::Services::RealTimeActivity::RealTimeActivitySubscriptionState get();
}
/// <summary>
/// The organizer ID the subscription is for.
/// </summary>
DEFINE_PTR_PROP_GET_STR_OBJ(OrganizerId, organizer_id);
/// <summary>
/// The tournament ID the subscription is for.
/// </summary>
DEFINE_PTR_PROP_GET_STR_OBJ(TournamentId, tournament_id);
/// <summary>
/// The team ID the subscription is for.
/// </summary>
DEFINE_PTR_PROP_GET_STR_OBJ(TeamId, team_id);
internal:
TeamChangeSubscription(_In_ std::shared_ptr<xbox::services::tournaments::team_change_subscription> cppObj);
std::shared_ptr<xbox::services::tournaments::team_change_subscription> GetCppObj() const;
private:
std::shared_ptr<xbox::services::tournaments::team_change_subscription> m_cppObj;
};
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_END

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

@ -4,6 +4,7 @@
#include "pch.h"
#include "TournamentService_WinRT.h"
#include "Utils_WinRT.h"
#include "TeamChangeEventArgs_WinRT.h"
using namespace Platform;
using namespace concurrency;
@ -12,6 +13,64 @@ using namespace xbox::services::tournaments;
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_BEGIN
TeamEventBind::TeamEventBind(
_In_ Platform::WeakReference setting,
_In_ xbox::services::tournaments::tournament_service& cppObj
) :
m_setting(setting),
m_cppObj(cppObj)
{
}
void
TeamEventBind::RemoveTeamEvent(
_In_ xbox::services::tournaments::tournament_service& cppObj
)
{
cppObj.remove_team_changed_handler(m_functionContext);
}
void TeamEventBind::TeamChangeRouter(
_In_ const xbox::services::tournaments::team_change_event_args& teamChangeEventArgs
)
{
TournamentService^ setting = m_setting.Resolve<TournamentService>();
if (setting != nullptr)
{
if (m_cppObj._Xbox_live_context_settings()->use_core_dispatcher_for_event_routing() && Xbox::Services::XboxLiveContextSettings::Dispatcher != nullptr)
{
Xbox::Services::XboxLiveContextSettings::Dispatcher->RunAsync(
Windows::UI::Core::CoreDispatcherPriority::Normal,
ref new Windows::UI::Core::DispatchedHandler([setting, teamChangeEventArgs]()
{
setting->RaiseTeamChange(ref new TeamChangeEventArgs(teamChangeEventArgs));
}));
}
else
{
setting->RaiseTeamChange(ref new TeamChangeEventArgs(teamChangeEventArgs));
}
}
}
void TeamEventBind::AddTeamEvent()
{
std::weak_ptr<TeamEventBind> thisWeakPtr = shared_from_this();
m_functionContext = m_cppObj.add_team_changed_handler([thisWeakPtr](_In_ const xbox::services::tournaments::team_change_event_args& teamChangeEventArgs)
{
std::shared_ptr<TeamEventBind> pThis(thisWeakPtr.lock());
if (pThis != nullptr)
{
pThis->TeamChangeRouter(teamChangeEventArgs);
}
});
}
void TournamentService::RaiseTeamChange(_In_ TeamChangeEventArgs^ args)
{
TeamChanged(this, args);
}
TournamentService::TournamentService(
_In_ xbox::services::tournaments::tournament_service cppObj
) :
@ -95,4 +154,39 @@ TournamentService::GetTeamDetailsAsync(
return ASYNC_FROM_TASK(task);
}
TeamChangeSubscription^
TournamentService::SubscribeToTeamChange(
_In_ Platform::String^ organizerId,
_In_ Platform::String^ tournamentId,
_In_ Platform::String^ teamId
)
{
std::shared_ptr<team_change_subscription> subscription;
auto subscriptionResult = m_cppObj.subscribe_to_team_change(
STRING_T_FROM_PLATFORM_STRING(organizerId),
STRING_T_FROM_PLATFORM_STRING(tournamentId),
STRING_T_FROM_PLATFORM_STRING(teamId)
);
THROW_IF_ERR(subscriptionResult);
subscription = subscriptionResult.payload();
return ref new TeamChangeSubscription(subscription);
}
void
TournamentService::UnsubscribeFromTeamChange(
_In_ TeamChangeSubscription^ subscription
)
{
THROW_INVALIDARGUMENT_IF_NULL(subscription);
auto unsubscribeResult = m_cppObj.unsubscribe_from_team_change(
subscription->GetCppObj()
);
THROW_IF_ERR(unsubscribeResult);
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_END

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

@ -9,15 +9,40 @@
#include "TeamInfo_WinRT.h"
#include "TeamRequest_WinRT.h"
#include "TeamRequestResult_WinRT.h"
#include "TeamChangeEventArgs_WinRT.h"
#include "TeamChangeSubscription_WinRT.h"
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_BEGIN
class TeamEventBind : public std::enable_shared_from_this<TeamEventBind>
{
public:
TeamEventBind(
_In_ Platform::WeakReference setting,
_In_ xbox::services::tournaments::tournament_service& cppObj
);
void AddTeamEvent();
void RemoveTeamEvent(
_In_ xbox::services::tournaments::tournament_service& cppObj
);
void TeamChangeRouter(_In_ const xbox::services::tournaments::team_change_event_args& teamChangeEventArgs);
private:
function_context m_functionContext;
Platform::WeakReference m_setting;
xbox::services::tournaments::tournament_service m_cppObj;
};
/// <summary>
/// Represents an endpoint that you can use to access the Tournament service.
/// </summary>
public ref class TournamentService sealed
{
public:
/// <summary>
/// Returns a list of tournaments for the current title.
/// </summary>
@ -78,12 +103,41 @@ public:
_In_ Platform::String^ teamId
);
/// <summary>
/// Registers for team change notifications. Event handlers receive a TeamChangeEventArgs^ object.
/// </summary>
event Windows::Foundation::EventHandler<TeamChangeEventArgs^>^ TeamChanged;
/// <summary>
/// Subscribes to team update notifications via the TeamChanged event.
/// </summary>
/// <param name="organizerId">The ID of the tournament organizer. This is case sensitive.</param>
/// <param name="tournamentId">The ID of the tournament.</param>
/// <param name="teamId">The ID of the team.</param>
/// <returns>A subscription object that contains the state of the subscription.
/// You can register an event handler for team changes by using the TeamChanged event.</returns>
TeamChangeSubscription^ SubscribeToTeamChange(
_In_ Platform::String^ organizerId,
_In_ Platform::String^ tournamentId,
_In_ Platform::String^ teamId
);
/// <summary>
/// Unsubscribe a previously created team change subscription.
/// </summary>
/// <param name="subscription">The subscription object to unsubscribe.</param>
void UnsubscribeFromTeamChange(
_In_ TeamChangeSubscription^ subscription
);
internal:
TournamentService(
_In_ xbox::services::tournaments::tournament_service cppObj
);
const xbox::services::tournaments::tournament_service& GetCppObj() const;
void RaiseTeamChange(_In_ TeamChangeEventArgs^ args);
private:
xbox::services::tournaments::tournament_service m_cppObj;
};

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

@ -0,0 +1,42 @@
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pch.h"
#include "xsapi/tournaments.h"
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_CPP_BEGIN
team_change_event_args::team_change_event_args()
{
}
team_change_event_args::team_change_event_args(
_In_ const string_t& organizerId,
_In_ const string_t& tournamentId,
_In_ const string_t& teamId
) :
m_organizerId(std::move(organizerId)),
m_tournamentId(std::move(tournamentId)),
m_teamId(std::move(teamId))
{
}
const string_t&
team_change_event_args::organizer_id() const
{
return m_organizerId;
}
const string_t&
team_change_event_args::tournament_id() const
{
return m_tournamentId;
}
const string_t&
team_change_event_args::team_id() const
{
return m_teamId;
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_CPP_END

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

@ -0,0 +1,115 @@
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pch.h"
#include "xsapi/tournaments.h"
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_CPP_BEGIN
team_change_subscription::team_change_subscription(
_In_ const string_t& organizerId,
_In_ const string_t& tournamentId,
_In_ const string_t& teamId,
_In_ std::function<void(const team_change_event_args&)> handler,
_In_ std::function<void(const xbox::services::real_time_activity::real_time_activity_subscription_error_event_args&)> subscriptionErrorHandler
) :
real_time_activity_subscription(subscriptionErrorHandler),
m_organizerId(std::move(organizerId)),
m_tournamentId(std::move(tournamentId)),
m_teamId(std::move(teamId)),
m_teamChangeHandler(handler)
{
XSAPI_ASSERT(handler != nullptr);
stringstream_t uriPath;
uriPath << _T("https://tournamentshub.xboxlive.com/tournaments/") << m_organizerId << _T("/") << m_tournamentId << _T("/teams/") << m_teamId;
m_resourceUri = uriPath.str();
}
void
team_change_subscription::on_subscription_created(
_In_ uint32_t id,
_In_ const web::json::value& data
)
{
real_time_activity_subscription::on_subscription_created(
id,
data
);
if (m_teamChangeHandler)
{
m_teamChangeHandler(
team_change_event_args(
m_organizerId,
m_tournamentId,
m_teamId
)
);
}
else
{
if (m_subscriptionErrorHandler != nullptr)
{
m_subscriptionErrorHandler(
xbox::services::real_time_activity::real_time_activity_subscription_error_event_args(
*this,
xbox_live_error_code::json_error,
"JSON not found on subscription"
)
);
}
}
}
void
team_change_subscription::on_event_received(
_In_ const web::json::value& data
)
{
team_change_event_args teamChangeEventArgs;
if (m_teamChangeHandler)
{
m_teamChangeHandler(
team_change_event_args(
m_organizerId,
m_tournamentId,
m_teamId
)
);
}
else
{
if (m_subscriptionErrorHandler != nullptr)
{
m_subscriptionErrorHandler(
xbox::services::real_time_activity::real_time_activity_subscription_error_event_args(
*this,
xbox_live_error_code::json_error,
"JSON not found on change event"
)
);
}
}
}
const string_t&
team_change_subscription::organizer_id() const
{
return m_organizerId;
}
const string_t&
team_change_subscription::tournament_id() const
{
return m_tournamentId;
}
const string_t&
team_change_subscription::team_id() const
{
return m_teamId;
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_CPP_END

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

@ -18,12 +18,14 @@ team_request_result::team_request_result()
void team_request_result::_Init_next_page_info(
_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::services::xbox_live_app_config> appConfig,
_In_ std::shared_ptr<xbox::services::real_time_activity::real_time_activity_service> rtaService
)
{
m_userContext = std::move(userContext);
m_xboxLiveContextSettings = std::move(xboxLiveContextSettings);
m_appConfig = std::move(appConfig);
m_realTimeActivityService = std::move(rtaService);
}
const std::vector<team_info>&
@ -50,7 +52,8 @@ team_request_result::get_next()
return tournament_service(
m_userContext,
m_xboxLiveContextSettings,
m_appConfig
m_appConfig,
m_realTimeActivityService
)._Get_teams(m_nextLinkUrl);
}

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

@ -18,12 +18,14 @@ tournament_request_result::tournament_request_result()
void tournament_request_result::_Init_next_page_info(
_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::services::xbox_live_app_config> appConfig,
_In_ std::shared_ptr<xbox::services::real_time_activity::real_time_activity_service> rtaService
)
{
m_userContext = std::move(userContext);
m_xboxLiveContextSettings = std::move(xboxLiveContextSettings);
m_appConfig = std::move(appConfig);
m_realTimeActivityService = std::move(rtaService);
}
const std::vector<tournament>&
@ -50,7 +52,8 @@ tournament_request_result::get_next()
return tournament_service(
m_userContext,
m_xboxLiveContextSettings,
m_appConfig
m_appConfig,
m_realTimeActivityService
)._Get_tournaments(m_nextLinkUrl);
}

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

@ -6,6 +6,7 @@
#include "xbox_system_factory.h"
#include "utils.h"
#include "user_context.h"
#include "tournament_service_internal.h"
using namespace pplx;
using namespace xbox::services::system;
@ -22,11 +23,14 @@ tournament_service::tournament_service()
tournament_service::tournament_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::services::xbox_live_app_config> appConfig,
_In_ std::shared_ptr<xbox::services::real_time_activity::real_time_activity_service> rtaService
) :
m_userContext(std::move(userContext)),
m_xboxLiveContextSettings(std::move(xboxLiveContextSettings)),
m_appConfig(std::move(appConfig))
m_appConfig(std::move(appConfig)),
m_realTimeActivityService(rtaService),
m_tournamentServiceImpl(std::make_shared<tournament_service_impl>(rtaService))
{
}
@ -68,9 +72,10 @@ tournament_service::get_tournaments_internal(
auto userContext = m_userContext;
auto xboxLiveContextSettings = m_xboxLiveContextSettings;
auto appConfig = m_appConfig;
auto rtaService = m_realTimeActivityService;
auto task = httpCall->get_response_with_auth(m_userContext)
.then([userContext, xboxLiveContextSettings, appConfig](std::shared_ptr<http_call_response> response)
.then([userContext, xboxLiveContextSettings, appConfig, rtaService](std::shared_ptr<http_call_response> response)
{
if (response->response_body_json().size() > 0)
{
@ -84,8 +89,9 @@ tournament_service::get_tournaments_internal(
tournamentResult._Init_next_page_info(
userContext,
xboxLiveContextSettings,
appConfig
);
appConfig,
rtaService
);
return result;
}
@ -181,9 +187,10 @@ tournament_service::get_teams_internal(
auto userContext = m_userContext;
auto xboxLiveContextSettings = m_xboxLiveContextSettings;
auto appConfig = m_appConfig;
auto rtaService = m_realTimeActivityService;
auto task = httpCall->get_response_with_auth(m_userContext)
.then([userContext, xboxLiveContextSettings, appConfig](std::shared_ptr<http_call_response> response)
.then([userContext, xboxLiveContextSettings, appConfig, rtaService](std::shared_ptr<http_call_response> response)
{
if (response->response_body_json().size() > 0)
{
@ -197,7 +204,8 @@ tournament_service::get_teams_internal(
teamResult._Init_next_page_info(
userContext,
xboxLiveContextSettings,
appConfig
appConfig,
rtaService
);
return result;
@ -216,7 +224,7 @@ tournament_service::get_team_details(
_In_ const string_t& organizerId,
_In_ const string_t& tournamentId,
_In_ const string_t& teamId
)
)
{
RETURN_TASK_CPP_INVALIDARGUMENT_IF(organizerId.empty(), team_info, "organizer id is empty");
RETURN_TASK_CPP_INVALIDARGUMENT_IF(tournamentId.empty(), team_info, "tournament id is empty");
@ -492,4 +500,46 @@ tournament_service::_Convert_string_to_team_state(
return xbox::services::tournaments::team_state::unknown;
}
function_context
tournament_service::add_team_changed_handler(
_In_ std::function<void(team_change_event_args)> handler
)
{
return m_tournamentServiceImpl->add_team_changed_handler(
std::move(handler)
);
}
void
tournament_service::remove_team_changed_handler(
_In_ function_context context
)
{
return m_tournamentServiceImpl->remove_team_changed_handler(
context
);
}
xbox_live_result<std::shared_ptr<team_change_subscription>>
tournament_service::subscribe_to_team_change(
_In_ const string_t& organizerId,
_In_ const string_t& tournamentId,
_In_ const string_t& teamId
)
{
return m_tournamentServiceImpl->subscribe_to_team_change(
organizerId,
tournamentId,
teamId
);
}
xbox_live_result<void>
tournament_service::unsubscribe_from_team_change(
_In_ std::shared_ptr<team_change_subscription> subscription
)
{
return m_tournamentServiceImpl->unsubscribe_from_team_change(subscription);
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_CPP_END

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

@ -0,0 +1,128 @@
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pch.h"
#include "xsapi/tournaments.h"
#include "tournament_service_internal.h"
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_CPP_BEGIN
tournament_service_impl::tournament_service_impl(
_In_ std::shared_ptr<xbox::services::real_time_activity::real_time_activity_service> rtaService
) :
m_realTimeActivityService(rtaService),
m_teamChangeHandlerCounter(0)
{
}
tournament_service_impl::~tournament_service_impl()
{
m_teamChangeHandler.clear();
}
function_context
tournament_service_impl::add_team_changed_handler(
_In_ std::function<void(const team_change_event_args&)> handler
)
{
std::lock_guard<std::mutex> lock(m_teamHandlerLock.get());
function_context context = -1;
if (handler != nullptr)
{
context = ++m_teamChangeHandlerCounter;
m_teamChangeHandler[m_teamChangeHandlerCounter] = std::move(handler);
}
return context;
}
void
tournament_service_impl::remove_team_changed_handler(
_In_ function_context context
)
{
std::lock_guard<std::mutex> lock(m_teamHandlerLock.get());
m_teamChangeHandler.erase(context);
}
void
tournament_service_impl::team_changed(
_In_ const team_change_event_args& eventArgs
)
{
std::unordered_map<function_context, std::function<void(const team_change_event_args&)>> teamChangeHandlerCopy;
{
std::lock_guard<std::mutex> lock(m_teamHandlerLock.get());
teamChangeHandlerCopy = m_teamChangeHandler;
}
for (auto& handler : teamChangeHandlerCopy)
{
XSAPI_ASSERT(handler.second != nullptr);
if (handler.second != nullptr)
{
try
{
handler.second(eventArgs);
}
catch (...)
{
LOG_ERROR("team_changed handler threw an exception");
}
}
}
}
xbox_live_result<std::shared_ptr<team_change_subscription>>
tournament_service_impl::subscribe_to_team_change(
_In_ const string_t& organizerId,
_In_ const string_t& tournamentId,
_In_ const string_t& teamId
)
{
std::weak_ptr<tournament_service_impl> thisWeakPtr = shared_from_this();
std::shared_ptr<team_change_subscription> statChangeSub = std::make_shared<team_change_subscription>(
organizerId,
tournamentId,
teamId,
([thisWeakPtr](const team_change_event_args& eventArgs)
{
std::shared_ptr<tournament_service_impl> pThis(thisWeakPtr.lock());
if (pThis != nullptr)
{
pThis->team_changed(eventArgs);
}
}),
([thisWeakPtr](const xbox::services::real_time_activity::real_time_activity_subscription_error_event_args& eventArgs)
{
std::shared_ptr<tournament_service_impl> pThis(thisWeakPtr.lock());
if (pThis != nullptr)
{
pThis->m_realTimeActivityService->_Trigger_subscription_error(eventArgs);
}
})
);
auto subscriptionSucceeded = m_realTimeActivityService->_Add_subscription(
statChangeSub
);
if (!subscriptionSucceeded.err())
{
return xbox_live_result<std::shared_ptr<team_change_subscription>>(statChangeSub);
}
return xbox_live_result<std::shared_ptr<team_change_subscription>>(subscriptionSucceeded.err(), subscriptionSucceeded.err_message());
}
xbox_live_result<void>
tournament_service_impl::unsubscribe_from_team_change(
_In_ std::shared_ptr<team_change_subscription> subscription
)
{
return m_realTimeActivityService->_Remove_subscription(subscription);
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_CPP_END

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

@ -0,0 +1,40 @@
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#pragma once
#include "system_internal.h"
namespace xbox { namespace services { namespace tournaments {
class tournament_service_impl : public std::enable_shared_from_this<tournament_service_impl>
{
public:
tournament_service_impl(
_In_ std::shared_ptr<xbox::services::real_time_activity::real_time_activity_service> rtaService
);
~tournament_service_impl();
xbox_live_result<std::shared_ptr<team_change_subscription>> subscribe_to_team_change(
_In_ const string_t& organizerId,
_In_ const string_t& tournamentId,
_In_ const string_t& teamId
);
xbox_live_result<void> unsubscribe_from_team_change(
_In_ std::shared_ptr<team_change_subscription> subscription
);
function_context add_team_changed_handler(_In_ std::function<void(const team_change_event_args&)> handler);
void remove_team_changed_handler(_In_ function_context context);
private:
void team_changed(_In_ const team_change_event_args& eventArgs);
xbox::services::system::xbox_live_mutex m_teamHandlerLock;
std::shared_ptr<xbox::services::real_time_activity::real_time_activity_service> m_realTimeActivityService;
std::unordered_map<function_context, std::function<void(const team_change_event_args&)>> m_teamChangeHandler;
function_context m_teamChangeHandlerCounter;
};
}}}

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

@ -128,6 +128,7 @@ private:
// Tournament Methods
void GetTournaments();
void GetTeams();
void TestTeamRTASubscription(string_t teamId);
// Device resources.
std::unique_ptr<DX::DeviceResources> m_deviceResources;
@ -169,6 +170,7 @@ private:
string_t m_organizerId;
string_t m_tournamentId;
string_t m_teamId;
std::shared_ptr<xbox::services::tournaments::team_change_subscription> m_teamSubscription;
void ChangeAppStates();
string_t CreateGuid();

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

@ -94,11 +94,9 @@ void Sample::GetTeams()
{
auto& teamResult = result.payload();
// For testing, assign the first team as the locally cached team.
for (const auto& team : teamResult.teams())
{
m_teamId = team.id();
break;
TestTeamRTASubscription(team.id());
}
// Get next page until the end
@ -136,4 +134,32 @@ void Sample::GetTeams()
}
}
});
}
void Sample::TestTeamRTASubscription(string_t teamId)
{
auto context = m_liveResources->GetLiveContext();
context->real_time_activity_service()->activate();
auto teamChangeContext = context->tournament_service().add_team_changed_handler(
[this, context](team_change_event_args args)
{
auto orgId = args.organizer_id();
}
);
auto teamResults = context->tournament_service().subscribe_to_team_change(
m_organizerId,
m_tournamentId,
teamId
);
if (!teamResults.err())
{
m_teamSubscription = teamResults.payload();
}
else
{
LogErrorFormat(L"Error calling subscribe_to_team_change:: %S\n", teamResults.err_message().c_str());
}
}