Skip to content

Commit

Permalink
2104 GDK (#564)
Browse files Browse the repository at this point in the history
  • Loading branch information
natiskan authored Apr 22, 2021
1 parent 730f579 commit b67fe71
Show file tree
Hide file tree
Showing 43 changed files with 665 additions and 785 deletions.
2 changes: 1 addition & 1 deletion External/Xal/Source/Xal/Include/Xal/xal_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ extern "C"
/// YYYYMMDD Date string describing the date the build was created
/// rrr QFE number (000 indicates base release)
/// </summary>
#define XAL_VERSION "2020.11.20201204.001"
#define XAL_VERSION "2021.04.20210319.000"

}
10 changes: 9 additions & 1 deletion Include/xsapi-c/multiplayer_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -3293,9 +3293,13 @@ STDAPI XblMultiplayerGetSessionAsync(
/// Gets the result of an XblMultiplayerGetSessionResult call.
/// </summary>
/// <param name="async">The AsyncBlock for this operation.</param>
/// <param name="handle">Passes back a handle to a new instance of a local multiplayer session object.
/// <param name="handle">Passes back a handle to a new instance of a local multiplayer session object.
/// It must be release by the caller with <see cref="XblMultiplayerSessionCloseHandle"/>.</param>
/// <returns>HRESULT return code for this API operation.</returns>
/// <remarks>
/// If the session does not exist, this API will return __HRESULT_FROM_WIN32(ERROR_RESOURCE_DATA_NOT_FOUND) and a null
/// XblMultiplayerSessionHandle.
/// </remarks>
STDAPI XblMultiplayerGetSessionResult(
_In_ XAsyncBlock* async,
_Out_ XblMultiplayerSessionHandle* handle
Expand Down Expand Up @@ -3326,6 +3330,10 @@ STDAPI XblMultiplayerGetSessionByHandleAsync(
/// <param name="handle">Passes back a handle to a new instance of a local multiplayer session object.
/// It must be release by the caller with <see cref="XblMultiplayerSessionCloseHandle"/>.</param>
/// <returns>HRESULT return code for this API operation.</returns>
/// <remarks>
/// If the session does not exist, this API will return __HRESULT_FROM_WIN32(ERROR_RESOURCE_DATA_NOT_FOUND) and a null
/// XblMultiplayerSessionHandle.
/// </remarks>
STDAPI XblMultiplayerGetSessionByHandleResult(
_In_ XAsyncBlock* async,
_Out_ XblMultiplayerSessionHandle* handle
Expand Down
4 changes: 4 additions & 0 deletions Include/xsapi-c/multiplayer_manager_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,7 @@ XBL_WARNING_POP
/// Changes are batched and written to the service on the next XblMultiplayerManagerDoWork().
/// All session properties and members contain updated response returned from the server
/// upon calling XblMultiplayerManagerDoWork().
/// When attempting to join a session, the service will return HTTP_E_STATUS_BAD_REQUEST (HTTP status 400) in the event the server is full.
/// </remarks>
STDAPI XblMultiplayerManagerLobbySessionAddLocalUser(
_In_ XblUserHandle user
Expand Down Expand Up @@ -1112,6 +1113,7 @@ STDAPI XblMultiplayerManagerGameSessionSetSynchronizedHost(
/// After joining, you can set the host via XblMultiplayerManagerLobbySessionSetSynchronizedHost() if one doesn't exist.
/// Instead, if you don't need a lobby session, and if you haven't added the local users through
/// XblMultiplayerManagerLobbySessionAddLocalUser(), you can pass in the list of users via the XblMultiplayerManagerJoinGame() API.
/// When attempting to join a session, the service will return HTTP_E_STATUS_BAD_REQUEST (HTTP status 400) in the event the server is full.
/// </remarks>
STDAPI XblMultiplayerManagerJoinLobby(
_In_z_ const char* handleId,
Expand All @@ -1129,6 +1131,7 @@ STDAPI XblMultiplayerManagerJoinLobby(
/// through XblMultiplayerManagerDoWork().
/// This does not migrate existing lobby session properties over to the game session.
/// After joining, you can set the properties or the host via XblMultiplayerManagerGameSessionSetSynchronized APIs.
/// When attempting to join a session, the service will return HTTP_E_STATUS_BAD_REQUEST (HTTP status 400) in the event the server is full.
/// </remarks>
STDAPI XblMultiplayerManagerJoinGameFromLobby(
_In_z_ const char* sessionTemplateName
Expand All @@ -1147,6 +1150,7 @@ STDAPI XblMultiplayerManagerJoinGameFromLobby(
/// <remarks>
/// The result is delivered via an event of type XblMultiplayerEventType::JoinGameCompleted through XblMultiplayerManagerDoWork().
/// After joining, you can set the properties or the host via XblMultiplayerManagerGameSessionSetSynchronized APIs.
/// When attempting to join a session, the service will return HTTP_E_STATUS_BAD_REQUEST (HTTP status 400) in the event the server is full.
/// </remarks>
STDAPI XblMultiplayerManagerJoinGame(
_In_z_ const char* sessionName,
Expand Down
9 changes: 9 additions & 0 deletions Include/xsapi-c/social_manager_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,17 @@ enum class XblPresenceFilter : uint32_t
/// <summary>
/// Has played this title and is offline.
/// </summary>
/// <remarks>
/// This filter option requires <see cref="XblSocialManagerExtraDetailLevel"/>::TitleHistoryLevel to be set in <see cref="XblSocialManagerAddLocalUser"/>
/// </remarks>
TitleOffline,

/// <summary>
/// Has played this title, is online but not currently playing this title.
/// </summary>
/// <remarks>
/// This filter option requires <see cref="XblSocialManagerExtraDetailLevel"/>::TitleHistoryLevel to be set in <see cref="XblSocialManagerAddLocalUser"/>
/// </remarks>
TitleOnlineOutsideTitle,

/// <summary>
Expand All @@ -83,6 +89,9 @@ enum class XblPresenceFilter : uint32_t
/// <summary>
/// Everyone who has played or is playing the title.
/// </summary>
/// <remarks>
/// This filter option requires <see cref="XblSocialManagerExtraDetailLevel"/>::TitleHistoryLevel to be set in <see cref="XblSocialManagerAddLocalUser"/>
/// </remarks>
AllTitle,

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ using namespace xbox::services;

XblAchievementsManagerResult::XblAchievementsManagerResult(_In_ const XblAchievement & achievement)
: m_achievements({ achievement }),
m_explicitCleanup(false),
m_achievementsData(nullptr),
m_achievementsCount()
m_achievementsCount(),
m_explicitCleanup(false)
{
}

Expand Down Expand Up @@ -63,9 +63,9 @@ AchievementsManagerUser::AchievementsManagerUser(
_In_ User&& localUser,
_In_ const TaskQueue& queue
) noexcept :
m_queue{ queue.DeriveWorkerQueue() },
m_xuid{ localUser.Xuid() },
m_rtaManager{ GlobalState::Get()->RTAManager() }
m_rtaManager{ GlobalState::Get()->RTAManager() },
m_queue{ queue.DeriveWorkerQueue() }
{
// Maintain legacy RTA activation count.
m_rtaManager->Activate(localUser);
Expand Down
8 changes: 4 additions & 4 deletions Source/Services/Achievements/achievement_service_internal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ AchievementsService::AchievementsService(
_In_ std::shared_ptr<xbox::services::real_time_activity::RealTimeActivityManager> rtaManager
) :
m_user{ std::move(user) },
m_xboxLiveContextSettings(std::move(xboxLiveContextSettings)),
m_appConfig(std::move(appConfig)),
m_xboxLiveContextImpl(std::move(xboxLiveContextImpl)),
m_rtaManager{ std::move(rtaManager) }
m_xboxLiveContextSettings{ std::move(xboxLiveContextSettings) },
m_appConfig{ std::move(appConfig) },
m_rtaManager{ std::move(rtaManager) },
m_xboxLiveContextImpl{ std::move(xboxLiveContextImpl) }
{
}

Expand Down
4 changes: 2 additions & 2 deletions Source/Services/Common/xbox_live_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ HRESULT XblContext::Initialize(
RETURN_HR_IF_FAILED(userResult.Hresult());
#if XSAPI_NOTIFICATION_SERVICE
#if !XSAPI_UNIT_TESTS && (HC_PLATFORM == HC_PLATFORM_WIN32 || HC_PLATFORM_IS_EXTERNAL)
m_notificationService = MakeShared<xbox::services::notification::RTANotificationService>(userResult.ExtractPayload(), m_xboxLiveContextSettings, rtaManager);
m_notificationService->RegisterForSpopNotificationEvents();
m_notificationService = MakeShared<xbox::services::notification::RTANotificationService>(userResult.ExtractPayload(), globalQueue, m_xboxLiveContextSettings, rtaManager);
RETURN_HR_IF_FAILED(m_notificationService->Initialize());
#elif HC_PLATFORM == HC_PLATFORM_ANDROID || HC_PLATFORM == HC_PLATFORM_IOS
m_notificationService = MakeShared<xbox::services::notification::MobileNotificationService>(userResult.ExtractPayload(), m_xboxLiveContextSettings);
#elif HC_PLATFORM == HC_PLATFORM_UWP
Expand Down
2 changes: 1 addition & 1 deletion Source/Services/Common/xbox_live_context_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ struct XblContext : public std::enable_shared_from_this<XblContext>, public xbox
std::shared_ptr<xbox::services::events::IEventsService> m_eventsService;
#endif

XblFunctionContext m_userChangeEventToken{ 0 };
uint64_t m_userChangeEventToken{ 0 };
uint64_t m_xuid{ 0 };

xbox::services::User m_user;
Expand Down
47 changes: 25 additions & 22 deletions Source/Services/Leaderboard/leaderboard_result.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,36 +68,39 @@ LeaderboardResult::ParseAdditionalColumns(const xsapi_internal_vector<xsapi_inte
{
const xsapi_internal_string& columnName = additionalColumnNames[i];
auto stat = stats.find(columnName);
const JsonValue& val = row.m_metadata[columnName.c_str()];
if (stat == stats.end() || stat->second == legacy::leaderboard_stat_type::stat_other)
if (row.m_metadata.IsObject() && row.m_metadata.HasMember(columnName.data()))
{
if(val.IsBool())
const JsonValue& val = row.m_metadata[columnName.c_str()];
if (stat == stats.end() || stat->second == legacy::leaderboard_stat_type::stat_other)
{
stats[columnName] = legacy::leaderboard_stat_type::stat_boolean;
}
else if (val.IsNumber())
{
stats[columnName] = legacy::leaderboard_stat_type::stat_double;
if (val.IsBool())
{
stats[columnName] = legacy::leaderboard_stat_type::stat_boolean;
}
else if (val.IsNumber())
{
stats[columnName] = legacy::leaderboard_stat_type::stat_double;
}
else if (val.IsString())
{
stats[columnName] = legacy::leaderboard_stat_type::stat_string;
}
else
{
stats[columnName] = legacy::leaderboard_stat_type::stat_other;
}

}
else if (val.IsString())

auto columnValues = JsonUtils::SerializeJson(val);
if (i >= row.m_columnValues.size() - 1)
{
stats[columnName] = legacy::leaderboard_stat_type::stat_string;
row.m_columnValues.push_back(columnValues);
}
else
{
stats[columnName] = legacy::leaderboard_stat_type::stat_other;
row.m_columnValues[i] = columnValues;
}

}

auto columnValues = JsonUtils::SerializeJson(val);
if (i >= row.m_columnValues.size() - 1)
{
row.m_columnValues.push_back(columnValues);
}
else
{
row.m_columnValues[i] = columnValues;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Services/Multiplayer/multiplayer_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2025,7 +2025,7 @@ STDAPI XblMultiplayerGetActivitiesWithPropertiesForSocialGroupResult(

size_t count{ 0 };
size_t verifiedSize{ 0 };
for (; verifiedSize < *bufferUsed - XBL_ALIGN_SIZE; ++count)
for (; *bufferUsed > 0 && verifiedSize < *bufferUsed - XBL_ALIGN_SIZE; ++count)
{
verifiedSize += sizeof(XblMultiplayerActivityDetails);
verifiedSize += strlen((*ptrToBuffer)[count].CustomSessionPropertiesJson) + 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ STDAPI_(XblFunctionContext) XblMultiplayerActivityAddInviteHandler(
}

auto rtaNotificationService = std::dynamic_pointer_cast<RTANotificationService>(xblContext->NotificationService());
return rtaNotificationService->AddGameInviteHandler(GameInviteSubscription::MultiplayerActivityInviteHandler{
return rtaNotificationService->AddGameInviteHandler(NotificationSubscription::MultiplayerActivityInviteHandler{
[
handler, context
]
Expand All @@ -316,7 +316,7 @@ STDAPI XblMultiplayerActivityRemoveInviteHandler(
{
RETURN_HR_INVALIDARGUMENT_IF_NULL(xblContext);
auto rtaNotificationService = std::dynamic_pointer_cast<RTANotificationService>(xblContext->NotificationService());
rtaNotificationService->RemoveGameInviteHandler(token);
rtaNotificationService->RemoveNotificationHandler(token);
return S_OK;
}
#endif
Loading

0 comments on commit b67fe71

Please sign in to comment.