Skip to content

Commit

Permalink
2303 publish to Github (#600)
Browse files Browse the repository at this point in the history
Co-authored-by: Raul Gomez Rodriguez <[email protected]>
  • Loading branch information
rgomez391 and raulalbertog authored Mar 23, 2023
1 parent f1a347b commit d5841d9
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Include/xsapi-c/social_manager_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ typedef struct XblSocialManagerPresenceTitleRecord
/// </summary>
uint32_t titleId;

/// <summary>
/// The title name.
/// </summary>
char titleName[XBL_TITLE_NAME_CHAR_SIZE];

/// <summary>
/// The active state for the title.
/// </summary>
Expand Down
1 change: 1 addition & 0 deletions Include/xsapi-c/types_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ extern "C"
#define XBL_UNIQUE_MODERN_GAMERTAG_CHAR_SIZE (XBL_MODERN_GAMERTAG_CHAR_SIZE + 1 + 3 ) // modern gamertag + '#' + max suffix size for cases when MGT display length is 12. Null terminator already accoutned for in MGT
#define XBL_REAL_NAME_CHAR_SIZE (255 * 3)
#define XBL_RICH_PRESENCE_CHAR_SIZE (100 * 3)
#define XBL_TITLE_NAME_CHAR_SIZE (100 * 3)
#define XBL_XBOX_USER_ID_CHAR_SIZE (21 * 3)
#define XBL_LAST_TIME_PLAYED_CHAR_SIZE 25

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ MultiplayerClientManager::JoinGame(
gameSession->Join(nullptr, false);
for (const auto& memberXuid : xboxUserIds)
{
if (memberXuid == primaryContext->Xuid())
if (memberXuid != primaryContext->Xuid())
{
gameSession->AddMemberReservation(memberXuid);
}
Expand Down
12 changes: 12 additions & 0 deletions Source/Services/Social/Manager/peoplehub_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,18 @@ Result<XblSocialManagerPresenceTitleRecord> PeoplehubService::DeserializePresenc
record.titleId = utils::internal_string_to_uint32(titleId);
RETURN_HR_IF_FAILED(JsonUtils::ExtractJsonBool(json, "IsPrimary", record.isPrimary));

//get titleName from Presence string: format should be "Title - Rich Presence Text"
for (int i = 0; i < XBL_TITLE_NAME_CHAR_SIZE; i++)
{
char c = record.presenceText[i];
if (c == '-' || c == '\0')
{
record.titleName[i] = '\0';
break;
}
record.titleName[i] = c;
}

return Result<XblSocialManagerPresenceTitleRecord>{ record };
}

Expand Down
1 change: 1 addition & 0 deletions Source/Services/Social/Manager/social_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,7 @@ XblSocialManagerPresenceRecord SocialGraph::ConvertPresenceRecord(

smTitleRecord.titleId = newTitleRecord.titleId;
smTitleRecord.isTitleActive = newTitleRecord.titleActive;
utils::strcpy(smTitleRecord.titleName, sizeof(smTitleRecord.titleName), newTitleRecord.titleName);
utils::strcpy(smTitleRecord.presenceText, sizeof(smTitleRecord.presenceText), newTitleRecord.richPresenceString);
smTitleRecord.isBroadcasting = newTitleRecord.broadcastRecord != nullptr;
smTitleRecord.deviceType = deviceRecord.deviceType;
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 "2022.10.20221025.1"
#define XBOX_SERVICES_API_VERSION_STRING "2023.03.20230214.0"
1 change: 1 addition & 0 deletions Tests/ApiExplorer/Shared/mem_hook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ bool ApiRunerMemHook::IsStackInXSAPI(StackInfo& stackInfo)
void ApiRunerMemHook::GetStackTrace(StackInfo &stackInfo)
{
#if HC_PLATFORM == HC_PLATFORM_WIN32 || (HC_PLATFORM == HC_PLATFORM_GDK && !_GAMING_XBOX)
std::lock_guard<std::recursive_mutex> guard(m_lock);
void* stack[TRACE_MAX_STACK_FRAMES] = { 0 };
WORD numberOfFrames = CaptureStackBackTrace(0, TRACE_MAX_STACK_FRAMES, stack, NULL);
stackInfo.stackSize = numberOfFrames < 64 ? numberOfFrames : 64;
Expand Down

0 comments on commit d5841d9

Please sign in to comment.