Skip to content

Commit

Permalink
2410 GDK (#603)
Browse files Browse the repository at this point in the history
* 2410 GDK

* Removing NogginOutput folder
  • Loading branch information
NandoCT1014 authored Nov 15, 2024
1 parent 8744d20 commit 1189ba7
Show file tree
Hide file tree
Showing 16 changed files with 311 additions and 30 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 "2024.02.20240220.000"
#define XAL_VERSION "2024.10.20240920.000"

}
Empty file.
2 changes: 1 addition & 1 deletion Include/xsapi-c/presence_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ STDAPI XblPresenceGetPresenceForMultipleUsersResult(
/// </summary>
/// <param name="xblContextHandle">Xbox live context for the local user.</param>
/// <param name="socialGroupName">The name of the group of users to get presence for.
/// This can be either "Favorites" or "People".</param>
/// This can be either "Favorites" to retrieve information about favorites, "People" to retrieve information about mutual friends and people a user follows, or "Friends" to retrieve information about mutual friends.</param>
/// <param name="socialGroupOwnerXuid">The user whose group should be targeted. If the input is null, current user will be used.</param>
/// <param name="filters">Optional filters struct to filter results.</param>
/// <param name="async">The AsyncBlock for this operation.</param>
Expand Down
8 changes: 7 additions & 1 deletion Include/xsapi-c/social_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,13 @@ typedef struct XblSocialRelationship
bool isFavorite;

/// <summary>
/// Indicates whether the person is following the person that requested the information.
/// Indicates whether there exists a mutual follower/following relation between a user and another Xbox User
/// </summary>
bool isFriend;

/// <summary>
/// Does not reflect a follower/following relationship, is currently kept for backwards compatibility purposes.
/// The value of this field is determined by the value of 'isFriend' within a XblSocialRelationship
/// </summary>
bool isFollowingCaller;

Expand Down
11 changes: 9 additions & 2 deletions Include/xsapi-c/social_manager_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,19 @@ typedef struct XblSocialManagerUser
bool isFavorite;

/// <summary>
/// Whether the calling user is following them.
/// Indicates whether there exists a mutual follower/following relation between a user and another user
/// </summary>
bool isFriend;

/// <summary>
/// No longer indicates whether a calling user is following a given user. Kept for backwards compatibility purposes.
/// The value of this field is determined by the value of 'isFriend'
/// </summary>
bool isFollowingUser;

/// <summary>
/// Whether they calling user is followed by this person.
/// No longer indicates whether a calling user is followed by given user. Kept for backwards compatibility purposes.
/// The value of this field is determined by the value of 'isFriend'
/// </summary>
bool isFollowedByCaller;

Expand Down
6 changes: 6 additions & 0 deletions Include/xsapi-cpp/impl/social.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ xbox_social_relationship::xbox_social_relationship(
m_xuid{ Utils::StringTFromUint64(socialRelationship.xboxUserId) },
m_isFavorite{ socialRelationship.isFavorite },
m_isFollowingCaller{ socialRelationship.isFollowingCaller },
m_isFriend{ socialRelationship.isFriend },
m_socialNetworks{ Utils::Transform<string_t>(socialRelationship.socialNetworks, socialRelationship.socialNetworksCount, Utils::StringTFromUtf8) }
{
}
Expand All @@ -35,6 +36,11 @@ bool xbox_social_relationship::is_following_caller() const
return m_isFollowingCaller;
}

bool xbox_social_relationship::is_friend() const
{
return m_isFriend;
}

const std::vector<string_t>& xbox_social_relationship::social_networks() const
{
return m_socialNetworks;
Expand Down
10 changes: 9 additions & 1 deletion Include/xsapi-cpp/social.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,14 @@ class xbox_social_relationship
inline bool is_favorite() const;

/// <summary>
/// Indicates whether the person is following the person that requested the information.
/// Indicates whether the person is a friend (mutual follower) of the user.
/// </summary>
inline bool is_friend() const;

/// <summary>
/// Does not indicate a following/follower relation between caller user other users.
/// Currently will return true if a person is a mutual follower of a user that
/// requested information (this is dependent on the value of 'isFriend' field).
/// </summary>
inline bool is_following_caller() const;

Expand All @@ -238,6 +245,7 @@ class xbox_social_relationship
string_t m_xuid;
bool m_isFavorite{ false };
bool m_isFollowingCaller{ false };
bool m_isFriend{ false };
std::vector<string_t> m_socialNetworks;
};

Expand Down
19 changes: 13 additions & 6 deletions Source/Services/Social/Manager/peoplehub_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ HRESULT PeoplehubService::GetSocialUsers(
{
return MakeServiceCall(xuid, decorations, RelationshipType::Batch, xuids, async);
}

HRESULT PeoplehubService::MakeServiceCall(
_In_ uint64_t xuid,
_In_ XblSocialManagerExtraDetailLevel decorations,
Expand All @@ -54,7 +54,7 @@ HRESULT PeoplehubService::MakeServiceCall(
{
case RelationshipType::Social:
{
subpath << "social";
subpath << "friends";
break;
}
case RelationshipType::Batch:
Expand Down Expand Up @@ -99,7 +99,7 @@ HRESULT PeoplehubService::MakeServiceCall(
xbox_live_api::get_social_graph
));

httpCall->SetXblServiceContractVersion(5);
httpCall->SetXblServiceContractVersion(7);

if (!bodyJson.IsNull())
{
Expand Down Expand Up @@ -166,9 +166,8 @@ Result<XblSocialManagerUser> PeoplehubService::DeserializeUser(
}

RETURN_HR_IF_FAILED(JsonUtils::ExtractJsonXuid(json, "xuid", user.xboxUserId, true));
RETURN_HR_IF_FAILED(JsonUtils::ExtractJsonBool(json, "isFavorite", user.isFavorite));
RETURN_HR_IF_FAILED(JsonUtils::ExtractJsonBool(json, "isFollowedByCaller", user.isFollowedByCaller));
RETURN_HR_IF_FAILED(JsonUtils::ExtractJsonBool(json, "isFollowingCaller", user.isFollowingUser));
RETURN_HR_IF_FAILED(JsonUtils::ExtractJsonBool(json, "isFriend", user.isFriend));
RETURN_HR_IF_FAILED(JsonUtils::ExtractJsonBool(json, "isFavorite", user.isFavorite));
RETURN_HR_IF_FAILED(JsonUtils::ExtractJsonStringToCharArray(json, "displayName", user.displayName, sizeof(user.displayName)));
RETURN_HR_IF_FAILED(JsonUtils::ExtractJsonStringToCharArray(json, "realName", user.realName, sizeof(user.realName)));
RETURN_HR_IF_FAILED(JsonUtils::ExtractJsonStringToCharArray(json, "displayPicRaw", user.displayPicUrlRaw, sizeof(user.displayPicUrlRaw)));
Expand All @@ -179,6 +178,14 @@ Result<XblSocialManagerUser> PeoplehubService::DeserializeUser(
RETURN_HR_IF_FAILED(JsonUtils::ExtractJsonStringToCharArray(json, "uniqueModernGamertag", user.uniqueModernGamertag, sizeof(user.uniqueModernGamertag)));
RETURN_HR_IF_FAILED(JsonUtils::ExtractJsonStringToCharArray(json, "gamerScore", user.gamerscore, sizeof(user.gamerscore)));

// isFavorite should reflect both isFavorite && isFriend from the service response
user.isFavorite = user.isFavorite && user.isFriend;
// Shim isFollowingUser and isFollowedByCaller to be true if isFriend is true
// This is purely for compatibility purposes and doesn’t reflect a follower/following relationship
user.isFollowedByCaller = user.isFriend;
user.isFollowingUser = user.isFriend;


auto presenceRecordResult = DeserializePresenceRecord(json);
if (Succeeded(presenceRecordResult))
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Services/Social/Manager/social_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ void SocialGraph::StopTrackingUsers(
for (auto xuid : xuids)
{
auto iter{ m_trackedUsers.find(xuid) };
if (--iter->second.refCount == 0)
if (iter != m_trackedUsers.end() && --iter->second.refCount == 0)
{
m_trackedUsers.erase(iter);
m_pendingUpdates[xuid] = { ProfileChanges::None, nullptr };
Expand Down
7 changes: 6 additions & 1 deletion Source/Services/Social/social_relationship_result.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,13 @@ Result<std::shared_ptr<XblSocialRelationshipResult>> XblSocialRelationshipResult
XblSocialRelationship relationship{};
RETURN_HR_IF_FAILED(JsonUtils::ExtractJsonXuid(person, "xuid", relationship.xboxUserId, true));
RETURN_HR_IF_FAILED(JsonUtils::ExtractJsonBool(person, "isFavorite", relationship.isFavorite));
RETURN_HR_IF_FAILED(JsonUtils::ExtractJsonBool(person, "isFollowingCaller", relationship.isFollowingCaller));
RETURN_HR_IF_FAILED(JsonUtils::ExtractJsonBool(person, "isFriend", relationship.isFriend));

// isFavorite should reflect the vlaues of 'isFavorite' and ‘isFriend’ from the service response
relationship.isFavorite = relationship.isFavorite && relationship.isFriend;
// Shimming isFriend response into isFollowingCaller for compatibility purposes.
// This does not reflect a follower/following relationship.
relationship.isFollowingCaller = relationship.isFriend;
xsapi_internal_vector<xsapi_internal_string> socialNetworksInternalVector;
JsonUtils::ExtractJsonVector<xsapi_internal_string>(JsonUtils::JsonStringExtractor, person, "socialNetworks", socialNetworksInternalVector, false);
UTF8StringArray socialNetworks(socialNetworksInternalVector);
Expand Down
20 changes: 9 additions & 11 deletions Source/Services/Social/social_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ HRESULT SocialService::GetSocialRelationships(
_In_ AsyncContext<Result<std::shared_ptr<XblSocialRelationshipResult>>> async
) const noexcept
{
bool includeViewFilter = filter != XblSocialRelationshipFilter::All;

xsapi_internal_stringstream subpath;
subpath << "/users/xuid(";
Expand All @@ -73,13 +72,11 @@ HRESULT SocialService::GetSocialRelationships(

xsapi_internal_string nextDelimiter = "?";

if (includeViewFilter)
{
subpath << nextDelimiter;
subpath << "view=";
subpath << SocialRelationshipFilterToString(filter);
nextDelimiter = "&";
}
subpath << nextDelimiter;
subpath << "view=";
subpath << SocialRelationshipFilterToString(filter);
nextDelimiter = "&";


if (startIndex > 0)
{
Expand Down Expand Up @@ -108,6 +105,8 @@ HRESULT SocialService::GetSocialRelationships(
xbox_live_api::get_social_relationships
));

httpCall->SetXblServiceContractVersion(3);

return httpCall->Perform({
async.Queue(),
[
Expand Down Expand Up @@ -150,12 +149,11 @@ xsapi_internal_string SocialService::SocialRelationshipFilterToString(
case XblSocialRelationshipFilter::LegacyXboxLiveFriends:
{
return "LegacyXboxLiveFriends";
}

}
case XblSocialRelationshipFilter::All:
default:
{
return xsapi_internal_string{};
return "FriendList";
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Shared/build_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
//*********************************************************
#pragma once

#define XBOX_SERVICES_API_VERSION_STRING "2024.06.20240521.0"
#define XBOX_SERVICES_API_VERSION_STRING "2024.10.20240919.0"
2 changes: 1 addition & 1 deletion Tests/ApiExplorer/APIs/apis_cpp_presence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ int PresenceServiceGetPresenceForMultipleUsers_Lua(lua_State* L)
int PresenceServiceGetPresenceForSocialGroup_Lua(lua_State *L)
{
#if CPP_TESTS_ENABLED
string_t socialGroup = xbox::services::Utils::StringTFromUtf8(GetStringFromLua(L, 1, "Favorites").c_str());
string_t socialGroup = xbox::services::Utils::StringTFromUtf8(GetStringFromLua(L, 1, "Friends").c_str());

std::shared_ptr<xbox::services::xbox_live_context> xblc = std::make_shared<xbox::services::xbox_live_context>(Data()->xboxLiveContext);
xblc->presence_service().get_presence_for_social_group(socialGroup).then(
Expand Down
3 changes: 2 additions & 1 deletion Tests/ApiExplorer/Tests/cmds.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"rem rt gdk-gameinvite\\game-invite.lua", // rt will run a single test
"rem repeat social\\social_manager_2.lua", // "repeat" will repeat this single test without cleanup forever
"rem loop", // "loop" will loop the entire cmds.json file including cleanup, forever
"rts"
"rem rts",
"rt presence/presence-cpp.lua"
]
}
1 change: 0 additions & 1 deletion Tests/GDK/APIRunner.GDK/APIRunner.143.GDK.Src.log

This file was deleted.

Loading

0 comments on commit 1189ba7

Please sign in to comment.