Adding Team APIs (Cpp & WinRT)

* Adding Team APIs
* Adding Team API files to all XSAPI projects.
This commit is contained in:
Aditya Toney 2017-03-17 22:56:15 -07:00 коммит произвёл GitHub
Родитель 4269a7aba3
Коммит 9ca7a69d29
54 изменённых файлов: 2130 добавлений и 192 удалений

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

@ -238,6 +238,12 @@
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_request_result.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_service.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_team_result.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" />
<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\Shared\call_buffer_timer.cpp" />
<ClCompile Include="..\..\Source\Shared\initiator.cpp" />
<ClCompile Include="..\..\Source\Shared\local_config.cpp" />

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

@ -648,6 +648,24 @@
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_request_result.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_info.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_request.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_request_result.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\match_metadata.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\current_match_metadata.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\previous_match_metadata.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>

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

@ -386,12 +386,24 @@
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_request_result.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_service.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_team_result.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" />
<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\WinRT\TournamentReference_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TournamentRequestResult_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TournamentRequest_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TournamentService_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TournamentTeamResult_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\Tournament_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\MatchMetadata_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\CurrentMatchMetadata_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\PreviousMatchMetadata_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamRequest_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamRequestResult_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamInfo_WinRT.cpp" />
<ClCompile Include="..\..\Source\Shared\call_buffer_timer.cpp" />
<ClCompile Include="..\..\Source\Shared\errors.cpp" />
<ClCompile Include="..\..\Source\Shared\http_call_impl.cpp" />
@ -708,6 +720,14 @@
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TournamentState_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TournamentTeamResult_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\Tournament_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\MatchMetadata_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\CurrentMatchMetadata_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\PreviousMatchMetadata_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamCompletedReason_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamOrderBy_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamRequest_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamRequestResult_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamInfo_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" />

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

@ -1164,6 +1164,24 @@
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_service.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_info.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_request.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_request_result.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\match_metadata.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\current_match_metadata.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\previous_match_metadata.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\Tournament_WinRT.cpp">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClCompile>
@ -1176,6 +1194,24 @@
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TournamentService_WinRT.cpp">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\MatchMetadata_WinRT.cpp">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\CurrentMatchMetadata_WinRT.cpp">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\PreviousMatchMetadata_WinRT.cpp">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamRequest_WinRT.cpp">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamRequestResult_WinRT.cpp">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamInfo_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>
@ -2135,6 +2171,30 @@
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamState_WinRT.h">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\MatchMetadata_WinRT.h">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\CurrentMatchMetadata_WinRT.h">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\PreviousMatchMetadata_WinRT.h">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamCompletedReason_WinRT.h">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamOrderBy_WinRT.h">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamRequest_WinRT.h">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamRequestResult_WinRT.h">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamInfo_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>

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

@ -315,6 +315,12 @@
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_request_result.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_service.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_team_result.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" />
<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\Shared\call_buffer_timer.cpp" />
<ClCompile Include="..\..\Source\Shared\errors.cpp" />
<ClCompile Include="..\..\Source\Shared\http_call_request_message.cpp" />

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

@ -738,6 +738,24 @@
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_request_result.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_info.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_request.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_request_result.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\match_metadata.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\current_match_metadata.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\previous_match_metadata.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Shared\http_call_response.h">

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

@ -452,12 +452,24 @@
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_request_result.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_service.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_team_result.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" />
<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\WinRT\TournamentReference_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TournamentRequestResult_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TournamentRequest_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TournamentService_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TournamentTeamResult_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\Tournament_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\MatchMetadata_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\CurrentMatchMetadata_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\PreviousMatchMetadata_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamRequest_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamRequestResult_WinRT.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamInfo_WinRT.cpp" />
<ClCompile Include="..\..\Source\Shared\call_buffer_timer.cpp" />
<ClCompile Include="..\..\Source\Shared\errors.cpp" />
<ClCompile Include="..\..\Source\Shared\http_call_impl.cpp" />
@ -767,6 +779,14 @@
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TournamentState_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TournamentTeamResult_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\Tournament_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\MatchMetadata_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\CurrentMatchMetadata_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\PreviousMatchMetadata_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamCompletedReason_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamOrderBy_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamRequest_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamRequestResult_WinRT.h" />
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamInfo_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" />

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

@ -1254,6 +1254,24 @@
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_service.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_info.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_request.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_request_result.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\match_metadata.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\current_match_metadata.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\previous_match_metadata.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\Tournament_WinRT.cpp">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClCompile>
@ -1266,6 +1284,24 @@
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TournamentService_WinRT.cpp">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\MatchMetadata_WinRT.cpp">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\CurrentMatchMetadata_WinRT.cpp">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\PreviousMatchMetadata_WinRT.cpp">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamRequest_WinRT.cpp">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamRequestResult_WinRT.cpp">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\WinRT\TeamInfo_WinRT.cpp">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\Source\Shared\WinRT\Macros_WinRT.h">
@ -2189,5 +2225,29 @@
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamState_WinRT.h">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\MatchMetadata_WinRT.h">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\CurrentMatchMetadata_WinRT.h">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\PreviousMatchMetadata_WinRT.h">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamCompletedReason_WinRT.h">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamOrderBy_WinRT.h">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamRequest_WinRT.h">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamRequestResult_WinRT.h">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\Services\Tournaments\WinRT\TeamInfo_WinRT.h">
<Filter>C++ Source\Tournaments\WinRT</Filter>
</ClInclude>
</ItemGroup>
</Project>

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

@ -238,6 +238,12 @@
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_request_result.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_service.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_team_result.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" />
<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\Shared\call_buffer_timer.cpp" />
<ClCompile Include="..\..\Source\Shared\initiator.cpp" />
<ClCompile Include="..\..\Source\Shared\local_config.cpp" />

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

@ -663,6 +663,24 @@
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_team_result.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_info.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_request.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_request_result.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\match_metadata.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\current_match_metadata.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\previous_match_metadata.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>

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

@ -238,6 +238,12 @@
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_request_result.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_service.cpp" />
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_team_result.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" />
<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\Shared\call_buffer_timer.cpp" />
<ClCompile Include="..\..\Source\Shared\initiator.cpp" />
<ClCompile Include="..\..\Source\Shared\local_config.cpp" />

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

@ -663,6 +663,24 @@
<ClCompile Include="..\..\Source\Services\Tournaments\tournament_request_result.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_info.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_request.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\team_request_result.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\match_metadata.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\current_match_metadata.cpp">
<Filter>C++ Source\Tournaments</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\Services\Tournaments\previous_match_metadata.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>

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

@ -297,6 +297,14 @@
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TournamentState_WinRT.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TournamentTeamResult_WinRT.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\Tournament_WinRT.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\MatchMetadata_WinRT.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\CurrentMatchMetadata_WinRT.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\PreviousMatchMetadata_WinRT.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TeamCompletedReason_WinRT.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TeamOrderBy_WinRT.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TeamRequest_WinRT.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TeamRequestResult_WinRT.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TeamInfo_WinRT.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Shared\build_version.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Shared\call_buffer_timer.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Shared\http_call_impl.h" />
@ -687,12 +695,24 @@
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\tournament_request_result.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\tournament_service.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\tournament_team_result.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\team_info.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\team_request.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\team_request_result.cpp" />
<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\WinRT\TournamentReference_WinRT.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TournamentRequestResult_WinRT.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TournamentRequest_WinRT.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TournamentService_WinRT.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TournamentTeamResult_WinRT.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\Tournament_WinRT.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\MatchMetadata_WinRT.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\CurrentMatchMetadata_WinRT.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\PreviousMatchMetadata_WinRT.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TeamRequest_WinRT.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TeamRequestResult_WinRT.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TeamInfo_WinRT.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Shared\call_buffer_timer.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Shared\errors.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Shared\http_call_impl.cpp" />

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

