diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py index 9e857ed8bc..59e454479c 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_entity_utils.py @@ -132,6 +132,7 @@ class EditorEntity: def __init__(self, id: azlmbr.entity.EntityId): self.id: azlmbr.entity.EntityId = id + self.components: List[EditorComponent] = [] # Creation functions @classmethod @@ -279,7 +280,7 @@ class EditorEntity: ), f"Failure: Could not add component: '{new_comp.get_component_name()}' to entity: '{self.get_name()}'" new_comp.id = add_component_outcome.GetValue()[0] components.append(new_comp) - + self.components.append(new_comp) return components def get_components_of_type(self, component_names: list) -> List[EditorComponent]: diff --git a/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Main_Optimized.py b/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Main_Optimized.py index 3d668a2085..0661c6742b 100644 --- a/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Main_Optimized.py +++ b/AutomatedTesting/Gem/PythonTests/Physics/TestSuite_Main_Optimized.py @@ -60,7 +60,7 @@ class EditorSingleTest_WithFileOverrides(EditorSingleTest): class TestAutomationWithPrefabSystemEnabled(EditorTestSuite): global_extra_cmdline_args = ['-BatchMode', '-autotest_mode', - 'extra_cmdline_args=["--regset=/Amazon/Preferences/EnablePrefabSystem=true"]'] + '--regset=/Amazon/Preferences/EnablePrefabSystem=true'] @staticmethod def get_number_parallel_editors(): diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/largeworlds/CMakeLists.txt index c2123d683c..98801b49d6 100644 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/CMakeLists.txt @@ -24,7 +24,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ LargeWorlds ) - ly_add_pytest( NAME AutomatedTesting::DynamicVegetationTests_Periodic TEST_SERIAL @@ -39,6 +38,20 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ LargeWorlds ) + ly_add_pytest( + NAME AutomatedTesting::DynamicVegetationTests_Periodic_Optimized + TEST_SERIAL + TEST_SUITE periodic + PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg/TestSuite_Periodic_Optimized.py + RUNTIME_DEPENDENCIES + AZ::AssetProcessor + Legacy::Editor + AutomatedTesting.Assets + AutomatedTesting.GameLauncher + COMPONENT + LargeWorlds + ) + ly_add_pytest( NAME AutomatedTesting::DynamicVegetationTests_Main_Optimized TEST_SERIAL diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynVegUtils_TempPrefabCreationWorks.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynVegUtils_TempPrefabCreationWorks.py new file mode 100644 index 0000000000..d016473d5e --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynVegUtils_TempPrefabCreationWorks.py @@ -0,0 +1,85 @@ +""" +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 +""" + + +def DynVegUtils_TempPrefabCreationWorks(): + """ + Summary: + An existing level is opened. Each Prefab setup to be spawned by Dynamic Vegetation tests is created in memory and + validated against existing test slice components/mesh assignments. + + Expected Behavior: + Temporary prefabs contain the expected components/assets. + + Test Steps: + 1) Open an existing level + 2) Create each of the necessary temporary Mesh prefabs, and validate the component/mesh setups + 3) Create the necessary temporary PhysX Collider, and validate the component setup + 4) Report errors/asserts + + :return: None + """ + + import os + + import azlmbr.asset as asset + import azlmbr.bus as bus + import azlmbr.math as math + + from Prefab.tests import PrefabTestUtils as prefab_test_utils + from largeworlds.large_worlds_utils import editor_dynveg_test_helper as dynveg + from editor_python_test_tools.utils import Report, Tracer + from editor_python_test_tools.utils import TestHelper as helper + from editor_python_test_tools.prefab_utils import PrefabInstance + + with Tracer() as error_tracer: + # Create dictionary for prefab filenames and paths to create using helper function + mesh_prefabs = { + "PinkFlower": os.path.join("assets", "objects", "foliage", "grass_flower_pink.azmodel"), + "PurpleFlower": os.path.join("assets", "objects", "foliage", "grass_flower_purple.azmodel"), + "1m_Cube": os.path.join("objects", "_primitives", "_box_1x1.azmodel"), + "CedarTree": os.path.join("assets", "objects", "foliage", "cedar.azmodel"), + "Bush": os.path.join("assets", "objects", "foliage", "bush_privet_01.azmodel"), + } + + # 1) Open an existing simple level + prefab_test_utils.open_base_tests_level() + + # 2) Create each of the Mesh asset prefabs and validate that the prefab created successfully + for prefab_filename, asset_path in mesh_prefabs.items(): + mesh_prefab_created = ( + f"Temporary mesh prefab: {prefab_filename} created successfully", + f"Failed to create temporary mesh prefab: {prefab_filename}" + ) + prefab = dynveg.create_temp_mesh_prefab(asset_path, prefab_filename) + Report.result(mesh_prefab_created, helper.wait_for_condition(lambda: + PrefabInstance.is_valid(prefab[1]), 3.0)) + + # 3) Create temp PhysX Collider prefab and validate that the prefab created successfully + physx_prefab_filename = "CedarTree_Collision" + physx_collider_prefab_created = ( + f"Temporary mesh prefab: {physx_prefab_filename} created successfully", + f"Failed to create temporary mesh prefab: {physx_prefab_filename}" + ) + test_physx_mesh_asset_id = asset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", os.path.join( + "assets", "objects", "foliage", "cedar.pxmesh"), math.Uuid(), False) + dynveg.create_temp_physx_mesh_collider(test_physx_mesh_asset_id, physx_prefab_filename) + Report.result(physx_collider_prefab_created, helper.wait_for_condition(lambda: + PrefabInstance.is_valid(prefab[1]), 3.0)) + + # 4) Report errors/asserts + helper.wait_for_condition(lambda: error_tracer.has_errors or error_tracer.has_asserts, 1.0) + for error_info in error_tracer.errors: + Report.info(f"Error: {error_info.filename} {error_info.function} | {error_info.message}") + for assert_info in error_tracer.asserts: + Report.info(f"Assert: {assert_info.filename} {assert_info.function} | {assert_info.message}") + + +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(DynVegUtils_TempPrefabCreationWorks) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Periodic_Optimized.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Periodic_Optimized.py new file mode 100644 index 0000000000..8d298e970b --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/TestSuite_Periodic_Optimized.py @@ -0,0 +1,23 @@ +""" +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 +""" + +import os +import pytest + +import ly_test_tools.environment.file_system as file_system +from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite + + +@pytest.mark.SUITE_main +@pytest.mark.parametrize("launcher_platform", ['windows_editor']) +@pytest.mark.parametrize("project", ["AutomatedTesting"]) +class TestAutomation(EditorTestSuite): + + global_extra_cmdline_args = ["-BatchMode", "-autotest_mode", "--regset=/Amazon/Preferences/EnablePrefabSystem=true"] + + class test_DynVegUtils_TempPrefabCreationWorks(EditorSharedTest): + from .EditorScripts import DynVegUtils_TempPrefabCreationWorks as test_module diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/large_worlds_utils/editor_dynveg_test_helper.py b/AutomatedTesting/Gem/PythonTests/largeworlds/large_worlds_utils/editor_dynveg_test_helper.py index 957536fffb..d7d5842518 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/large_worlds_utils/editor_dynveg_test_helper.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/large_worlds_utils/editor_dynveg_test_helper.py @@ -19,6 +19,45 @@ import azlmbr.paths sys.path.append(os.path.join(azlmbr.paths.projectroot, 'Gem', 'PythonTests')) import editor_python_test_tools.hydra_editor_utils as hydra +from editor_python_test_tools.editor_entity_utils import EditorEntity +from editor_python_test_tools.prefab_utils import Prefab + + +def create_temp_mesh_prefab(mesh_asset_path, prefab_filename): + # Create initial entity + root = EditorEntity.create_editor_entity(name=prefab_filename) + assert root.exists(), "Failed to create entity" + # Add mesh component + mesh_component = root.add_component("Mesh") + assert root.has_component("Mesh") and mesh_component.is_enabled(), "Failed to add/activate Mesh component" + # Assign the specified mesh asset + mesh_asset = asset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", mesh_asset_path, math.Uuid(), False) + mesh_component.set_component_property_value("Controller|Configuration|Mesh Asset", mesh_asset) + assert mesh_component.get_component_property_value("Controller|Configuration|Mesh Asset") == mesh_asset, \ + "Failed to set Mesh asset" + # Create and return the temporary/in-memory prefab + temp_prefab = Prefab.create_prefab([root], prefab_filename) + return temp_prefab + + +def create_temp_physx_mesh_collider(physx_mesh_id, prefab_filename): + # Create initial entity + root = EditorEntity.create_editor_entity(name=prefab_filename) + assert root.exists(), "Failed to create entity" + # Add PhysX Collider component + collider_component = root.add_component("PhysX Collider") + assert root.has_component("PhysX Collider") and collider_component.is_enabled(), \ + "Failed to add/activate PhysX Collider component" + # Set the Collider's Shape Configuration field to PhysicsAsset, and assign the specified PhysX Mesh asset + collider_component.set_component_property_value("Shape Configuration|Shape", 7) + assert collider_component.get_component_property_value("Shape Configuration|Shape") == 7, \ + "Failed to set Collider Shape to PhysicsAsset" + collider_component.set_component_property_value("Shape Configuration|Asset|PhysX Mesh", physx_mesh_id) + assert collider_component.get_component_property_value("Shape Configuration|Asset|PhysX Mesh") == physx_mesh_id, \ + "Failed to assign PhysX Mesh asset" + # Create and return the temporary/in-memory prefab + temp_prefab = Prefab.create_prefab([root], prefab_filename) + return temp_prefab def create_surface_entity(name, center_point, box_size_x, box_size_y, box_size_z): diff --git a/Code/Editor/AboutDialog.ui b/Code/Editor/AboutDialog.ui index a36d65e35b..09a7c18841 100644 --- a/Code/Editor/AboutDialog.ui +++ b/Code/Editor/AboutDialog.ui @@ -125,7 +125,7 @@ - Stable 21.11 + development Qt::AutoText diff --git a/Code/Editor/StartupLogoDialog.ui b/Code/Editor/StartupLogoDialog.ui index c2cbfcfd69..cbc596f53a 100644 --- a/Code/Editor/StartupLogoDialog.ui +++ b/Code/Editor/StartupLogoDialog.ui @@ -103,7 +103,7 @@ - Stable 21.11 + development diff --git a/Code/Legacy/CrySystem/SystemInit.cpp b/Code/Legacy/CrySystem/SystemInit.cpp index 8a0586fb13..5cb60f2cdf 100644 --- a/Code/Legacy/CrySystem/SystemInit.cpp +++ b/Code/Legacy/CrySystem/SystemInit.cpp @@ -1225,20 +1225,6 @@ static AZStd::string ConcatPath(const char* szPart1, const char* szPart2) return ret; } -// Helper to maintain backwards compatibility with our CVar but not force our new code to -// pull in CryCommon by routing through an environment variable -void CmdSetAwsLogLevel(IConsoleCmdArgs* pArgs) -{ - static const char* const logLevelEnvVar = "sys_SetLogLevel"; - static AZ::EnvironmentVariable logVar = AZ::Environment::CreateVariable(logLevelEnvVar); - if (pArgs->GetArgCount() > 1) - { - int logLevel = atoi(pArgs->GetArg(1)); - *logVar = logLevel; - AZ_TracePrintf("AWSLogging", "Log level set to %d", *logVar); - } -} - ////////////////////////////////////////////////////////////////////////// void CSystem::CreateSystemVars() { @@ -1601,8 +1587,6 @@ void CSystem::CreateSystemVars() // Since the UI Canvas Editor is incomplete, we have a variable to enable it. // By default it is now enabled. Modify system.cfg or game.cfg to disable it REGISTER_INT("sys_enableCanvasEditor", 1, VF_NULL, "Enables the UI Canvas Editor"); - - REGISTER_COMMAND("sys_SetLogLevel", CmdSetAwsLogLevel, 0, "Set AWS log level [0 - 6]."); } ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Tools/AWSNativeSDKInit/CMakeLists.txt b/Code/Tools/AWSNativeSDKInit/CMakeLists.txt index d571f0d9e3..57ee31d30d 100644 --- a/Code/Tools/AWSNativeSDKInit/CMakeLists.txt +++ b/Code/Tools/AWSNativeSDKInit/CMakeLists.txt @@ -24,3 +24,30 @@ ly_add_target( 3rdParty::AWSNativeSDK::Core AZ::AzCore ) + +################################################################################ +# Tests +################################################################################ +if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) + ly_add_target( + NAME AWSNativeSDKInit.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} + NAMESPACE AZ + FILES_CMAKE + aws_native_sdk_init_tests_files.cmake + INCLUDE_DIRECTORIES + PRIVATE + include + tests + source + BUILD_DEPENDENCIES + PRIVATE + AZ::AzCore + AZ::AzFramework + AZ::AzTest + AZ::AWSNativeSDKInit + 3rdParty::AWSNativeSDK::Core + ) + ly_add_googletest( + NAME AZ::AWSNativeSDKInit.Tests + ) +endif() diff --git a/Code/Tools/AWSNativeSDKInit/aws_native_sdk_init_tests_files.cmake b/Code/Tools/AWSNativeSDKInit/aws_native_sdk_init_tests_files.cmake new file mode 100644 index 0000000000..9029a1198a --- /dev/null +++ b/Code/Tools/AWSNativeSDKInit/aws_native_sdk_init_tests_files.cmake @@ -0,0 +1,12 @@ +# +# 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 + tests/AWSLogSystemInterfaceTest.cpp + tests/AWSNativeSDKInitTest.cpp +) diff --git a/Code/Tools/AWSNativeSDKInit/source/AWSLogSystemInterface.cpp b/Code/Tools/AWSNativeSDKInit/source/AWSLogSystemInterface.cpp index 113e513743..0ccfc43ba4 100644 --- a/Code/Tools/AWSNativeSDKInit/source/AWSLogSystemInterface.cpp +++ b/Code/Tools/AWSNativeSDKInit/source/AWSLogSystemInterface.cpp @@ -10,6 +10,8 @@ #include #include +#include +#include #include #include @@ -24,6 +26,9 @@ AZ_POP_DISABLE_WARNING namespace AWSNativeSDKInit { + AZ_CVAR(int, bg_awsLogLevel, -1, nullptr, AZ::ConsoleFunctorFlags::Null, + "AWSLogLevel used to control verbosity of logging system. Off = 0, Fatal = 1, Error = 2, Warn = 3, Info = 4, Debug = 5, Trace = 6"); + const char* AWSLogSystemInterface::AWS_API_LOG_PREFIX = "AwsApi-"; const int AWSLogSystemInterface::MAX_MESSAGE_LENGTH = 4096; const char* AWSLogSystemInterface::MESSAGE_FORMAT = "[AWS] %s - %s"; @@ -40,15 +45,16 @@ namespace AWSNativeSDKInit Aws::Utils::Logging::LogLevel AWSLogSystemInterface::GetLogLevel() const { Aws::Utils::Logging::LogLevel newLevel = m_logLevel; - static const char* const logLevelEnvVar = "sys_SetLogLevel"; - auto logVar = AZ::Environment::FindVariable(logLevelEnvVar); - - if (logVar) + if (auto console = AZ::Interface::Get(); console != nullptr) { - newLevel = (Aws::Utils::Logging::LogLevel) *logVar; + int awsLogLevel = -1; + console->GetCvarValue("bg_awsLogLevel", awsLogLevel); + if (awsLogLevel >= 0) + { + newLevel = static_cast(awsLogLevel); + } } - - return newLevel != m_logLevel ? newLevel : m_logLevel; + return newLevel; } /** @@ -78,14 +84,12 @@ namespace AWSNativeSDKInit */ void AWSLogSystemInterface::LogStream(Aws::Utils::Logging::LogLevel logLevel, const char* tag, const Aws::OStringStream &messageStream) { - if(!ShouldLog(logLevel)) { return; } ForwardAwsApiLogMessage(logLevel, tag, messageStream.str().c_str()); - } bool AWSLogSystemInterface::ShouldLog(Aws::Utils::Logging::LogLevel logLevel) @@ -93,7 +97,7 @@ namespace AWSNativeSDKInit #if defined(PLATFORM_SUPPORTS_AWS_NATIVE_SDK) Aws::Utils::Logging::LogLevel newLevel = GetLogLevel(); - if (newLevel > Aws::Utils::Logging::LogLevel::Info && newLevel <= Aws::Utils::Logging::LogLevel::Trace && newLevel != m_logLevel) + if (newLevel != m_logLevel) { SetLogLevel(newLevel); } @@ -124,7 +128,7 @@ namespace AWSNativeSDKInit break; case Aws::Utils::Logging::LogLevel::Error: - AZ::Debug::Trace::Instance().Warning(__FILE__, __LINE__, AZ_FUNCTION_SIGNATURE, AWSLogSystemInterface::ERROR_WINDOW_NAME, MESSAGE_FORMAT, tag, message); + AZ::Debug::Trace::Instance().Error(__FILE__, __LINE__, AZ_FUNCTION_SIGNATURE, AWSLogSystemInterface::ERROR_WINDOW_NAME, MESSAGE_FORMAT, tag, message); break; case Aws::Utils::Logging::LogLevel::Warn: diff --git a/Code/Tools/AWSNativeSDKInit/source/AWSNativeSDKInit.cpp b/Code/Tools/AWSNativeSDKInit/source/AWSNativeSDKInit.cpp index 815fc1bbf0..ca63859945 100644 --- a/Code/Tools/AWSNativeSDKInit/source/AWSNativeSDKInit.cpp +++ b/Code/Tools/AWSNativeSDKInit/source/AWSNativeSDKInit.cpp @@ -64,10 +64,10 @@ namespace AWSNativeSDKInit { #if defined(PLATFORM_SUPPORTS_AWS_NATIVE_SDK) Aws::Utils::Logging::LogLevel logLevel; -#ifdef _DEBUG +#if defined(AZ_DEBUG_BUILD) || defined(AZ_PROFILE_BUILD) logLevel = Aws::Utils::Logging::LogLevel::Warn; #else - logLevel = Aws::Utils::Logging::LogLevel::Warn; + logLevel = Aws::Utils::Logging::LogLevel::Error; #endif m_awsSDKOptions.loggingOptions.logLevel = logLevel; m_awsSDKOptions.loggingOptions.logger_create_fn = [logLevel]() diff --git a/Code/Tools/AWSNativeSDKInit/tests/AWSLogSystemInterfaceTest.cpp b/Code/Tools/AWSNativeSDKInit/tests/AWSLogSystemInterfaceTest.cpp new file mode 100644 index 0000000000..02b6cbebc1 --- /dev/null +++ b/Code/Tools/AWSNativeSDKInit/tests/AWSLogSystemInterfaceTest.cpp @@ -0,0 +1,169 @@ +/* + * 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 +#include +#include +#include +#include + +#include + +#include + +using namespace AWSNativeSDKInit; + +class AWSLogSystemInterfaceTest + : public UnitTest::ScopedAllocatorSetupFixture + , public AZ::Debug::TraceMessageBus::Handler +{ +public: + bool OnPreAssert(const char*, int, const char*, const char*) override + { + return true; + } + + bool OnPreError(const char*, const char*, int, const char*, const char*) override + { + m_error = true; + return true; + } + + bool OnPreWarning(const char*, const char*, int, const char*, const char*) override + { + m_warning = true; + return true; + } + + bool OnPrintf(const char*, const char*) override + { + m_printf = true; + return true; + } + + void SetUp() override + { + BusConnect(); + if (!AZ::Interface::Get()) + { + m_console = AZStd::make_unique(); + m_console->LinkDeferredFunctors(AZ::ConsoleFunctorBase::GetDeferredHead()); + AZ::Interface::Register(m_console.get()); + } + } + + void TearDown() override + { + if (m_console) + { + AZ::Interface::Unregister(m_console.get()); + m_console.reset(); + } + BusDisconnect(); + } + + bool m_error = false; + bool m_warning = false; + bool m_printf = false; + +private: + AZStd::unique_ptr m_console; +}; + +TEST_F(AWSLogSystemInterfaceTest, LogStream_LogFatalMessage_GetExpectedNotification) +{ + AWSLogSystemInterface logSystem(Aws::Utils::Logging::LogLevel::Trace); + Aws::OStringStream testString; + logSystem.LogStream(Aws::Utils::Logging::LogLevel::Fatal, "test", testString); + ASSERT_TRUE(m_error); + ASSERT_FALSE(m_warning); + ASSERT_FALSE(m_printf); +} + +TEST_F(AWSLogSystemInterfaceTest, LogStream_LogErrorMessage_GetExpectedNotification) +{ + AWSLogSystemInterface logSystem(Aws::Utils::Logging::LogLevel::Trace); + Aws::OStringStream testString; + logSystem.LogStream(Aws::Utils::Logging::LogLevel::Error, "test", testString); + ASSERT_TRUE(m_error); + ASSERT_FALSE(m_warning); + ASSERT_FALSE(m_printf); +} + +TEST_F(AWSLogSystemInterfaceTest, LogStream_LogWarningMessage_GetExpectedNotification) +{ + AWSLogSystemInterface logSystem(Aws::Utils::Logging::LogLevel::Trace); + Aws::OStringStream testString; + logSystem.LogStream(Aws::Utils::Logging::LogLevel::Warn, "test", testString); + ASSERT_FALSE(m_error); + ASSERT_TRUE(m_warning); + ASSERT_FALSE(m_printf); +} + +TEST_F(AWSLogSystemInterfaceTest, LogStream_LogInfoMessage_GetExpectedNotification) +{ + AWSLogSystemInterface logSystem(Aws::Utils::Logging::LogLevel::Trace); + Aws::OStringStream testString; + logSystem.LogStream(Aws::Utils::Logging::LogLevel::Info, "test", testString); + ASSERT_FALSE(m_error); + ASSERT_FALSE(m_warning); + ASSERT_TRUE(m_printf); +} + +TEST_F(AWSLogSystemInterfaceTest, LogStream_LogDebugMessage_GetExpectedNotification) +{ + AWSLogSystemInterface logSystem(Aws::Utils::Logging::LogLevel::Trace); + Aws::OStringStream testString; + logSystem.LogStream(Aws::Utils::Logging::LogLevel::Debug, "test", testString); + ASSERT_FALSE(m_error); + ASSERT_FALSE(m_warning); + ASSERT_TRUE(m_printf); +} + +TEST_F(AWSLogSystemInterfaceTest, LogStream_LogTraceMessage_GetExpectedNotification) +{ + AWSLogSystemInterface logSystem(Aws::Utils::Logging::LogLevel::Trace); + Aws::OStringStream testString; + logSystem.LogStream(Aws::Utils::Logging::LogLevel::Trace, "test", testString); + ASSERT_FALSE(m_error); + ASSERT_FALSE(m_warning); + ASSERT_TRUE(m_printf); +} + +TEST_F(AWSLogSystemInterfaceTest, LogStream_OverrideWarnAndLogInfoMessage_GetExpectedNotification) +{ + AWSLogSystemInterface logSystem(Aws::Utils::Logging::LogLevel::Trace); + Aws::OStringStream testString; + AZ::Interface::Get()->PerformCommand("bg_awsLogLevel 3"); + logSystem.LogStream(Aws::Utils::Logging::LogLevel::Info, "test", testString); + ASSERT_FALSE(m_error); + ASSERT_FALSE(m_warning); + ASSERT_FALSE(m_printf); +} + +TEST_F(AWSLogSystemInterfaceTest, LogStream_OverrideWarnAndLogeErrorMessage_GetExpectedNotification) +{ + AWSLogSystemInterface logSystem(Aws::Utils::Logging::LogLevel::Trace); + Aws::OStringStream testString; + AZ::Interface::Get()->PerformCommand("bg_awsLogLevel 3"); + logSystem.LogStream(Aws::Utils::Logging::LogLevel::Error, "test", testString); + ASSERT_TRUE(m_error); + ASSERT_FALSE(m_warning); + ASSERT_FALSE(m_printf); +} + +TEST_F(AWSLogSystemInterfaceTest, LogStream_OverrideOffAndLogInfoMessage_GetExpectedNotification) +{ + AWSLogSystemInterface logSystem(Aws::Utils::Logging::LogLevel::Trace); + Aws::OStringStream testString; + AZ::Interface::Get()->PerformCommand("bg_awsLogLevel 0"); + logSystem.LogStream(Aws::Utils::Logging::LogLevel::Info, "test", testString); + ASSERT_FALSE(m_error); + ASSERT_FALSE(m_warning); + ASSERT_FALSE(m_printf); +} diff --git a/Code/Tools/AWSNativeSDKInit/tests/AWSNativeSDKInitTest.cpp b/Code/Tools/AWSNativeSDKInit/tests/AWSNativeSDKInitTest.cpp new file mode 100644 index 0000000000..40217ff9bc --- /dev/null +++ b/Code/Tools/AWSNativeSDKInit/tests/AWSNativeSDKInitTest.cpp @@ -0,0 +1,11 @@ +/* + * 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 + +AZ_UNIT_TEST_HOOK(DEFAULT_UNIT_TEST_ENV); diff --git a/Gems/AWSClientAuth/Code/Tests/Authorization/AWSCognitoAuthorizationControllerTest.cpp b/Gems/AWSClientAuth/Code/Tests/Authorization/AWSCognitoAuthorizationControllerTest.cpp index 9f31891512..2269a2340a 100644 --- a/Gems/AWSClientAuth/Code/Tests/Authorization/AWSCognitoAuthorizationControllerTest.cpp +++ b/Gems/AWSClientAuth/Code/Tests/Authorization/AWSCognitoAuthorizationControllerTest.cpp @@ -140,7 +140,9 @@ TEST_F(AWSCognitoAuthorizationControllerTest, RequestAWSCredentials_Fail_GetIdEr EXPECT_CALL(*m_cognitoIdentityClientMock, GetCredentialsForIdentity(testing::_)).Times(0); EXPECT_CALL(m_awsCognitoAuthorizationNotificationsBusMock, OnRequestAWSCredentialsSuccess(testing::_)).Times(0); EXPECT_CALL(m_awsCognitoAuthorizationNotificationsBusMock, OnRequestAWSCredentialsFail(testing::_)).Times(1); + AZ_TEST_START_TRACE_SUPPRESSION; m_mockController->RequestAWSCredentialsAsync(); + AZ_TEST_STOP_TRACE_SUPPRESSION_NO_COUNT; } TEST_F(AWSCognitoAuthorizationControllerTest, RequestAWSCredentials_Fail_GetCredentialsForIdentityError) @@ -174,7 +176,9 @@ TEST_F(AWSCognitoAuthorizationControllerTest, RequestAWSCredentials_Fail_GetCred EXPECT_CALL(*m_cognitoIdentityClientMock, GetCredentialsForIdentity(testing::_)).Times(1).WillOnce(testing::Return(outcome)); EXPECT_CALL(m_awsCognitoAuthorizationNotificationsBusMock, OnRequestAWSCredentialsSuccess(testing::_)).Times(0); EXPECT_CALL(m_awsCognitoAuthorizationNotificationsBusMock, OnRequestAWSCredentialsFail(testing::_)).Times(1); + AZ_TEST_START_TRACE_SUPPRESSION; m_mockController->RequestAWSCredentialsAsync(); + AZ_TEST_STOP_TRACE_SUPPRESSION_NO_COUNT; } TEST_F(AWSCognitoAuthorizationControllerTest, AddRemoveLogins_Succuess) @@ -331,8 +335,10 @@ TEST_F(AWSCognitoAuthorizationControllerTest, GetCredentialsProvider_NoPersisted EXPECT_CALL(*m_cognitoIdentityClientMock, GetCredentialsForIdentity(testing::_)).Times(0); std::shared_ptr actualCredentialsProvider; + AZ_TEST_START_TRACE_SUPPRESSION; AWSCore::AWSCredentialRequestBus::BroadcastResult( actualCredentialsProvider, &AWSCore::AWSCredentialRequests::GetCredentialsProvider); + AZ_TEST_STOP_TRACE_SUPPRESSION_NO_COUNT; EXPECT_TRUE(actualCredentialsProvider == nullptr); } diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/CMakeLists.txt b/Gems/AWSGameLift/Code/AWSGameLiftClient/CMakeLists.txt index 1fab09e9f4..ab85e89f75 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/CMakeLists.txt +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/CMakeLists.txt @@ -6,8 +6,6 @@ # # -set(awsgameliftclient_compile_definition $,AWSGAMELIFT_RELEASE,AWSGAMELIFT_DEV>) - ly_add_target( NAME AWSGameLift.Client.Static STATIC NAMESPACE Gem diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/AWSGameLiftClientManager.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/AWSGameLiftClientManager.cpp index 4ee2d31ebf..f900310078 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/AWSGameLiftClientManager.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/AWSGameLiftClientManager.cpp @@ -33,7 +33,7 @@ namespace AWSGameLift { -#if defined(AWSGAMELIFT_DEV) +#if defined(AZ_DEBUG_BUILD) || defined(AZ_PROFILE_BUILD) AZ_CVAR(AZ::CVarFixedString, cl_gameliftLocalEndpoint, "", nullptr, AZ::ConsoleFunctorFlags::Null, "The local endpoint to test with GameLiftLocal SDK."); #endif @@ -87,7 +87,7 @@ namespace AWSGameLift // Set up client endpoint or region AZStd::string localEndpoint = ""; -#if defined(AWSGAMELIFT_DEV) +#if defined(AZ_DEBUG_BUILD) || defined(AZ_PROFILE_BUILD) localEndpoint = static_cast(cl_gameliftLocalEndpoint); #endif if (!localEndpoint.empty()) @@ -139,7 +139,7 @@ namespace AWSGameLift { const AWSGameLiftAcceptMatchRequest& gameliftStartMatchmakingRequest = static_cast(acceptMatchRequest); - AcceptMatchHelper(gameliftStartMatchmakingRequest); + AcceptMatchActivity::AcceptMatch(gameliftStartMatchmakingRequest); } } @@ -157,9 +157,9 @@ namespace AWSGameLift AZ::JobContext* jobContext = nullptr; AWSCore::AWSCoreRequestBus::BroadcastResult(jobContext, &AWSCore::AWSCoreRequests::GetDefaultJobContext); AZ::Job* acceptMatchJob = AZ::CreateJobFunction( - [this, gameliftStartMatchmakingRequest]() + [gameliftStartMatchmakingRequest]() { - AcceptMatchHelper(gameliftStartMatchmakingRequest); + AcceptMatchActivity::AcceptMatch(gameliftStartMatchmakingRequest); AzFramework::MatchmakingAsyncRequestNotificationBus::Broadcast( &AzFramework::MatchmakingAsyncRequestNotifications::OnAcceptMatchAsyncComplete); @@ -169,21 +169,6 @@ namespace AWSGameLift acceptMatchJob->Start(); } - void AWSGameLiftClientManager::AcceptMatchHelper(const AWSGameLiftAcceptMatchRequest& acceptMatchRequest) - { - auto gameliftClient = AZ::Interface::Get()->GetGameLiftClient(); - - AZStd::string response; - if (!gameliftClient) - { - AZ_Error(AWSGameLiftClientManagerName, false, AWSGameLiftClientMissingErrorMessage); - } - else - { - AcceptMatchActivity::AcceptMatch(*gameliftClient, acceptMatchRequest); - } - } - AZStd::string AWSGameLiftClientManager::CreateSession(const AzFramework::CreateSessionRequest& createSessionRequest) { AZStd::string result = ""; @@ -191,13 +176,13 @@ namespace AWSGameLift { const AWSGameLiftCreateSessionRequest& gameliftCreateSessionRequest = static_cast(createSessionRequest); - result = CreateSessionHelper(gameliftCreateSessionRequest); + result = CreateSessionActivity::CreateSession(gameliftCreateSessionRequest); } else if (CreateSessionOnQueueActivity::ValidateCreateSessionOnQueueRequest(createSessionRequest)) { const AWSGameLiftCreateSessionOnQueueRequest& gameliftCreateSessionOnQueueRequest = static_cast(createSessionRequest); - result = CreateSessionOnQueueHelper(gameliftCreateSessionOnQueueRequest); + result = CreateSessionOnQueueActivity::CreateSessionOnQueue(gameliftCreateSessionOnQueueRequest); } else { @@ -217,9 +202,9 @@ namespace AWSGameLift AZ::JobContext* jobContext = nullptr; AWSCore::AWSCoreRequestBus::BroadcastResult(jobContext, &AWSCore::AWSCoreRequests::GetDefaultJobContext); AZ::Job* createSessionJob = AZ::CreateJobFunction( - [this, gameliftCreateSessionRequest]() + [gameliftCreateSessionRequest]() { - AZStd::string result = CreateSessionHelper(gameliftCreateSessionRequest); + AZStd::string result = CreateSessionActivity::CreateSession(gameliftCreateSessionRequest); AzFramework::SessionAsyncRequestNotificationBus::Broadcast( &AzFramework::SessionAsyncRequestNotifications::OnCreateSessionAsyncComplete, result); @@ -235,9 +220,9 @@ namespace AWSGameLift AZ::JobContext* jobContext = nullptr; AWSCore::AWSCoreRequestBus::BroadcastResult(jobContext, &AWSCore::AWSCoreRequests::GetDefaultJobContext); AZ::Job* createSessionOnQueueJob = AZ::CreateJobFunction( - [this, gameliftCreateSessionOnQueueRequest]() + [gameliftCreateSessionOnQueueRequest]() { - AZStd::string result = CreateSessionOnQueueHelper(gameliftCreateSessionOnQueueRequest); + AZStd::string result = CreateSessionOnQueueActivity::CreateSessionOnQueue(gameliftCreateSessionOnQueueRequest); AzFramework::SessionAsyncRequestNotificationBus::Broadcast( &AzFramework::SessionAsyncRequestNotifications::OnCreateSessionAsyncComplete, result); @@ -253,38 +238,6 @@ namespace AWSGameLift } } - AZStd::string AWSGameLiftClientManager::CreateSessionHelper( - const AWSGameLiftCreateSessionRequest& createSessionRequest) - { - auto gameliftClient = AZ::Interface::Get()->GetGameLiftClient(); - AZStd::string result = ""; - if (!gameliftClient) - { - AZ_Error(AWSGameLiftClientManagerName, false, AWSGameLiftClientMissingErrorMessage); - } - else - { - result = CreateSessionActivity::CreateSession(*gameliftClient, createSessionRequest); - } - return result; - } - - AZStd::string AWSGameLiftClientManager::CreateSessionOnQueueHelper( - const AWSGameLiftCreateSessionOnQueueRequest& createSessionOnQueueRequest) - { - auto gameliftClient = AZ::Interface::Get()->GetGameLiftClient(); - AZStd::string result; - if (!gameliftClient) - { - AZ_Error(AWSGameLiftClientManagerName, false, AWSGameLiftClientMissingErrorMessage); - } - else - { - result = CreateSessionOnQueueActivity::CreateSessionOnQueue(*gameliftClient, createSessionOnQueueRequest); - } - return result; - } - bool AWSGameLiftClientManager::JoinSession(const AzFramework::JoinSessionRequest& joinSessionRequest) { bool result = false; @@ -292,7 +245,8 @@ namespace AWSGameLift { const AWSGameLiftJoinSessionRequest& gameliftJoinSessionRequest = static_cast(joinSessionRequest); - result = JoinSessionHelper(gameliftJoinSessionRequest); + auto createPlayerSessionOutcome = JoinSessionActivity::CreatePlayerSession(gameliftJoinSessionRequest); + result = JoinSessionActivity::RequestPlayerJoinSession(createPlayerSessionOutcome); } return result; @@ -313,9 +267,10 @@ namespace AWSGameLift AZ::JobContext* jobContext = nullptr; AWSCore::AWSCoreRequestBus::BroadcastResult(jobContext, &AWSCore::AWSCoreRequests::GetDefaultJobContext); AZ::Job* joinSessionJob = AZ::CreateJobFunction( - [this, gameliftJoinSessionRequest]() + [gameliftJoinSessionRequest]() { - bool result = JoinSessionHelper(gameliftJoinSessionRequest); + auto createPlayerSessionOutcome = JoinSessionActivity::CreatePlayerSession(gameliftJoinSessionRequest); + bool result = JoinSessionActivity::RequestPlayerJoinSession(createPlayerSessionOutcome); AzFramework::SessionAsyncRequestNotificationBus::Broadcast( &AzFramework::SessionAsyncRequestNotifications::OnJoinSessionAsyncComplete, result); @@ -325,23 +280,6 @@ namespace AWSGameLift joinSessionJob->Start(); } - bool AWSGameLiftClientManager::JoinSessionHelper(const AWSGameLiftJoinSessionRequest& joinSessionRequest) - { - auto gameliftClient = AZ::Interface::Get()->GetGameLiftClient(); - bool result = false; - if (!gameliftClient) - { - AZ_Error(AWSGameLiftClientManagerName, false, AWSGameLiftClientMissingErrorMessage); - } - else - { - auto createPlayerSessionOutcome = JoinSessionActivity::CreatePlayerSession(*gameliftClient, joinSessionRequest); - - result = JoinSessionActivity::RequestPlayerJoinSession(createPlayerSessionOutcome); - } - return result; - } - void AWSGameLiftClientManager::LeaveSession() { AWSGameLift::LeaveSessionActivity::LeaveSession(); @@ -371,7 +309,7 @@ namespace AWSGameLift { const AWSGameLiftSearchSessionsRequest& gameliftSearchSessionsRequest = static_cast(searchSessionsRequest); - response = SearchSessionsHelper(gameliftSearchSessionsRequest); + response = SearchSessionsActivity::SearchSessions(gameliftSearchSessionsRequest); } return response; @@ -392,9 +330,9 @@ namespace AWSGameLift AZ::JobContext* jobContext = nullptr; AWSCore::AWSCoreRequestBus::BroadcastResult(jobContext, &AWSCore::AWSCoreRequests::GetDefaultJobContext); AZ::Job* searchSessionsJob = AZ::CreateJobFunction( - [this, gameliftSearchSessionsRequest]() + [gameliftSearchSessionsRequest]() { - AzFramework::SearchSessionsResponse response = SearchSessionsHelper(gameliftSearchSessionsRequest); + AzFramework::SearchSessionsResponse response = SearchSessionsActivity::SearchSessions(gameliftSearchSessionsRequest); AzFramework::SessionAsyncRequestNotificationBus::Broadcast( &AzFramework::SessionAsyncRequestNotifications::OnSearchSessionsAsyncComplete, response); @@ -404,22 +342,6 @@ namespace AWSGameLift searchSessionsJob->Start(); } - AzFramework::SearchSessionsResponse AWSGameLiftClientManager::SearchSessionsHelper( - const AWSGameLiftSearchSessionsRequest& searchSessionsRequest) const - { - auto gameliftClient = AZ::Interface::Get()->GetGameLiftClient(); - AzFramework::SearchSessionsResponse response; - if (!gameliftClient) - { - AZ_Error(AWSGameLiftClientManagerName, false, AWSGameLiftClientMissingErrorMessage); - } - else - { - response = SearchSessionsActivity::SearchSessions(*gameliftClient, searchSessionsRequest); - } - return response; - } - AZStd::string AWSGameLiftClientManager::StartMatchmaking(const AzFramework::StartMatchmakingRequest& startMatchmakingRequest) { AZStd::string response; @@ -427,7 +349,7 @@ namespace AWSGameLift { const AWSGameLiftStartMatchmakingRequest& gameliftStartMatchmakingRequest = static_cast(startMatchmakingRequest); - response = StartMatchmakingHelper(gameliftStartMatchmakingRequest); + response = StartMatchmakingActivity::StartMatchmaking(gameliftStartMatchmakingRequest); } return response; @@ -448,9 +370,9 @@ namespace AWSGameLift AZ::JobContext* jobContext = nullptr; AWSCore::AWSCoreRequestBus::BroadcastResult(jobContext, &AWSCore::AWSCoreRequests::GetDefaultJobContext); AZ::Job* startMatchmakingJob = AZ::CreateJobFunction( - [this, gameliftStartMatchmakingRequest]() + [gameliftStartMatchmakingRequest]() { - AZStd::string response = StartMatchmakingHelper(gameliftStartMatchmakingRequest); + AZStd::string response = StartMatchmakingActivity::StartMatchmaking(gameliftStartMatchmakingRequest); AzFramework::MatchmakingAsyncRequestNotificationBus::Broadcast( &AzFramework::MatchmakingAsyncRequestNotifications::OnStartMatchmakingAsyncComplete, response); @@ -460,29 +382,14 @@ namespace AWSGameLift startMatchmakingJob->Start(); } - AZStd::string AWSGameLiftClientManager::StartMatchmakingHelper(const AWSGameLiftStartMatchmakingRequest& startMatchmakingRequest) - { - auto gameliftClient = AZ::Interface::Get()->GetGameLiftClient(); - - AZStd::string response; - if (!gameliftClient) - { - AZ_Error(AWSGameLiftClientManagerName, false, AWSGameLiftClientMissingErrorMessage); - } - else - { - response = StartMatchmakingActivity::StartMatchmaking(*gameliftClient, startMatchmakingRequest); - } - return response; - } - void AWSGameLiftClientManager::StopMatchmaking(const AzFramework::StopMatchmakingRequest& stopMatchmakingRequest) { if (StopMatchmakingActivity::ValidateStopMatchmakingRequest(stopMatchmakingRequest)) { const AWSGameLiftStopMatchmakingRequest& gameliftStopMatchmakingRequest = static_cast(stopMatchmakingRequest); - StopMatchmakingHelper(gameliftStopMatchmakingRequest); + + StopMatchmakingActivity::StopMatchmaking(gameliftStopMatchmakingRequest); } } @@ -501,9 +408,9 @@ namespace AWSGameLift AZ::JobContext* jobContext = nullptr; AWSCore::AWSCoreRequestBus::BroadcastResult(jobContext, &AWSCore::AWSCoreRequests::GetDefaultJobContext); AZ::Job* stopMatchmakingJob = AZ::CreateJobFunction( - [this, gameliftStopMatchmakingRequest]() + [gameliftStopMatchmakingRequest]() { - StopMatchmakingHelper(gameliftStopMatchmakingRequest); + StopMatchmakingActivity::StopMatchmaking(gameliftStopMatchmakingRequest); AzFramework::MatchmakingAsyncRequestNotificationBus::Broadcast( &AzFramework::MatchmakingAsyncRequestNotifications::OnStopMatchmakingAsyncComplete); @@ -512,18 +419,4 @@ namespace AWSGameLift stopMatchmakingJob->Start(); } - - void AWSGameLiftClientManager::StopMatchmakingHelper(const AWSGameLiftStopMatchmakingRequest& stopMatchmakingRequest) - { - auto gameliftClient = AZ::Interface::Get()->GetGameLiftClient(); - - if (!gameliftClient) - { - AZ_Error(AWSGameLiftClientManagerName, false, AWSGameLiftClientMissingErrorMessage); - } - else - { - StopMatchmakingActivity::StopMatchmaking(*gameliftClient, stopMatchmakingRequest); - } - } } // namespace AWSGameLift diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/AWSGameLiftClientManager.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/AWSGameLiftClientManager.h index 8a0c91c36d..f37152bc60 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/AWSGameLiftClientManager.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/AWSGameLiftClientManager.h @@ -175,14 +175,5 @@ namespace AWSGameLift bool JoinSession(const AzFramework::JoinSessionRequest& joinSessionRequest) override; AzFramework::SearchSessionsResponse SearchSessions(const AzFramework::SearchSessionsRequest& searchSessionsRequest) const override; void LeaveSession() override; - - private: - void AcceptMatchHelper(const AWSGameLiftAcceptMatchRequest& createSessionRequest); - AZStd::string CreateSessionHelper(const AWSGameLiftCreateSessionRequest& createSessionRequest); - AZStd::string CreateSessionOnQueueHelper(const AWSGameLiftCreateSessionOnQueueRequest& createSessionOnQueueRequest); - bool JoinSessionHelper(const AWSGameLiftJoinSessionRequest& joinSessionRequest); - AzFramework::SearchSessionsResponse SearchSessionsHelper(const AWSGameLiftSearchSessionsRequest& searchSessionsRequest) const; - AZStd::string StartMatchmakingHelper(const AWSGameLiftStartMatchmakingRequest& startMatchmakingRequest); - void StopMatchmakingHelper(const AWSGameLiftStopMatchmakingRequest& stopMatchmakingRequest); }; } // namespace AWSGameLift diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftAcceptMatchActivity.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftAcceptMatchActivity.cpp index 25ba328fd0..dbeced1728 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftAcceptMatchActivity.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftAcceptMatchActivity.cpp @@ -7,9 +7,11 @@ */ #include +#include #include #include +#include #include #include @@ -42,13 +44,19 @@ namespace AWSGameLift return request; } - void AcceptMatch(const Aws::GameLift::GameLiftClient& gameliftClient, - const AWSGameLiftAcceptMatchRequest& AcceptMatchRequest) + void AcceptMatch(const AWSGameLiftAcceptMatchRequest& AcceptMatchRequest) { + auto gameliftClient = AZ::Interface::Get()->GetGameLiftClient(); + if (!gameliftClient) + { + AZ_Error(AWSGameLiftAcceptMatchActivityName, false, AWSGameLiftClientMissingErrorMessage); + return; + } + AZ_TracePrintf(AWSGameLiftAcceptMatchActivityName, "Requesting AcceptMatch against Amazon GameLift service ..."); Aws::GameLift::Model::AcceptMatchRequest request = BuildAWSGameLiftAcceptMatchRequest(AcceptMatchRequest); - auto AcceptMatchOutcome = gameliftClient.AcceptMatch(request); + auto AcceptMatchOutcome = gameliftClient->AcceptMatch(request); if (AcceptMatchOutcome.IsSuccess()) { diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftAcceptMatchActivity.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftAcceptMatchActivity.h index d5f28f92e2..ac4012c347 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftAcceptMatchActivity.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftAcceptMatchActivity.h @@ -23,7 +23,7 @@ namespace AWSGameLift Aws::GameLift::Model::AcceptMatchRequest BuildAWSGameLiftAcceptMatchRequest(const AWSGameLiftAcceptMatchRequest& AcceptMatchRequest); // Create AcceptMatchRequest and make a AcceptMatch call through GameLift client - void AcceptMatch(const Aws::GameLift::GameLiftClient& gameliftClient, const AWSGameLiftAcceptMatchRequest& AcceptMatchRequest); + void AcceptMatch(const AWSGameLiftAcceptMatchRequest& AcceptMatchRequest); // Validate AcceptMatchRequest and check required request parameters bool ValidateAcceptMatchRequest(const AzFramework::AcceptMatchRequest& AcceptMatchRequest); diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionActivity.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionActivity.cpp index 0332ea7a76..ee93f022a1 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionActivity.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionActivity.cpp @@ -6,9 +6,16 @@ * */ +#include +#include + #include #include #include +#include + +#include +#include namespace AWSGameLift { @@ -63,15 +70,21 @@ namespace AWSGameLift return request; } - AZStd::string CreateSession( - const Aws::GameLift::GameLiftClient& gameliftClient, - const AWSGameLiftCreateSessionRequest& createSessionRequest) + AZStd::string CreateSession(const AWSGameLiftCreateSessionRequest& createSessionRequest) { + AZStd::string result = ""; + + auto gameliftClient = AZ::Interface::Get()->GetGameLiftClient(); + if (!gameliftClient) + { + AZ_Error(AWSGameLiftCreateSessionActivityName, false, AWSGameLiftClientMissingErrorMessage); + return result; + } + AZ_TracePrintf(AWSGameLiftCreateSessionActivityName, "Requesting CreateGameSession against Amazon GameLift service ..."); - AZStd::string result = ""; Aws::GameLift::Model::CreateGameSessionRequest request = BuildAWSGameLiftCreateGameSessionRequest(createSessionRequest); - auto createSessionOutcome = gameliftClient.CreateGameSession(request); + auto createSessionOutcome = gameliftClient->CreateGameSession(request); AZ_TracePrintf(AWSGameLiftCreateSessionActivityName, "CreateGameSession request against Amazon GameLift service is complete"); if (createSessionOutcome.IsSuccess()) diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionActivity.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionActivity.h index 714675c652..af236dbfa4 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionActivity.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionActivity.h @@ -10,9 +10,7 @@ #include -#include #include -#include namespace AWSGameLift { @@ -24,9 +22,7 @@ namespace AWSGameLift Aws::GameLift::Model::CreateGameSessionRequest BuildAWSGameLiftCreateGameSessionRequest(const AWSGameLiftCreateSessionRequest& createSessionRequest); // Create CreateGameSessionRequest and make a CreateGameSession call through GameLift client - AZStd::string CreateSession( - const Aws::GameLift::GameLiftClient& gameliftClient, - const AWSGameLiftCreateSessionRequest& createSessionRequest); + AZStd::string CreateSession(const AWSGameLiftCreateSessionRequest& createSessionRequest); // Validate CreateSessionRequest and check required request parameters bool ValidateCreateSessionRequest(const AzFramework::CreateSessionRequest& createSessionRequest); diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionOnQueueActivity.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionOnQueueActivity.cpp index 52be365ea5..8e8d7e23c5 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionOnQueueActivity.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionOnQueueActivity.cpp @@ -6,9 +6,16 @@ * */ +#include +#include + #include #include #include +#include + +#include +#include namespace AWSGameLift { @@ -47,17 +54,23 @@ namespace AWSGameLift return request; } - AZStd::string CreateSessionOnQueue( - const Aws::GameLift::GameLiftClient& gameliftClient, - const AWSGameLiftCreateSessionOnQueueRequest& createSessionOnQueueRequest) + AZStd::string CreateSessionOnQueue(const AWSGameLiftCreateSessionOnQueueRequest& createSessionOnQueueRequest) { + AZStd::string result = ""; + + auto gameliftClient = AZ::Interface::Get()->GetGameLiftClient(); + if (!gameliftClient) + { + AZ_Error(AWSGameLiftCreateSessionOnQueueActivityName, false, AWSGameLiftClientMissingErrorMessage); + return result; + } + AZ_TracePrintf(AWSGameLiftCreateSessionOnQueueActivityName, "Requesting StartGameSessionPlacement against Amazon GameLift service ..."); - AZStd::string result = ""; Aws::GameLift::Model::StartGameSessionPlacementRequest request = BuildAWSGameLiftStartGameSessionPlacementRequest(createSessionOnQueueRequest); - auto createSessionOnQueueOutcome = gameliftClient.StartGameSessionPlacement(request); + auto createSessionOnQueueOutcome = gameliftClient->StartGameSessionPlacement(request); AZ_TracePrintf(AWSGameLiftCreateSessionOnQueueActivityName, "StartGameSessionPlacement request against Amazon GameLift service is complete."); diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionOnQueueActivity.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionOnQueueActivity.h index 714bcd1060..5f16bf0b31 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionOnQueueActivity.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftCreateSessionOnQueueActivity.h @@ -10,9 +10,7 @@ #include -#include #include -#include namespace AWSGameLift { @@ -25,9 +23,7 @@ namespace AWSGameLift const AWSGameLiftCreateSessionOnQueueRequest& createSessionOnQueueRequest); // Create StartGameSessionPlacementRequest and make a CreateGameSession call through GameLift client - AZStd::string CreateSessionOnQueue( - const Aws::GameLift::GameLiftClient& gameliftClient, - const AWSGameLiftCreateSessionOnQueueRequest& createSessionOnQueueRequest); + AZStd::string CreateSessionOnQueue(const AWSGameLiftCreateSessionOnQueueRequest& createSessionOnQueueRequest); // Validate CreateSessionOnQueueRequest and check required request parameters bool ValidateCreateSessionOnQueueRequest(const AzFramework::CreateSessionRequest& createSessionRequest); diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftJoinSessionActivity.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftJoinSessionActivity.cpp index a47e59255f..71ef9e9737 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftJoinSessionActivity.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftJoinSessionActivity.cpp @@ -7,10 +7,11 @@ */ #include -#include +#include #include #include +#include namespace AWSGameLift { @@ -59,16 +60,24 @@ namespace AWSGameLift } Aws::GameLift::Model::CreatePlayerSessionOutcome CreatePlayerSession( - const Aws::GameLift::GameLiftClient& gameliftClient, const AWSGameLiftJoinSessionRequest& joinSessionRequest) { + Aws::GameLift::Model::CreatePlayerSessionOutcome createPlayerSessionOutcome; + + auto gameliftClient = AZ::Interface::Get()->GetGameLiftClient(); + if (!gameliftClient) + { + AZ_Error(AWSGameLiftJoinSessionActivityName, false, AWSGameLiftClientMissingErrorMessage); + return createPlayerSessionOutcome; + } + AZ_TracePrintf(AWSGameLiftJoinSessionActivityName, "Requesting CreatePlayerSession for player %s against Amazon GameLift service ...", joinSessionRequest.m_playerId.c_str()); Aws::GameLift::Model::CreatePlayerSessionRequest request = BuildAWSGameLiftCreatePlayerSessionRequest(joinSessionRequest); - auto createPlayerSessionOutcome = gameliftClient.CreatePlayerSession(request); + createPlayerSessionOutcome = gameliftClient->CreatePlayerSession(request); AZ_TracePrintf(AWSGameLiftJoinSessionActivityName, "CreatePlayerSession request for player %s against Amazon GameLift service is complete", joinSessionRequest.m_playerId.c_str()); diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftJoinSessionActivity.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftJoinSessionActivity.h index fe34e5fe57..b011f4877b 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftJoinSessionActivity.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftJoinSessionActivity.h @@ -36,7 +36,6 @@ namespace AWSGameLift // Create CreatePlayerSessionRequest and make a CreatePlayerSession call through GameLift client Aws::GameLift::Model::CreatePlayerSessionOutcome CreatePlayerSession( - const Aws::GameLift::GameLiftClient& gameliftClient, const AWSGameLiftJoinSessionRequest& joinSessionRequest); // Request to setup networking connection for player diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftLeaveSessionActivity.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftLeaveSessionActivity.cpp index a99fed4edc..fd3b3d6ebc 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftLeaveSessionActivity.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftLeaveSessionActivity.cpp @@ -6,11 +6,12 @@ * */ -#include - #include +#include #include +#include + namespace AWSGameLift { namespace LeaveSessionActivity diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftSearchSessionsActivity.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftSearchSessionsActivity.cpp index 5f0b6fd012..b7917e6d59 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftSearchSessionsActivity.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftSearchSessionsActivity.cpp @@ -6,10 +6,16 @@ * */ +#include +#include #include #include #include +#include + +#include +#include namespace AWSGameLift { @@ -62,14 +68,21 @@ namespace AWSGameLift } AzFramework::SearchSessionsResponse SearchSessions( - const Aws::GameLift::GameLiftClient& gameliftClient, const AWSGameLiftSearchSessionsRequest& searchSessionsRequest) { + AzFramework::SearchSessionsResponse response; + + auto gameliftClient = AZ::Interface::Get()->GetGameLiftClient(); + if (!gameliftClient) + { + AZ_Error(AWSGameLiftSearchSessionsActivityName, false, AWSGameLiftClientMissingErrorMessage); + return response; + } + AZ_TracePrintf(AWSGameLiftSearchSessionsActivityName, "Requesting SearchGameSessions against Amazon GameLift service ..."); - AzFramework::SearchSessionsResponse response; Aws::GameLift::Model::SearchGameSessionsRequest request = BuildAWSGameLiftSearchGameSessionsRequest(searchSessionsRequest); - Aws::GameLift::Model::SearchGameSessionsOutcome outcome = gameliftClient.SearchGameSessions(request); + Aws::GameLift::Model::SearchGameSessionsOutcome outcome = gameliftClient->SearchGameSessions(request); AZ_TracePrintf(AWSGameLiftSearchSessionsActivityName, "SearchGameSessions request against Amazon GameLift service is complete"); if (outcome.IsSuccess()) diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftSearchSessionsActivity.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftSearchSessionsActivity.h index 205e83dd96..d5bcda992c 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftSearchSessionsActivity.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftSearchSessionsActivity.h @@ -10,9 +10,7 @@ #include -#include #include -#include namespace AWSGameLift { @@ -28,7 +26,6 @@ namespace AWSGameLift // Create SearchGameSessionsRequest and make a SeachGameSessions call through GameLift client AzFramework::SearchSessionsResponse SearchSessions( - const Aws::GameLift::GameLiftClient& gameliftClient, const AWSGameLiftSearchSessionsRequest& searchSessionsRequest); // Convert from Aws::GameLift::Model::SearchGameSessionsResult to AzFramework::SearchSessionsResponse. diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStartMatchmakingActivity.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStartMatchmakingActivity.cpp index 00a7773491..6f6c7fccc0 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStartMatchmakingActivity.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStartMatchmakingActivity.cpp @@ -7,11 +7,13 @@ */ #include +#include #include #include #include #include +#include #include #include @@ -78,14 +80,21 @@ namespace AWSGameLift } AZStd::string StartMatchmaking( - const Aws::GameLift::GameLiftClient& gameliftClient, const AWSGameLiftStartMatchmakingRequest& startMatchmakingRequest) { + AZStd::string result = ""; + + auto gameliftClient = AZ::Interface::Get()->GetGameLiftClient(); + if (!gameliftClient) + { + AZ_Error(AWSGameLiftStartMatchmakingActivityName, false, AWSGameLiftClientMissingErrorMessage); + return result; + } + AZ_TracePrintf(AWSGameLiftStartMatchmakingActivityName, "Requesting StartMatchmaking against Amazon GameLift service ..."); - AZStd::string result = ""; Aws::GameLift::Model::StartMatchmakingRequest request = BuildAWSGameLiftStartMatchmakingRequest(startMatchmakingRequest); - auto startMatchmakingOutcome = gameliftClient.StartMatchmaking(request); + auto startMatchmakingOutcome = gameliftClient->StartMatchmaking(request); if (startMatchmakingOutcome.IsSuccess()) { result = AZStd::string(startMatchmakingOutcome.GetResult().GetMatchmakingTicket().GetTicketId().c_str()); diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStartMatchmakingActivity.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStartMatchmakingActivity.h index db814c14b2..f736e318fb 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStartMatchmakingActivity.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStartMatchmakingActivity.h @@ -23,7 +23,7 @@ namespace AWSGameLift Aws::GameLift::Model::StartMatchmakingRequest BuildAWSGameLiftStartMatchmakingRequest(const AWSGameLiftStartMatchmakingRequest& startMatchmakingRequest); // Create StartMatchmakingRequest and make a StartMatchmaking call through GameLift client - AZStd::string StartMatchmaking(const Aws::GameLift::GameLiftClient& gameliftClient, const AWSGameLiftStartMatchmakingRequest& startMatchmakingRequest); + AZStd::string StartMatchmaking(const AWSGameLiftStartMatchmakingRequest& startMatchmakingRequest); // Validate StartMatchmakingRequest and check required request parameters bool ValidateStartMatchmakingRequest(const AzFramework::StartMatchmakingRequest& startMatchmakingRequest); diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStopMatchmakingActivity.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStopMatchmakingActivity.cpp index b427d0323a..022861570a 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStopMatchmakingActivity.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStopMatchmakingActivity.cpp @@ -7,9 +7,11 @@ */ #include +#include #include #include +#include #include #include @@ -32,13 +34,19 @@ namespace AWSGameLift return request; } - void StopMatchmaking(const Aws::GameLift::GameLiftClient& gameliftClient, - const AWSGameLiftStopMatchmakingRequest& stopMatchmakingRequest) + void StopMatchmaking(const AWSGameLiftStopMatchmakingRequest& stopMatchmakingRequest) { + auto gameliftClient = AZ::Interface::Get()->GetGameLiftClient(); + if (!gameliftClient) + { + AZ_Error(AWSGameLiftStopMatchmakingActivityName, false, AWSGameLiftClientMissingErrorMessage); + return; + } + AZ_TracePrintf(AWSGameLiftStopMatchmakingActivityName, "Requesting StopMatchmaking against Amazon GameLift service ..."); Aws::GameLift::Model::StopMatchmakingRequest request = BuildAWSGameLiftStopMatchmakingRequest(stopMatchmakingRequest); - auto stopMatchmakingOutcome = gameliftClient.StopMatchmaking(request); + auto stopMatchmakingOutcome = gameliftClient->StopMatchmaking(request); if (stopMatchmakingOutcome.IsSuccess()) { diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStopMatchmakingActivity.h b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStopMatchmakingActivity.h index 0820f2c05e..b5f19d35df 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStopMatchmakingActivity.h +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Source/Activity/AWSGameLiftStopMatchmakingActivity.h @@ -23,7 +23,7 @@ namespace AWSGameLift Aws::GameLift::Model::StopMatchmakingRequest BuildAWSGameLiftStopMatchmakingRequest(const AWSGameLiftStopMatchmakingRequest& stopMatchmakingRequest); // Create StopMatchmakingRequest and make a StopMatchmaking call through GameLift client - void StopMatchmaking(const Aws::GameLift::GameLiftClient& gameliftClient, const AWSGameLiftStopMatchmakingRequest& stopMatchmakingRequest); + void StopMatchmaking(const AWSGameLiftStopMatchmakingRequest& stopMatchmakingRequest); // Validate StopMatchmakingRequest and check required request parameters bool ValidateStopMatchmakingRequest(const AzFramework::StopMatchmakingRequest& stopMatchmakingRequest); diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftCreateSessionActivityTest.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftCreateSessionActivityTest.cpp index 70dcdba1af..fcf867138b 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftCreateSessionActivityTest.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftCreateSessionActivityTest.cpp @@ -9,6 +9,8 @@ #include #include +#include + using namespace AWSGameLift; using AWSGameLiftCreateSessionActivityTest = AWSGameLiftClientFixture; diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftCreateSessionOnQueueActivityTest.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftCreateSessionOnQueueActivityTest.cpp index 8a785d8007..4845586e47 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftCreateSessionOnQueueActivityTest.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftCreateSessionOnQueueActivityTest.cpp @@ -9,6 +9,8 @@ #include #include +#include + using namespace AWSGameLift; using AWSGameLiftCreateSessionOnQueueActivityTest = AWSGameLiftClientFixture; diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftJoinSessionActivityTest.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftJoinSessionActivityTest.cpp index 6a1156646a..33b03649c7 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftJoinSessionActivityTest.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftJoinSessionActivityTest.cpp @@ -6,6 +6,8 @@ * */ +#include + #include #include diff --git a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftSearchSessionsActivityTest.cpp b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftSearchSessionsActivityTest.cpp index 3337c2f6d2..0d3c8c137b 100644 --- a/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftSearchSessionsActivityTest.cpp +++ b/Gems/AWSGameLift/Code/AWSGameLiftClient/Tests/Activity/AWSGameLiftSearchSessionsActivityTest.cpp @@ -12,6 +12,9 @@ #include #include +#include +#include + using namespace AWSGameLift; using AWSGameLiftSearchSessionsActivityTest = AWSGameLiftClientFixture;