Skip to content

Commit

Permalink
2210 GDK (#597)
Browse files Browse the repository at this point in the history
* 2210 GDK
  • Loading branch information
natiskan authored Oct 27, 2022
1 parent 65a698f commit 525786e
Show file tree
Hide file tree
Showing 62 changed files with 5,150 additions and 1,080 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 "2022.06.20220603.000"
#define XAL_VERSION "2022.08.20220825.000"

}
2 changes: 1 addition & 1 deletion Include/xsapi-c/achievements_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ enum class XblAchievementRewardType : uint32_t
enum class XblAchievementRarityCategory : uint32_t
{
/// <summary>
/// The rarity is incalculable (e.g. no one has played the title yet, demoninator is 0).
/// The rarity is incalculable (e.g. no one has played the title yet, denominator is 0).
/// </summary>
Unset = 0,

Expand Down
4 changes: 2 additions & 2 deletions Include/xsapi-c/achievements_manager_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ STDAPI XblAchievementsManagerGetAchievementsByState(
/// </summary>
/// <param name="xboxUserId">The Xbox User ID of the player.</param>
/// <param name="achievementId">The UTF-8 encoded achievement ID as defined by Dev Center.</param>
/// <param name="currentProgess">The completion percentage of the achievement to indicate progress.
/// <param name="currentProgress">The completion percentage of the achievement to indicate progress.
/// Valid values are from 1 to 100. Set to 100 to unlock the achievement.
/// Progress will be set by the server to the highest value sent</param>
/// <returns>HRESULT return code for this API operation.</returns>
Expand All @@ -287,7 +287,7 @@ STDAPI XblAchievementsManagerGetAchievementsByState(
STDAPI XblAchievementsManagerUpdateAchievement(
_In_ uint64_t xboxUserId,
_In_ const char* achievementId,
_In_ uint8_t currentProgess
_In_ uint8_t currentProgress
) XBL_NOEXCEPT;

} //end extern "C"
Expand Down
12 changes: 6 additions & 6 deletions Include/xsapi-c/multiplayer_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ enum class XblMultiplayerInitializationStage : uint32_t
Evaluating,

/// <summary>
/// Failed stage. If the first initilization episode didn't succeed, the session can't be initialized.
/// Failed stage. If the first initialization episode didn't succeed, the session can't be initialized.
/// </summary>
Failed
};
Expand Down Expand Up @@ -1138,7 +1138,7 @@ typedef struct XblMultiplayerSessionConstants
XblMultiplayerSessionCapabilities SessionCapabilities;
} XblMultiplayerSessionConstants;

#define XBL_MULTIPLAYER_DEVICE_TOKEN_MAX_LENGTH 40 // TODO confirm max size, not a GUID
#define XBL_MULTIPLAYER_DEVICE_TOKEN_MAX_LENGTH 40
#define XBL_MULTIPLAYER_SESSION_TEMPLATE_NAME_MAX_LENGTH 100
#define XBL_MULTIPLAYER_SESSION_NAME_MAX_LENGTH XBL_MULTIPLAYER_SESSION_TEMPLATE_NAME_MAX_LENGTH

