Merge branch 'development' of https://github.com/o3de/o3de into carlitosan/development
This commit is contained in:
@@ -77,7 +77,6 @@ class TestAllComponentsIndepthTests(object):
|
||||
unexpected_lines=unexpected_lines,
|
||||
halt_on_unexpected=True,
|
||||
cfg_args=[level],
|
||||
auto_test_mode=False,
|
||||
null_renderer=False,
|
||||
)
|
||||
|
||||
|
||||
@@ -497,9 +497,15 @@ void LevelEditorMenuHandler::PopulateEditMenu(ActionManager::MenuWrapper& editMe
|
||||
// Hide Selection
|
||||
editMenu.AddAction(AzToolsFramework::HideSelection);
|
||||
|
||||
// Unhide All
|
||||
// Show All
|
||||
editMenu.AddAction(AzToolsFramework::ShowAll);
|
||||
|
||||
// Lock Selection
|
||||
editMenu.AddAction(AzToolsFramework::LockSelection);
|
||||
|
||||
// UnLock All
|
||||
editMenu.AddAction(AzToolsFramework::UnlockAll);
|
||||
|
||||
/*
|
||||
* The following block of code is part of the feature "Isolation Mode" and is temporarily
|
||||
* disabled for 1.10 release.
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include <AzCore/Math/Vector3.h>
|
||||
#include <AzCore/Serialization/Json/JsonSerializationSettings.h>
|
||||
#include <AzCore/std/string/string_view.h>
|
||||
#include <Tests/Serialization/Json/JsonSerializationTests.h>
|
||||
|
||||
@@ -43,7 +44,9 @@ namespace JsonSerializationTests
|
||||
}
|
||||
|
||||
void CheckApplyPatchOutcome(const char* target, const char* patch,
|
||||
AZ::JsonSerializationResult::Outcomes outcome, AZ::JsonSerializationResult::Processing processing)
|
||||
AZ::JsonSerializationResult::Outcomes outcome,
|
||||
AZ::JsonSerializationResult::Processing processing,
|
||||
const AZ::JsonApplyPatchSettings& settings = AZ::JsonApplyPatchSettings{})
|
||||
{
|
||||
m_jsonDocument->Parse(target);
|
||||
ASSERT_FALSE(m_jsonDocument->HasParseError());
|
||||
@@ -53,12 +56,24 @@ namespace JsonSerializationTests
|
||||
ASSERT_FALSE(patchDocument.HasParseError());
|
||||
|
||||
AZ::JsonSerializationResult::ResultCode result = AZ::JsonSerialization::ApplyPatch(*m_jsonDocument,
|
||||
m_jsonDocument->GetAllocator(), patchDocument, AZ::JsonMergeApproach::JsonPatch);
|
||||
m_jsonDocument->GetAllocator(), patchDocument, AZ::JsonMergeApproach::JsonPatch, settings);
|
||||
EXPECT_EQ(result.GetTask(), AZ::JsonSerializationResult::Tasks::Merge);
|
||||
EXPECT_EQ(result.GetOutcome(), outcome);
|
||||
EXPECT_EQ(result.GetProcessing(), processing);
|
||||
}
|
||||
|
||||
void CheckApplyPatchOutcome(
|
||||
const char* target,
|
||||
const char* patch,
|
||||
const char* expectedPatchedResult,
|
||||
AZ::JsonSerializationResult::Outcomes outcome,
|
||||
AZ::JsonSerializationResult::Processing processing,
|
||||
const AZ::JsonApplyPatchSettings& settings = AZ::JsonApplyPatchSettings{})
|
||||
{
|
||||
CheckApplyPatchOutcome(target, patch, outcome, processing, settings);
|
||||
Expect_DocStrEq(expectedPatchedResult);
|
||||
}
|
||||
|
||||
void CheckCreatePatch_Core(const char* source, AZStd::string_view patch, const char* target,
|
||||
AZ::JsonMergeApproach approach)
|
||||
{
|
||||
@@ -262,6 +277,36 @@ namespace JsonSerializationTests
|
||||
Outcomes::TypeMismatch, Processing::Halted);
|
||||
}
|
||||
|
||||
TEST_F(JsonPatchingSerializationTests, ApplyPatch_UseJsonPatchWithCustomReportingCallback_ReportPartialSkip)
|
||||
{
|
||||
using namespace AZ::JsonSerializationResult;
|
||||
auto issueReportingCallback = [](AZStd::string_view, AZ::JsonSerializationResult::ResultCode result,
|
||||
AZStd::string_view) -> AZ::JsonSerializationResult::ResultCode
|
||||
{
|
||||
using namespace AZ::JsonSerializationResult;
|
||||
if (result.GetProcessing() == Processing::Halted)
|
||||
{
|
||||
return ResultCode(result.GetTask(), Outcomes::PartialSkip);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
AZ::JsonApplyPatchSettings applyPatchSettings;
|
||||
applyPatchSettings.m_reporting = AZStd::move(issueReportingCallback);
|
||||
CheckApplyPatchOutcome(
|
||||
R"({})",
|
||||
R"([
|
||||
{ "op": "add", "path": "/nonexistent_key/new_member", "value": "someValue" },
|
||||
{ "op": "add", "path": "/test", "value": "someValue" }
|
||||
])",
|
||||
R"(
|
||||
{ "test": "someValue" }
|
||||
)",
|
||||
Outcomes::PartialSkip,
|
||||
Processing::Completed,
|
||||
AZStd::move(applyPatchSettings));
|
||||
}
|
||||
|
||||
TEST_F(JsonPatchingSerializationTests, ApplyPatch_UseJsonPatchAddUnnamedMember_ReportsSuccess)
|
||||
{
|
||||
CheckApplyPatch(
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace AzNetworking
|
||||
|
||||
void TcpSocketManager::ProcessEvents(AZ::TimeMs maxBlockMs, const SocketEventCallback& readCallback, const SocketEventCallback& writeCallback)
|
||||
{
|
||||
if(static_cast<int32_t>(m_maxFd) <= 0 && m_socketFds.empty())
|
||||
if(static_cast<int32_t>(m_maxFd) <= 0 || m_socketFds.empty())
|
||||
{
|
||||
// There are no available sockets to process
|
||||
return;
|
||||
|
||||
+11
-8
@@ -172,20 +172,23 @@ namespace AzToolsFramework
|
||||
PrefabDom& templateDomReference = m_prefabSystemComponentInterface->FindTemplateDom(templateId);
|
||||
|
||||
//apply patch to template
|
||||
AZ::JsonSerializationResult::ResultCode result = AZ::JsonSerialization::ApplyPatch(templateDomReference,
|
||||
templateDomReference.GetAllocator(), providedPatch, AZ::JsonMergeApproach::JsonPatch);
|
||||
AZ::JsonSerializationResult::ResultCode result =
|
||||
PrefabDomUtils::ApplyPatches(templateDomReference, templateDomReference.GetAllocator(), providedPatch);
|
||||
|
||||
//trigger propagation
|
||||
if (result.GetOutcome() == AZ::JsonSerializationResult::Outcomes::Success)
|
||||
if (result.GetOutcome() != AZ::JsonSerializationResult::Outcomes::Success)
|
||||
{
|
||||
m_prefabSystemComponentInterface->SetTemplateDirtyFlag(templateId, true);
|
||||
m_prefabSystemComponentInterface->PropagateTemplateChanges(templateId, instanceToExclude);
|
||||
return true;
|
||||
AZ_Error("Prefab", false, "Patch was not successfully applied.");
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
AZ_Error("Prefab", false, "Patch was not successfully applied");
|
||||
return false;
|
||||
AZ_Error(
|
||||
"Prefab", result.GetOutcome() != AZ::JsonSerializationResult::Outcomes::PartialSkip,
|
||||
"Some of the patches are not successfully applied.");
|
||||
m_prefabSystemComponentInterface->SetTemplateDirtyFlag(templateId, true);
|
||||
m_prefabSystemComponentInterface->PropagateTemplateChanges(templateId, instanceToExclude);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -176,12 +176,17 @@ namespace AzToolsFramework
|
||||
}
|
||||
else
|
||||
{
|
||||
AZ::JsonSerializationResult::ResultCode applyPatchResult = AZ::JsonSerialization::ApplyPatch(
|
||||
sourceTemplateDomCopy,
|
||||
targetTemplatePrefabDom.GetAllocator(),
|
||||
patchesReference->get(),
|
||||
AZ::JsonMergeApproach::JsonPatch);
|
||||
AZ::JsonSerializationResult::ResultCode applyPatchResult =
|
||||
PrefabDomUtils::ApplyPatches(sourceTemplateDomCopy, targetTemplatePrefabDom.GetAllocator(), patchesReference->get());
|
||||
linkedInstanceDom.CopyFrom(sourceTemplateDomCopy, targetTemplatePrefabDom.GetAllocator());
|
||||
|
||||
PrefabDomValueReference sourceTemplateName =
|
||||
PrefabDomUtils::FindPrefabDomValue(sourceTemplateDomCopy, PrefabDomUtils::SourceName);
|
||||
AZ_Assert(sourceTemplateName && sourceTemplateName->get().IsString(), "A valid source template name couldn't be found");
|
||||
PrefabDomValueReference targetTemplateName =
|
||||
PrefabDomUtils::FindPrefabDomValue(targetTemplatePrefabDom, PrefabDomUtils::SourceName);
|
||||
AZ_Assert(targetTemplateName && targetTemplateName->get().IsString(), "A valid target template name couldn't be found");
|
||||
|
||||
if (applyPatchResult.GetProcessing() != AZ::JsonSerializationResult::Processing::Completed)
|
||||
{
|
||||
AZ_Error(
|
||||
@@ -190,6 +195,14 @@ namespace AzToolsFramework
|
||||
m_sourceTemplateId, m_targetTemplateId);
|
||||
return false;
|
||||
}
|
||||
if (applyPatchResult.GetOutcome() == AZ::JsonSerializationResult::Outcomes::PartialSkip)
|
||||
{
|
||||
AZ_Error(
|
||||
"Prefab", false,
|
||||
"Link::UpdateTarget - Some of the patches couldn't be applied on the source template '%s' present under the "
|
||||
"target Template '%s'.",
|
||||
sourceTemplateName->get().GetString(), targetTemplateName->get().GetString());
|
||||
}
|
||||
}
|
||||
|
||||
// This is a guardrail to ensure the linked instance dom always has the LinkId value
|
||||
|
||||
@@ -236,6 +236,26 @@ namespace AzToolsFramework
|
||||
return findInstancesResult->get();
|
||||
}
|
||||
|
||||
AZ::JsonSerializationResult::ResultCode ApplyPatches(
|
||||
PrefabDomValue& prefabDomToApplyPatchesOn, PrefabDom::AllocatorType& allocator, const PrefabDomValue& patches)
|
||||
{
|
||||
auto issueReportingCallback = [](AZStd::string_view, AZ::JsonSerializationResult::ResultCode result,
|
||||
AZStd::string_view) -> AZ::JsonSerializationResult::ResultCode
|
||||
{
|
||||
using namespace AZ::JsonSerializationResult;
|
||||
if (result.GetProcessing() == Processing::Halted)
|
||||
{
|
||||
return ResultCode(result.GetTask(), Outcomes::PartialSkip);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
AZ::JsonApplyPatchSettings applyPatchSettings;
|
||||
applyPatchSettings.m_reporting = AZStd::move(issueReportingCallback);
|
||||
return AZ::JsonSerialization::ApplyPatch(
|
||||
prefabDomToApplyPatchesOn, allocator, patches, AZ::JsonMergeApproach::JsonPatch, applyPatchSettings);
|
||||
}
|
||||
|
||||
void PrintPrefabDomValue(
|
||||
[[maybe_unused]] const AZStd::string_view printMessage,
|
||||
[[maybe_unused]] const PrefabDomValue& prefabDomValue)
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/Serialization/Json/JsonSerializationResult.h>
|
||||
#include <AzCore/std/optional.h>
|
||||
#include <AzCore/Asset/AssetCommon.h>
|
||||
#include <AzToolsFramework/Prefab/Instance/Instance.h>
|
||||
@@ -122,6 +123,11 @@ namespace AzToolsFramework
|
||||
*/
|
||||
PrefabDomValueConstReference GetInstancesValue(const PrefabDomValue& prefabDom);
|
||||
|
||||
AZ::JsonSerializationResult::ResultCode ApplyPatches(
|
||||
PrefabDomValue& prefabDomToApplyPatchesOn,
|
||||
PrefabDom::AllocatorType& allocator,
|
||||
const PrefabDomValue& patches);
|
||||
|
||||
/**
|
||||
* Prints the contents of the given prefab DOM value to the debug output console in a readable format.
|
||||
* @param printMessage The message that will be printed before printing the PrefabDomValue
|
||||
|
||||
@@ -261,8 +261,13 @@ namespace AzToolsFramework
|
||||
instanceDom.CopyFrom(instanceDomRef->get(), instanceDom.GetAllocator());
|
||||
|
||||
//apply the patch to the template within the target
|
||||
AZ::JsonSerializationResult::ResultCode result = AZ::JsonSerialization::ApplyPatch(instanceDom,
|
||||
instanceDom.GetAllocator(), patch, AZ::JsonMergeApproach::JsonPatch);
|
||||
AZ::JsonSerializationResult::ResultCode result = PrefabDomUtils::ApplyPatches(instanceDom, instanceDom.GetAllocator(), patch);
|
||||
|
||||
AZ_Error(
|
||||
"Prefab",
|
||||
result.GetOutcome() == AZ::JsonSerializationResult::Outcomes::PartialSkip ||
|
||||
result.GetOutcome() == AZ::JsonSerializationResult::Outcomes::Success,
|
||||
"Some of the patches are not successfully applied.");
|
||||
|
||||
//remove the link id placed into the instance
|
||||
auto linkIdIter = instanceDom.FindMember(PrefabDomUtils::LinkIdName);
|
||||
|
||||
@@ -22,11 +22,11 @@ namespace AzToolsFramework
|
||||
/// @name Reverse URLs.
|
||||
/// Used to identify common actions and override them when necessary.
|
||||
//@{
|
||||
static const AZ::Crc32 s_backAction = AZ_CRC("com.amazon.action.common.back", 0xd772a2af);
|
||||
static const AZ::Crc32 s_deleteAction = AZ_CRC("com.amazon.action.common.delete", 0x5731f6cb);
|
||||
static const AZ::Crc32 s_duplicateAction = AZ_CRC("com.amazon.action.common.duplicate", 0x08ccf461);
|
||||
static const AZ::Crc32 s_nextComponentMode = AZ_CRC("com.amazon.action.common.nextComponentMode", 0xcc26094f);
|
||||
static const AZ::Crc32 s_previousComponentMode = AZ_CRC("com.amazon.action.common.previousComponentMode", 0x0d18ff39);
|
||||
static const AZ::Crc32 s_backAction = AZ_CRC("com.o3de.action.common.back", 0xd772a2af);
|
||||
static const AZ::Crc32 s_deleteAction = AZ_CRC("com.o3de.action.common.delete", 0x5731f6cb);
|
||||
static const AZ::Crc32 s_duplicateAction = AZ_CRC("com.o3de.action.common.duplicate", 0x08ccf461);
|
||||
static const AZ::Crc32 s_nextComponentMode = AZ_CRC("com.o3de.action.common.nextComponentMode", 0xcc26094f);
|
||||
static const AZ::Crc32 s_previousComponentMode = AZ_CRC("com.o3de.action.common.previousComponentMode", 0x0d18ff39);
|
||||
//@}
|
||||
|
||||
/// Specific Action properties to be sent to a type implementing
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ namespace AzToolsFramework
|
||||
{
|
||||
}
|
||||
|
||||
AZ::Crc32 m_uri; //!< Unique identifier for the Action. (In the form 'com.amazon.action.---").
|
||||
AZ::Crc32 m_uri; //!< Unique identifier for the Action. (In the form 'com.o3de.action.---").
|
||||
AZStd::vector<AZStd::function<void()>> m_callbacks; //!< Callbacks associated with this Action (note: with multi-selections
|
||||
//!< there will be a callback per Entity/Component).
|
||||
AZStd::unique_ptr<QAction> m_action; //!< The QAction associated with the overrideWidget for all ComponentMode actions.
|
||||
|
||||
@@ -196,7 +196,7 @@ namespace AzToolsFramework
|
||||
|
||||
AZStd::vector<AzToolsFramework::ActionOverride> PlaceHolderComponentMode::PopulateActionsImpl()
|
||||
{
|
||||
const AZ::Crc32 placeHolderComponentModeAction = AZ_CRC_CE("com.amazon.action.placeholder.test");
|
||||
const AZ::Crc32 placeHolderComponentModeAction = AZ_CRC_CE("com.o3de.action.placeholder.test");
|
||||
|
||||
return AZStd::vector<AzToolsFramework::ActionOverride>
|
||||
{
|
||||
|
||||
@@ -96,8 +96,8 @@ namespace UnitTest
|
||||
|
||||
//apply the patch
|
||||
PrefabDom& templateDomReference = m_prefabSystemComponent->FindTemplateDom(nestedTemplateId);
|
||||
AZ::JsonSerializationResult::ResultCode result = AZ::JsonSerialization::ApplyPatch(templateDomReference,
|
||||
templateDomReference.GetAllocator(), patch, AZ::JsonMergeApproach::JsonPatch);
|
||||
AZ::JsonSerializationResult::ResultCode result =
|
||||
PrefabDomUtils::ApplyPatches(templateDomReference, templateDomReference.GetAllocator(), patch);
|
||||
|
||||
AZ_Error("Prefab", result.GetOutcome() == AZ::JsonSerializationResult::Outcomes::Success,
|
||||
"Patch was not successfully applied");
|
||||
|
||||
@@ -25,6 +25,8 @@ namespace AWSNativeSDKInit
|
||||
#if defined(PLATFORM_SUPPORTS_AWS_NATIVE_SDK)
|
||||
void CustomizeSDKOptions(Aws::SDKOptions& options);
|
||||
void CustomizeShutdown();
|
||||
|
||||
void CopyCaCertBundle();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -44,6 +46,8 @@ namespace AWSNativeSDKInit
|
||||
void InitializationManager::InitAwsApi()
|
||||
{
|
||||
s_initManager = AZ::Environment::CreateVariable<InitializationManager>(initializationManagerTag);
|
||||
|
||||
Platform::CopyCaCertBundle();
|
||||
}
|
||||
|
||||
void InitializationManager::Shutdown()
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzCore/PlatformDef.h>
|
||||
// The AWS Native SDK AWSAllocator triggers a warning due to accessing members of std::allocator directly.
|
||||
// AWSAllocator.h(70): warning C4996: 'std::allocator<T>::pointer': warning STL4010: Various members of std::allocator are deprecated in
|
||||
// C++17. Use std::allocator_traits instead of accessing these members directly. You can define
|
||||
// _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received
|
||||
// this warning.
|
||||
AZ_PUSH_DISABLE_WARNING(4251 4996, "-Wunknown-warning-option")
|
||||
#include <aws/core/utils/memory/stl/AWSString.h>
|
||||
AZ_POP_DISABLE_WARNING
|
||||
#include <AzCore/Android/Utils.h>
|
||||
#include <AzCore/IO/FileIO.h>
|
||||
#include <AzCore/IO/SystemFile.h>
|
||||
#include <AzCore/std/containers/vector.h>
|
||||
|
||||
namespace AWSNativeSDKInit
|
||||
{
|
||||
namespace Platform
|
||||
{
|
||||
void CopyCaCertBundle()
|
||||
{
|
||||
AZStd::vector<char> contents;
|
||||
AZStd::string certificatePath = "@assets@/certificates/aws/cacert.pem";
|
||||
AZStd::string publicStoragePath = AZ::Android::Utils::GetAppPublicStoragePath();
|
||||
publicStoragePath.append("/certificates/aws/cacert.pem");
|
||||
|
||||
AZ::IO::FileIOBase* fileBase = AZ::IO::FileIOBase::GetInstance();
|
||||
|
||||
if (!fileBase->Exists(certificatePath.c_str()))
|
||||
{
|
||||
AZ_Error("AWSNativeSDKInit", false, "Certificate File(%s) does not exist.\n", certificatePath.c_str());
|
||||
}
|
||||
|
||||
AZ::IO::HandleType fileHandle;
|
||||
AZ::IO::Result fileResult = fileBase->Open(certificatePath.c_str(), AZ::IO::OpenMode::ModeRead, fileHandle);
|
||||
|
||||
if (!fileResult)
|
||||
{
|
||||
AZ_Error("AWSNativeSDKInit", false, "Failed to open certificate file with result %i\n", fileResult.GetResultCode());
|
||||
}
|
||||
|
||||
AZ::u64 fileSize = 0;
|
||||
fileBase->Size(fileHandle, fileSize);
|
||||
|
||||
if (fileSize == 0)
|
||||
{
|
||||
AZ_Error("AWSNativeSDKInit", false, "Given empty file(%s) as the certificate bundle.\n", certificatePath.c_str());
|
||||
}
|
||||
|
||||
contents.resize(fileSize + 1);
|
||||
fileResult = fileBase->Read(fileHandle, contents.data(), fileSize);
|
||||
|
||||
if (!fileResult)
|
||||
{
|
||||
AZ_Error(
|
||||
"AWSNativeSDKInit", false, "Failed to read from the certificate bundle(%s) with result code(%i).\n", certificatePath.c_str(),
|
||||
fileResult.GetResultCode());
|
||||
}
|
||||
|
||||
AZ_Printf("AWSNativeSDKInit", "Certificate bundle is read successfully from %s", certificatePath.c_str());
|
||||
|
||||
AZ::IO::HandleType outFileHandle;
|
||||
|
||||
AZ::IO::Result outFileResult = fileBase->Open(publicStoragePath.c_str(), AZ::IO::OpenMode::ModeWrite, outFileHandle);
|
||||
|
||||
if (!outFileResult)
|
||||
{
|
||||
AZ_Error("AWSNativeSDKInit", false, "Failed to open the certificate bundle with result %i\n", fileResult.GetResultCode());
|
||||
}
|
||||
|
||||
AZ::IO::Result writeFileResult = fileBase->Write(outFileHandle, contents.data(), fileSize);
|
||||
if (!writeFileResult)
|
||||
{
|
||||
AZ_Error("AWSNativeSDKInit", false, "Failed to write the certificate bundle with result %i\n", writeFileResult.GetResultCode());
|
||||
}
|
||||
|
||||
fileBase->Close(fileHandle);
|
||||
fileBase->Close(outFileHandle);
|
||||
|
||||
AZ_Printf("AWSNativeSDKInit", "Certificate bundle successfully copied to %s", publicStoragePath.c_str());
|
||||
}
|
||||
} // namespace Platform
|
||||
}
|
||||
@@ -7,4 +7,5 @@
|
||||
|
||||
set(FILES
|
||||
../Common/Default/AWSNativeSDKInit_Default.cpp
|
||||
InitializeCerts_Android.cpp
|
||||
)
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
namespace AWSNativeSDKInit
|
||||
{
|
||||
namespace Platform
|
||||
{
|
||||
void CopyCaCertBundle()
|
||||
{
|
||||
}
|
||||
} // namespace Platform
|
||||
} // namespace AWSCore
|
||||
@@ -7,4 +7,5 @@
|
||||
|
||||
set(FILES
|
||||
../Common/Default/AWSNativeSDKInit_Default.cpp
|
||||
../Common/Default/InitializeCerts_Null.cpp
|
||||
)
|
||||
|
||||
@@ -7,4 +7,5 @@
|
||||
|
||||
set(FILES
|
||||
../Common/Default/AWSNativeSDKInit_Default.cpp
|
||||
../Common/Default/InitializeCerts_Null.cpp
|
||||
)
|
||||
|
||||
@@ -7,4 +7,5 @@
|
||||
|
||||
set(FILES
|
||||
../Common/Default/AWSNativeSDKInit_Default.cpp
|
||||
../Common/Default/InitializeCerts_Null.cpp
|
||||
)
|
||||
|
||||
@@ -7,4 +7,5 @@
|
||||
|
||||
set(FILES
|
||||
../Common/Default/AWSNativeSDKInit_Default.cpp
|
||||
../Common/Default/InitializeCerts_Null.cpp
|
||||
)
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <Authorization/AWSCognitoAuthorizationController.h>
|
||||
#include <AzCore/std/smart_ptr/make_shared.h>
|
||||
#include <ResourceMapping/AWSResourceMappingBus.h>
|
||||
#include <Framework/AWSApiJobConfig.h>
|
||||
|
||||
#include <aws/cognito-identity/CognitoIdentityClient.h>
|
||||
#include <aws/cognito-idp/CognitoIdentityProviderClient.h>
|
||||
@@ -163,7 +164,11 @@ namespace AWSClientAuth
|
||||
|
||||
void AWSClientAuthSystemComponent::OnSDKInitialized()
|
||||
{
|
||||
Aws::Client::ClientConfiguration clientConfiguration;
|
||||
AWSCore::AwsApiJobConfig* defaultConfig;
|
||||
AWSCore::AWSCoreRequestBus::BroadcastResult(defaultConfig, &AWSCore::AWSCoreRequests::GetDefaultConfig);
|
||||
Aws::Client::ClientConfiguration clientConfiguration =
|
||||
defaultConfig ? defaultConfig->GetClientConfiguration() : Aws::Client::ClientConfiguration();
|
||||
|
||||
AZStd::string region;
|
||||
AWSCore::AWSResourceMappingRequestBus::BroadcastResult(region, &AWSCore::AWSResourceMappingRequests::GetDefaultRegion);
|
||||
|
||||
|
||||
@@ -113,6 +113,27 @@ namespace AWSClientAuthUnitTest
|
||||
MOCK_METHOD1(ReloadConfigFile, void(bool isReloadingConfigFileName));
|
||||
};
|
||||
|
||||
class AWSCoreRequestBusMock
|
||||
: public AWSCore::AWSCoreRequestBus::Handler
|
||||
{
|
||||
public:
|
||||
AWSCoreRequestBusMock()
|
||||
{
|
||||
AWSCore::AWSCoreRequestBus::Handler::BusConnect();
|
||||
|
||||
ON_CALL(*this, GetDefaultJobContext).WillByDefault(testing::Return(nullptr));
|
||||
ON_CALL(*this, GetDefaultConfig).WillByDefault(testing::Return(nullptr));
|
||||
}
|
||||
|
||||
~AWSCoreRequestBusMock()
|
||||
{
|
||||
AWSCore::AWSCoreRequestBus::Handler::BusDisconnect();
|
||||
}
|
||||
|
||||
MOCK_METHOD0(GetDefaultJobContext, AZ::JobContext*());
|
||||
MOCK_METHOD0(GetDefaultConfig, AWSCore::AwsApiJobConfig*());
|
||||
};
|
||||
|
||||
class HttpRequestorRequestBusMock
|
||||
: public HttpRequestor::HttpRequestorRequestBus::Handler
|
||||
{
|
||||
|
||||
@@ -161,6 +161,7 @@ public:
|
||||
testing::NiceMock<AWSClientAuthUnitTest::AWSClientAuthSystemComponentMock> *m_awsClientAuthSystemsComponent;
|
||||
testing::NiceMock<AWSClientAuthUnitTest::AWSCoreSystemComponentMock> *m_awsCoreSystemsComponent;
|
||||
testing::NiceMock<AWSClientAuthUnitTest::AWSResourceMappingRequestBusMock> m_awsResourceMappingRequestBusMock;
|
||||
testing::NiceMock<AWSClientAuthUnitTest::AWSCoreRequestBusMock> m_awsCoreRequestBusMock;
|
||||
AZ::Entity* m_entity = nullptr;
|
||||
};
|
||||
|
||||
@@ -176,6 +177,7 @@ TEST_F(AWSClientAuthSystemComponentTest, ActivateDeactivate_Success)
|
||||
EXPECT_CALL(*m_awsCoreSystemsComponent, Init()).Times(1).InSequence(s1);
|
||||
EXPECT_CALL(*m_awsClientAuthSystemsComponent, Init()).Times(1).InSequence(s1);
|
||||
EXPECT_CALL(*m_awsCoreSystemsComponent, Activate()).Times(1).InSequence(s1);
|
||||
EXPECT_CALL(m_awsCoreRequestBusMock, GetDefaultConfig()).Times(1).InSequence(s1);
|
||||
EXPECT_CALL(m_awsResourceMappingRequestBusMock, GetDefaultRegion()).Times(1).InSequence(s1);
|
||||
EXPECT_CALL(*m_awsClientAuthSystemsComponent, Activate()).Times(1).InSequence(s1);
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,12 +6,14 @@
|
||||
#
|
||||
|
||||
ly_get_list_relative_pal_filename(pal_editor_include_dir ${CMAKE_CURRENT_LIST_DIR}/Include/Private/Editor/Platform/${PAL_PLATFORM_NAME})
|
||||
ly_get_list_relative_pal_filename(pal_cafile_include_dir ${CMAKE_CURRENT_LIST_DIR}/Source/Framework/Platform/${PAL_PLATFORM_NAME})
|
||||
|
||||
ly_add_target(
|
||||
NAME AWSCore.Static STATIC
|
||||
NAMESPACE Gem
|
||||
FILES_CMAKE
|
||||
awscore_files.cmake
|
||||
${pal_cafile_include_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
|
||||
INCLUDE_DIRECTORIES
|
||||
PUBLIC
|
||||
Include/Public
|
||||
|
||||
@@ -9,6 +9,10 @@
|
||||
|
||||
namespace AWSCore
|
||||
{
|
||||
namespace Platform
|
||||
{
|
||||
Aws::String GetCaCertBundlePath();
|
||||
}
|
||||
|
||||
const char* AwsApiJob::COMPONENT_DISPLAY_NAME = "AWSCoreFramework";
|
||||
|
||||
@@ -29,6 +33,14 @@ namespace AWSCore
|
||||
config.userAgent = "/O3DE_AwsApiJob";
|
||||
config.requestTimeoutMs = 30000;
|
||||
config.connectTimeoutMs = 30000;
|
||||
|
||||
// Instructs the HTTP client where to find the SSL certificate trust store.
|
||||
// It is required to copy the cacert.pem to the expected file path for running the Android client.
|
||||
Aws::String caFilePath = Platform::GetCaCertBundlePath();
|
||||
if (!caFilePath.empty())
|
||||
{
|
||||
config.caFile = caFilePath;
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzCore/PlatformDef.h>
|
||||
// The AWS Native SDK AWSAllocator triggers a warning due to accessing members of std::allocator directly.
|
||||
// AWSAllocator.h(70): warning C4996: 'std::allocator<T>::pointer': warning STL4010: Various members of std::allocator are deprecated in
|
||||
// C++17. Use std::allocator_traits instead of accessing these members directly. You can define
|
||||
// _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received
|
||||
// this warning.
|
||||
AZ_PUSH_DISABLE_WARNING(4251 4996, "-Wunknown-warning-option")
|
||||
#include <aws/core/utils/memory/stl/AWSString.h>
|
||||
AZ_POP_DISABLE_WARNING
|
||||
#include <AzCore/Android/Utils.h>
|
||||
#include <AzCore/std/string/string.h>
|
||||
|
||||
namespace AWSCore
|
||||
{
|
||||
namespace Platform
|
||||
{
|
||||
Aws::String GetCaCertBundlePath()
|
||||
{
|
||||
AZStd::string publicStoragePath = AZ::Android::Utils::GetAppPublicStoragePath();
|
||||
publicStoragePath.append("/certificates/aws/cacert.pem");
|
||||
|
||||
return publicStoragePath.c_str();
|
||||
}
|
||||
} // namespace Platform
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
|
||||
set(FILES
|
||||
GetCertsPath_Android.cpp
|
||||
)
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzCore/PlatformDef.h>
|
||||
// The AWS Native SDK AWSAllocator triggers a warning due to accessing members of std::allocator directly.
|
||||
// AWSAllocator.h(70): warning C4996: 'std::allocator<T>::pointer': warning STL4010: Various members of std::allocator are deprecated in
|
||||
// C++17. Use std::allocator_traits instead of accessing these members directly. You can define
|
||||
// _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received
|
||||
// this warning.
|
||||
AZ_PUSH_DISABLE_WARNING(4251 4996, "-Wunknown-warning-option")
|
||||
#include <aws/core/utils/memory/stl/AWSString.h>
|
||||
AZ_POP_DISABLE_WARNING
|
||||
|
||||
namespace AWSCore
|
||||
{
|
||||
namespace Platform
|
||||
{
|
||||
Aws::String GetCaCertBundlePath()
|
||||
{
|
||||
return ""; // no-op
|
||||
}
|
||||
} // namespace Platform
|
||||
} // namespace GridMate
|
||||
@@ -0,0 +1,10 @@
|
||||
#
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
|
||||
set(FILES
|
||||
../Common/GetCertsPath_Null.cpp
|
||||
)
|
||||
@@ -0,0 +1,10 @@
|
||||
#
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
|
||||
set(FILES
|
||||
../Common/GetCertsPath_Null.cpp
|
||||
)
|
||||
@@ -0,0 +1,10 @@
|
||||
#
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
|
||||
set(FILES
|
||||
../Common/GetCertsPath_Null.cpp
|
||||
)
|
||||
@@ -0,0 +1,10 @@
|
||||
#
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
|
||||
set(FILES
|
||||
../Common/GetCertsPath_Null.cpp
|
||||
)
|
||||
@@ -22,7 +22,7 @@ namespace LmbrCentral
|
||||
{
|
||||
AZ_CLASS_ALLOCATOR_IMPL(EditorTubeShapeComponentMode, AZ::SystemAllocator, 0)
|
||||
|
||||
static const AZ::Crc32 s_resetVariableRadii = AZ_CRC("com.amazon.action.tubeshape.reset_radii", 0x0f2ef8e2);
|
||||
static const AZ::Crc32 s_resetVariableRadii = AZ_CRC("com.o3de.action.tubeshape.reset_radii", 0x0f2ef8e2);
|
||||
static const char* const s_resetRadiiTitle = "Reset Radii";
|
||||
static const char* const s_resetRadiiDesc = "Reset all variable radius values to the default";
|
||||
|
||||
|
||||
@@ -178,6 +178,18 @@ namespace Multiplayer
|
||||
|
||||
void MultiplayerEditorConnection::OnDisconnect([[maybe_unused]] AzNetworking::IConnection* connection, [[maybe_unused]] DisconnectReason reason, [[maybe_unused]] TerminationEndpoint endpoint)
|
||||
{
|
||||
;
|
||||
bool editorLaunch = false;
|
||||
if (auto console = AZ::Interface<AZ::IConsole>::Get(); console)
|
||||
{
|
||||
console->GetCvarValue("editorsv_launch", editorLaunch);
|
||||
}
|
||||
|
||||
if (editorsv_isDedicated && editorLaunch && m_networkEditorInterface->GetConnectionSet().GetConnectionCount() == 1)
|
||||
{
|
||||
if (m_networkEditorInterface->GetPort() != 0)
|
||||
{
|
||||
m_networkEditorInterface->StopListening();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace Multiplayer
|
||||
AZStd::queue<AZStd::string> m_pendingConnectionTickets;
|
||||
|
||||
AZ::TimeMs m_lastReplicatedHostTimeMs = AZ::TimeMs{ 0 };
|
||||
HostFrameId m_lastReplicatedHostFrameId = InvalidHostFrameId;
|
||||
HostFrameId m_lastReplicatedHostFrameId = HostFrameId(0);
|
||||
|
||||
double m_serverSendAccumulator = 0.0;
|
||||
float m_renderBlendFactor = 0.0f;
|
||||
|
||||
+14
-11
@@ -123,20 +123,23 @@ namespace Multiplayer
|
||||
|
||||
bool PropertyPublisher::PrepareUpdateEntityRecord()
|
||||
{
|
||||
// If we reach the maximum outstanding records, reset the replication state
|
||||
bool didPrepare = true;
|
||||
if (m_sentRecords.size() >= net_EntityReplicatorRecordsMax)
|
||||
{
|
||||
return PrepareAddEntityRecord();
|
||||
// If we reach the maximum outstanding records, reset the replication state
|
||||
didPrepare = PrepareAddEntityRecord();
|
||||
}
|
||||
|
||||
// We need to clear out old records, and build up a list of everything that has changed since the last acked packet
|
||||
m_sentRecords.push_front(m_pendingRecord);
|
||||
auto iter = m_sentRecords.begin();
|
||||
++iter; // Consider everything after the record we are going to send
|
||||
for (; iter != m_sentRecords.end(); ++iter)
|
||||
else
|
||||
{
|
||||
// Sequence wasn't acked, so we need to send these bits again
|
||||
m_pendingRecord.Append(*iter);
|
||||
// We need to clear out old records, and build up a list of everything that has changed since the last acked packet
|
||||
m_sentRecords.push_front(m_pendingRecord);
|
||||
auto iter = m_sentRecords.begin();
|
||||
++iter; // Consider everything after the record we are going to send
|
||||
for (; iter != m_sentRecords.end(); ++iter)
|
||||
{
|
||||
// Sequence wasn't acked, so we need to send these bits again
|
||||
m_pendingRecord.Append(*iter);
|
||||
}
|
||||
}
|
||||
|
||||
// Don't send predictable properties back to the Autonomous unless we correct them
|
||||
@@ -145,7 +148,7 @@ namespace Multiplayer
|
||||
m_pendingRecord.Subtract(m_netBindComponent->GetPredictableRecord());
|
||||
}
|
||||
|
||||
return true;
|
||||
return didPrepare;
|
||||
}
|
||||
|
||||
bool PropertyPublisher::PrepareDeleteEntityRecord()
|
||||
|
||||
@@ -191,6 +191,8 @@ namespace Multiplayer
|
||||
|
||||
bool ReplicationRecord::ContainsAuthorityToClientBits() const
|
||||
{
|
||||
// Check != Authority here since several modes require information about client updates
|
||||
// (i.e. Autonomous when performing corrections)
|
||||
return (m_remoteNetEntityRole != NetEntityRole::Authority)
|
||||
|| (m_remoteNetEntityRole == NetEntityRole::InvalidRole);
|
||||
}
|
||||
|
||||
@@ -28,10 +28,10 @@ namespace PhysX
|
||||
namespace
|
||||
{
|
||||
//! Uri's for shortcut actions.
|
||||
const AZ::Crc32 SetDimensionsSubModeActionUri = AZ_CRC("com.amazon.action.physx.setdimensionssubmode", 0x77b70dd6);
|
||||
const AZ::Crc32 SetOffsetSubModeActionUri = AZ_CRC("com.amazon.action.physx.setoffsetsubmode", 0xc06132e5);
|
||||
const AZ::Crc32 SetRotationSubModeActionUri = AZ_CRC("com.amazon.action.physx.setrotationsubmode", 0xc4225918);
|
||||
const AZ::Crc32 ResetSubModeActionUri = AZ_CRC("com.amazon.action.physx.resetsubmode", 0xb70b120e);
|
||||
const AZ::Crc32 SetDimensionsSubModeActionUri = AZ_CRC("com.o3de.action.physx.setdimensionssubmode", 0x77b70dd6);
|
||||
const AZ::Crc32 SetOffsetSubModeActionUri = AZ_CRC("com.o3de.action.physx.setoffsetsubmode", 0xc06132e5);
|
||||
const AZ::Crc32 SetRotationSubModeActionUri = AZ_CRC("com.o3de.action.physx.setrotationsubmode", 0xc4225918);
|
||||
const AZ::Crc32 ResetSubModeActionUri = AZ_CRC("com.o3de.action.physx.resetsubmode", 0xb70b120e);
|
||||
}
|
||||
|
||||
AZ_CLASS_ALLOCATOR_IMPL(ColliderComponentMode, AZ::SystemAllocator, 0);
|
||||
|
||||
@@ -23,8 +23,8 @@ namespace PhysX
|
||||
namespace
|
||||
{
|
||||
//! Uri's for shortcut actions.
|
||||
const AZ::Crc32 GoToNextModeActionUri = AZ_CRC("com.amazon.action.physx.joint.nextmode", 0xe9cf4ed6);
|
||||
const AZ::Crc32 GoToPrevModeActionUri = AZ_CRC("com.amazon.action.physx.joint.prevmode", 0xe70f8daa);
|
||||
const AZ::Crc32 GoToNextModeActionUri = AZ_CRC("com.o3de.action.physx.joint.nextmode", 0xe9cf4ed6);
|
||||
const AZ::Crc32 GoToPrevModeActionUri = AZ_CRC("com.o3de.action.physx.joint.prevmode", 0xe70f8daa);
|
||||
}
|
||||
|
||||
const AZStd::string EditorJointComponentMode::s_parameterAngularPair = "Twist Limits";
|
||||
|
||||
@@ -37,6 +37,7 @@ namespace StartingPointInput
|
||||
editContext->Class<InputEventGroup>("InputEventGroup", "Groups input bindings by the event they generate")
|
||||
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
|
||||
->Attribute(AZ::Edit::Attributes::NameLabelOverride, &InputEventGroup::GetEditorText)
|
||||
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
|
||||
->DataElement(0, &InputEventGroup::m_eventName, "Event Name", "The event generated by the collection of Input Bindings")
|
||||
->Attribute(AZ::Edit::Attributes::ChangeNotify, AZ_CRC("RefreshAttributesAndValues"))
|
||||
->DataElement(0, &InputEventGroup::m_inputHandlers, "Event Generators", "Handlers that generate named events")
|
||||
|
||||
@@ -34,8 +34,8 @@ namespace WhiteBox
|
||||
AZ::Color, cl_whiteBoxVertexIndicatorColor, AZ::Color::CreateFromRgba(0, 0, 0, 102), nullptr,
|
||||
AZ::ConsoleFunctorFlags::Null, "The color of the vertex indicator");
|
||||
|
||||
static const AZ::Crc32 HideEdge = AZ_CRC("com.amazon.action.whitebox.hide_edge", 0x6a60ae23);
|
||||
static const AZ::Crc32 HideVertex = AZ_CRC("com.amazon.action.whitebox.hide_vertex", 0x4a4bd092);
|
||||
static const AZ::Crc32 HideEdge = AZ_CRC("com.o3de.action.whitebox.hide_edge", 0x6a60ae23);
|
||||
static const AZ::Crc32 HideVertex = AZ_CRC("com.o3de.action.whitebox.hide_vertex", 0x4a4bd092);
|
||||
|
||||
static const char* const HideEdgeTitle = "Hide Edge";
|
||||
static const char* const HideEdgeDesc = "Hide the selected edge to merge the two connected polygons";
|
||||
|
||||
Reference in New Issue
Block a user