@ -964,6 +964,30 @@
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TournamentState_WinRT.h">
<Filter>XSAPI\Services\Touraments\WinRT</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\MatchMetadata_WinRT.h">
<Filter>XSAPI\Services\Touraments\WinRT</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\CurrentMatchMetadata_WinRT.h">
<Filter>XSAPI\Services\Touraments\WinRT</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\PreviousMatchMetadata_WinRT.h">
<Filter>XSAPI\Services\Touraments\WinRT</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TeamCompletedReason_WinRT.h">
<Filter>XSAPI\Services\Touraments\WinRT</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TeamOrderBy_WinRT.h">
<Filter>XSAPI\Services\Touraments\WinRT</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TeamRequest_WinRT.h">
<Filter>XSAPI\Services\Touraments\WinRT</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TeamRequestResult_WinRT.h">
<Filter>XSAPI\Services\Touraments\WinRT</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TeamInfo_WinRT.h">
<Filter>XSAPI\Services\Touraments\WinRT</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="XSAPI">
@ -2303,6 +2327,24 @@
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\tournament_service.cpp">
<Filter>XSAPI\Services\Touraments</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\team_info.cpp">
<Filter>XSAPI\Services\Touraments</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\team_request.cpp">
<Filter>XSAPI\Services\Touraments</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\team_request_result.cpp">
<Filter>XSAPI\Services\Touraments</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\match_metadata.cpp">
<Filter>XSAPI\Services\Touraments</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\current_match_metadata.cpp">
<Filter>XSAPI\Services\Touraments</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\previous_match_metadata.cpp">
<Filter>XSAPI\Services\Touraments</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\Tournament_WinRT.cpp">
<Filter>XSAPI\Services\Touraments\WinRT</Filter>
</ClCompile>
@ -2315,5 +2357,23 @@
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TournamentService_WinRT.cpp">
<Filter>XSAPI\Services\Touraments\WinRT</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\MatchMetadata_WinRT.cpp">
<Filter>XSAPI\Services\Touraments\WinRT</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\CurrentMatchMetadata_WinRT.cpp">
<Filter>XSAPI\Services\Touraments\WinRT</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\PreviousMatchMetadata_WinRT.cpp">
<Filter>XSAPI\Services\Touraments\WinRT</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TeamRequest_WinRT.cpp">
<Filter>XSAPI\Services\Touraments\WinRT</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TeamRequestResult_WinRT.cpp">
<Filter>XSAPI\Services\Touraments\WinRT</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Tournaments\WinRT\TeamInfo_WinRT.cpp">
<Filter>XSAPI\Services\Touraments\WinRT</Filter>
</ClCompile>
</ItemGroup>
</Project>

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

