From 5d5087e0d34b327521c346395996ceb778bb5633 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Tue, 9 Nov 2021 11:11:15 -0800 Subject: [PATCH 01/14] Moving CommunicatorTracePrinter to a place that AP and Multiplayer gem can use it. MultiplayerEditorSystemComponent now watching the server process and pumping the trace printer. Wip; for some reason not all the server logs are reaching the editor Signed-off-by: Gene Walters --- .../ProcessCommunicatorTracePrinter.cpp} | 12 ++++----- .../ProcessCommunicatorTracePrinter.h} | 13 +++++----- .../AzFramework/azframework_files.cmake | 2 ++ .../assetprocessor_static_files.cmake | 2 -- .../native/resourcecompiler/RCBuilder.cpp | 2 -- .../utilities/ApplicationManagerBase.cpp | 2 +- .../native/utilities/BuilderManager.cpp | 2 +- .../native/utilities/BuilderManager.h | 4 +-- .../MultiplayerEditorSystemComponent.cpp | 26 ++++++++++++++++--- .../Editor/MultiplayerEditorSystemComponent.h | 13 +++++++--- .../Source/MultiplayerSystemComponent.cpp | 1 + 11 files changed, 51 insertions(+), 28 deletions(-) rename Code/{Tools/AssetProcessor/native/utilities/CommunicatorTracePrinter.cpp => Framework/AzFramework/AzFramework/Process/ProcessCommunicatorTracePrinter.cpp} (82%) rename Code/{Tools/AssetProcessor/native/utilities/CommunicatorTracePrinter.h => Framework/AzFramework/AzFramework/Process/ProcessCommunicatorTracePrinter.h} (54%) diff --git a/Code/Tools/AssetProcessor/native/utilities/CommunicatorTracePrinter.cpp b/Code/Framework/AzFramework/AzFramework/Process/ProcessCommunicatorTracePrinter.cpp similarity index 82% rename from Code/Tools/AssetProcessor/native/utilities/CommunicatorTracePrinter.cpp rename to Code/Framework/AzFramework/AzFramework/Process/ProcessCommunicatorTracePrinter.cpp index c6008deb34..8f3e45bec5 100644 --- a/Code/Tools/AssetProcessor/native/utilities/CommunicatorTracePrinter.cpp +++ b/Code/Framework/AzFramework/AzFramework/Process/ProcessCommunicatorTracePrinter.cpp @@ -6,16 +6,16 @@ * */ -#include "CommunicatorTracePrinter.h" +#include "ProcessCommunicatorTracePrinter.h" -CommunicatorTracePrinter::CommunicatorTracePrinter(AzFramework::ProcessCommunicator* communicator, const char* window) : +ProcessCommunicatorTracePrinter::ProcessCommunicatorTracePrinter(AzFramework::ProcessCommunicator* communicator, const char* window) : m_communicator(communicator), m_window(window) { m_stringBeingConcatenated.reserve(1024); } -CommunicatorTracePrinter::~CommunicatorTracePrinter() +ProcessCommunicatorTracePrinter::~ProcessCommunicatorTracePrinter() { // flush stdout WriteCurrentString(false); @@ -24,7 +24,7 @@ CommunicatorTracePrinter::~CommunicatorTracePrinter() WriteCurrentString(true); } -void CommunicatorTracePrinter::Pump() +void ProcessCommunicatorTracePrinter::Pump() { if (m_communicator->IsValid()) { @@ -42,7 +42,7 @@ void CommunicatorTracePrinter::Pump() } } -void CommunicatorTracePrinter::ParseDataBuffer(AZ::u32 readSize, bool isFromStdErr) +void ProcessCommunicatorTracePrinter::ParseDataBuffer(AZ::u32 readSize, bool isFromStdErr) { if (readSize > AZ_ARRAY_SIZE(m_streamBuffer)) { @@ -67,7 +67,7 @@ void CommunicatorTracePrinter::ParseDataBuffer(AZ::u32 readSize, bool isFromStdE } } -void CommunicatorTracePrinter::WriteCurrentString(bool isFromStdErr) +void ProcessCommunicatorTracePrinter::WriteCurrentString(bool isFromStdErr) { AZStd::string& bufferToUse = isFromStdErr ? m_errorStringBeingConcatenated : m_stringBeingConcatenated; diff --git a/Code/Tools/AssetProcessor/native/utilities/CommunicatorTracePrinter.h b/Code/Framework/AzFramework/AzFramework/Process/ProcessCommunicatorTracePrinter.h similarity index 54% rename from Code/Tools/AssetProcessor/native/utilities/CommunicatorTracePrinter.h rename to Code/Framework/AzFramework/AzFramework/Process/ProcessCommunicatorTracePrinter.h index c2e4da32af..8b84c4c28d 100644 --- a/Code/Tools/AssetProcessor/native/utilities/CommunicatorTracePrinter.h +++ b/Code/Framework/AzFramework/AzFramework/Process/ProcessCommunicatorTracePrinter.h @@ -10,20 +10,21 @@ #include -//! CommunicatorTracePrinter listens to stderr and stdout of a running process and writes its output to the AZ_Trace system +//! ProcessCommunicatorTracePrinter listens to stderr and stdout of a running process and writes its output to the AZ_Trace system //! Importantly, it does not do any blocking operations. -class CommunicatorTracePrinter +class ProcessCommunicatorTracePrinter { public: - CommunicatorTracePrinter(AzFramework::ProcessCommunicator* communicator, const char* window); - ~CommunicatorTracePrinter(); + ProcessCommunicatorTracePrinter(AzFramework::ProcessCommunicator* communicator, const char* window); + ~ProcessCommunicatorTracePrinter(); - // call this periodically to drain the buffers and write them. + // Call this periodically to drain the buffers and write them. void Pump(); - // drains the buffer into the string thats being built, then traces the string when it hits a newline. + // Drains the buffer into the string that's being built, then traces the string when it hits a newline. void ParseDataBuffer(AZ::u32 readSize, bool isFromStdErr); + // Prints the current buffer to AZ_Error or AZ_TracePrintf so that it can be picked up by AZ::Debug::Trace void WriteCurrentString(bool isFromStdError); private: diff --git a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake index e03d166cfc..232975d7c8 100644 --- a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake +++ b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake @@ -274,6 +274,8 @@ set(FILES Process/ProcessWatcher.cpp Process/ProcessWatcher.h Process/ProcessCommon_fwd.h + Process/ProcessCommunicatorTracePrinter.cpp + Process/ProcessCommunicatorTracePrinter.h ProjectManager/ProjectManager.h ProjectManager/ProjectManager.cpp Render/GameIntersectorComponent.h diff --git a/Code/Tools/AssetProcessor/assetprocessor_static_files.cmake b/Code/Tools/AssetProcessor/assetprocessor_static_files.cmake index 0c1347517f..056b88beb2 100644 --- a/Code/Tools/AssetProcessor/assetprocessor_static_files.cmake +++ b/Code/Tools/AssetProcessor/assetprocessor_static_files.cmake @@ -89,8 +89,6 @@ set(FILES native/utilities/BuilderManager.inl native/utilities/ByteArrayStream.cpp native/utilities/ByteArrayStream.h - native/utilities/CommunicatorTracePrinter.cpp - native/utilities/CommunicatorTracePrinter.h native/utilities/IniConfiguration.cpp native/utilities/IniConfiguration.h native/utilities/JobDiagnosticTracker.cpp diff --git a/Code/Tools/AssetProcessor/native/resourcecompiler/RCBuilder.cpp b/Code/Tools/AssetProcessor/native/resourcecompiler/RCBuilder.cpp index 27210685fc..c463f2320e 100644 --- a/Code/Tools/AssetProcessor/native/resourcecompiler/RCBuilder.cpp +++ b/Code/Tools/AssetProcessor/native/resourcecompiler/RCBuilder.cpp @@ -20,7 +20,6 @@ #include #include -#include #include #include @@ -31,7 +30,6 @@ #include "native/utilities/assetUtils.h" #include "native/utilities/AssetBuilderInfo.h" -#include "native/utilities/CommunicatorTracePrinter.h" #include diff --git a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp index 4e0bc7e434..2c322da2f7 100644 --- a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp @@ -1479,7 +1479,7 @@ bool ApplicationManagerBase::WaitForBuilderExit(AzFramework::ProcessWatcher* pro AZ::u32 exitCode = 0; bool finishedOK = false; QElapsedTimer ticker; - CommunicatorTracePrinter tracer(processWatcher->GetCommunicator(), "AssetBuilder"); + ProcessCommunicatorTracePrinter tracer(processWatcher->GetCommunicator(), "AssetBuilder"); ticker.start(); diff --git a/Code/Tools/AssetProcessor/native/utilities/BuilderManager.cpp b/Code/Tools/AssetProcessor/native/utilities/BuilderManager.cpp index 751afc1a5d..aa462f7590 100644 --- a/Code/Tools/AssetProcessor/native/utilities/BuilderManager.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/BuilderManager.cpp @@ -164,7 +164,7 @@ namespace AssetProcessor return false; } - m_tracePrinter = AZStd::make_unique(m_processWatcher->GetCommunicator(), "AssetBuilder"); + m_tracePrinter = AZStd::make_unique(m_processWatcher->GetCommunicator(), "AssetBuilder"); return WaitForConnection(); } diff --git a/Code/Tools/AssetProcessor/native/utilities/BuilderManager.h b/Code/Tools/AssetProcessor/native/utilities/BuilderManager.h index 657e4c7788..440f0b3709 100644 --- a/Code/Tools/AssetProcessor/native/utilities/BuilderManager.h +++ b/Code/Tools/AssetProcessor/native/utilities/BuilderManager.h @@ -10,11 +10,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include // used in the inl file. @@ -127,7 +127,7 @@ namespace AssetProcessor AZStd::unique_ptr m_processWatcher = nullptr; //! Optional communicator, only available if we have a process watcher - AZStd::unique_ptr m_tracePrinter = nullptr; + AZStd::unique_ptr m_tracePrinter = nullptr; const AssetUtilities::QuitListener& m_quitListener; }; diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp index 11aca101b3..7d6a684b6b 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp @@ -6,6 +6,8 @@ * */ +#include "AzFramework/Process/ProcessCommunicator.h" + #include #include #include @@ -133,6 +135,7 @@ namespace Multiplayer AzToolsFramework::EditorEvents::Bus::Handler::BusDisconnect(); AzFramework::GameEntityContextEventBus::Handler::BusDisconnect(); MultiplayerEditorServerRequestBus::Handler::BusDisconnect(); + AZ::TickBus::Handler::BusDisconnect(); } void MultiplayerEditorSystemComponent::NotifyRegisterViews() @@ -157,12 +160,21 @@ namespace Multiplayer [[fallthrough]]; case eNotify_OnEndGameMode: // Kill the configured server if it's active - if (m_serverProcess) + if (m_serverProcessWatcher) { - m_serverProcess->TerminateProcess(0); - m_serverProcess = nullptr; + m_serverProcessWatcher->TerminateProcess(0); + if (m_serverProcessTracePrinter) + { + m_serverProcessTracePrinter->Pump(); + m_serverProcessTracePrinter->WriteCurrentString(true); + m_serverProcessTracePrinter->WriteCurrentString(false); + } + m_serverProcessWatcher = nullptr; + m_serverProcessTracePrinter = nullptr; } + AZ::TickBus::Handler::BusDisconnect(); + if (INetworkInterface* editorNetworkInterface = AZ::Interface::Get()->RetrieveNetworkInterface(AZ::Name(MpEditorInterfaceName))) { editorNetworkInterface->Disconnect(m_editorConnId, AzNetworking::DisconnectReason::TerminatedByClient); @@ -220,7 +232,7 @@ namespace Multiplayer // Launch the Server AzFramework::ProcessWatcher* outProcess = AzFramework::ProcessWatcher::LaunchProcess( - processLaunchInfo, AzFramework::ProcessCommunicationType::COMMUNICATOR_TYPE_NONE); + processLaunchInfo, AzFramework::ProcessCommunicationType::COMMUNICATOR_TYPE_STDINOUT); AZ_Error( "MultiplayerEditor", processLaunchInfo.m_launchResult != AzFramework::ProcessLauncher::ProcessLaunchResult::PLR_MissingFile, @@ -389,4 +401,10 @@ namespace Multiplayer { return PyIsInGameMode(); } + + void MultiplayerEditorSystemComponent::OnTick(float, AZ::ScriptTimePoint) + { + m_serverProcessTracePrinter->Pump(); + } + } diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.h b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.h index 77b41a5dc4..330a2c9d81 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.h +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.h @@ -13,14 +13,12 @@ #include #include -#include - #include #include #include -#include #include #include +#include #include namespace AzNetworking @@ -52,6 +50,7 @@ namespace Multiplayer , private AzToolsFramework::EditorEvents::Bus::Handler , private IEditorNotifyListener , private MultiplayerEditorServerRequestBus::Handler + , private AZ::TickBus::Handler { public: AZ_COMPONENT(MultiplayerEditorSystemComponent, "{9F335CC0-5574-4AD3-A2D8-2FAEF356946C}"); @@ -101,8 +100,14 @@ namespace Multiplayer void SendEditorServerLevelDataPacket(AzNetworking::IConnection* connection) override; //! @} + //! AZ::TickBus::Handler + //! @{ + void OnTick(float, AZ::ScriptTimePoint) override; + //! @} + IEditor* m_editor = nullptr; - AzFramework::ProcessWatcher* m_serverProcess = nullptr; + AzFramework::ProcessWatcher* m_serverProcessWatcher = nullptr; + AZStd::unique_ptr m_serverProcessTracePrinter = nullptr; AzNetworking::ConnectionId m_editorConnId; ServerAcceptanceReceivedEvent::Handler m_serverAcceptanceReceivedHandler; diff --git a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp index 6df5e4611f..54f5534864 100644 --- a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp +++ b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp @@ -1134,6 +1134,7 @@ namespace Multiplayer AZStd::to_lower(sv_defaultPlayerSpawnAssetLowerCase.begin(), sv_defaultPlayerSpawnAssetLowerCase.end()); PrefabEntityId playerPrefabEntityId(AZ::Name(static_cast(sv_defaultPlayerSpawnAssetLowerCase).c_str())); INetworkEntityManager::EntityList entityList = m_networkEntityManager.CreateEntitiesImmediate(playerPrefabEntityId, NetEntityRole::Authority, AZ::Transform::CreateIdentity(), Multiplayer::AutoActivate::DoNotActivate); + AZ_TracePrintf("MultiplayerSystemComponent", "Server spawned the default player: %s", sv_defaultPlayerSpawnAssetLowerCase.c_str()) for (NetworkEntityHandle subEntity : entityList) { From d6803d800b1521456cfbdbcaacf0c9883dbd4083 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 10 Nov 2021 19:37:11 -0800 Subject: [PATCH 02/14] Externed cvars dont get registered with setreg (not sure why). Updating sv_defaultPlayer to grab the variable via console string lookup instead so the proper value is gathered Signed-off-by: Gene Walters --- .../Editor/MultiplayerEditorSystemComponent.cpp | 16 ++++++++++++++-- .../Code/Source/MultiplayerSystemComponent.h | 2 -- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp index 7d6a684b6b..c5f3d0e226 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp @@ -219,12 +219,22 @@ namespace Multiplayer { server_rhi = static_cast(editorsv_rhi_override); } + + const auto console = AZ::Interface::Get(); + AZ::CVarFixedString sv_defaultPlayerSpawnAsset; + + if (console->GetCvarValue("sv_defaultPlayerSpawnAsset", sv_defaultPlayerSpawnAsset) != AZ::GetValueResult::Success) + { + AZ_Assert( false, + "MultiplayerEditorSystemComponent::LaunchEditorServer failed! Could not find the sv_defaultPlayerSpawnAsset cvar; the editor-server " + "will fall back to using some other default player! Please update this code to use a valid cvar!") + } processLaunchInfo.m_commandlineParameters = AZStd::string::format( R"("%s" --project-path "%s" --editorsv_isDedicated true --sv_defaultPlayerSpawnAsset "%s" --rhi "%s")", serverPath.c_str(), AZ::Utils::GetProjectPath().c_str(), - static_cast(sv_defaultPlayerSpawnAsset).c_str(), + sv_defaultPlayerSpawnAsset.c_str(), server_rhi.GetCStr() ); processLaunchInfo.m_showWindow = true; @@ -292,7 +302,9 @@ namespace Multiplayer editorNetworkInterface->Listen(editorsv_port); // Launch the editor-server - m_serverProcess = LaunchEditorServer(); + m_serverProcessWatcher = LaunchEditorServer(); + m_serverProcessTracePrinter = AZStd::make_unique(m_serverProcessWatcher->GetCommunicator(), "EditorServer"); + AZ::TickBus::Handler::BusConnect(); } else { diff --git a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h index 87d084d5bc..0281916de2 100644 --- a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h +++ b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h @@ -37,8 +37,6 @@ namespace AzNetworking namespace Multiplayer { - AZ_CVAR_EXTERNED(AZ::CVarFixedString, sv_defaultPlayerSpawnAsset); - //! Multiplayer system component wraps the bridging logic between the game and transport layer. class MultiplayerSystemComponent final : public AZ::Component From 4d161f42dfe65d483c50ee16a3713186dd8c8cf8 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Mon, 15 Nov 2021 12:37:21 -0800 Subject: [PATCH 03/14] WiP. fwrites are being stopped by AZCoreLogSink; need a long term solution to work around this... Signed-off-by: Gene Walters --- Code/Framework/AzCore/AzCore/Debug/Trace.cpp | 7 +++++-- .../AzFramework/Process/ProcessCommunicator_Win.cpp | 2 ++ .../Source/Editor/MultiplayerEditorSystemComponent.cpp | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Debug/Trace.cpp b/Code/Framework/AzCore/AzCore/Debug/Trace.cpp index b9e4003500..d393018a92 100644 --- a/Code/Framework/AzCore/AzCore/Debug/Trace.cpp +++ b/Code/Framework/AzCore/AzCore/Debug/Trace.cpp @@ -26,6 +26,7 @@ #include #include #include +#pragma optimize("", off) //< remember to place this after the #includes so that you only optimize the code you want namespace AZ::Debug { @@ -523,10 +524,10 @@ namespace AZ::Debug EBUS_EVENT(TraceMessageDrillerBus, OnOutput, window, message); TraceMessageResult result; EBUS_EVENT_RESULT(result, TraceMessageBus, OnOutput, window, message); - if (result.m_value) + /* if (result.m_value) { return; - } + }*/ } // printf on Windows platforms seem to have a buffer length limit of 4096 characters @@ -537,6 +538,7 @@ namespace AZ::Debug fwrite(windowView.data(), 1, windowView.size(), stdout); fwrite(windowMessageSeparator.data(), 1, windowMessageSeparator.size(), stdout); fwrite(messageView.data(), 1, messageView.size(), stdout); + fwrite("\n\r", 1, 2, stdout); } //========================================================================= @@ -612,3 +614,4 @@ namespace AZ::Debug } } } // namspace AZ::Debug +#pragma optimize("", on) diff --git a/Code/Framework/AzFramework/Platform/Windows/AzFramework/Process/ProcessCommunicator_Win.cpp b/Code/Framework/AzFramework/Platform/Windows/AzFramework/Process/ProcessCommunicator_Win.cpp index c4629ccf2c..9c7bbfac15 100644 --- a/Code/Framework/AzFramework/Platform/Windows/AzFramework/Process/ProcessCommunicator_Win.cpp +++ b/Code/Framework/AzFramework/Platform/Windows/AzFramework/Process/ProcessCommunicator_Win.cpp @@ -8,6 +8,7 @@ #include +#pragma optimize("", off) //< remember to place this after the #includes so that you only optimize the code you want namespace AzFramework { @@ -274,3 +275,4 @@ namespace AzFramework } } // namespace AzToolsFramework +#pragma optimize("", on) diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp index 669393e31e..d75fbcbc70 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp @@ -420,6 +420,8 @@ namespace Multiplayer void MultiplayerEditorSystemComponent::OnTick(float, AZ::ScriptTimePoint) { + AZ_TracePrintf("MultiplayerEditorSystemComponent", "OnTick Pump"); + m_serverProcessTracePrinter->Pump(); } From e1ace4a8f63244f16a03b82a9ffd56586ec6e859 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Mon, 15 Nov 2021 12:37:52 -0800 Subject: [PATCH 04/14] WiP. fwrites are being stopped by AZCoreLogSink; need a long term solution to work around this... Signed-off-by: Gene Walters --- .../AzFramework/Process/ProcessCommunicatorTracePrinter.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Code/Framework/AzFramework/AzFramework/Process/ProcessCommunicatorTracePrinter.cpp b/Code/Framework/AzFramework/AzFramework/Process/ProcessCommunicatorTracePrinter.cpp index 8f3e45bec5..ab9f7c8103 100644 --- a/Code/Framework/AzFramework/AzFramework/Process/ProcessCommunicatorTracePrinter.cpp +++ b/Code/Framework/AzFramework/AzFramework/Process/ProcessCommunicatorTracePrinter.cpp @@ -8,6 +8,8 @@ #include "ProcessCommunicatorTracePrinter.h" +#pragma optimize("", off) //< remember to place this after the #includes so that you only optimize the code you want + ProcessCommunicatorTracePrinter::ProcessCommunicatorTracePrinter(AzFramework::ProcessCommunicator* communicator, const char* window) : m_communicator(communicator), m_window(window) @@ -84,3 +86,4 @@ void ProcessCommunicatorTracePrinter::WriteCurrentString(bool isFromStdErr) bufferToUse.clear(); } } +#pragma optimize("", on) From 02590a1766d0613a12ec3be95f10fd8f7057c402 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Sat, 20 Nov 2021 14:48:48 -0800 Subject: [PATCH 05/14] AzCoreLogSink will check if it's running in an editor-server and will allow stdouts Signed-off-by: Gene Walters --- Code/Framework/AzCore/AzCore/Debug/Trace.cpp | 4 ++-- Code/Legacy/CrySystem/AZCoreLogSink.h | 11 +++++++++++ .../Editor/MultiplayerEditorSystemComponent.cpp | 2 -- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Debug/Trace.cpp b/Code/Framework/AzCore/AzCore/Debug/Trace.cpp index 78dbf3c979..d8a39deebb 100644 --- a/Code/Framework/AzCore/AzCore/Debug/Trace.cpp +++ b/Code/Framework/AzCore/AzCore/Debug/Trace.cpp @@ -535,10 +535,10 @@ namespace AZ::Debug EBUS_EVENT(TraceMessageDrillerBus, OnOutput, window, message); TraceMessageResult result; EBUS_EVENT_RESULT(result, TraceMessageBus, OnOutput, window, message); - /* if (result.m_value) + if (result.m_value) { return; - }*/ + } } RawOutput(window, message); diff --git a/Code/Legacy/CrySystem/AZCoreLogSink.h b/Code/Legacy/CrySystem/AZCoreLogSink.h index 1b09c3198d..605367f418 100644 --- a/Code/Legacy/CrySystem/AZCoreLogSink.h +++ b/Code/Legacy/CrySystem/AZCoreLogSink.h @@ -180,6 +180,17 @@ public: CryLog("(%s) - %s", window, message); } + // If this is an editor-server, then allow the default trace behavior (fwrites to stdout) to occur + // The editor will being listening to the stdout of this server + if (const auto console = AZ::Interface::Get()) + { + bool editorsv_isDedicated = false; + if (console->GetCvarValue("editorsv_isDedicated", editorsv_isDedicated) == AZ::GetValueResult::Success) + { + return !editorsv_isDedicated; + } + } + return true; // suppress default AzCore behavior. } diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp index d75fbcbc70..669393e31e 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp @@ -420,8 +420,6 @@ namespace Multiplayer void MultiplayerEditorSystemComponent::OnTick(float, AZ::ScriptTimePoint) { - AZ_TracePrintf("MultiplayerEditorSystemComponent", "OnTick Pump"); - m_serverProcessTracePrinter->Pump(); } From 0bd86cf0a4f7bf3a2f5a2bec63f420872a71d558 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Sat, 20 Nov 2021 14:58:09 -0800 Subject: [PATCH 06/14] small edit: removing pragma optimize offs Signed-off-by: Gene Walters --- Code/Framework/AzCore/AzCore/Debug/Trace.cpp | 2 -- .../AzFramework/Process/ProcessCommunicatorTracePrinter.cpp | 2 -- .../Windows/AzFramework/Process/ProcessCommunicator_Win.cpp | 2 -- Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp | 1 - 4 files changed, 7 deletions(-) diff --git a/Code/Framework/AzCore/AzCore/Debug/Trace.cpp b/Code/Framework/AzCore/AzCore/Debug/Trace.cpp index d8a39deebb..e2f0c6b29c 100644 --- a/Code/Framework/AzCore/AzCore/Debug/Trace.cpp +++ b/Code/Framework/AzCore/AzCore/Debug/Trace.cpp @@ -26,7 +26,6 @@ #include #include #include -#pragma optimize("", off) //< remember to place this after the #includes so that you only optimize the code you want namespace AZ::Debug { @@ -645,4 +644,3 @@ namespace AZ::Debug } } } // namspace AZ::Debug -#pragma optimize("", on) diff --git a/Code/Framework/AzFramework/AzFramework/Process/ProcessCommunicatorTracePrinter.cpp b/Code/Framework/AzFramework/AzFramework/Process/ProcessCommunicatorTracePrinter.cpp index ab9f7c8103..51674bb32c 100644 --- a/Code/Framework/AzFramework/AzFramework/Process/ProcessCommunicatorTracePrinter.cpp +++ b/Code/Framework/AzFramework/AzFramework/Process/ProcessCommunicatorTracePrinter.cpp @@ -8,7 +8,6 @@ #include "ProcessCommunicatorTracePrinter.h" -#pragma optimize("", off) //< remember to place this after the #includes so that you only optimize the code you want ProcessCommunicatorTracePrinter::ProcessCommunicatorTracePrinter(AzFramework::ProcessCommunicator* communicator, const char* window) : m_communicator(communicator), @@ -86,4 +85,3 @@ void ProcessCommunicatorTracePrinter::WriteCurrentString(bool isFromStdErr) bufferToUse.clear(); } } -#pragma optimize("", on) diff --git a/Code/Framework/AzFramework/Platform/Windows/AzFramework/Process/ProcessCommunicator_Win.cpp b/Code/Framework/AzFramework/Platform/Windows/AzFramework/Process/ProcessCommunicator_Win.cpp index 9c7bbfac15..c4629ccf2c 100644 --- a/Code/Framework/AzFramework/Platform/Windows/AzFramework/Process/ProcessCommunicator_Win.cpp +++ b/Code/Framework/AzFramework/Platform/Windows/AzFramework/Process/ProcessCommunicator_Win.cpp @@ -8,7 +8,6 @@ #include -#pragma optimize("", off) //< remember to place this after the #includes so that you only optimize the code you want namespace AzFramework { @@ -275,4 +274,3 @@ namespace AzFramework } } // namespace AzToolsFramework -#pragma optimize("", on) diff --git a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp index 8eb6d2d777..503a8128b0 100644 --- a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp +++ b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp @@ -1137,7 +1137,6 @@ namespace Multiplayer AZStd::to_lower(sv_defaultPlayerSpawnAssetLowerCase.begin(), sv_defaultPlayerSpawnAssetLowerCase.end()); PrefabEntityId playerPrefabEntityId(AZ::Name(static_cast(sv_defaultPlayerSpawnAssetLowerCase).c_str())); INetworkEntityManager::EntityList entityList = m_networkEntityManager.CreateEntitiesImmediate(playerPrefabEntityId, NetEntityRole::Authority, AZ::Transform::CreateIdentity(), Multiplayer::AutoActivate::DoNotActivate); - AZ_TracePrintf("MultiplayerSystemComponent", "Server spawned the default player: %s", sv_defaultPlayerSpawnAssetLowerCase.c_str()) for (NetworkEntityHandle subEntity : entityList) { From ff862a2f206aa2449e4c7ee77d2914b091103086 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Mon, 22 Nov 2021 18:56:48 -0800 Subject: [PATCH 07/14] Fix memory leak of ProcessWatcher Signed-off-by: Gene Walters --- .../Editor/MultiplayerEditorSystemComponent.cpp | 13 +++++++++---- .../Editor/MultiplayerEditorSystemComponent.h | 6 ++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp index 669393e31e..7cc6fbc1b5 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp @@ -193,7 +193,7 @@ namespace Multiplayer } } - AzFramework::ProcessWatcher* LaunchEditorServer() + void MultiplayerEditorSystemComponent::LaunchEditorServer() { // Assemble the server's path AZ::CVarFixedString serverProcess = editorsv_process; @@ -248,7 +248,13 @@ namespace Multiplayer "MultiplayerEditor", processLaunchInfo.m_launchResult != AzFramework::ProcessLauncher::ProcessLaunchResult::PLR_MissingFile, "LaunchEditorServer failed! The ServerLauncher binary is missing! (%s) Please build server launcher.", serverPath.c_str()) - return outProcess; + // Stop the previous server if one exists + if (m_serverProcessWatcher) + { + m_serverProcessWatcher->TerminateProcess(0); + } + m_serverProcessWatcher.reset(outProcess); + m_serverProcessTracePrinter = AZStd::make_unique(m_serverProcessWatcher->GetCommunicator(), "EditorServer"); } void MultiplayerEditorSystemComponent::OnGameEntitiesStarted() @@ -308,8 +314,7 @@ namespace Multiplayer editorNetworkInterface->Listen(editorsv_port); // Launch the editor-server - m_serverProcessWatcher = LaunchEditorServer(); - m_serverProcessTracePrinter = AZStd::make_unique(m_serverProcessWatcher->GetCommunicator(), "EditorServer"); + LaunchEditorServer(); AZ::TickBus::Handler::BusConnect(); } else diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.h b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.h index 330a2c9d81..5e49f8f08d 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.h +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.h @@ -83,7 +83,9 @@ namespace Multiplayer bool IsInGameMode() override; //! @} - private: + private: + void LaunchEditorServer(); + //! EditorEvents::Handler overrides //! @{ void OnEditorNotifyEvent(EEditorNotifyEvent event) override; @@ -106,7 +108,7 @@ namespace Multiplayer //! @} IEditor* m_editor = nullptr; - AzFramework::ProcessWatcher* m_serverProcessWatcher = nullptr; + AZStd::unique_ptr m_serverProcessWatcher = nullptr; AZStd::unique_ptr m_serverProcessTracePrinter = nullptr; AzNetworking::ConnectionId m_editorConnId; From 33e44a4813b5beb109225085ed05e0d35e5dfa11 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Tue, 23 Nov 2021 09:27:50 -0800 Subject: [PATCH 08/14] revert rawoutput function. we'll update any of the logs we care about to include newlines Signed-off-by: Gene Walters --- Code/Framework/AzCore/AzCore/Debug/Trace.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Code/Framework/AzCore/AzCore/Debug/Trace.cpp b/Code/Framework/AzCore/AzCore/Debug/Trace.cpp index e2f0c6b29c..2c2b8215c0 100644 --- a/Code/Framework/AzCore/AzCore/Debug/Trace.cpp +++ b/Code/Framework/AzCore/AzCore/Debug/Trace.cpp @@ -558,7 +558,6 @@ namespace AZ::Debug fwrite(windowView.data(), 1, windowView.size(), stdout); fwrite(windowMessageSeparator.data(), 1, windowMessageSeparator.size(), stdout); fwrite(messageView.data(), 1, messageView.size(), stdout); - fwrite("\n\r", 1, 2, stdout); } //========================================================================= From 77e3dd786d30d14e45ccc847c999f87d75c815ec Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Wed, 24 Nov 2021 16:05:53 -0800 Subject: [PATCH 09/14] Instead of AZCoreLogSink pulling a cvar, we'll check if we're running an editor-server on SystemInit Signed-off-by: Gene Walters --- Code/Legacy/CrySystem/AZCoreLogSink.h | 19 +++++-------------- Code/Legacy/CrySystem/SystemInit.cpp | 13 ++++++++++++- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Code/Legacy/CrySystem/AZCoreLogSink.h b/Code/Legacy/CrySystem/AZCoreLogSink.h index 605367f418..39a6131262 100644 --- a/Code/Legacy/CrySystem/AZCoreLogSink.h +++ b/Code/Legacy/CrySystem/AZCoreLogSink.h @@ -36,9 +36,10 @@ public: Disconnect(); } - inline static void Connect() + inline static void Connect(bool suppressSystemOutput) { GetInstance().m_ignoredAsserts = new IgnoredAssertMap(); + GetInstance().m_suppressSystemOutput = suppressSystemOutput; GetInstance().BusConnect(); } @@ -179,23 +180,13 @@ public: { CryLog("(%s) - %s", window, message); } - - // If this is an editor-server, then allow the default trace behavior (fwrites to stdout) to occur - // The editor will being listening to the stdout of this server - if (const auto console = AZ::Interface::Get()) - { - bool editorsv_isDedicated = false; - if (console->GetCvarValue("editorsv_isDedicated", editorsv_isDedicated) == AZ::GetValueResult::Success) - { - return !editorsv_isDedicated; - } - } - - return true; // suppress default AzCore behavior. + + return m_suppressSystemOutput; } private: using IgnoredAssertMap = AZStd::unordered_map, AZStd::equal_to, AZ::OSStdAllocator>; IgnoredAssertMap* m_ignoredAsserts; + bool m_suppressSystemOutput = true; }; diff --git a/Code/Legacy/CrySystem/SystemInit.cpp b/Code/Legacy/CrySystem/SystemInit.cpp index c5039f57e9..6f550fcac6 100644 --- a/Code/Legacy/CrySystem/SystemInit.cpp +++ b/Code/Legacy/CrySystem/SystemInit.cpp @@ -737,7 +737,18 @@ bool CSystem::Init(const SSystemInitParams& startupParams) m_pCmdLine = new CCmdLine(startupParams.szSystemCmdLine); - AZCoreLogSink::Connect(); + // Init AZCoreLogSink. Don't suppress system output if we're running as an editor-server + bool suppressSystemOutput = true; + if (const ICmdLineArg* isEditorServerArg = m_pCmdLine->FindArg(eCLAT_Pre, "editorsv_isDedicated")) + { + AZ::CVarFixedString lowercaseValue(isEditorServerArg->GetValue()); + AZStd::to_lower(lowercaseValue.begin(), lowercaseValue.end()); + if (lowercaseValue == "true") + { + suppressSystemOutput = false; + } + } + AZCoreLogSink::Connect(suppressSystemOutput); // Registers all AZ Console Variables functors specified within CrySystem if (auto azConsole = AZ::Interface::Get(); azConsole) From 9c9d2c70f5c9593a4087d1d44499628b8db00f2d Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Mon, 29 Nov 2021 18:26:31 -0800 Subject: [PATCH 10/14] Making sure to stop pulling server logs before terminating the server process; otherwise we might be pulling an invalid process-communicator. Updating AZCoreLogSink to also allow for piping warnings/errors/asserts Signed-off-by: Gene Walters --- Code/Legacy/CrySystem/AZCoreLogSink.h | 6 +++--- .../Source/Editor/MultiplayerEditorSystemComponent.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Code/Legacy/CrySystem/AZCoreLogSink.h b/Code/Legacy/CrySystem/AZCoreLogSink.h index 39a6131262..9d732b3dd4 100644 --- a/Code/Legacy/CrySystem/AZCoreLogSink.h +++ b/Code/Legacy/CrySystem/AZCoreLogSink.h @@ -127,7 +127,7 @@ public: CryLogAlways("%s", message); } - return true; // suppress default AzCore behavior. + return m_suppressSystemOutput; #else AZ_UNUSED(fileName); AZ_UNUSED(line); @@ -147,7 +147,7 @@ public: return false; // allow AZCore to do its default behavior. } gEnv->pLog->LogError("(%s) - %s", window, message); - return true; // suppress default AzCore behavior. + return m_suppressSystemOutput; } bool OnPreWarning(const char* window, const char* fileName, int line, const char* func, const char* message) override @@ -162,7 +162,7 @@ public: } CryWarning(VALIDATOR_MODULE_UNKNOWN, VALIDATOR_WARNING, "(%s) - %s", window, message); - return true; // suppress default AzCore behavior. + return m_suppressSystemOutput; } bool OnOutput(const char* window, const char* message) override diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp index 7cc6fbc1b5..fa855cf28c 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp @@ -160,6 +160,7 @@ namespace Multiplayer [[fallthrough]]; case eNotify_OnEndGameMode: // Kill the configured server if it's active + AZ::TickBus::Handler::BusDisconnect(); if (m_serverProcessWatcher) { m_serverProcessWatcher->TerminateProcess(0); @@ -172,9 +173,7 @@ namespace Multiplayer m_serverProcessWatcher = nullptr; m_serverProcessTracePrinter = nullptr; } - - AZ::TickBus::Handler::BusDisconnect(); - + if (INetworkInterface* editorNetworkInterface = AZ::Interface::Get()->RetrieveNetworkInterface(AZ::Name(MpEditorInterfaceName))) { editorNetworkInterface->Disconnect(m_editorConnId, AzNetworking::DisconnectReason::TerminatedByClient); @@ -251,10 +250,12 @@ namespace Multiplayer // Stop the previous server if one exists if (m_serverProcessWatcher) { + AZ::TickBus::Handler::BusDisconnect(); m_serverProcessWatcher->TerminateProcess(0); } m_serverProcessWatcher.reset(outProcess); m_serverProcessTracePrinter = AZStd::make_unique(m_serverProcessWatcher->GetCommunicator(), "EditorServer"); + AZ::TickBus::Handler::BusConnect(); } void MultiplayerEditorSystemComponent::OnGameEntitiesStarted() @@ -315,7 +316,6 @@ namespace Multiplayer // Launch the editor-server LaunchEditorServer(); - AZ::TickBus::Handler::BusConnect(); } else { From d600b1c9fd6659f79ef15fc3eba481b43b51f28c Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Tue, 30 Nov 2021 11:10:00 -0800 Subject: [PATCH 11/14] Adding GetBool method to CmdLineArg Signed-off-by: Gene Walters --- Code/Legacy/CryCommon/ICmdLine.h | 8 ++++++++ Code/Legacy/CrySystem/CmdLineArg.cpp | 17 +++++++++++++++++ Code/Legacy/CrySystem/CmdLineArg.h | 1 + 3 files changed, 26 insertions(+) diff --git a/Code/Legacy/CryCommon/ICmdLine.h b/Code/Legacy/CryCommon/ICmdLine.h index 6071671b02..80561fd85c 100644 --- a/Code/Legacy/CryCommon/ICmdLine.h +++ b/Code/Legacy/CryCommon/ICmdLine.h @@ -71,6 +71,14 @@ public: // The value of the argument as integer number. virtual const int GetIValue() const = 0; // + + // Description: + // Retrieve the value of the argument. + // Arguments: + // cmdLineValue. The cmdline value will be filled out if a valid boolean is found. + // Return Value: + // Returns true if the cmdline arg is actually a boolean string matching "true" or "false"; otherwise return false. + virtual const bool GetBoolValue(bool& cmdLineValue) const = 0; }; // Command line interface diff --git a/Code/Legacy/CrySystem/CmdLineArg.cpp b/Code/Legacy/CrySystem/CmdLineArg.cpp index 79d23ddae7..554e734055 100644 --- a/Code/Legacy/CrySystem/CmdLineArg.cpp +++ b/Code/Legacy/CrySystem/CmdLineArg.cpp @@ -42,5 +42,22 @@ const int CCmdLineArg::GetIValue() const { return atoi(m_value.c_str()); } +const bool CCmdLineArg::GetBoolValue(bool& cmdLineValue) const +{ + AZStd::string lowercaseValue(m_value); + AZStd::to_lower(lowercaseValue.begin(), lowercaseValue.end()); + if (lowercaseValue == "true") + { + cmdLineValue = true; + return true; + } + if (lowercaseValue == "false") + { + cmdLineValue = false; + return true; + } + + return false; +} diff --git a/Code/Legacy/CrySystem/CmdLineArg.h b/Code/Legacy/CrySystem/CmdLineArg.h index 5e3a629e7c..66d56be132 100644 --- a/Code/Legacy/CrySystem/CmdLineArg.h +++ b/Code/Legacy/CrySystem/CmdLineArg.h @@ -30,6 +30,7 @@ public: const ECmdLineArgType GetType() const; const float GetFValue() const; const int GetIValue() const; + const bool GetBoolValue(bool& cmdLineValue) const; private: From 6d0ba68b55378c8170c72b4f2630cc1fcc902ebc Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Tue, 30 Nov 2021 11:12:07 -0800 Subject: [PATCH 12/14] Using new GetBool value when checking if we're an editor-server. Clean up MPEditorSystemComponent for unused #includes, and null-checking when piping server logs Signed-off-by: Gene Walters --- Code/Legacy/CrySystem/SystemInit.cpp | 5 ++--- .../Editor/MultiplayerEditorSystemComponent.cpp | 16 +++++++++++----- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Code/Legacy/CrySystem/SystemInit.cpp b/Code/Legacy/CrySystem/SystemInit.cpp index 6f550fcac6..70595e53c1 100644 --- a/Code/Legacy/CrySystem/SystemInit.cpp +++ b/Code/Legacy/CrySystem/SystemInit.cpp @@ -741,9 +741,8 @@ bool CSystem::Init(const SSystemInitParams& startupParams) bool suppressSystemOutput = true; if (const ICmdLineArg* isEditorServerArg = m_pCmdLine->FindArg(eCLAT_Pre, "editorsv_isDedicated")) { - AZ::CVarFixedString lowercaseValue(isEditorServerArg->GetValue()); - AZStd::to_lower(lowercaseValue.begin(), lowercaseValue.end()); - if (lowercaseValue == "true") + bool editorsv_isDedicated = false; + if (isEditorServerArg->GetBoolValue(editorsv_isDedicated) && editorsv_isDedicated) { suppressSystemOutput = false; } diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp index fa855cf28c..259d544279 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp @@ -6,7 +6,6 @@ * */ -#include "AzFramework/Process/ProcessCommunicator.h" #include #include @@ -16,11 +15,8 @@ #include #include #include -#include -#include #include -#include #include #include #include @@ -425,7 +421,17 @@ namespace Multiplayer void MultiplayerEditorSystemComponent::OnTick(float, AZ::ScriptTimePoint) { - m_serverProcessTracePrinter->Pump(); + if (m_serverProcessTracePrinter) + { + m_serverProcessTracePrinter->Pump(); + } + else + { + AZ::TickBus::Handler::BusDisconnect(); + AZ_Warning( + "MultiplayerEditorSystemComponent", false, + "The server process trace printer is NULL so we won't be able to pipe server logs to the editor. Please update the code to call AZ::TickBus::Handler::BusDisconnect whenever the editor-server is terminated.") + } } } From 8afd47950c788dfe5f6e317f3265fcef3a0e1c15 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Tue, 30 Nov 2021 12:01:04 -0800 Subject: [PATCH 13/14] Removing an extra new-line I added by accident Signed-off-by: Gene Walters --- .../Code/Source/Editor/MultiplayerEditorSystemComponent.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp index 259d544279..ec783808a2 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp @@ -6,7 +6,6 @@ * */ - #include #include #include From 530bcb9428dc0e898f3392c3e1eac1947ed77da2 Mon Sep 17 00:00:00 2001 From: Gene Walters Date: Tue, 30 Nov 2021 14:17:02 -0800 Subject: [PATCH 14/14] //! for code comments autogen Signed-off-by: Gene Walters --- .../AzFramework/Process/ProcessCommunicatorTracePrinter.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Code/Framework/AzFramework/AzFramework/Process/ProcessCommunicatorTracePrinter.h b/Code/Framework/AzFramework/AzFramework/Process/ProcessCommunicatorTracePrinter.h index 8b84c4c28d..5e14fa290d 100644 --- a/Code/Framework/AzFramework/AzFramework/Process/ProcessCommunicatorTracePrinter.h +++ b/Code/Framework/AzFramework/AzFramework/Process/ProcessCommunicatorTracePrinter.h @@ -18,13 +18,13 @@ public: ProcessCommunicatorTracePrinter(AzFramework::ProcessCommunicator* communicator, const char* window); ~ProcessCommunicatorTracePrinter(); - // Call this periodically to drain the buffers and write them. + //! Call this periodically to drain the buffers and write them. void Pump(); - // Drains the buffer into the string that's being built, then traces the string when it hits a newline. + //! Drains the buffer into the string that's being built, then traces the string when it hits a newline. void ParseDataBuffer(AZ::u32 readSize, bool isFromStdErr); - // Prints the current buffer to AZ_Error or AZ_TracePrintf so that it can be picked up by AZ::Debug::Trace + //! Prints the current buffer to AZ_Error or AZ_TracePrintf so that it can be picked up by AZ::Debug::Trace void WriteCurrentString(bool isFromStdError); private: