From 19316e422b7c42cce7b3ac6d52c5fbb9e9dc68a2 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Tue, 18 May 2021 10:46:18 -0700 Subject: [PATCH] Check launch process exists before waiting for 15 seconds --- .../Code/Source/Editor/MultiplayerEditorSystemComponent.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp index 159f3b944b..a3d2551dd8 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp @@ -126,7 +126,6 @@ namespace Multiplayer { // If enabled but no process name is supplied, try this project's ServerLauncher serverProcess = AZ::Utils::GetProjectName() + ".ServerLauncher"; - serverPath = AZ::Utils::GetExecutableDirectory(); serverPath /= serverProcess + AZ_TRAIT_OS_EXECUTABLE_EXTENSION; } @@ -144,7 +143,10 @@ namespace Multiplayer // Launch the Server and give it a few seconds to boot up AzFramework::ProcessWatcher* outProcess = AzFramework::ProcessWatcher::LaunchProcess( processLaunchInfo, AzFramework::ProcessCommunicationType::COMMUNICATOR_TYPE_NONE); - AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(15000)); + if (outProcess) + { + AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(15000)); + } return outProcess; }