Merging latest LYN-8025_PipeEditorServerLogsToEditor

Signed-off-by: Gene Walters <genewalt@amazon.com>
This commit is contained in:
Gene Walters
2021-11-30 12:08:19 -08:00
5 changed files with 39 additions and 5 deletions
+8
View File
@@ -71,6 +71,14 @@ public:
// The value of the argument as integer number.
virtual const int GetIValue() const = 0;
// </interfuscator:shuffle>
// 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
+17
View File
@@ -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;
}
+1
View File
@@ -30,6 +30,7 @@ public:
const ECmdLineArgType GetType() const;
const float GetFValue() const;
const int GetIValue() const;
const bool GetBoolValue(bool& cmdLineValue) const;
private:
+2 -3
View File
@@ -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;
}
@@ -6,7 +6,6 @@
*
*/
#include <Multiplayer/IMultiplayer.h>
#include <Multiplayer/IMultiplayerTools.h>
#include <Multiplayer/INetworkSpawnableLibrary.h>
@@ -421,7 +420,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.")
}
}
}