Expand Down Expand Up @@ -2580,7 +2580,7 @@ STDAPI XblMultiplayerSessionSetMutableRoleSettings(
/// Gets the collection of members that are in the session or entering the session together.
/// </summary>
/// <param name="handle">Handle to the multiplayer session.</param>
/// <param name="members">Passes back a pointer to array of session member ojects.
/// <param name="members">Passes back a pointer to array of session member objects.
/// The memory for the returned pointer will remain valid for the life of the XblMultiplayerSessionHandle object until it is closed.</param>
/// <param name="membersCount">Passes back the size of the returned array.</param>
/// <returns>HRESULT return code for this API operation.</returns>
Expand Down Expand Up @@ -3243,7 +3243,7 @@ STDAPI XblMultiplayerSearchHandleGetJoinRestriction(
) XBL_NOEXCEPT;

/// <summary>
/// Get whether or not the session associated with the search handle is temporaraly closed for joining.
/// Get whether or not the session associated with the search handle is temporarily closed for joining.
/// </summary>
/// <param name="handle">Handle to the search handle details.</param>
/// <param name="closed">Passes back whether the session is closed or not.</param>
Expand All @@ -3270,7 +3270,7 @@ STDAPI XblMultiplayerSearchHandleGetMemberCounts(
/// Get the creation time of the search handle.
/// </summary>
/// <param name="handle">Handle to the search handle details.</param>
/// <param name="creationTime">Passes back the time the serach handle was created in MPSD (not the local object).</param>
/// <param name="creationTime">Passes back the time the search handle was created in MPSD (not the local object).</param>
/// <returns>HRESULT return code for this API operation.</returns>
STDAPI XblMultiplayerSearchHandleGetCreationTime(
_In_ XblMultiplayerSearchHandle handle,
Expand Down Expand Up @@ -3936,7 +3936,7 @@ STDAPI XblMultiplayerGetActivitiesWithPropertiesForUsersResult(
/// <returns>HRESULT return code for this API operation.</returns>
/// <remarks>
/// This method immediately enables the RTA connection, but the in order to receive session changed callbacks, the session
/// must be written again after enabling sunscriptions.
/// must be written again after enabling subscriptions.
/// </remarks>
STDAPI XblMultiplayerSetSubscriptionsEnabled(
_In_ XblContextHandle xblContext,
Expand Down
4 changes: 2 additions & 2 deletions Include/xsapi-c/multiplayer_manager_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@ STDAPI XblMultiplayerManagerLobbySessionSetProperties(
/// <remarks>
/// This function sets the value, represented as a JSON string, of a custom property for the lobby session. Custom properties
/// can be changed at any time. If custom properties are shared between devices, or may be updated by several devices
/// at the same time, use this function to ensure atomicity and resolve any conflicts between devices while changing the values of those cusotm properties.
/// at the same time, use this function to ensure atomicity and resolve any conflicts between devices while changing the values of those custom properties.
/// If a custom property isn't shared across devices, use the <see cref="XblMultiplayerManagerLobbySessionSetProperties"/> function instead
/// to change the value of that custom property.
/// <para>The service may reject the request to change the custom property if a race condition occurs due to a conflict.
Expand Down Expand Up @@ -1363,7 +1363,7 @@ STDAPI XblMultiplayerManagerGameSessionSetProperties(
/// <remarks>
/// This function sets the value, represented as a JSON string, of a custom property for the game session. Custom properties
/// can be changed at any time. If custom properties are shared between devices, or may be updated by several devices
/// at the same time, use this function to ensure atomicity and resolve any conflicts between devices while changing the values of those cusotm properties.
/// at the same time, use this function to ensure atomicity and resolve any conflicts between devices while changing the values of those custom properties.
/// If a custom property isn't shared across devices, use the <see cref="XblMultiplayerManagerGameSessionSetProperties"/> function instead
/// to change the value of that custom property.
/// <para>The service may reject the request to change the custom property if a race condition occurs due to a conflict.
Expand Down
2 changes: 1 addition & 1 deletion Include/xsapi-c/title_storage_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extern "C"

#define XBL_TITLE_STORAGE_BLOB_PATH_MAX_LENGTH (257 * 3)
#define XBL_TITLE_STORAGE_BLOB_DISPLAY_NAME_MAX_LENGTH (129 * 3)
#define XBL_TITLE_STORAGE_BLOB_ETAG_MAX_LENGTH (18 * 3) // TODO confirm with Azure Blob Services team
#define XBL_TITLE_STORAGE_BLOB_ETAG_MAX_LENGTH (18 * 3)

/// <summary>
/// Defines values used to indicate title storage type.
Expand Down
8 changes: 8 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Auto generated file from Gardener Plugin CentralFeedServiceAdoptionPlugin -->
<configuration>
<packageSources>
<clear />
<add key="xbox.services_PublicPackages" value="https://pkgs.dev.azure.com/microsoft/xbox.services/_packaging/xbox.services_PublicPackages/nuget/v3/index.json" />
</packageSources>
</configuration>
9 changes: 8 additions & 1 deletion Source/Services/Leaderboard/leaderboard_result.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,14 @@ LeaderboardResult::SerializeQuery(XblLeaderboardQuery* query, char* buffer)
query->xboxUserId = m_globalQuery->xuid.empty() ? 0 : utils::internal_string_to_uint64(m_globalQuery->xuid);

utils::strcpy(buffer, m_globalQuery->name.size() + 1, m_globalQuery->name.c_str());
query->leaderboardName = static_cast<char*>(buffer);
if (m_globalQuery->isTitleManaged)
{
query->statName = static_cast<char*>(buffer);
}
else
{
query->leaderboardName = static_cast<char*>(buffer);
}
buffer += m_globalQuery->name.size() + 1;

m_additionalColumnleaderboardNamesC.resize(m_globalQuery->columns.size());
Expand Down
21 changes: 16 additions & 5 deletions Source/Services/Multiplayer/Manager/multiplayer_lobby_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1201,11 +1201,22 @@ HRESULT MultiplayerLobbyClient::CreateGameFromLobby() noexcept
}
else if(m_setTransferHandleAttempt++ < MAX_CONNECTION_ATTEMPTS)
{
m_sessionToCommit = writeSessionResult.ExtractPayload();
// Retry setting transfer handle after a small delay
HRESULT hr = m_lobbyClient->m_queue.RunWork([op] {
op->SetTransferHandleToPending();
}, RETRY_DELAY_MS);

std::shared_ptr<XblMultiplayerSession> sessionToCommitTemp = writeSessionResult.ExtractPayload();

HRESULT hr = S_OK;
if (sessionToCommitTemp != nullptr) // handle rare case where an empty body is returned
{
m_sessionToCommit = sessionToCommitTemp;
// Retry setting transfer handle after a small delay
hr = m_lobbyClient->m_queue.RunWork([op] {
op->SetTransferHandleToPending();
}, RETRY_DELAY_MS);
}
else
{
hr = writeSessionResult.Hresult();
}

if (FAILED(hr))
{
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.06.20220915.4"
#define XBOX_SERVICES_API_VERSION_STRING "2022.10.20220915.0"
2 changes: 2 additions & 0 deletions Tests/ApiExplorer/APIs/apis_xal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ int XalCleanupAsync_Lua(lua_State *L)
if (Data()->nsalMockCall != nullptr)
{
HCMockRemoveMock(Data()->nsalMockCall);
//Close the handle we're holding onto for API runner state
HCMockCallCloseHandle(Data()->nsalMockCall);
Data()->nsalMockCall = nullptr;

if (Data()->libHttpClientInit) // Set on GDK where XAL is just a wrapper around XUser
Expand Down
19 changes: 19 additions & 0 deletions Tests/ApiExplorer/APIs/apis_xblc_multiplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ int XblMultiplayerSessionCreateHandle_Lua(lua_State *L)
// CODE SNIPPET END

auto state{ MPState() };
auto& session{ state->sessionHandles[static_cast<size_t>(sessionIndex)] };
if (session)
{
XblMultiplayerSessionCloseHandle(session);
}
state->sessionHandles[static_cast<unsigned int>(sessionIndex)] = sessionHandle;

lua_pushinteger(L, static_cast<lua_Integer>(sessionIndex));
Expand Down Expand Up @@ -1441,6 +1446,13 @@ int XblMultiplayerGetSessionAsync_Lua(lua_State *L)
std::unique_ptr<size_t> sessionIndexPtr{ static_cast<size_t*>(asyncBlock->context) };
auto sessionIndex{ *sessionIndexPtr };

auto& session{ MPState()->sessionHandles[sessionIndex] }; //CODE SNIP SKIP
if (session) //CODE SNIP SKIP
{
XblMultiplayerSessionCloseHandle(session); //CODE SNIP SKIP
MPState()->sessionHandles[sessionIndex] = nullptr; //CODE SNIP SKIP
}

XblMultiplayerSessionHandle sessionHandle = nullptr;
auto hr = XblMultiplayerGetSessionResult(asyncBlock, &sessionHandle);
LogToFile("XblMultiplayerGetSessionResult: hr=%s", ConvertHR(hr).c_str()); // CODE SNIP SKIP
Expand Down Expand Up @@ -1490,6 +1502,13 @@ int XblMultiplayerGetSessionByHandleAsync_Lua(lua_State *L)
std::unique_ptr<size_t> sessionIndexPtr{ static_cast<size_t*>(asyncBlock->context) };
auto sessionIndex{ *sessionIndexPtr };

auto& session{ MPState()->sessionHandles[sessionIndex] }; //CODE SNIP SKIP
if (session) //CODE SNIP SKIP
{
XblMultiplayerSessionCloseHandle(session); //CODE SNIP SKIP
MPState()->sessionHandles[sessionIndex] = nullptr; //CODE SNIP SKIP
}

XblMultiplayerSessionHandle sessionHandle = nullptr;
auto hr = XblMultiplayerGetSessionByHandleResult(asyncBlock, &sessionHandle);
LogToFile("XblMultiplayerGetSessionByHandleResult: hr=%s", ConvertHR(hr).c_str()); // CODE SNIP SKIP
Expand Down
1 change: 1 addition & 0 deletions Tests/ApiExplorer/Tests/mp/mp_partial_invite_flow.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ function OnXblMultiplayerSendInvitesAsync()
end

function OnXblMultiplayerGetSessionByHandleAsync()
XblMultiplayerSessionCloseHandle()
test.stopTest();
end

Expand Down
1 change: 1 addition & 0 deletions Tests/ApiExplorer/Tests/mp/mp_search.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ end

function OnXblMultiplayerDeleteSearchHandleAsync()
XblMultiplayerSearchHandleCloseHandle()
XblMultiplayerSessionCloseHandle()
test.stopTest();
end

Expand Down
2 changes: 2 additions & 0 deletions Tests/ApiExplorer/Tests/mp/mp_transfer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ function OnXblMultiplayerWriteSessionAsync()
end

function OnXblMultiplayerSetTransferHandleAsync()
XblMultiplayerSessionCloseHandle(session1)
XblMultiplayerSessionCloseHandle(session2)
test.stopTest();
end

Expand Down
2 changes: 1 addition & 1 deletion Tests/GDK/APIRunner.GDK/APIRunnerBin-MicrosoftGame.Config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Game configVersion="0">
<Game configVersion="1">

<Identity Name="41336MicrosoftATG.XboxLiveE2E" Publisher="CN=A4954634-DF4B-47C7-AB70-D3215D246AF1" Version="1.7.0.0" />

Expand Down
2 changes: 1 addition & 1 deletion Tests/GDK/APIRunner.GDK/APIRunnerSrc-MicrosoftGame.Config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Game configVersion="0">
<Game configVersion="1">

<Identity Name="41336MicrosoftATG.XboxLiveE2E" Publisher="CN=A4954634-DF4B-47C7-AB70-D3215D246AF1" Version="1.7.0.0" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Game configVersion="0">
<Game configVersion="1">

<Identity Name="41336MicrosoftATG.XboxLiveE2E" Publisher="CN=A4954634-DF4B-47C7-AB70-D3215D246AF1" Version="1.7.0.0" />

Expand Down
Loading

0 comments on commit 525786e

Please sign in to comment.