@ -1,12 +1,6 @@
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#pragma once
#include "xsapi/multiplayer.h"
@ -159,7 +153,7 @@ enum class team_completed_reason
};
/// <summary>
///
/// The property used to order results by for retrieving a list of teams.
/// </summary>
enum class team_order_by
{
@ -233,7 +227,7 @@ public:
_XSAPIIMP const xbox::services::multiplayer::multiplayer_session_reference& game_session_reference() const;
/// <summary>
///
/// Metadata associated with the team's current or upcoming match.
/// </summary>
_XSAPIIMP const match_metadata& match_details() const;
@ -260,7 +254,7 @@ class previous_match_metadata
public:
/// <summary>
/// The last game's result for the tournament.
/// Previous game's result for the tournament.
/// </summary>
_XSAPIIMP xbox::services::tournaments::tournament_team_result result() const;
@ -270,7 +264,7 @@ public:
_XSAPIIMP const utility::datetime& match_end_time() const;
/// <summary>
///
/// Metadata associated with the team's previously played match.
/// </summary>
_XSAPIIMP const match_metadata& match_details() const;
@ -323,6 +317,16 @@ public:
/// <param name="orderBy">The field used to order results.</param>
_XSAPIIMP void set_order_by(_In_ team_order_by orderBy);
/// <summary>
/// Internal function
/// </summary>
_XSAPIIMP const string_t& _Organizer_id() const;
/// <summary>
/// Internal function
/// </summary>
_XSAPIIMP const string_t& _Tournament_id() const;
/// <summary>
/// Internal function
/// </summary>
@ -358,7 +362,7 @@ public:
_XSAPIIMP const string_t& id() const;
/// <summary>
/// he display name of the team
/// The display name of the team
/// </summary>
_XSAPIIMP const string_t& name() const;
@ -372,6 +376,11 @@ public:
/// </summary>
_XSAPIIMP const utility::datetime& registration_date() const;
/// <summary>
/// A formatted string that describes the team's standing in the tournament. For example '1W - 0L'.
/// </summary>
_XSAPIIMP const string_t& standing() const;
/// <summary>
/// The state of the team.
/// </summary>
@ -413,6 +422,7 @@ private:
string_t m_teamId;
string_t m_teamName;
string_t m_standing;
std::vector<string_t> m_memberXuids;
utility::datetime m_registrationDate;
team_state m_state;
@ -913,13 +923,23 @@ public:
private:
pplx::task<xbox::services::xbox_live_result<tournament_request_result>> get_tournaments_internal(_In_ const string_t& subPath);
pplx::task<xbox::services::xbox_live_result<tournament_request_result>> get_tournaments_internal(
_In_ const string_t& subPath
);
pplx::task<xbox::services::xbox_live_result<team_request_result>> get_teams_internal(
_In_ const string_t& subPath
);
string_t tournament_sub_path_url(_In_ tournament_request getTournamentsRequest);
string_t team_sub_path_url(_In_ team_request getTeamRequest);
string_t convert_state_to_string(_In_ tournament_state state);
string_t convert_sort_order_to_string(_In_ tournament_sort_order order);
string_t convert_order_by_to_string(_In_ tournament_order_by order);
string_t convert_tournament_state_to_string(_In_ tournament_state state);
string_t convert_tournament_sort_order_to_string(_In_ tournament_sort_order order);
string_t convert_tournament_order_by_to_string(_In_ tournament_order_by order);
string_t convert_team_state_to_string(_In_ team_state state);
string_t convert_team_order_by_to_string(_In_ team_order_by order);
std::shared_ptr<xbox::services::user_context> m_userContext;
std::shared_ptr<xbox::services::xbox_live_context_settings> m_xboxLiveContextSettings;

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

@ -0,0 +1,40 @@
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pch.h"
#include "CurrentMatchMetadata_WinRT.h"
using namespace concurrency;
using namespace Windows::Foundation;
using namespace Microsoft::Xbox::Services::Multiplayer;
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_BEGIN
CurrentMatchMetadata::CurrentMatchMetadata(
_In_ xbox::services::tournaments::current_match_metadata cppObj
) :
m_cppObj(std::move(cppObj))
{
m_gameSessionReference = ref new MultiplayerSessionReference(m_cppObj.game_session_reference());
m_matchDetails = ref new MatchMetadata(m_cppObj.match_details());
}
const xbox::services::tournaments::current_match_metadata&
CurrentMatchMetadata::GetCppObj() const
{
return m_cppObj;
}
MultiplayerSessionReference^
CurrentMatchMetadata::GameSessionReference::get()
{
return m_gameSessionReference;
}
MatchMetadata^
CurrentMatchMetadata::MatchDetails::get()
{
return m_matchDetails;
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_END

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

@ -0,0 +1,44 @@
// 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 "MultiplayerSessionReference_WinRT.h"
#include "MatchMetadata_WinRT.h"
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_BEGIN
/// <summary>
/// Represents a reference to a multiplayer session.
/// </summary>
public ref class CurrentMatchMetadata sealed
{
public:
/// <summary>
/// The uniquely identifying information for the game session.
/// </summary>
property Microsoft::Xbox::Services::Multiplayer::MultiplayerSessionReference^ GameSessionReference
{
Microsoft::Xbox::Services::Multiplayer::MultiplayerSessionReference^ get();
}
/// <summary>
/// Metadata associated with the team's current or upcoming match.
/// </summary>
property MatchMetadata^ MatchDetails { MatchMetadata^ get(); }
internal:
CurrentMatchMetadata(
_In_ xbox::services::tournaments::current_match_metadata cppObj
);
const xbox::services::tournaments::current_match_metadata& GetCppObj() const;
private:
xbox::services::tournaments::current_match_metadata m_cppObj;
Microsoft::Xbox::Services::Multiplayer::MultiplayerSessionReference^ m_gameSessionReference;
MatchMetadata^ m_matchDetails;
};
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_END

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

@ -0,0 +1,35 @@
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pch.h"
#include "MatchMetadata_WinRT.h"
#include "Utils_WinRT.h"
using namespace concurrency;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Microsoft::Xbox::Services::System;
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_BEGIN
MatchMetadata::MatchMetadata(
_In_ xbox::services::tournaments::match_metadata cppObj
) :
m_cppObj(std::move(cppObj))
{
m_teamIds = UtilsWinRT::CreatePlatformVectorFromStdVectorString(m_cppObj.opposing_team_ids())->GetView();
}
const xbox::services::tournaments::match_metadata&
MatchMetadata::GetCppObj() const
{
return m_cppObj;
}
IVectorView<Platform::String^>^
MatchMetadata::OpposingTeamIds::get()
{
return m_teamIds;
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_END

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

@ -0,0 +1,52 @@
// 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"
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_BEGIN
/// <summary>
/// Represents a reference to a multiplayer session.
/// </summary>
public ref class MatchMetadata sealed
{
public:
/// <summary>
/// A formatted string that describes the team's standing in the tournament. For example '1W - 0L'.
/// References a format string and provides values for the substitution tokens.
/// </summary>
DEFINE_PROP_GET_STR_OBJ(Label, label);
/// <summary>
/// The time this match is scheduled to start.
/// </summary>
DEFINE_PROP_GET_DATETIME_OBJ(StartTIme, start_time);
/// <summary>
/// True if the match is a bye which means that the opposing team does not play.
/// </summary>
DEFINE_PROP_GET_OBJ(IsBye, is_bye, bool);
/// <summary>
/// The team IDs of all the opposing teams. This should be absent if bye is true.
/// </summary>
property Windows::Foundation::Collections::IVectorView<Platform::String^>^ OpposingTeamIds
{
Windows::Foundation::Collections::IVectorView<Platform::String^>^ get();
}
internal:
MatchMetadata(
_In_ xbox::services::tournaments::match_metadata cppObj
);
const xbox::services::tournaments::match_metadata& GetCppObj() const;
private:
xbox::services::tournaments::match_metadata m_cppObj;
Windows::Foundation::Collections::IVectorView<Platform::String^>^ m_teamIds;
};
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_END

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

@ -0,0 +1,43 @@
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pch.h"
#include "PreviousMatchMetadata_WinRT.h"
using namespace concurrency;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace xbox::services;
using namespace xbox::services::tournaments;
using namespace Microsoft::Xbox::Services::System;
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_BEGIN
PreviousMatchMetadata::PreviousMatchMetadata(
_In_ xbox::services::tournaments::previous_match_metadata cppObj
) :
m_cppObj(std::move(cppObj))
{
m_result = ref new TournamentTeamResult(m_cppObj.result());
m_matchDetails = ref new MatchMetadata(m_cppObj.match_details());
}
const xbox::services::tournaments::previous_match_metadata&
PreviousMatchMetadata::GetCppObj() const
{
return m_cppObj;
}
TournamentTeamResult^
PreviousMatchMetadata::Result::get()
{
return m_result;
}
MatchMetadata^
PreviousMatchMetadata::MatchDetails::get()
{
return m_matchDetails;
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_END

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

@ -0,0 +1,49 @@
// 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 "MatchMetadata_WinRT.h"
#include "TournamentTeamResult_WinRT.h"
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_BEGIN
/// <summary>
/// Represents a reference to a multiplayer session.
/// </summary>
public ref class PreviousMatchMetadata sealed
{
public:
/// <summary>
/// Previous game's result for the tournament.
/// </summary>
property Microsoft::Xbox::Services::Tournaments::TournamentTeamResult^ Result
{
Microsoft::Xbox::Services::Tournaments::TournamentTeamResult^ get();
}
/// <summary>
/// The timestamp when the match ended.
/// </summary>
DEFINE_PROP_GET_DATETIME_OBJ(MatchEndTime, match_end_time);
/// <summary>
/// Metadata associated with the team's previously played match.
/// </summary>
property MatchMetadata^ MatchDetails { MatchMetadata^ get(); }
internal:
PreviousMatchMetadata(
_In_ xbox::services::tournaments::previous_match_metadata cppObj
);
const xbox::services::tournaments::previous_match_metadata& GetCppObj() const;
private:
xbox::services::tournaments::previous_match_metadata m_cppObj;
MatchMetadata^ m_matchDetails;
Microsoft::Xbox::Services::Tournaments::TournamentTeamResult^ m_result;
};
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_END

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

@ -0,0 +1,35 @@
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#pragma once
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_BEGIN
/// <summary>
///
/// </summary>
public enum class TeamCompletedReason
{
/// <summary>
/// The team was rejected.
/// </summary>
Rejected = xbox::services::tournaments::team_completed_reason::rejected,
/// <summary>
/// The team was eliminated.
/// </summary>
Eliminated = xbox::services::tournaments::team_completed_reason::eliminated,
/// <summary>
/// The team was evicted.
/// </summary>
Evicted = xbox::services::tournaments::team_completed_reason::evicted,
/// <summary>
/// The team has successfully completed the tournament.
/// </summary>
Completed = xbox::services::tournaments::team_completed_reason::completed
};
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_END

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

@ -0,0 +1,48 @@
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pch.h"
#include "TeamInfo_WinRT.h"
#include "Utils_WinRT.h"
using namespace Microsoft::Xbox::Services::Tournaments;
using namespace Microsoft::Xbox::Services::System;
using namespace Windows::Foundation::Collections;
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_BEGIN
TeamInfo::TeamInfo(
_In_ xbox::services::tournaments::team_info cppObj
) :
m_cppObj(std::move(cppObj))
{
m_currentMatchMetadata = ref new Microsoft::Xbox::Services::Tournaments::CurrentMatchMetadata(m_cppObj.current_match_metadata());
m_previousMatchMetadata = ref new Microsoft::Xbox::Services::Tournaments::PreviousMatchMetadata(m_cppObj.previous_match_metadata());
m_memberXboxUserIds = UtilsWinRT::CreatePlatformVectorFromStdVectorString(m_cppObj.member_xbox_user_ids())->GetView();
}
IVectorView<Platform::String^>^
TeamInfo::MemberXboxUserIds::get()
{
return m_memberXboxUserIds;
}
const xbox::services::tournaments::team_info&
TeamInfo::GetCppObj() const
{
return m_cppObj;
}
CurrentMatchMetadata^
TeamInfo::CurrentMatchMetadata::get()
{
return m_currentMatchMetadata;
}
PreviousMatchMetadata^
TeamInfo::PreviousMatchMetadata::get()
{
return m_previousMatchMetadata;
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_END

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

@ -0,0 +1,92 @@
// 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 "TeamState_WinRT.h"
#include "TeamCompletedReason_WinRT.h"
#include "CurrentMatchMetadata_WinRT.h"
#include "PreviousMatchMetadata_WinRT.h"
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_BEGIN
/// <summary>
/// Represents
/// </summary>
public ref class TeamInfo sealed
{
public:
/// <summary>
/// The ID of the team. It is an opaque string specified by the tournament organizer.
/// </summary>
DEFINE_PROP_GET_STR_OBJ(Id, id);
/// <summary>
/// The display name of the team
/// </summary>
DEFINE_PROP_GET_STR_OBJ(Name, name);
/// <summary>
/// Member xbox_user_ids for this team.
/// </summary>
property Windows::Foundation::Collections::IVectorView<Platform::String^>^ MemberXboxUserIds
{
Windows::Foundation::Collections::IVectorView<Platform::String^>^ get();
}
/// <summary>
/// The timestamp at which the team was registered. Used to determine ordering if team is waitlisted.
/// </summary>
DEFINE_PROP_GET_DATETIME_OBJ(RegistrationDate, registration_date);
/// <summary>
/// A formatted string that describes the team's standing in the tournament. For example '1W - 0L'.
/// </summary>
DEFINE_PROP_GET_STR_OBJ(Standing, standing);
/// <summary>
/// The state of the team.
/// </summary>
DEFINE_PROP_GET_ENUM_OBJ(TeamState, state, Microsoft::Xbox::Services::Tournaments::TeamState);
/// <summary>
/// The reason the team is in the Completed state.
/// </summary>
DEFINE_PROP_GET_ENUM_OBJ(CompletedReason, completed_reason, Microsoft::Xbox::Services::Tournaments::TeamCompletedReason);
/// <summary>
/// The team's final rank within the tournament, if it is available. If missing, the rank is not available.
/// </summary>
DEFINE_PROP_GET_OBJ(Ranking, ranking, uint64);
/// <summary>
/// Information about the team's current or upcoming match. Absent if the team does not have an current or upcoming match.
/// </summary>
property Microsoft::Xbox::Services::Tournaments::CurrentMatchMetadata^ CurrentMatchMetadata
{
Microsoft::Xbox::Services::Tournaments::CurrentMatchMetadata^ get();
}
/// <summary>
/// Information about the previously played match. Absent if the player has not played any matches.
/// </summary>
property Microsoft::Xbox::Services::Tournaments::PreviousMatchMetadata^ PreviousMatchMetadata
{
Microsoft::Xbox::Services::Tournaments::PreviousMatchMetadata^ get();
}
internal:
TeamInfo(
_In_ xbox::services::tournaments::team_info cppObj
);
const xbox::services::tournaments::team_info& GetCppObj() const;
private:
xbox::services::tournaments::team_info m_cppObj;
Microsoft::Xbox::Services::Tournaments::CurrentMatchMetadata^ m_currentMatchMetadata;
Microsoft::Xbox::Services::Tournaments::PreviousMatchMetadata^ m_previousMatchMetadata;
Windows::Foundation::Collections::IVectorView<Platform::String^>^ m_memberXboxUserIds;
};
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.
#pragma once
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_BEGIN
/// <summary>
/// The property used to order results by for retrieving a list of teams.
/// </summary>
public enum class TeamOrderBy
{
/// <summary>
/// No order provided.
/// </summary>
None = xbox::services::tournaments::team_order_by::none,
/// <summary>
/// Order by name.
/// </summary>
Name = xbox::services::tournaments::team_order_by::name,
/// <summary>
/// Order by ranking.
/// </summary>
Ranking = xbox::services::tournaments::team_order_by::ranking
};
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_END

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

@ -0,0 +1,49 @@
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pch.h"
#include "TeamRequestResult_WinRT.h"
using namespace concurrency;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace xbox::services;
using namespace xbox::services::tournaments;
using namespace Microsoft::Xbox::Services::System;
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_BEGIN
TeamRequestResult::TeamRequestResult(
_In_ xbox::services::tournaments::team_request_result cppObj
) :
m_cppObj(std::move(cppObj))
{
m_teams = UtilsWinRT::CreatePlatformVectorFromStdVectorObj<TeamInfo, team_info>(m_cppObj.teams())->GetView();
}
const xbox::services::tournaments::team_request_result&
TeamRequestResult::GetCppObj() const
{
return m_cppObj;
}
IVectorView<TeamInfo^>^
TeamRequestResult::Teams::get()
{
return m_teams;
}
IAsyncOperation<TeamRequestResult^>^
TeamRequestResult::GetNextAsync()
{
auto task = m_cppObj.get_next()
.then([](xbox_live_result<team_request_result> cppResult)
{
THROW_IF_ERR(cppResult);
return ref new TeamRequestResult(cppResult.payload());
});
return ASYNC_FROM_TASK(task);
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_END

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

@ -0,0 +1,51 @@
// 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 "TeamInfo_WinRT.h"
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_BEGIN
/// <summary>
/// Represents a collection of TeamInfo class objects returned by a request.
/// </summary>
public ref class TeamRequestResult sealed
{
public:
/// <summary>
/// A collection of TeamInfo objects returned by a request.
/// </summary>
property Windows::Foundation::Collections::IVectorView<TeamInfo^>^ Teams
{
Windows::Foundation::Collections::IVectorView<TeamInfo^>^ get();
}
/// <summary>
/// Returns a boolean value that indicates if there are more pages of teams to retrieve.
/// </summary>
/// <returns>True if there are more pages, otherwise false.</returns>
DEFINE_PROP_GET_OBJ(HasNext, has_next, bool);
/// <summary>
/// Returns an TeamRequestResult object that contains the next page of Tournament.
/// </summary>
/// <returns>An TeamRequestResult object that contains a list of tournament objects.</returns>
/// <remarks>
/// Returns a concurrency::task<T> object that represents the state of the asynchronous operation.
/// </remarks>
Windows::Foundation::IAsyncOperation<TeamRequestResult^>^ GetNextAsync();
internal:
TeamRequestResult(
_In_ xbox::services::tournaments::team_request_result cppObj
);
const xbox::services::tournaments::team_request_result& GetCppObj() const;
private:
xbox::services::tournaments::team_request_result m_cppObj;
Windows::Foundation::Collections::IVectorView<TeamInfo^>^ m_teams;
};
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_END

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

@ -0,0 +1,55 @@
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pch.h"
#include "TeamRequest_WinRT.h"
#include "Utils_WinRT.h"
using namespace xbox::services::tournaments;
using namespace Windows::Foundation::Collections;
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_BEGIN
TeamRequest::TeamRequest(
_In_ Platform::String^ organizerId,
_In_ Platform::String^ tournamentId
) :
m_cppObj(
STRING_T_FROM_PLATFORM_STRING(organizerId),
STRING_T_FROM_PLATFORM_STRING(tournamentId)
)
{
}
TeamRequest::TeamRequest(
_In_ xbox::services::tournaments::team_request cppObj
) :
m_cppObj(std::move(cppObj))
{
}
const xbox::services::tournaments::team_request&
TeamRequest::GetCppObj() const
{
return m_cppObj;
}
void
TeamRequest::StateFilter::set(
_In_ Windows::Foundation::Collections::IVectorView<TeamState>^ states
)
{
m_teamStates = std::move(states);
std::vector<team_state> teamStates;
if (m_teamStates != nullptr)
{
for (const auto& state : m_teamStates)
{
teamStates.push_back(static_cast<team_state>(state));
}
}
m_cppObj.set_state_filter(teamStates);
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_END

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

@ -0,0 +1,58 @@
// 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 "TournamentState_WinRT.h"
#include "TeamOrderBy_WinRT.h"
#include "TeamState_WinRT.h"
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_BEGIN
/// <summary>
/// Gets tournaments based on the configuration of this request.
/// </summary>
public ref class TeamRequest sealed
{
public:
/// <summary>Creates a team_request object.</summary>
/// <param name="organizerId">The ID of the tournament organizer.</param>
/// <param name="tournamentId">The ID of the tournament.</param>
TeamRequest(
_In_ Platform::String^ organizerId,
_In_ Platform::String^ tournamentId
);
/// <summary>
/// The maximum number of items to return.
/// </summary>
/// <param name="maxItems">The maximum number of items to return.</param>
DEFINE_PROP_SET_OBJ(MaxItems, max_items, uint32);
/// <summary>
/// Filter results based on the multiple states of the team.
/// </summary>
/// <param name="state">The team states to filter on.</param>
property Windows::Foundation::Collections::IVectorView<TeamState>^ StateFilter
{
void set(_In_ Windows::Foundation::Collections::IVectorView<TeamState>^ states);
}
/// <summary>
/// Filter results based on the order specified.
/// </summary>
/// <param name="orderBy">The field used to order results.</param>
DEFINE_PROP_SET_ENUM_OBJ(OrderBy, order_by, TeamOrderBy, xbox::services::tournaments::team_order_by);
internal:
TeamRequest(
_In_ xbox::services::tournaments::team_request cppObj
);
const xbox::services::tournaments::team_request& GetCppObj() const;
private:
xbox::services::tournaments::team_request m_cppObj;
Windows::Foundation::Collections::IVectorView<TeamState>^ m_teamStates;
};
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_END

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

@ -1,12 +1,6 @@
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#pragma once
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_BEGIN

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

@ -1,12 +1,6 @@
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#pragma once
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_BEGIN

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

@ -1,12 +1,6 @@
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pch.h"
#include "TournamentRequestResult_WinRT.h"
@ -24,7 +18,7 @@ TournamentRequestResult::TournamentRequestResult(
) :
m_cppObj(std::move(cppObj))
{
m_items = UtilsWinRT::CreatePlatformVectorFromStdVectorObj<Tournament, tournament>(m_cppObj.tournaments())->GetView();
m_tournaments = UtilsWinRT::CreatePlatformVectorFromStdVectorObj<Tournament, tournament>(m_cppObj.tournaments())->GetView();
}
const xbox::services::tournaments::tournament_request_result&
@ -34,9 +28,9 @@ TournamentRequestResult::GetCppObj() const
}
IVectorView<Tournament^>^
TournamentRequestResult::Items::get()
TournamentRequestResult::Tournaments::get()
{
return m_items;
return m_tournaments;
}
IAsyncOperation<TournamentRequestResult^>^

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

@ -1,12 +1,6 @@
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
// 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"
@ -14,7 +8,7 @@
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_BEGIN
/// <summary>
/// Represents a collection of tournament class objects returned by a request.
/// Represents a collection of Tournament class objects returned by a request.
/// </summary>
public ref class TournamentRequestResult sealed
{
@ -23,7 +17,7 @@ public:
/// <summary>
/// The collection of tournament objects returned by a request.
/// </summary>
property Windows::Foundation::Collections::IVectorView<Tournament^>^ Items
property Windows::Foundation::Collections::IVectorView<Tournament^>^ Tournaments
{
Windows::Foundation::Collections::IVectorView<Tournament^>^ get();
}
@ -51,7 +45,7 @@ internal:
const xbox::services::tournaments::tournament_request_result& GetCppObj() const;
private:
xbox::services::tournaments::tournament_request_result m_cppObj;
Windows::Foundation::Collections::IVectorView<Tournament^>^ m_items;
Windows::Foundation::Collections::IVectorView<Tournament^>^ m_tournaments;
};
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_END

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

@ -1,12 +1,6 @@
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pch.h"
#include "TournamentRequest_WinRT.h"
#include "Utils_WinRT.h"

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

@ -1,12 +1,6 @@
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
// 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 "TournamentState_WinRT.h"

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

@ -1,12 +1,6 @@
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pch.h"
#include "TournamentService_WinRT.h"
#include "Utils_WinRT.h"
@ -65,4 +59,40 @@ TournamentService::GetTournamentDetailsAsync(
return ASYNC_FROM_TASK(task);
}
Windows::Foundation::IAsyncOperation<TeamRequestResult^>^
TournamentService::GetTeamsAsync(
_In_ TeamRequest^ request
)
{
auto task = m_cppObj.get_teams(request->GetCppObj())
.then([](xbox_live_result<team_request_result> cppResult)
{
THROW_IF_ERR(cppResult);
return ref new TeamRequestResult(cppResult.payload());
});
return ASYNC_FROM_TASK(task);
}
Windows::Foundation::IAsyncOperation<TeamInfo^>^
TournamentService::GetTeamDetailsAsync(
_In_ Platform::String^ organizerId,
_In_ Platform::String^ tournamentId,
_In_ Platform::String^ teamId
)
{
auto task = m_cppObj.get_team_details(
STRING_T_FROM_PLATFORM_STRING(organizerId),
STRING_T_FROM_PLATFORM_STRING(tournamentId),
STRING_T_FROM_PLATFORM_STRING(teamId)
)
.then([](xbox_live_result<team_info> cppResult)
{
THROW_IF_ERR(cppResult);
return ref new TeamInfo(cppResult.payload());
});
return ASYNC_FROM_TASK(task);
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_END

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

@ -1,17 +1,14 @@
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
// 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 "TournamentRequest_WinRT.h"
#include "TournamentRequestResult_WinRT.h"
#include "TeamInfo_WinRT.h"
#include "TeamRequest_WinRT.h"
#include "TeamRequestResult_WinRT.h"
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_BEGIN
@ -50,6 +47,37 @@ public:
_In_ Platform::String^ tournamentId
);
/// <summary>
/// Returns a list of tournaments for the current title.
/// </summary>
/// <param name="request">A team request object that retrieves team based on the configuration of the request.</param>
/// <returns>A list of teams if they exist.</returns>
/// <remarks>
/// Returns a concurrency::task<T> object that represents the state of the asynchronous operation.
/// This method calls GET /tournaments/{organizer}/{id}/teams
/// </remarks>
Windows::Foundation::IAsyncOperation<TeamRequestResult^>^ GetTeamsAsync(
_In_ TeamRequest^ request
);
/// <summary>
/// Returns a specific tournament object.
/// The tournament ID and the organizer ID together uniquely identify a tournament.
/// </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 specific tournament if they exist.</returns>
/// <remarks>
/// Returns a concurrency::task<T> object that represents the state of the asynchronous operation.
/// This method calls GET /tournaments/{organizer}/{id}/teams/{teamId}
/// </remarks>
Windows::Foundation::IAsyncOperation<TeamInfo^>^ GetTeamDetailsAsync(
_In_ Platform::String^ organizerId,
_In_ Platform::String^ tournamentId,
_In_ Platform::String^ teamId
);
internal:
TournamentService(
_In_ xbox::services::tournaments::tournament_service cppObj

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

@ -1,12 +1,6 @@
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#pragma once
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_BEGIN

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

@ -1,12 +1,6 @@
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#pragma once
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_BEGIN

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

@ -1,12 +1,6 @@
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pch.h"
#include "Tournament_WinRT.h"
#include "Utils_WinRT.h"

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

@ -1,12 +1,6 @@
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
// 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 "TournamentState_WinRT.h"

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

@ -0,0 +1,57 @@
// 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"
using namespace pplx;
using namespace xbox::services;
using namespace xbox::services::multiplayer;
using namespace xbox::services::tournaments;
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_CPP_BEGIN
current_match_metadata::current_match_metadata()
{
}
const xbox::services::multiplayer::multiplayer_session_reference&
current_match_metadata::game_session_reference() const
{
return m_gameSessionReference;
}
const match_metadata&
current_match_metadata::match_details() const
{
return m_matchDetails;
}
xbox_live_result<current_match_metadata>
current_match_metadata::_Deserialize(
_In_ const web::json::value& json
)
{
if (json.is_null()) return xbox_live_result<current_match_metadata>();
current_match_metadata result;
std::error_code errCode = xbox_live_error_code::no_error;
auto sessionReference = multiplayer_session_reference::_Deserialize(utils::extract_json_field(json, _T("gameSessionRef"), errCode, false));
if (sessionReference.err())
{
errCode = sessionReference.err();
}
result.m_gameSessionReference = sessionReference.payload();
auto matchDetailsResult = match_metadata::_Deserialize(json);
if (matchDetailsResult.err())
{
errCode = matchDetailsResult.err();
}
result.m_matchDetails = matchDetailsResult.payload();
return result;
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_CPP_END

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

@ -0,0 +1,78 @@
// 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"
using namespace pplx;
using namespace xbox::services;
using namespace xbox::services::tournaments;
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_CPP_BEGIN
match_metadata::match_metadata() :
m_isBye(false)
{
}
const string_t&
match_metadata::label() const
{
return m_label;
}
const utility::datetime&
match_metadata::start_time() const
{
return m_startTime;
}
bool
match_metadata::is_bye() const
{
return m_isBye;
}
const std::vector<string_t>&
match_metadata::opposing_team_ids() const
{
return m_opposingTeamIds;
}
xbox_live_result<match_metadata>
match_metadata::_Deserialize(
_In_ const web::json::value& json
)
{
if (json.is_null()) return xbox_live_result<match_metadata>();
match_metadata result;
std::error_code errCode = xbox_live_error_code::no_error;
web::json::value labelJson = utils::extract_json_field(json, _T("label"), false);
if (!labelJson.is_null())
{
string_t formatMoniker = utils::extract_json_string(labelJson, _T("formatMoniker"), errCode);
auto params = utils::extract_json_vector<string_t>(utils::json_string_extractor, labelJson, _T("params"), errCode, false);
int index = 0;
for (const auto& param : params)
{
stringstream_t ss;
ss << _T("{");
ss << index;
ss << _T("}");
formatMoniker = utils::replace_sub_string(formatMoniker, ss.str(), param);
index++;
}
result.m_label = formatMoniker;
}
result.m_isBye = utils::extract_json_bool(json, _T("bye"), errCode);
result.m_startTime = utils::extract_json_time(json, _T("startTime"), errCode);
result.m_opposingTeamIds = utils::extract_json_vector<string_t>(utils::json_string_extractor, json, _T("opposingTeamIds"), errCode, true);
return result;
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_CPP_END

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

@ -0,0 +1,68 @@
// 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"
using namespace pplx;
using namespace xbox::services;
using namespace xbox::services::tournaments;
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_CPP_BEGIN
previous_match_metadata::previous_match_metadata()
{
}
xbox::services::tournaments::tournament_team_result
previous_match_metadata::result() const
{
return m_result;
}
const utility::datetime&
previous_match_metadata::match_end_time() const
{
return m_endTime;
}
const match_metadata&
previous_match_metadata::match_details() const
{
return m_matchDetails;
}
xbox_live_result<previous_match_metadata>
previous_match_metadata::_Deserialize(
_In_ const web::json::value& json
)
{
if (json.is_null()) return xbox_live_result<previous_match_metadata>();
previous_match_metadata result;
std::error_code errCode = xbox_live_error_code::no_error;
auto matchDetailsResult = match_metadata::_Deserialize(json);
if (matchDetailsResult.err())
{
errCode = matchDetailsResult.err();
}
result.m_matchDetails = matchDetailsResult.payload();
result.m_endTime = utils::extract_json_time(json, _T("endTime"), errCode);
auto resultJson = utils::extract_json_field(json, _T("result"), errCode, false);
if (!resultJson.is_null())
{
auto tournamentTemResult = tournament_team_result::_Deserialize(resultJson);
if (tournamentTemResult.err())
{
errCode = tournamentTemResult.err();
}
result.m_result = tournamentTemResult.payload();
}
return result;
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_CPP_END

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

@ -0,0 +1,178 @@
// 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 "utils.h"
using namespace pplx;
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_CPP_BEGIN
team_info::team_info() :
m_ranking(0),
m_state(team_state::unknown),
m_completedReason(team_completed_reason::unknown)
{
}
const string_t&
team_info::id() const
{
return m_teamId;
}
const string_t&
team_info::name() const
{
return m_teamName;
}
const std::vector<string_t>&
team_info::member_xbox_user_ids() const
{
return m_memberXuids;
}
const utility::datetime&
team_info::registration_date() const
{
return m_registrationDate;
}
const string_t&
team_info::standing() const
{
return m_standing;
}
team_state
team_info::state() const
{
return m_state;
}
team_completed_reason
team_info::completed_reason() const
{
return m_completedReason;
}
uint64_t
team_info::ranking() const
{
return m_ranking;
}
const xbox::services::tournaments::current_match_metadata&
team_info::current_match_metadata() const
{
return m_currentMatchMetadata;
}
const xbox::services::tournaments::previous_match_metadata&
team_info::previous_match_metadata() const
{
return m_previousMatchMetadata;
}
xbox::services::xbox_live_result<team_info>
team_info::_Deserialize(_In_ const web::json::value& json)
{
if (json.is_null()) return xbox_live_result<team_info>();
team_info result;
std::error_code errCode = xbox_live_error_code::no_error;
result.m_teamId = utils::extract_json_string(json, _T("id"), errCode);
result.m_teamName = utils::extract_json_string(json, _T("name"), errCode);
result.m_standing = utils::extract_json_string(json, _T("standing"), errCode);
result.m_registrationDate = utils::extract_json_time(json, _T("registrationDate"), errCode);
result.m_ranking = utils::extract_json_int(json, _T("ranking"), errCode);
result.m_state = _Convert_string_to_team_state(utils::extract_json_string(json, _T("state"), errCode));
result.m_completedReason = _Convert_string_to_completed_reason(utils::extract_json_string(json, _T("completedReason"), errCode));
web::json::value members = utils::extract_json_field(json, _T("members"), errCode, false);
web::json::array membersArray = members.as_array();
for (const auto& memberJson : membersArray)
{
auto xuid = utils::extract_json_string(memberJson, _T("id"), errCode);
result.m_memberXuids.push_back(xuid);
}
auto currentMatchData = xbox::services::tournaments::current_match_metadata::_Deserialize(utils::extract_json_field(json, _T("currentMatch"), errCode, false));
if (currentMatchData.err())
{
errCode = currentMatchData.err();
}
result.m_currentMatchMetadata = currentMatchData.payload();
auto previoustMatchData = xbox::services::tournaments::previous_match_metadata::_Deserialize(utils::extract_json_field(json, _T("previousMatch"), errCode, false));
if (previoustMatchData.err())
{
errCode = previoustMatchData.err();
}
result.m_previousMatchMetadata = previoustMatchData.payload();
return xbox_live_result<team_info>(result, errCode);
}
team_state
team_info::_Convert_string_to_team_state(
_In_ const string_t& value
)
{
if (utils::str_icmp(value, _T("registered")) == 0)
{
return team_state::registered;
}
else if (utils::str_icmp(value, _T("waitlisted")) == 0)
{
return team_state::waitlisted;
}
else if (utils::str_icmp(value, _T("standBy")) == 0)
{
return team_state::stand_by;
}
else if (utils::str_icmp(value, _T("checkedIn")) == 0)
{
return team_state::checked_in;
}
else if (utils::str_icmp(value, _T("playing")) == 0)
{
return team_state::playing;
}
else if (utils::str_icmp(value, _T("completed")) == 0)
{
return team_state::completed;
}
return team_state::unknown;
}
team_completed_reason
team_info::_Convert_string_to_completed_reason(
_In_ const string_t& value
)
{
if (utils::str_icmp(value, _T("rejected")) == 0)
{
return team_completed_reason::rejected;
}
else if (utils::str_icmp(value, _T("eliminated")) == 0)
{
return team_completed_reason::eliminated;
}
else if (utils::str_icmp(value, _T("evicted")) == 0)
{
return team_completed_reason::evicted;
}
else if (utils::str_icmp(value, _T("completed")) == 0)
{
return team_completed_reason::completed;
}
return team_completed_reason::unknown;
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_CPP_END

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

@ -0,0 +1,77 @@
// 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 "utils.h"
using namespace pplx;
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_CPP_BEGIN
team_request::team_request(
_In_ string_t organizerId,
_In_ string_t tournamentId
) :
m_organizerId(std::move(organizerId)),
m_tournamentId(std::move(tournamentId)),
m_maxItems(0),
m_orderBy(team_order_by::none)
{
}
const string_t&
team_request::_Organizer_id() const
{
return m_organizerId;
}
const string_t&
team_request::_Tournament_id() const
{
return m_tournamentId;
}
uint32_t
team_request::_Max_items() const
{
return m_maxItems;
}
void
team_request::set_max_items(
_In_ uint32_t maxItems
)
{
m_maxItems = maxItems;
}
const std::vector<team_state>&
team_request::_Team_states() const
{
return m_states;
}
void
team_request::set_state_filter(
_In_ std::vector<team_state> states
)
{
m_states = std::move(states);
}
team_order_by
team_request::_Order_by() const
{
return m_orderBy;
}
void
team_request::set_order_by(
_In_ team_order_by orderBy
)
{
m_orderBy = orderBy;
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_CPP_END

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

@ -0,0 +1,73 @@
// 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 "xbox_system_factory.h" // ??
#include "utils.h"
#include "user_context.h"
using namespace pplx;
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_CPP_BEGIN
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
)
{
m_userContext = std::move(userContext);
m_xboxLiveContextSettings = std::move(xboxLiveContextSettings);
m_appConfig = std::move(appConfig);
}
const std::vector<team_info>&
team_request_result::teams() const
{
return m_items;
}
bool
team_request_result::has_next() const
{
return !m_nextLinkUrl.empty();
}
pplx::task<xbox::services::xbox_live_result<team_request_result>>
team_request_result::get_next()
{
if (m_nextLinkUrl.empty())
{
xbox_live_result<team_request_result> results(xbox_live_error_code::logic_error, "team_request_result doesn't have next page");
return pplx::task_from_result<xbox::services::xbox_live_result<team_request_result>>(results);
}
return tournament_service(
m_userContext,
m_xboxLiveContextSettings,
m_appConfig
)._Get_teams(m_nextLinkUrl);
}
xbox_live_result<team_request_result>
team_request_result::_Deserialize(
_In_ const web::json::value& json
)
{
if (json.is_null()) return xbox_live_result<team_request_result>();
team_request_result result;
std::error_code errCode = xbox_live_error_code::no_error;
result.m_items = utils::extract_json_vector<team_info>(team_info::_Deserialize, json, _T("value"), errCode, true);
result.m_nextLinkUrl = utils::extract_json_string(json, _T("@nextLink"), errCode, false);
return xbox_live_result<team_request_result>(result, errCode);
}
NAMESPACE_MICROSOFT_XBOX_SERVICES_TOURNAMENTS_CPP_END

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

@ -1,12 +1,6 @@
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
// 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 "xbox_system_factory.h"

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

@ -1,12 +1,6 @@
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
// 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 "utils.h"

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

@ -1,12 +1,6 @@
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
// 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 "xbox_system_factory.h"

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

@ -1,12 +1,6 @@
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
// 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 "xbox_system_factory.h"
@ -117,7 +111,7 @@ tournament_service::get_tournament_details(
_T("GET"),
utils::create_xboxlive_endpoint(_T("tournamentshub"), m_appConfig),
subPath.str(),
xbox_live_api::get_tournaments
xbox_live_api::get_tournament_details
);
httpCall->set_xbox_contract_version_header_value(c_tournamentsHubServiceContractHeaderValue);
@ -145,6 +139,117 @@ tournament_service::get_tournament_details(
return utils::create_exception_free_task<tournament>(task);
}
pplx::task<xbox::services::xbox_live_result<team_request_result>>
tournament_service::_Get_teams(
_In_ const string_t& nextLinkUrl
)
{
return get_teams_internal(nextLinkUrl);
}
pplx::task<xbox::services::xbox_live_result<team_request_result>>
tournament_service::get_teams(
_In_ team_request request
)
{
auto subPath = team_sub_path_url(request);
return get_teams_internal(subPath);
}
pplx::task<xbox::services::xbox_live_result<team_request_result>>
tournament_service::get_teams_internal(
_In_ const string_t& subPath
)
{
std::shared_ptr<http_call> httpCall = xbox::services::system::xbox_system_factory::get_factory()->create_http_call(
m_xboxLiveContextSettings,
_T("GET"),
utils::create_xboxlive_endpoint(_T("tournamentshub"), m_appConfig),
subPath,
xbox_live_api::get_teams
);
httpCall->set_xbox_contract_version_header_value(c_tournamentsHubServiceContractHeaderValue);
auto userContext = m_userContext;
auto xboxLiveContextSettings = m_xboxLiveContextSettings;
auto appConfig = m_appConfig;
auto task = httpCall->get_response_with_auth(m_userContext)
.then([userContext, xboxLiveContextSettings, appConfig](std::shared_ptr<http_call_response> response)
{
if (response->response_body_json().size() > 0)
{
auto jsonResult = team_request_result::_Deserialize(response->response_body_json());
auto result = utils::generate_xbox_live_result<team_request_result>(
jsonResult,
response
);
auto& teamResult = result.payload();
teamResult._Init_next_page_info(
userContext,
xboxLiveContextSettings,
appConfig
);
return result;
}
else
{
return xbox_live_result<team_request_result>(response->err_code(), response->err_message());
}
});
return utils::create_exception_free_task<team_request_result>(task);
}
pplx::task<xbox::services::xbox_live_result<team_info>>
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");
RETURN_TASK_CPP_INVALIDARGUMENT_IF(teamId.empty(), team_info, "team id is empty");
stringstream_t subPath;
subPath << _T("/tournaments/") << organizerId << _T("/") << tournamentId << _T("/teams/") << teamId;
std::shared_ptr<http_call> httpCall = xbox::services::system::xbox_system_factory::get_factory()->create_http_call(
m_xboxLiveContextSettings,
_T("GET"),
utils::create_xboxlive_endpoint(_T("tournamentshub"), m_appConfig),
subPath.str(),
xbox_live_api::get_tournament_details
);
httpCall->set_xbox_contract_version_header_value(c_tournamentsHubServiceContractHeaderValue);
auto userContext = m_userContext;
auto xboxLiveContextSettings = m_xboxLiveContextSettings;
auto appConfig = m_appConfig;
auto task = httpCall->get_response_with_auth(m_userContext)
.then([userContext, xboxLiveContextSettings, appConfig](std::shared_ptr<http_call_response> response)
{
if (response->response_body_json().size() > 0)
{
auto jsonResult = team_info::_Deserialize(response->response_body_json());
return utils::generate_xbox_live_result<team_info>(
jsonResult,
response
);
}
else
{
return xbox_live_result<team_info>(response->err_code(), response->err_message());
}
});
return utils::create_exception_free_task<team_info>(task);
}
string_t
tournament_service::tournament_sub_path_url(
_In_ tournament_request request
@ -153,7 +258,7 @@ tournament_service::tournament_sub_path_url(
web::uri_builder subPathBuilder;
stringstream_t path;
path << _T("/tournaments/");
path << _T("/tournaments");
subPathBuilder.set_path(path.str());
subPathBuilder.append_query(_T("titleId"), m_appConfig->title_id());
@ -174,7 +279,7 @@ tournament_service::tournament_sub_path_url(
for (const auto& state : request._Tournament_states())
{
statesArray += L"\"";
statesArray += convert_state_to_string(state);
statesArray += convert_tournament_state_to_string(state);
statesArray += L"\",";
}
statesArray.erase(statesArray.end() - 1, statesArray.end()); // remove the last ','
@ -184,12 +289,12 @@ tournament_service::tournament_sub_path_url(
if (request._Sort_order() != tournament_sort_order::none)
{
subPathBuilder.append_query(_T("sortOrder"), convert_sort_order_to_string(request._Sort_order()));
subPathBuilder.append_query(_T("sortOrder"), convert_tournament_sort_order_to_string(request._Sort_order()));
}
if (request._Order_by() != tournament_order_by::none)
{
subPathBuilder.append_query(_T("orderBy"), convert_order_by_to_string(request._Order_by()));
subPathBuilder.append_query(_T("orderBy"), convert_tournament_order_by_to_string(request._Order_by()));
}
if (request._Max_items() > 0)
@ -200,8 +305,48 @@ tournament_service::tournament_sub_path_url(
return subPathBuilder.to_string();
}
string_t
tournament_service::convert_state_to_string(
tournament_service::team_sub_path_url(
_In_ team_request request
)
{
web::uri_builder subPathBuilder;
stringstream_t path;
path << _T("/tournaments/") << request._Organizer_id() << _T("/") << request._Tournament_id() << _T("/teams");
subPathBuilder.set_path(path.str());
subPathBuilder.append_query(_T("memberId"), m_userContext->xbox_user_id());
if (request._Max_items() > 0)
{
subPathBuilder.append_query(_T("maxItems"), request._Max_items());
}
if (request._Team_states().size() > 0)
{
string_t statesArray = L"[";
for (const auto& state : request._Team_states())
{
statesArray += L"\"";
statesArray += convert_team_state_to_string(state);
statesArray += L"\",";
}
statesArray.erase(statesArray.end() - 1, statesArray.end()); // remove the last ','
statesArray += L"]";
subPathBuilder.append_query(_T("state"), statesArray);
}
if (request._Order_by() != team_order_by::none)
{
subPathBuilder.append_query(_T("orderBy"), convert_team_order_by_to_string(request._Order_by()));
}
return subPathBuilder.to_string();
}
string_t
tournament_service::convert_tournament_state_to_string(
_In_ tournament_state state
)
{
@ -222,7 +367,7 @@ tournament_service::convert_state_to_string(
}
string_t
tournament_service::convert_sort_order_to_string(
tournament_service::convert_tournament_sort_order_to_string(
_In_ tournament_sort_order order
)
{
@ -240,7 +385,7 @@ tournament_service::convert_sort_order_to_string(
}
string_t
tournament_service::convert_order_by_to_string(
tournament_service::convert_tournament_order_by_to_string(
_In_ tournament_order_by order
)
{
@ -257,6 +402,54 @@ tournament_service::convert_order_by_to_string(
}
}
string_t
tournament_service::convert_team_state_to_string(
_In_ team_state state
)
{
switch (state)
{
case team_state::registered:
return _T("registered");
case team_state::waitlisted:
return _T("waitlisted");
case team_state::stand_by:
return _T("standby");
case team_state::checked_in:
return _T("checkedin");
case team_state::playing:
return _T("playing");
case team_state::completed:
return _T("completed");
default:
return _T("unknown");
}
}
string_t
tournament_service::convert_team_order_by_to_string(
_In_ team_order_by order
)
{
switch (order)
{
case team_order_by::name:
return _T("name");
case team_order_by::ranking:
return _T("ranking");
default:
return _T("none");
}
}
xbox::services::tournaments::team_state
tournament_service::_Convert_string_to_team_state(
_In_ const string_t& value

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

@ -68,8 +68,9 @@ enum class xbox_live_api
get_stats_value_document,
get_ticket_status,
get_tournaments,
get_tournament_instances,
get_tournament_progress,
get_tournament_details,
get_teams,
get_team_details,
get_user_profiles,
get_user_profiles_for_social_group,
register_team,

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

@ -34,12 +34,12 @@
"minTeamSize": 1,
"maxTeamSize": 4,
"schedule": {
"registrationStart": "2017-01-26T06:53:19",
"registrationEnd": "2017-01-27T06:53:19",
"checkinStart": "2017-01-28T06:53:19",
"checkinEnd": "2017-01-29T06:53:19",
"playingStart": "2017-01-30T06:53:19",
"playingEnd": "2017-05-01T06:53:19"
"registrationStart": "2017-02-17T20:06:10.1949991Z",
"registrationEnd": "2017-02-18T20:06:10.1949991Z",
"checkinStart": "2017-02-17T20:06:10.1949991Z",
"checkinEnd": "2017-02-18T20:06:10.1949991Z",
"playingStart": "2017-02-17T20:06:10.1949991Z",
"playingEnd": "2017-02-18T20:06:10.1949991Z"
}
},
"team": {
@ -89,5 +89,113 @@
}
}
}]
},
"defaultGetTeamsResponse": {
"value": [{
"rtaSubscription": "https://tournamentshub.xboxlive.com/tournaments/manualtest/00004/teams/0003",
"continuationUri": {
"uwp_xboxone": {
"continuationUri": "xbox-arena://tournamentdetails?organizerId=manualtest&tournamentId=00004",
"pfn": "Xbox.Social_8wekyb3d8bbwe"
},
"uwp_desktop": {
"continuationUri": "xbox-arena://tournamentdetails?organizerId=manualtest&tournamentId=00004",
"pfn": "Microsoft.XboxApp_8wekyb3d8bbwe"
}
},
"id": "0003",
"name": "teamname",
"registrationDate": "2017-02-17T20:06:10.1949991Z",
"state": "Registered",
"completedReason": "Completed",
"standing": "4W - 2L",
"ranking": 5,
"currentMatch": {
"gameSessionRef": {
"scid": "42c6562b-6841-4b21-8729-4dd643af374b",
"templateName": "templatename",
"name": "sessionname"
},
"label" : {
"formatMoniker": "{0}W - {1}L",
"params": ["6", "1"]
},
"startTime": "2017-02-17T20:06:10.1949991Z",
"bye": false,
"opposingTeamIds": ["0001", "0002"]
},
"previousMatch": {
"endTime": "2017-02-17T20:06:10.1949991Z",
"result": {
"outcome": "Win"
},
"label" : {
"formatMoniker": "{0}W - {1}L",
"params": ["6", "1"]
},
"startTime": "2017-02-17T20:06:10.1949991Z",
"bye": false,
"opposingTeamIds": ["a0a15919-b490-4368-bf95-22280e4412cc", "3a6e314e-ee6c-477f-bc33-50dfc268407a"]
},
"members": [{
"id": "2533274815757150"
},
{
"id": "2533274815757150"
},
{
"id": "2533274815757150"
}]
},
{
"rtaSubscription": "https://tournamentshub.xboxlive.com/tournaments/manualtest/00004/teams/20170221045135",
"continuationUri": {
"uwp_xboxone": {
"continuationUri": "xbox-arena://tournamentdetails?organizerId=manualtest&tournamentId=00004",
"pfn": "Xbox.Social_8wekyb3d8bbwe"
},
"uwp_desktop": {
"continuationUri": "xbox-arena://tournamentdetails?organizerId=manualtest&tournamentId=00004",
"pfn": "Microsoft.XboxApp_8wekyb3d8bbwe"
}
},
"id": "20170221045135",
"name": "20170221045135",
"registrationDate": "2017-02-21T16:51:35.2138655Z",
"state": "Registered",
"completedReason": "Completed",
"standing": "4W - 2L",
"ranking": 5,
"currentMatch": {
"gameSessionRef": {
"scid": "42c6562b-6841-4b21-8729-4dd643af374b",
"templateName": "templatename",
"name": "sessionname"
},
"label" : {
"formatMoniker": "{0}W - {1}L",
"params": ["6", "1"]
},
"startTime": "2017-02-17T20:06:10.1949991Z",
"bye": false,
"opposingTeamIds": ["eb947ba2-a3dd-412a-8872-4a895d59ac2a", "42bbde1c-dee3-4e23-85dc-6bd4642277ed"]
},
"previousMatch": {
"endTime": "2017-02-17T20:06:10.1949991Z",
"result": {
"outcome": "Win"
},
"label" : {
"formatMoniker": "{0}W - {1}L",
"params": ["6", "1"]
},
"startTime": "2017-02-17T20:06:10.1949991Z",
"bye": false,
"opposingTeamIds": ["a0a15919-b490-4368-bf95-22280e4412cc", "3a6e314e-ee6c-477f-bc33-50dfc268407a"]
},
"members": [{
"id": "2533274815757150"
}]
}]
}
}

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

@ -30,6 +30,67 @@ public:
const string_t filePath = _T("\\TestResponses\\Tournaments.json");
web::json::value testResponseJsonFromFile = utils::read_test_response_file(filePath);
void VerifyMultiplayerSessionReference(MultiplayerSessionReference^ result, web::json::value resultToVerify)
{
VERIFY_ARE_EQUAL(result->ServiceConfigurationId->Data(), resultToVerify[L"scid"].as_string());
VERIFY_ARE_EQUAL(result->SessionTemplateName->Data(), resultToVerify[L"templateName"].as_string());
VERIFY_ARE_EQUAL(result->SessionName->Data(), resultToVerify[L"name"].as_string());
}
void VerifyMatchMetadata(Tournaments::MatchMetadata^ currentMatchData, web::json::value matchDataToVerify)
{
VERIFY_ARE_EQUAL_STR(currentMatchData->Label->Data(), L"6W - 1L");
VERIFY_ARE_EQUAL(DateTimeToString(
currentMatchData->StartTIme).substr(0, DATETIME_STRING_LENGTH_TO_SECOND).c_str(),
matchDataToVerify[L"startTime"].as_string().substr(0, DATETIME_STRING_LENGTH_TO_SECOND));
VERIFY_ARE_EQUAL(currentMatchData->IsBye, matchDataToVerify[L"bye"].as_bool());
web::json::array opposingTeamIdsArray = matchDataToVerify[L"opposingTeamIds"].as_array();
uint32 counter = 0;
for (auto oppTeamId : currentMatchData->OpposingTeamIds)
{
VERIFY_ARE_EQUAL(oppTeamId->Data(), opposingTeamIdsArray[counter].as_string());
++counter;
}
}
void VerifyCurrentMatchMetadata(Tournaments::CurrentMatchMetadata^ currentMatchData, web::json::value matchDataToVerify)
{
VerifyMultiplayerSessionReference(currentMatchData->GameSessionReference, matchDataToVerify[L"gameSessionRef"]);
VerifyMatchMetadata(currentMatchData->MatchDetails, matchDataToVerify);
}
void VerifyPreviousMatchMetadata(Tournaments::PreviousMatchMetadata^ previousMatchData, web::json::value matchDataToVerify)
{
VERIFY_ARE_EQUAL_STR_IGNORE_CASE(previousMatchData->Result->State.ToString()->Data(), matchDataToVerify[L"result"][L"outcome"].as_string().c_str());
if (previousMatchData->Result->State == TournamentGameResultState::Rank)
{
VERIFY_ARE_EQUAL_INT(previousMatchData->Result->Ranking, matchDataToVerify[L"result"][L"ranking"].as_integer());
}
VERIFY_ARE_EQUAL(DateTimeToString(
previousMatchData->MatchEndTime).substr(0, DATETIME_STRING_LENGTH_TO_SECOND).c_str(),
matchDataToVerify[L"endTime"].as_string().substr(0, DATETIME_STRING_LENGTH_TO_SECOND));
VerifyMatchMetadata(previousMatchData->MatchDetails, matchDataToVerify);
}
void VerifyTeam(Tournaments::TeamInfo^ teamInfo, web::json::value teamToVerify)
{
VERIFY_ARE_EQUAL(teamInfo->Id->Data(), teamToVerify[L"id"].as_string());
VERIFY_ARE_EQUAL(teamInfo->Name->Data(), teamToVerify[L"name"].as_string());
VERIFY_ARE_EQUAL(teamInfo->Standing->Data(), teamToVerify[L"standing"].as_string());
VERIFY_ARE_EQUAL_INT(teamInfo->Ranking, teamToVerify[L"ranking"].as_integer());
VERIFY_ARE_EQUAL_STR_IGNORE_CASE(teamInfo->TeamState.ToString()->Data(), teamToVerify[L"state"].as_string().c_str());
VERIFY_ARE_EQUAL_STR_IGNORE_CASE(teamInfo->CompletedReason.ToString()->Data(), teamToVerify[L"completedReason"].as_string().c_str());
VERIFY_ARE_EQUAL(DateTimeToString(
teamInfo->RegistrationDate).substr(0, DATETIME_STRING_LENGTH_TO_SECOND).c_str(),
teamToVerify[L"registrationDate"].as_string().substr(0, DATETIME_STRING_LENGTH_TO_SECOND));
VerifyCurrentMatchMetadata(teamInfo->CurrentMatchMetadata, teamToVerify[L"currentMatch"]);
VerifyPreviousMatchMetadata(teamInfo->PreviousMatchMetadata, teamToVerify[L"previousMatch"]);
}
void VerifyTournament(Tournaments::Tournament^ tournament, web::json::value tournamentToVerify)
{
web::json::value tournamentJson = tournamentToVerify[L"tournament"];
@ -103,14 +164,14 @@ public:
auto task = create_task(xboxLiveContext->TournamentService->GetTournamentsAsync(request));
VERIFY_ARE_EQUAL_STR(L"GET", httpCall->HttpMethod);
VERIFY_ARE_EQUAL_STR(L"https://tournamentshub.mockenv.xboxlive.com", httpCall->ServerName);
VERIFY_ARE_EQUAL_STR(L"/tournaments/?titleId=1234&teamForMember=TestXboxUserId&memberId=TestXboxUserId", httpCall->PathQueryFragment.to_string());
VERIFY_ARE_EQUAL_STR(L"/tournaments?titleId=1234&teamForMember=TestXboxUserId&memberId=TestXboxUserId", httpCall->PathQueryFragment.to_string());
TournamentRequestResult^ result = task.get();
VERIFY_ARE_EQUAL_INT(result->Items->Size, responseJson.as_object()[L"value"].as_array().size());
VERIFY_ARE_EQUAL_INT(result->Tournaments->Size, responseJson.as_object()[L"value"].as_array().size());
for (uint32_t i = 0; i < result->Items->Size; i++)
for (uint32_t i = 0; i < result->Tournaments->Size; i++)
{
VerifyTournament(result->Items->GetAt(i), responseJson.as_object()[L"value"].as_array()[i]);
VerifyTournament(result->Tournaments->GetAt(i), responseJson.as_object()[L"value"].as_array()[i]);
}
}
@ -133,14 +194,42 @@ public:
auto task = create_task(xboxLiveContext->TournamentService->GetTournamentsAsync(request));
VERIFY_ARE_EQUAL_STR(L"GET", httpCall->HttpMethod);
VERIFY_ARE_EQUAL_STR(L"https://tournamentshub.mockenv.xboxlive.com", httpCall->ServerName);
VERIFY_ARE_EQUAL_STR_IGNORE_CASE(L"/tournaments/?titleId=1234&teamForMember=TestXboxUserId&state=%5B%22active%22,%22completed%22%5D", httpCall->PathQueryFragment.to_string().c_str());
VERIFY_ARE_EQUAL_STR_IGNORE_CASE(L"/tournaments?titleId=1234&teamForMember=TestXboxUserId&state=%5B%22active%22,%22completed%22%5D", httpCall->PathQueryFragment.to_string().c_str());
TournamentRequestResult^ result = task.get();
VERIFY_ARE_EQUAL_INT(result->Items->Size, responseJson.as_object()[L"value"].as_array().size());
VERIFY_ARE_EQUAL_INT(result->Tournaments->Size, responseJson.as_object()[L"value"].as_array().size());
for (uint32_t i = 0; i < result->Items->Size; i++)
for (uint32_t i = 0; i < result->Tournaments->Size; i++)
{
VerifyTournament(result->Items->GetAt(i), responseJson.as_object()[L"value"].as_array()[i]);
VerifyTournament(result->Tournaments->GetAt(i), responseJson.as_object()[L"value"].as_array()[i]);
}
}
DEFINE_TEST_CASE(TestGetTeamsAsync)
{
DEFINE_TEST_CASE_PROPERTIES(TestGetTeamsAsync);
const string_t defaultGetTournamentsResponse = testResponseJsonFromFile[L"defaultGetTeamsResponse"].serialize();
auto responseJson = web::json::value::parse(defaultGetTournamentsResponse);
auto httpCall = m_mockXboxSystemFactory->GetMockHttpCall();
httpCall->ResultValue = StockMocks::CreateMockHttpCallResponse(responseJson);
XboxLiveContext^ xboxLiveContext = GetMockXboxLiveContext_WinRT();
TeamRequest^ request = ref new TeamRequest(
ref new Platform::String(L"xbox-live"),
ref new Platform::String(L"MyTestTournamentId")
);
auto task = create_task(xboxLiveContext->TournamentService->GetTeamsAsync(request));
VERIFY_ARE_EQUAL_STR(L"GET", httpCall->HttpMethod);
VERIFY_ARE_EQUAL_STR(L"https://tournamentshub.mockenv.xboxlive.com", httpCall->ServerName);
VERIFY_ARE_EQUAL_STR(L"/tournaments/xbox-live/MyTestTournamentId/teams?memberId=TestXboxUserId", httpCall->PathQueryFragment.to_string());
TeamRequestResult^ result = task.get();
VERIFY_ARE_EQUAL_INT(result->Teams->Size, responseJson.as_object()[L"value"].as_array().size());
for (uint32_t i = 0; i < result->Teams->Size; i++)
{
VerifyTeam(result->Teams->GetAt(i), responseJson.as_object()[L"value"].as_array()[i]);
}
}
};